Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8.24.0 #711

Merged
merged 48 commits into from
Sep 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
91f1550
Update release.yaml
bimac Aug 26, 2024
017dc7c
Update release.yaml
bimac Aug 26, 2024
04baddc
Create validate_hifi.py
bimac Aug 26, 2024
1d5591b
Update release.yaml
bimac Aug 26, 2024
eaf3516
add changelog / version info
bimac Aug 26, 2024
dd1af77
Update CHANGELOG.md
bimac Aug 26, 2024
f26ed87
Update faq.rst
bimac Aug 26, 2024
599c9ed
Merge branch 'iblrigv8dev' of github.com:int-brain-lab/iblrig into ib…
bimac Aug 26, 2024
14a471e
document states in get_state_machine_trial()
bimac Aug 27, 2024
7606f28
Merge branch 'iblrigv8dev' of https://github.com/int-brain-lab/iblrig…
bimac Aug 27, 2024
fe5c2c2
add QObjects for handling Alyx
bimac Aug 28, 2024
110cbf4
add documentation
bimac Aug 28, 2024
5ce2e10
Update tools.py
bimac Aug 28, 2024
955823c
Update tools.py
bimac Aug 28, 2024
3011ba2
add StatefulButton
bimac Aug 29, 2024
3cb4a89
Update tools.py
bimac Aug 29, 2024
ddd83aa
validate trialdata
bimac Aug 30, 2024
89d13b3
Update pydantic_definitions.py
bimac Aug 30, 2024
54b9c91
Update base_choice_world.py
bimac Aug 30, 2024
0d55122
Update pydantic_definitions.py
bimac Aug 30, 2024
947df85
class method for creating empty dataframe based on pydantic model
bimac Aug 30, 2024
d6c6b95
Finish implementation of trial_data check
bimac Aug 31, 2024
6226a4d
Update pydantic_definitions.py
bimac Aug 31, 2024
b6f43ba
place TrialDataModels with session classes
bimac Aug 31, 2024
b20bd36
work on documentation
bimac Sep 2, 2024
4fdd124
repair CI
bimac Sep 2, 2024
dca9248
simplify use of TrialDataModel
bimac Sep 2, 2024
dd2301d
minor fix
bimac Sep 3, 2024
0c9f77d
make protocol_name an abstract property of BaseSession
bimac Sep 3, 2024
770d435
do not cache subjects and projects
bimac Sep 3, 2024
768a1fa
Update base_tasks.py
bimac Sep 3, 2024
0ad4f6f
minor changes to base_tasks (protocol, abstract properties)
bimac Sep 3, 2024
3371657
Update custom-module-template.rst
bimac Sep 3, 2024
9552658
add `TrialDataModel` for all session types in `base_choice_world`
bimac Sep 3, 2024
1d178bc
Update reference_write_your_own_task.rst
bimac Sep 3, 2024
33d26bc
Merge branch 'iblrigv8dev' of github.com:int-brain-lab/iblrig into ib…
bimac Sep 3, 2024
f37a84b
add private submodules of iblrig_tasks to API reference
bimac Sep 3, 2024
75932fa
add TrialDataModel to NeuroModulatorChoiceWorld
bimac Sep 4, 2024
b39fd8e
EphysCW: actually use pregenerated data from parquet
bimac Sep 4, 2024
71e9be0
Update base_choice_world.py
bimac Sep 4, 2024
6c6684f
correct trial fixtures for ephysChoiceWorld
bimac Sep 4, 2024
e20c8bc
simplify overriding of trial parameters in draw_next_trial_info
bimac Sep 4, 2024
b0a17e9
minor update to documentation
bimac Sep 10, 2024
3d014f2
prepare release
bimac Sep 10, 2024
b9334f3
use dict for passing extra log items in show_trial_log
bimac Sep 10, 2024
a93837d
Update CHANGELOG.md
bimac Sep 10, 2024
f4abec1
Update CHANGELOG.md
bimac Sep 10, 2024
1842d95
Merge branch 'iblrigv8' into iblrigv8dev
bimac Sep 10, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ name: Release

on:
push:
branches:
- iblrigv8
tags:
- '[0-9]+.[0-9]+.[0-9]+'

