Skip to content

Commit

Permalink
Merge pull request #692 from int-brain-lab/iblrigv8dev
Browse files Browse the repository at this point in the history
8.21.0
  • Loading branch information
bimac authored Aug 5, 2024
2 parents deef1a4 + 4354671 commit 839751a
Show file tree
Hide file tree
Showing 49 changed files with 6,298 additions and 696 deletions.
27 changes: 9 additions & 18 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,39 +35,30 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Python
uses: actions/setup-python@v5
- name: Set up PDM
uses: pdm-project/setup-pdm@v4
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
cache-dependency-path: 'pyproject.toml'

- name: install requirements
shell: bash -l {0}
run: |
pip install --editable .[DEV]
cache: true
- name: Install requirements
run: pdm sync -dG test
- name: Install audio library (Ubuntu only)
if: matrix.os == 'ubuntu-latest'
run: sudo apt-get install -y libportaudio2

- name: iblrig unit tests
run: pytest

run: pdm run pytest
- name: coveralls.io
uses: coverallsapp/github-action@v2
with:
flag-name: ${{ matrix.python-version }}, ${{ matrix.os }}
parallel: true
file: coverage.xml
compare-ref: iblrigv8

- name: Generate requirements_frozen.txt
run: pip freeze > requirements_frozen.txt

run: pdm export -o requirements_frozen.txt --no-hashes
- name: Store frozen requirements as artifacts
uses: actions/upload-artifact@v3
if: matrix.os == 'ubuntu-latest'
uses: actions/upload-artifact@v4
with:
name: requirements_frozen
path: requirements_frozen.txt
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,6 @@ coverage.xml

devices/camera_setup/*.layout
devices/camera_recordings/*.layout
.pdm-python
/dist
*~
18 changes: 5 additions & 13 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,30 +1,22 @@
repos:

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v4.6.0
hooks:
- id: end-of-file-fixer
types_or: [python, yaml, json, toml]
- id: trailing-whitespace
types_or: [python, yaml, json, toml]
- id: check-case-conflict
- id: check-ast
- id: check-yaml
- id: check-json
- id: check-toml
- id: check-xml
- id: check-vcs-permalinks
- id: detect-private-key

- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.10.0
hooks:
- id: python-use-type-annotations
- id: python-no-log-warn
- id: text-unicode-replacement-char

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.3.5
rev: v0.5.1
hooks:
- id: ruff
types_or: [ python, pyi ]
args: [ --fix ]
- id: ruff-format
types_or: [ python, pyi ]
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@ Changelog
=========


8.21.0
------
* display values of automatically inferred task parameters
* store pause durations to trial info
* add backend for UDP communication between rig computers
* use PDM for managing dependencies
* log session call / commandline parameters to disk
* fix: potential deadlock with SerialSingleton
* fix: "galloping" valve during valve calibration
* fix: values computed by "Get Training Phase" in "Tools" menu
* fix: incorrect parsing of adaptive gain value in trainingChoiceWorld

8.20.0
------
* tab for displaying local sessions and their respective status
Expand Down Expand Up @@ -317,5 +329,6 @@ Changelog
8.9.0
-----
* major rework of the GUI
* allow pausing between trials
* task-specific settings
* new dialogs for weight & droppings
6 changes: 6 additions & 0 deletions docs/source/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,12 @@ To update the additional tasks and extractors (see :ref:`Installing iblrigv8`, p
git pull
.. tip::

While usually quite snappy, upgrading the virtual environment in some instances can take longer than expected.
Please be patient during the upgrade procedure.


Switch to specific iblrig version
---------------------------------
.. warning:: Downgrading is not recommended and may not work as some releases break compatibility with earlier versions.
Expand Down
38 changes: 18 additions & 20 deletions docs/source/reference_developer_guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,54 +35,61 @@ Here,
Both of these fields are inferred by means of git describe and do not require manual interaction from the developer.


PDM
---

We use `PDM <https://pdm-project.org/en/latest/>`_ to manage dependencies of IBLRIG.
See `PDM's documentation <https://pdm-project.org/en/latest/#installation>` for help with installing PDM.


Installing Developer Dependencies
---------------------------------

To install additional dependencies needed for working on IBLRIG's code-base, run the following within the venv:
To install additional dependencies needed for working on IBLRIG's code-base, run:

.. code-block:: console
pip install -U -e .[DEV]
pdm sync -d
Running Unit Tests Locally
--------------------------

To run unit tests locally, run the following within IBLRIG's venv:
To run unit tests locally, run:

.. code-block:: console
pytest
pdm run pytest
This will also generate a coverage report which can be found in the ``htmlcov`` directory.


Linting & Formatting
--------------------

To lint your code, run the following within IBLRIG's venv:
To lint your code, run the:

.. code-block:: console
ruff check .
pdm run ruff check
Adding the commandline flag ``--fix`` will automatically fix issues that are deemed safe to handle:

.. code-block:: console
ruff check . --fix
pdm run ruff check --fix
To *check* if your code conforms to the `Black code style <https://black.readthedocs.io/en/stable/the_black_code_style/current_style.html>`_, run:

.. code-block:: console
ruff format . --check
pdm run ruff format --check
To reformat your code according to the `Black code style <https://black.readthedocs.io/en/stable/the_black_code_style/current_style.html>`_, run:

.. code-block:: console
ruff format .
pdm run ruff format
Refer to `Ruff Formater's documentation <https://docs.astral.sh/ruff/formatter/>`_ for further details.

Expand All @@ -103,17 +110,8 @@ Building the documentation

.. code-block:: console
# make sure pre-requisites are installed
pip install --upgrade -e .[DEV]
# create the static directory
rm -rf ./docs/build
mkdir -p ./docs/build/html/_static
# unit tests generate task diagrams
python -m unittest discover ./iblrig/test
# generate class diagrams
pyreverse -o png -m y --ignore iblrig.test -A --output-directory ./docs/build/html/_static ./iblrig_tasks
# build and serve the docs locally
sphinx-autobuild ./docs/source ./docs/build/html/
pdm run sphinx-autobuild ./docs/source ./docs/build
Contribute to the documentation
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down
2 changes: 1 addition & 1 deletion iblrig/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# 5) git tag the release in accordance to the version number below (after merge!)
# >>> git tag 8.15.6
# >>> git push origin --tags
__version__ = '8.20.0'
__version__ = '8.21.0'


from iblrig.version_management import get_detailed_version_string
Expand Down
Loading

0 comments on commit 839751a

Please sign in to comment.