Skip to content

Commit

Permalink
Merge pull request #196 from NeuralEnsemble/development
Browse files Browse the repository at this point in the history
 Changes for NeuroML v2.3.1 release
  • Loading branch information
pgleeson authored Aug 20, 2024
2 parents 4c5ffef + 8f60aca commit 09be14e
Show file tree
Hide file tree
Showing 101 changed files with 37,600 additions and 32,681 deletions.
19 changes: 14 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,19 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
runs-on: [ubuntu-latest, windows-latest, macos-latest]
exclude:
- runs-on: macos-latest
python-version: "3.8"
- runs-on: macos-latest
python-version: "3.9"

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

Expand All @@ -30,6 +35,11 @@ jobs:
#sudo apt-get install libhdf5-serial-dev liblzo2-dev libgraphviz-dev -y
python -m pip install --upgrade pip
- name: Install HDF5 for pytables on macos-latest
if: ${{ matrix.runs-on == 'macos-latest' }}
run: |
brew install hdf5
- name: Build package
run: |
pip install .[full]
Expand All @@ -38,10 +48,9 @@ jobs:
if: ${{ matrix.runs-on == 'ubuntu-latest' }}
run: |
# Just test on linux for now...
pytest -vs
pytest -vs
- name: Run examples
if: ${{ matrix.python-version != '3.7' || matrix.runs-on != 'macos-latest' }} # issue with _bz2 module...
run: |
cd neuroml/examples
python run_all.py
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/regenerate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,19 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
sudo apt-get update -y
sudo apt-get install libhdf5-serial-dev liblzo2-dev libgraphviz-dev -y
python -m pip install --upgrade pip
pip install .[dev]
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,4 @@ neuroml/test/*.h5

sed-script.txt
/test.sh
/*ken.sh
17 changes: 17 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: trailing-whitespace
exclude: NeuroML.*xsd
- id: end-of-file-fixer
exclude: NeuroML.*xsd
- id: check-added-large-files
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.4.1
hooks:
- id: ruff
args: [ "--select", "I", "--fix" ]
- id: ruff-format
112 changes: 112 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
# Contributing

Please open issues to discuss enhancements and bugs that you may encounter with
libNeuroML. Pull requests with enhancements and bug fixes are welcome.

## Virtual environments and editable installs

It is best to use [virtual environments](https://docs.python.org/3/tutorial/venv.html) when developing Python packages.
This ensures that one uses a clean environment that includes the necessary
dependencies and does not affect the overall system installation.

For quick development, consider using [editable installs](https://setuptools.pypa.io/en/latest/userguide/development_mode.html).
The dependencies are broken down in the `setup.cfg` file. To get a complete development environment, one can run:


pip install -e .[dev] # an editable install with all development dependecies installed


## Code style

1. The source code uses spaces, and each tab is equivalent to 4 spaces.

2. We use the [reStructuredText (reST)
format](https://stackoverflow.com/a/24385103/375067) for Python docstrings.
Please document your code when opening pull requests.
All methods/functions/modules *must* include docstrings that explain the parameters.

3. We use [ruff](https://pypi.org/project/ruff/) to format and lint our code. (See the section on pre-commit below.)

4. Please use [type hints](https://docs.python.org/3/library/typing.html) wherever applicable.
You can set up type checkers such as [mypy](https://mypy.readthedocs.io/) to use type hints in your development environment/IDE.


pip install mypy


### Pre-commit

A number of [pre-commit](https://pre-commit.com/) hooks are used to improve code-quality.
Please run the following code to set up the pre-commit hooks:

$ pre-commit install

The hooks will be run at each `git commit`.
Please see `.pre-commit-config.yaml` for information on what hooks we run.


### Commit messages

Writing good commit messages makes things easy to follow.
Please see these posts:

- [How to write a Git commit message](https://cbea.ms/git-commit/)
- While not compulsory, we prefer [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/)


## Tests

Bug fixes and new features should include unit tests to test for correctness.
One can base new tests off the current ones included in the `tests/` directory.
To see how tests are run, please see the [GitHub Actions configuration file](https://github.com/NeuralEnsemble/libNeuroML/blob/development/.github/workflows/ci.yml).

We use [pytest](https://docs.pytest.org/) for unit testing.
One can run it from the root of the repository:

pytest


To run specific tests, one can use the `-k` flag:


pytest -k "..."


## Pull Request Process

1. Please contribute pull requests against the `development` branch.
2. Please ensure that the automated build for your pull request passes.
3. Please write good commit messages (see the section above).

### Updating your pull request branch

Over time, as pull requests are reviewed, the `development` branch continues to move on with other changes.
Sometimes, it can be useful/necessary to pull in these changes to the pull request branch, using the following steps.

Add the upstream libNeuroML repository as a remote:


git remote add upstream https://github.com/NeuralEnsemble/libNeuroML.git


Update your local copy of the `development` branch, and the remote copy in your fork:


git checkout development
git pull upstream development
git push


Pull in changes from development to your branch:


git checkout <feature branch being used for PR>
git merge development


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.
After any merge conflicts have been resolved (or if there aren't any), you can
push your branch to your fork to update the pull request:


git push
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ See https://docs.neuroml.org/ for an overview of the various NeuroML libraries.

## Changelog

See also https://github.com/NeuralEnsemble/libNeuroML/releases.

### version 0.5.8

- drop py3.7, add py3,12
Expand Down
1 change: 1 addition & 0 deletions doc/component-list.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"Cells": ["baseCell", "baseSpikingCell", "baseCellMembPot", "baseCellMembPotDL", "baseChannelPopulation", "channelPopulation", "channelPopulationNernst", "baseChannelDensity", "baseChannelDensityCond", "variableParameter", "inhomogeneousValue", "channelDensityNonUniform", "channelDensityNonUniformNernst", "channelDensityNonUniformGHK", "channelDensity", "channelDensityVShift", "channelDensityNernst", "channelDensityNernstCa2", "channelDensityGHK", "channelDensityGHK2", "pointCellCondBased", "pointCellCondBasedCa", "distal", "proximal", "parent", "segment", "segmentGroup", "member", "from", "to", "include", "path", "subTree", "inhomogeneousParameter", "proximalDetails", "distalDetails", "morphology", "specificCapacitance", "initMembPotential", "spikeThresh", "membraneProperties", "membraneProperties2CaPools", "biophysicalProperties", "biophysicalProperties2CaPools", "intracellularProperties", "intracellularProperties2CaPools", "resistivity", "concentrationModel", "decayingPoolConcentrationModel", "fixedFactorConcentrationModel", "fixedFactorConcentrationModelTraub", "species", "cell", "cell2CaPools", "baseCellMembPotCap", "baseIaf", "iafTauCell", "iafTauRefCell", "baseIafCapCell", "iafCell", "iafRefCell", "izhikevichCell", "izhikevich2007Cell", "adExIaFCell", "fitzHughNagumoCell", "pinskyRinzelCA3Cell", "hindmarshRose1984Cell"], "Synapses": ["baseSynapse", "baseVoltageDepSynapse", "baseSynapseDL", "baseCurrentBasedSynapse", "alphaCurrentSynapse", "baseConductanceBasedSynapse", "baseConductanceBasedSynapseTwo", "expOneSynapse", "alphaSynapse", "expTwoSynapse", "expThreeSynapse", "baseBlockMechanism", "voltageConcDepBlockMechanism", "basePlasticityMechanism", "tsodyksMarkramDepMechanism", "tsodyksMarkramDepFacMechanism", "blockingPlasticSynapse", "doubleSynapse", "stdpSynapse", "gapJunction", "baseGradedSynapse", "silentSynapse", "linearGradedSynapse", "gradedSynapse"], "Channels": ["baseVoltageDepRate", "baseVoltageConcDepRate", "baseHHRate", "HHExpRate", "HHSigmoidRate", "HHExpLinearRate", "baseVoltageDepVariable", "baseVoltageConcDepVariable", "baseHHVariable", "HHExpVariable", "HHSigmoidVariable", "HHExpLinearVariable", "baseVoltageDepTime", "baseVoltageConcDepTime", "fixedTimeCourse", "baseQ10Settings", "q10Fixed", "q10ExpTemp", "baseConductanceScaling", "q10ConductanceScaling", "baseConductanceScalingCaDependent", "baseGate", "gate", "gateHHrates", "gateHHtauInf", "gateHHInstantaneous", "gateHHratesTau", "gateHHratesInf", "gateHHratesTauInf", "gateFractional", "subGate", "baseIonChannel", "ionChannelPassive", "ionChannelHH", "ionChannel", "ionChannelVShift", "KSState", "closedState", "openState", "ionChannelKS", "KSTransition", "forwardTransition", "reverseTransition", "vHalfTransition", "tauInfTransition", "gateKS"], "Inputs": ["basePointCurrent", "baseVoltageDepPointCurrent", "baseVoltageDepPointCurrentSpiking", "basePointCurrentDL", "baseVoltageDepPointCurrentDL", "baseSpikeSource", "spikeGenerator", "spikeGeneratorRandom", "spikeGeneratorPoisson", "spikeGeneratorRefPoisson", "poissonFiringSynapse", "transientPoissonFiringSynapse", "timedSynapticInput", "spikeArray", "spike", "pulseGenerator", "compoundInput", "compoundInputDL", "pulseGeneratorDL", "sineGenerator", "sineGeneratorDL", "rampGenerator", "rampGeneratorDL", "voltageClamp", "voltageClampTriple"], "Networks": ["network", "networkWithTemperature", "basePopulation", "population", "populationList", "instance", "location", "region", "rectangularExtent", "projection", "explicitConnection", "connection", "synapticConnection", "synapticConnectionWD", "connectionWD", "electricalConnection", "electricalConnectionInstance", "electricalConnectionInstanceW", "electricalProjection", "continuousConnection", "continuousConnectionInstance", "continuousConnectionInstanceW", "continuousProjection", "explicitInput", "inputList", "input", "inputW"], "PyNN": ["basePyNNCell", "basePyNNIaFCell", "basePyNNIaFCondCell", "IF_curr_alpha", "IF_curr_exp", "IF_cond_alpha", "IF_cond_exp", "EIF_cond_exp_isfa_ista", "EIF_cond_alpha_isfa_ista", "HH_cond_exp", "basePynnSynapse", "expCondSynapse", "expCurrSynapse", "alphaCondSynapse", "alphaCurrSynapse", "SpikeSourcePoisson"], "NeuroMLCoreDimensions": [], "NeuroMLCoreCompTypes": ["notes", "annotation", "property", "baseStandalone", "rdf_RDF", "rdf_Description", "baseBqbiol", "bqbiol_encodes", "bqbiol_hasPart", "bqbiol_hasProperty", "bqbiol_hasVersion", "bqbiol_is", "bqbiol_isDescribedBy", "bqbiol_isEncodedBy", "bqbiol_isHomologTo", "bqbiol_isPartOf", "bqbiol_isPropertyOf", "bqbiol_isVersionOf", "bqbiol_occursIn", "bqbiol_hasTaxon", "bqmodel_is", "bqmodel_isDescribedBy", "bqmodel_isDerivedFrom", "rdf_Bag", "rdf:li", "point3DWithDiam"], "Simulation": ["Simulation", "Display", "Line", "OutputFile", "OutputColumn", "EventOutputFile", "EventSelection", "Meta"]}
2 changes: 1 addition & 1 deletion doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
# All configuration values have a default; values that are commented out
# serve to show the default.

import sys
import os
import sys

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
Expand Down
1 change: 0 additions & 1 deletion doc/devdocs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,3 @@ Contributing
implementation_of_bindings
meeting_june_2012
nodes_segments_sections

2 changes: 1 addition & 1 deletion doc/devdocs/meeting_june_2012.rst
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ Mike V was asked to add a clone method to a morphology.
It was decided that fraction_along should be a property of segment.

The syntax for segment groups should be as follows:
group=morph.segment_groups['axon_group']
group=morph.segment_groups['axon_group']
(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)

This was a subject of great debate and has not been completely settled.
Expand Down
6 changes: 3 additions & 3 deletions doc/devdocs/nodes_segments_sections.rst
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ unbranched segmentGroups, which can be used as the basis for sections in any par
in them, or be ignored by any other application.

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



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

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


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

0 comments on commit 09be14e

Please sign in to comment.