Expand Down Expand Up @@ -41,4 +39,4 @@ jobs:
name: documentation
- uses: softprops/action-gh-release@v2
with:
files: documentation/*.pdf
files: iblrig_*_reference.pdf
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,4 @@ devices/camera_recordings/*.layout
.pdm-python
/dist
*~
docs/source/api/*
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
Changelog
=========

8.24.0
------
* feature: validate values in `trials_table` using Pydantic
* feature: add auto-generated API reference to documentation
* changed: `show_trial_log()` now accepts a dict for including additional log items
* fix: `_ephysChoiceWorld` - values from the pre-generated sessions were not actually used
* fix: `_ephysChoiceWorld` - trial fixtures contained inverted values for `probability_left`
* fix: GUI - Subjects and Projects are not being cached
* add script for validating audio output of Bpod HiFi Module (in `scripts/` folder)

-------------------------------

8.23.1
------
* feature: post hardware information to alyx
Expand Down
12 changes: 12 additions & 0 deletions docs/source/_templates/custom-class-template.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{{ fullname | escape | underline}}

.. currentmodule:: {{ module }}

.. inheritance-diagram:: {{ objname }}
:parts: 1

|

.. autoclass:: {{ objname }}
:members:
:undoc-members:
84 changes: 84 additions & 0 deletions docs/source/_templates/custom-module-template.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
{{ fullname | escape | underline}}

.. automodule:: {{ fullname }}
{% block attributes %}
{%- if attributes %}
.. rubric:: {{ _('Module Attributes') }}

.. autosummary::
:nosignatures:
:toctree:
{% for item in attributes %}
{{ item }}
{%- endfor %}
{% endif %}
{%- endblock %}

{%- block functions %}
{%- if functions %}
.. rubric:: {{ _('Functions') }}

.. autosummary::
:nosignatures:
:toctree:
{% for item in functions %}
{{ item }}
{%- endfor %}
{% endif %}
{%- endblock %}

{%- block classes %}
{%- if classes %}
.. rubric:: {{ _('Classes') }}

.. autosummary::
:nosignatures:
:toctree:
:template: custom-class-template.rst
{% for item in classes %}
{{ item }}
{%- endfor %}
{% endif %}
{%- endblock %}

{%- block exceptions %}
{%- if exceptions %}
.. rubric:: {{ _('Exceptions') }}

.. autosummary::
:nosignatures:
:toctree:
{% for item in exceptions %}
{{ item }}
{%- endfor %}
{% endif %}
{%- endblock %}

{%- block modules %}
{%- if modules or name == 'iblrig_tasks' %}
.. rubric:: Modules

.. autosummary::
:nosignatures:
:toctree:
:template: custom-module-template.rst
:recursive:
{% for item in modules %}
{%- if item != 'test' %} {# EXCLUDE TESTS FROM API #}
{{ item }}
{% endif %}
{%- endfor %}
{%- if name == 'iblrig_tasks' %}
_iblrig_tasks_advancedChoiceWorld
_iblrig_tasks_biasedChoiceWorld
_iblrig_tasks_ephysChoiceWorld
_iblrig_tasks_habituationChoiceWorld
_iblrig_tasks_ImagingChoiceWorld
_iblrig_tasks_neuroModulatorChoiceWorld
_iblrig_tasks_passiveChoiceWorld
_iblrig_tasks_spontaneous
_iblrig_tasks_trainingChoiceWorld
_iblrig_tasks_trainingPhaseChoiceWorld
{% endif %}
{% endif %}
{%- endblock %}
10 changes: 10 additions & 0 deletions docs/source/api.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
API Reference
=============

.. autosummary::
:toctree: api
:template: custom-module-template.rst
:recursive:

iblrig
iblrig_tasks
65 changes: 58 additions & 7 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import os
import sys
from datetime import date

sys.path.insert(0, os.path.abspath('../..'))
from iblrig import __version__
from iblrig.constants import BASE_PATH


project = 'iblrig'
copyright = f'2018 – {date.today().year} International Brain Laboratory'
Expand All @@ -12,21 +15,41 @@
# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration

extensions = ['sphinx_lesson', 'sphinx.ext.autosectionlabel', 'sphinx_simplepdf']
templates_path = ['_templates']
extensions = [
'sphinx_lesson',
'sphinx.ext.autosectionlabel',
'sphinx_simplepdf',
'sphinx.ext.intersphinx',
'sphinx.ext.napoleon',
'sphinx.ext.autodoc',
'sphinx.ext.autosummary',
'sphinx.ext.inheritance_diagram',
'sphinx.ext.viewcode',
]
autosectionlabel_prefix_document = True
source_suffix = ['.rst', '.md']

templates_path = ['_templates']
exclude_patterns = []

intersphinx_mapping = {
'python': ('https://docs.python.org/3', None),
'sphinx': ('https://www.sphinx-doc.org/en/master/', None),
'matplotlib': ('https://matplotlib.org/stable/', None),
'numpy': ('https://numpy.org/doc/stable/', None),
'pandas': ('https://pandas.pydata.org/docs/', None),
'scipy': ('https://docs.scipy.org/doc/scipy/', None),
'one:': ('https://int-brain-lab.github.io/ONE/', None),
'pydantic': ('https://docs.pydantic.dev/latest/', None),
'iblenv': ('https://int-brain-lab.github.io/iblenv/', None),
'pyserial': ('https://pyserial.readthedocs.io/en/latest/', None),
'Sphinx': ('https://www.sphinx-doc.org/en/master/', None),
}

# -- Options for HTML output -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output

html_theme = 'sphinx_rtd_theme'
html_static_path = ['_static']


# -- Options for PDF creation ------------------------------------------------
simplepdf_vars = {
'primary': '#004f8c',
'secondary': '#004f8c',
Expand All @@ -39,3 +62,31 @@
'docs_scope': 'external',
'cover_meta_data': 'International Brain Laboratory',
}

# -- Settings for automatic API generation -----------------------------------
autodoc_mock_imports = ["PySpin"]
autodoc_class_signature = 'separated' # 'mixed', 'separated'
autodoc_member_order = 'groupwise' # 'alphabetical', 'groupwise', 'bysource'
autodoc_inherit_docstrings = False
autodoc_typehints = 'description' # 'description', 'signature', 'none', 'both'
autodoc_typehints_description_target = 'all' # 'all', 'documented', 'documented_params'
autodoc_typehints_format = 'short' # 'fully-qualified', 'short'

autosummary_generate = True
autosummary_imported_members = False

napoleon_google_docstring = False
napoleon_numpy_docstring = True
napoleon_include_init_with_doc = True
napoleon_include_private_with_doc = False
napoleon_include_special_with_doc = False
napoleon_use_admonition_for_examples = True
napoleon_use_admonition_for_notes = True
napoleon_use_admonition_for_references = True
napoleon_use_ivar = False
napoleon_use_param = False
napoleon_use_rtype = True
napoleon_use_keyword = True
napoleon_preprocess_types = True
napoleon_type_aliases = None
napoleon_attr_annotations = False
2 changes: 2 additions & 0 deletions docs/source/faq.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,13 @@ Sound Issues

* Is ``hardware_settings.yaml`` set up correctly? Valid options for sound ``OUTPUT`` are:

- ``hifi``,
- ``harp``,
- ``xonar``, or
- ``sysdefault``.

Make sure that this value matches the actual soundcard used on your rig.
Note that ``sysdefault`` is only used in test scenarios and should not be used during actual experiments.


Screen Issues
Expand Down
1 change: 1 addition & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
.. toctree::
:hidden:

api
changelog

.. toctree::
Expand Down
12 changes: 6 additions & 6 deletions docs/source/reference_write_your_own_task.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ During the lifetime of the IBL project, we realized that multiple task variants

This left us with the only option of developing a flexible task framework through hierarchical inheritance.

All tasks inherit from the ``iblrig.base_tasks.BaseSession`` class, which provides the following functionalities:
All tasks inherit from the :class:`iblrig.base_tasks.BaseSession` class, which provides the following functionalities:
- read hardware parameters and rig parameters
- optionally interfaces with the `Alyx experimental database <https://github.com/cortex-lab/alyx>`_
- creates the folder structure for the session
- writes the task and rig parameters, log, and :doc:`acquisition description files <../description_file>`
- writes the task and rig parameters, log, and :doc:`acquisition description files <../reference_description_file>`

Additionally the ``iblrig.base_tasks`` module provides "hardware mixins". Those are classes that provide hardware-specific functionalities, such as connecting to a Bpod or a rotary encoder. They are composed with the ``BaseSession`` class to create a task.
Additionally the :mod:`iblrig.base_tasks` module provides "hardware mixins". Those are classes that provide hardware-specific functionalities, such as connecting to a Bpod or a rotary encoder. They are composed with the :class:`~.iblrig.base_tasks.BaseSession` class to create a task.

.. warning::

Expand All @@ -33,21 +33,21 @@ What Happens When Running an IBL Task?
- Reading of task parameters.
- Instantiation of hardware mixins.

2. The task initiates the ``run()`` method. Prior to execution, this
2. The task initiates the :meth:`~.iblrig.base_tasks.run` method. Prior to execution, this
method:

- Launches the hardware modules.
- Establishes a session folder.
- Saves the parameters to disk.

3. The experiment unfolds: the ``run()`` method triggers the ``_run()``
3. The experiment unfolds: the :meth:`~.iblrig.base_tasks.run` method triggers the ``_run()``
method within the child class:

- Typically, this involves a loop that generates a Bpod state
machine for each trial and runs it.

4. Upon SIGINT or when the maximum trial count is reached, the
experiment concludes. The end of the ``run()`` method includes:
experiment concludes. The end of the :meth:`~.iblrig.base_tasks.run` method includes:

- Saving the final parameter file.
- Recording administered water and session performance on Alyx.
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.23.1'
__version__ = '8.24.0'


from iblrig.version_management import get_detailed_version_string
Expand Down
Loading