Development#

Create a new distribution#

Checklist before creating a new distribution#

Before creating a new distribution, the following checklist should be completed:

  • [ ] Double check the version number in the __init__.py file in the pynamicgain folder.

  • [ ] Remove the dist folder, the EGG-INFO folder, and the build folder.

  • [ ] Remove the conda environment and create a new one (conda remove -n pydg_analysis --all)

  • [ ] Install new conda environment (conda create -n pydg_analysis python=3.11)

  1. Update the version number in the __init__.py file in the pynamicgain folder.

  2. Create a new distribution with the following command:

pip install build

If used in development mode, the following command is necessary (in the root directory of the repository):

pip install --editable .

DO NOT MAKE THE FINAL TESTS IN DEVELOPMENT MODE!

Otherwise, create the tar.gz and wheel files with the following command:

python -m build

Checklist#

After creating a new distribution, the following checklist should be completed:

  • [ ] Double check the version number in the __init__.py file in the pynamicgain folder.

  • [ ] Check if the package is importable with the following command:

    • [ ] python -c "import pynamicgain"

    • [ ] python -> import pynamicgain as pydg -> pydg.__version__

  • [ ] Check if the package is locally installable: pip install dist/PynamicGain-0.0.9-py3-none-any.whl

  • [ ] Run all major commands

    • [ ] pydg_help

    • [ ] pydg_new_setup

Documentation#

Install additional dependencies with the following command:

pip install .[docs]

Add the pyreverse class and package overviews:

pyreverse pynamicgain

Transform the dot files to png files:

dot -Tpng packages.dot > docs/source/explanations/_images/pynamicgain_package.svg -Gdpi=300
dot -Tpng classes.dot > docs/source/explanations/_images/pynamicgain_classgraph.svg -Gdpi=300

Delete the dot files:

rm packages.dot classes.dot

To build the documentation, use the following command:

sphinx-apidoc -f -o docs/source/_apidoc/ pynamicgain
sphinx-build -b html docs/source docs/_build/html

This will currently generate 5 warnings, which are not critical.

Outlook/TODO#

  • [ ] Finish the documentation

  • [ ] Change Image Composition in the mini spike train analysis

  • [ ] Add phase plot to the analysis

  • [ ] Add DG analysis option (online/offline)

  • [ ] Add whole folder analysis option

  • [ ] Add automated testing