You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+25-10Lines changed: 25 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,6 @@
3
3
## Contributing code
4
4
5
5
### Creating a development environment
6
-
7
6
It is recommended to use [conda](conda:)
8
7
or [mamba](mamba:) to create a
9
8
development environment for movement. In the following we assume you have
@@ -34,7 +33,6 @@ pre-commit install
34
33
```
35
34
36
35
### Pull requests
37
-
38
36
In all cases, please submit code to the main repository via a pull request (PR).
39
37
We recommend, and adhere, to the following conventions:
40
38
@@ -62,7 +60,6 @@ A typical PR workflow would be:
62
60
## Development guidelines
63
61
64
62
### Formatting and pre-commit hooks
65
-
66
63
Running `pre-commit install` will set up [pre-commit hooks](https://pre-commit.com/) to ensure a consistent formatting style. Currently, these include:
67
64
*[ruff](https://github.com/astral-sh/ruff) does a number of jobs, including code linting and auto-formatting.
68
65
*[mypy](https://mypy.readthedocs.io/en/stable/index.html) as a static type checker.
@@ -109,7 +106,6 @@ Make sure to provide docstrings for all public functions, classes, and methods.
109
106
This is important as it allows for [automatic generation of the API reference](#updating-the-api-reference).
110
107
111
108
### Testing
112
-
113
109
We use [pytest](https://docs.pytest.org/en/latest/) for testing and aim for
114
110
~100% test coverage (as far as is reasonable).
115
111
All new features should be tested.
@@ -120,6 +116,31 @@ Do not include these data in the repository, especially if they are large.
120
116
We store several sample datasets in an external data repository.
121
117
See [sample data](#sample-data) for more information.
122
118
119
+
### Logging
120
+
We use the {mod}`loguru<loguru._logger>`-based {class}`MovementLogger<movement.utils.logging.MovementLogger>` for logging.
121
+
The logger is configured to write logs to a rotating log file at the `DEBUG` level and to {obj}`sys.stderr` at the `WARNING` level.
122
+
123
+
To import the logger:
124
+
```python
125
+
from movement.utils.logging import logger
126
+
```
127
+
128
+
Once the logger is imported, you can log messages with the appropriate [severity levels](inv:loguru#levels) using the same syntax as {mod}`loguru<loguru._logger>` (e.g. `logger.debug("Debug message")`, `logger.warning("Warning message")`).
129
+
130
+
#### Logging and raising exceptions
131
+
Both {meth}`logger.error()<movement.utils.logging.MovementLogger.error>` and {meth}`logger.exception()<movement.utils.logging.MovementLogger.exception>` can be used to log [](inv:python#tut-errors), with the difference that the latter will include the traceback in the log message.
132
+
As these methods will return the logged Exception, you can log and raise the Exception in a single line:
133
+
```python
134
+
raise logger.error(ValueError("message"))
135
+
raise logger.exception(ValueError("message")) # with traceback
136
+
```
137
+
138
+
#### When to use `print`, `warnings.warn`, and `logger.warning`
139
+
We aim to adhere to the [When to use logging guide](inv:python#logging-basic-tutorial) to ensure consistency in our logging practices.
140
+
In general:
141
+
* Use {func}`print` for simple, non-critical messages that do not need to be logged.
142
+
* Use {func}`warnings.warn` for user input issues that are non-critical and can be addressed within movement, e.g. deprecated function calls that are redirected, invalid `fps` number in {class}`ValidPosesDataset<movement.validators.datasets.ValidPosesDataset>` that is implicitly set to `None`; or when processing data containing excessive NaNs, which the user can potentially address using appropriate methods, e.g. {func}`interpolate_over_time()<movement.filtering.interpolate_over_time>`
143
+
* Use {meth}`logger.warning()<loguru._logger.Logger.warning>` for non-critical issues where default values are assigned to optional parameters, e.g. `individual_names`, `keypoint_names` in {class}`ValidPosesDataset<movement.validators.datasets.ValidPosesDataset>`.
123
144
124
145
### Continuous integration
125
146
All pushes and pull requests will be built by [GitHub actions](github-docs:actions).
@@ -155,7 +176,6 @@ The addition of a GitHub tag triggers the package's deployment to PyPI.
155
176
The version number is automatically determined from the latest tag on the _main_ branch.
156
177
157
178
## Contributing documentation
158
-
159
179
The documentation is hosted via [GitHub pages](https://pages.github.com/) at
160
180
[movement.neuroinformatics.dev](target-movement).
161
181
Its source files are located in the `docs` folder of this repository.
@@ -173,7 +193,6 @@ ensuring that the documentation is published in sync with each PyPI release.
173
193
174
194
175
195
### Editing the documentation
176
-
177
196
To edit the documentation, first clone the repository, and install `movement` in a
@@ -279,7 +298,6 @@ For example, to reference the {meth}`xarray.Dataset.update` method, use:
279
298
:::
280
299
::::
281
300
282
-
283
301
### Building the documentation locally
284
302
We recommend that you build and view the documentation website locally, before you push your proposed changes.
285
303
@@ -338,7 +356,6 @@ make clean html linkcheck
338
356
:::
339
357
340
358
## Sample data
341
-
342
359
We maintain some sample datasets to be used for testing, examples and tutorials on an
343
360
[external data repository](gin:neuroinformatics/movement-test-data).
344
361
Our hosting platform of choice is called [GIN](gin:) and is maintained
@@ -409,8 +426,6 @@ To add a new file, you will need to:
409
426
410
427
9. Upload the committed changes to the GIN repository by running `gin upload`. Latest changes to the repository can be pulled via `gin download`. `gin sync` will synchronise the latest changes bidirectionally.
Copy file name to clipboardExpand all lines: docs/source/community/roadmaps.md
+10-1Lines changed: 10 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,7 +19,16 @@ The following features are being considered for the first stable version `v1.0`.
19
19
navigation, social interactions, etc.
20
20
-__Integrate with neurophysiological data analysis tools__. We eventually aim to facilitate combined analysis of motion and neural data.
21
21
22
-
## Short-term milestone - `v0.1`
22
+
## Focus areas for 2025
23
+
24
+
- Annotate space by defining regions of interest programmatically and via our [GUI](target-gui).
25
+
- Annotate time by defining events of interest programmatically and via our [GUI](target-gui).
26
+
- Enable workflows for aligning motion tracks with concurrently recorded neurophysiological signals.
27
+
- Enrich the interactive visualisation of motion tracks in `napari`, providing more customisation options.
28
+
- Enable the saving of filtered tracks and derived kinematic variables to disk.
29
+
- Implement metrics useful for analysing spatial navigation, social interactions, and collective behaviour.
30
+
31
+
## Version 0.1
23
32
We've released version `v0.1` of `movement` in March 2025, providing a basic set of features to demonstrate the project's potential and to gather feedback from users. Our minimum requirements for this milestone were:
24
33
25
34
-[x] Ability to import pose tracks from [DeepLabCut](dlc:), [SLEAP](sleap:) and [LightningPose](lp:) into a common `xarray.Dataset` structure.
0 commit comments