Skip to content

Commit a9aca0e

Browse files
authored
Merge pull request #239 from ReactiveBayes/238-enhance-workflow-clarity-of-the-project
Update contributions documentation
2 parents 0bd5a60 + 899ef8f commit a9aca0e

File tree

6 files changed

+136
-256
lines changed

6 files changed

+136
-256
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,10 @@ Our high-level project roadmap outlines the key milestones and focus areas for t
173173

174174
For a more granular view of our progress and ongoing tasks, check out our [project board](https://github.com/orgs/reactivebayes/projects/2/views/4).
175175

176+
# Contributing
177+
178+
We welcome contributions from the community. If you are interested in contributing to the development of `RxInfer.jl`, please check out our [contributing guide](https://reactivebayes.github.io/RxInfer.jl/stable/contributing/guide), the [contributing guidelines](https://reactivebayes.github.io/RxInfer.jl/stable/contributing/guidelines), or look at the [issues linked with the `good first issue` label](https://github.com/ReactiveBayes/RxInfer.jl/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22) to get started.
179+
176180
# Ecosystem
177181

178182
The `RxInfer` framework consists of three *core* packages developed by reactivebayes:

docs/make.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,9 @@ makedocs(;
131131
ExamplesPages...
132132
],
133133
"Contributing" => [
134-
"Overview" => "contributing/overview.md",
134+
"Contribution guide" => "contributing/guide.md",
135+
"Contribution guidelines"=> "contributing/guidelines.md",
135136
"Contributing to the documentation" => "contributing/new-documentation.md",
136-
"Contributing to the dependencies" => "contributing/new-package.md",
137137
"Contributing to the examples" => "contributing/new-example.md",
138138
"Publishing a new release" => "contributing/new-release.md"
139139
]

docs/src/contributing/guide.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# [Contributing](@id contributing-overview)
2+
Welcome to the contribution guide for `RxInfer.jl`. Here you'll find information on the `RxInfer` project structure, and how to get started with contributing to the project. For more practical instructions and guidelines, refer to the [contribution guidelines](https://reactivebayes.github.io/RxInfer.jl/stable/contributing/guidelines.html).
3+
4+
## Project structure
5+
6+
`RxInfer.jl` is a Julia package that provides a high-level interface for probabilistic programming. It is composed of three major core dependencies:
7+
- `Rocket.jl`: A package for reactive programming, allowing asynchronous data processing
8+
- `GraphPPL.jl`: A domain-specific language for probabilistic programming, facilitating the `@model` macro and other crucial user-facing features.
9+
- `ReactiveMP.jl`: Reactive message passing engine, using `Rocket.jl` to pass messages between nodes in a probabilistic model defined with `GraphPPL.jl`.
10+
11+
In general, non-inference related functionality is implemented in `Rocket.jl` and `GraphPPL.jl`, while inference-related functionality is implemented in `ReactiveMP.jl`. For example, all factor nodes and inference rules for messages are implemented in `ReactiveMP.jl`.
12+
13+
## Getting started
14+
15+
To familiarize yourself with development in `RxInfer`, we recommend the following steps:
16+
1. Familiarize yourself with the collaborative tools used in the project. `RxInfer` uses GitHub for version control, issue tracking, and pull requests. We aim to maintain the [good first issue](https://github.com/ReactiveBayes/RxInfer.jl/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22) label on issues that are suitable for new contributors. Furthermore, the core development team tracks the project's progress and development tasks on the [project board](https://github.com/orgs/ReactiveBayes/projects/2/views/4). Because the project board is overwhelming, we recommend focusing first on issues labeled with the `good first issue` label.
17+
2. Read the [contribution guidelines](https://reactivebayes.github.io/RxInfer.jl/stable/contributing/guidelines.html) to understand the contribution process and best practices for contributing to `RxInfer`, as well as coding practices and testing procedures.
18+
3. Familiarize yourself with the `RxInfer` codebase and its core dependencies. While most information can be found on the `RxInfer` documentation page, it is also recommended to read the documentation for `Rocket.jl`, `GraphPPL.jl`, and `ReactiveMP.jl` to understand the core functionality and design principles of the project.
19+
4. Pick an issue to work on. We recommend starting with a `good first issue` to familiarize yourself with the contribution process. Once you're comfortable with the process, you can move on to more complex issues.
20+
21+
## Contribution guidelines
22+
23+
The contribution guidelines provide detailed instructions on how to contribute effectively to the project. They cover reporting bugs, suggesting features, and contributing code. For more information, refer to the [contribution guidelines](https://reactivebayes.github.io/RxInfer.jl/stable/contributing/guidelines.html).
24+

docs/src/contributing/guidelines.md

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
# [Contribution Guidelines](@id contributing-overview)
2+
3+
Welcome to the contribution guidelines for `RxInfer.jl`. Here you'll find detailed instructions on how to contribute effectively to the project.
4+
5+
## Reporting bugs
6+
7+
If you encounter any bugs while using the software, please report them via [GitHub issues](https://github.com/reactivebayes/RxInfer.jl/issues). To ensure efficient bug resolution, please provide comprehensive and reproducible bug reports. Include details such as the versions of Julia and `RxInfer` you're using, along with a concise description of the issue. Additionally, attach relevant code snippets, test cases, screenshots, or any other pertinent information that could aid in replicating and addressing the problem.
8+
9+
### Nightly Julia status
10+
11+
Check the badge below to see if `RxInfer` can be installed on a Julia nightly version. A failing badge may indicate issues with `RxInfer` or its dependencies. Click on the badge to access the latest evaluation report.
12+
13+
[![PkgEval](https://JuliaCI.github.io/NanosoldierReports/pkgeval_badges/R/RxInfer.svg)](https://JuliaCI.github.io/NanosoldierReports/pkgeval_badges/report.html)
14+
15+
## Suggesting features
16+
17+
We encourage proposals for new features. Before submitting a feature request, consider the following:
18+
19+
- Determine if the feature necessitates changes to the core `RxInfer` code. If not, such as adding a factor node for a specific application, consider local extensions in your script/notebook or creating a separate repository for your extensions.
20+
- For feature implementations requiring significant changes to the core `RxInfer` code, open a [GitHub issue](https://github.com/reactivebayes/RxInfer.jl/issues) to discuss your proposal before proceeding with implementation. This allows for thorough deliberation and avoids investing time in features that may be challenging to integrate later on.
21+
22+
## Contributing code
23+
24+
### Installing RxInfer
25+
26+
For development purposes, it's recommended to use the `dev` command from the Julia package manager to install `RxInfer`. Use your fork's URL in the dev command to work on your forked version. For example:
27+
28+
```
29+
] dev git@github.com:your_username/RxInfer.jl.git
30+
```
31+
32+
The `dev` command clones `RxInfer` to `~/.julia/dev/RxInfer`. All local changes to `RxInfer` code will be reflected in imported code.
33+
34+
!!! note
35+
It is also might be useful to install [Revise.jl](https://github.com/timholy/Revise.jl) package as it allows you to modify code and use the changes without restarting Julia.
36+
37+
### Core dependencies
38+
39+
`RxInfer.jl` depends heavily on the core packages `ReactiveMP.jl`, `GraphPPL.jl`, and `Rocket.jl`. Ensure `RxInfer.jl` is updated whenever any of these packages undergo major updates or API changes. While making changes to `RxInfer.jl`, developers are advised to use the `dev` command for these packages as well. Note that standard Julia testing utilities ignore the local development environment and test the package with the latest released versions of core dependencies. Refer to the Makefile section below to learn how to test `RxInfer.jl` with locally installed core dependencies.
40+
41+
### Committing code
42+
43+
We use the standard [GitHub Flow](https://guides.github.com/introduction/flow/) workflow where all contributions are added through pull requests. To contribute:
44+
- [Fork](https://guides.github.com/activities/forking/) the repository
45+
- Commit your contributions to your fork
46+
- Create a pull request on the `main` branch of the `RxInfer` repository.
47+
48+
Before opening a pull request, ensure all tests pass without errors. Additionally, ensure all examples (found in the `/examples/` directory) run succesfully.
49+
50+
!!! note
51+
Use `make test`, `make examples` and `make docs` commands to verify that all tests, examples, and documentation build correctly. See the `Makefile` section below for detailed command descriptions.
52+
53+
### Style conventions
54+
55+
We use the default [Julia style guide](https://docs.julialang.org/en/v1/manual/style-guide/index.html). There are a couple of important points modifications to the Julia style guide to take into account:
56+
57+
- Use 4 spaces for indentation
58+
- Type names use `UpperCamelCase`. For example: `AbstractFactorNode`, `RandomVariable`, etc..
59+
- Function names are `lowercase` with underscores, when necessary. For example: `activate!`, `randomvar`, `as_variable`, etc..
60+
- Variable names and function arguments use `snake_case`
61+
- The name of a method that modifies its argument(s) must end in `!`
62+
63+
!!! note
64+
The `RxInfer` repository contains scripts to automatically format code according to our guidelines. Use `make format` command to fix code style. This command overwrites files. Use `make lint` to run a linting procedure without overwriting the actual source files.
65+
66+
### Unit tests
67+
68+
We use the test-driven development (TDD) methodology for `RxInfer` development. Aim for comprehensive test coverage, ensuring tests cover each piece of added code.
69+
70+
All unit tests are located in the `/test/` directory. The `/test/` directory follows the structure of the `/src/` directory. Each test file should have the following filename format: `*_tests.jl`. Some tests are also present in `jldoctest` docs annotations directly in the source code.
71+
See [Julia's documentation](https://docs.julialang.org/en/v1/manual/documentation/index.html) about doctests.
72+
73+
The tests can be evaluated by running following command in the Julia REPL:
74+
75+
```
76+
] test RxInfer
77+
```
78+
79+
In addition tests can be evaluated by running following command in the `RxInfer` root directory:
80+
81+
```bash
82+
make test
83+
```
84+
85+
!!! note
86+
Use `make devtest` to use local `dev`-ed versions of the core packages.
87+
88+
### Makefile
89+
90+
`RxInfer.jl` uses `Makefile` for most common operations:
91+
92+
- `make help`: Shows help snippet
93+
- `make test`: Run tests, supports extra arguments
94+
- `make test test_args="distributions:normal_mean_variance"` would run tests only from `distributions/test_normal_mean_variance.jl`
95+
- `make test test_args="distributions:normal_mean_variance models:lgssm"` would run tests both from `distributions/test_normal_mean_variance.jl` and `models/test_lgssm.jl`
96+
- `make test dev=true` would run tests while using `dev-ed` versions of core packages
97+
- `make devtest`: Alias for the `make test dev=true ...`
98+
- `make docs`: Compile documentation
99+
- `make devdocs`: Same as `make docs`, but uses `dev-ed` versions of core packages
100+
- `make examples`: Run all examples and put them in the `docs/` folder if successfull
101+
- `make devexamples`: Same as `make examples`, but uses `dev-ed` versions of core packages
102+
- `make lint`: Check codestyle
103+
- `make format`: Check and fix codestyle
104+
105+
!!! note
106+
Core packages include `ReactiveMP.jl`, `GraphPPL.jl` and `Rocket.jl`. When using any of the `dev` commands from the `Makefile` those packages must be present in the `Pkg.devdir()` directory.

docs/src/contributing/new-package.md

Lines changed: 0 additions & 149 deletions
This file was deleted.

0 commit comments

Comments
 (0)