Skip to content

Commit 3ee1528

Browse files
authored
Merge pull request #189 from NeuralEnsemble/experimental
feat!: regenerate for 2.3.1
2 parents 5dcc898 + 9f78e71 commit 3ee1528

File tree

82 files changed

+34520
-30278
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+34520
-30278
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
if: ${{ matrix.runs-on == 'macos-latest' }}
4040
run: |
4141
brew install hdf5
42-
42+
4343
- name: Build package
4444
run: |
4545
pip install .[full]

.pre-commit-config.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# See https://pre-commit.com for more information
2+
# See https://pre-commit.com/hooks.html for more hooks
3+
repos:
4+
- repo: https://github.com/pre-commit/pre-commit-hooks
5+
rev: v4.4.0
6+
hooks:
7+
- id: trailing-whitespace
8+
- id: end-of-file-fixer
9+
- id: check-added-large-files
10+
- repo: https://github.com/astral-sh/ruff-pre-commit
11+
rev: v0.4.1
12+
hooks:
13+
- id: ruff
14+
args: [ "--select", "I", "--fix" ]
15+
- id: ruff-format

CONTRIBUTING.md

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
# Contributing
2+
3+
Please open issues to discuss enhancements and bugs that you may encounter with
4+
libNeuroML. Pull requests with enhancements and bug fixes are welcome.
5+
6+
## Virtual environments and editable installs
7+
8+
It is best to use [virtual environments](https://docs.python.org/3/tutorial/venv.html) when developing Python packages.
9+
This ensures that one uses a clean environment that includes the necessary
10+
dependencies and does not affect the overall system installation.
11+
12+
For quick development, consider using [editable installs](https://setuptools.pypa.io/en/latest/userguide/development_mode.html).
13+
The dependencies are broken down in the `setup.cfg` file. To get a complete development environment, one can run:
14+
15+
16+
pip install -e .[dev] # an editable install with all development dependecies installed
17+
18+
19+
## Code style
20+
21+
1. The source code uses spaces, and each tab is equivalent to 4 spaces.
22+
23+
2. We use the [reStructuredText (reST)
24+
format](https://stackoverflow.com/a/24385103/375067) for Python docstrings.
25+
Please document your code when opening pull requests.
26+
All methods/functions/modules *must* include docstrings that explain the parameters.
27+
28+
3. We use [ruff](https://pypi.org/project/ruff/) to format and lint our code. (See the section on pre-commit below.)
29+
30+
4. Please use [type hints](https://docs.python.org/3/library/typing.html) wherever applicable.
31+
You can set up type checkers such as [mypy](https://mypy.readthedocs.io/) to use type hints in your development environment/IDE.
32+
33+
34+
pip install mypy
35+
36+
37+
### Pre-commit
38+
39+
A number of [pre-commit](https://pre-commit.com/) hooks are used to improve code-quality.
40+
Please run the following code to set up the pre-commit hooks:
41+
42+
$ pre-commit install
43+
44+
The hooks will be run at each `git commit`.
45+
Please see `.pre-commit-config.yaml` for information on what hooks we run.
46+
47+
48+
### Commit messages
49+
50+
Writing good commit messages makes things easy to follow.
51+
Please see these posts:
52+
53+
- [How to write a Git commit message](https://cbea.ms/git-commit/)
54+
- While not compulsory, we prefer [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/)
55+
56+
57+
## Tests
58+
59+
Bug fixes and new features should include unit tests to test for correctness.
60+
One can base new tests off the current ones included in the `tests/` directory.
61+
To see how tests are run, please see the [GitHub Actions configuration file](https://github.com/NeuralEnsemble/libNeuroML/blob/development/.github/workflows/ci.yml).
62+
63+
We use [pytest](https://docs.pytest.org/) for unit testing.
64+
One can run it from the root of the repository:
65+
66+
pytest
67+
68+
69+
To run specific tests, one can use the `-k` flag:
70+
71+
72+
pytest -k "..."
73+
74+
75+
## Pull Request Process
76+
77+
1. Please contribute pull requests against the `development` branch.
78+
2. Please ensure that the automated build for your pull request passes.
79+
3. Please write good commit messages (see the section above).
80+
81+
### Updating your pull request branch
82+
83+
Over time, as pull requests are reviewed, the `development` branch continues to move on with other changes.
84+
Sometimes, it can be useful/necessary to pull in these changes to the pull request branch, using the following steps.
85+
86+
Add the upstream libNeuroML repository as a remote:
87+
88+
89+
git remote add upstream https://github.com/NeuralEnsemble/libNeuroML.git
90+
91+
92+
Update your local copy of the `development` branch, and the remote copy in your fork:
93+
94+
95+
git checkout development
96+
git pull upstream development
97+
git push
98+
99+
100+
Pull in changes from development to your branch:
101+
102+
103+
git checkout <feature branch being used for PR>
104+
git merge development
105+
106+
107+
If there are merge conflicts, you will need to [resolve these](https://git-scm.com/book/en/v2/Git-Branching-Basic-Branching-and-Merging#_basic_merge_conflicts), since merging the feature branch in the pull request will also result in these.
108+
After any merge conflicts have been resolved (or if there aren't any), you can
109+
push your branch to your fork to update the pull request:
110+
111+
112+
git push

doc/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
# All configuration values have a default; values that are commented out
1212
# serve to show the default.
1313

14-
import sys
1514
import os
15+
import sys
1616

1717
# If extensions (or modules to document with autodoc) are in another directory,
1818
# add these directories to sys.path here. If the directory is relative to the

doc/devdocs/index.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,3 @@ Contributing
99
implementation_of_bindings
1010
meeting_june_2012
1111
nodes_segments_sections
12-

doc/devdocs/meeting_june_2012.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ Mike V was asked to add a clone method to a morphology.
109109
It was decided that fraction_along should be a property of segment.
110110

111111
The syntax for segment groups should be as follows:
112-
group=morph.segment_groups['axon_group']
112+
group=morph.segment_groups['axon_group']
113113
(in connect merge groups should be false by default - throw an exception, tell the user setting merge_groups = True or rename group will fix this)
114114

115115
This was a subject of great debate and has not been completely settled.

doc/devdocs/nodes_segments_sections.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ unbranched segmentGroups, which can be used as the basis for sections in any par
5858
in them, or be ignored by any other application.
5959

6060
In libNeuroML, a section-like concept can be added at API level, to facilitate building cells, to facilitate import/export
61-
to/from simulators supporting this concept, and to serve as a basis for recompartmentalisation of cells.
61+
to/from simulators supporting this concept, and to serve as a basis for recompartmentalisation of cells.
6262

6363

6464

@@ -96,7 +96,7 @@ to the **parent** element, i.e.
9696
<parent segment="2" fractionAlong="0.5"/>
9797

9898
This is not possible in a node based format, but represents a logically consistent description of what the modeller
99-
wants.
99+
wants.
100100

101101

102102
What to do?
@@ -108,4 +108,4 @@ enforce "best practice"?
108108
PG: I'd argue for the first approach, as it retains as much as possible of what the original reconstructor/simulator specified.
109109
An API which enforces a policy when it encounters a non optimal morphology (e.g. moving all dendrites to connection points,
110110
inserting new nodes) will alter the original data in perhaps unintended ways, and that information will be lost by subsequent readers.
111-
It should be up to each parsing application to decide what to do with the extra information when it reads in a file.
111+
It should be up to each parsing application to decide what to do with the extra information when it reads in a file.

doc/helpers/nml-core-docs.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
Copyright 2023 NeuroML authors
88
"""
99

10-
1110
import textwrap
1211

1312
print("Generating list of nml classes")

doc/refs.bib

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,3 @@ @Article{Vella2014
2020
timestamp = {2019-02-20},
2121
year = {2014},
2222
}
23-

doc/userdocs/api.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,3 @@ You can find information on these in the pages below.
1212
writers
1313
utils
1414
arraymorph
15-
16-

0 commit comments

Comments
 (0)