Skip to content

Commit

Permalink
repair CI
Browse files Browse the repository at this point in the history
  • Loading branch information
bimac committed Sep 2, 2024
1 parent b20bd36 commit 4fdd124
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 16 deletions.
2 changes: 2 additions & 0 deletions docs/source/_templates/custom-class-template.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
.. currentmodule:: {{ module }}

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

|
.. autoclass:: {{ objname }}
Expand Down
11 changes: 6 additions & 5 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,11 @@
'sphinx.ext.autodoc',
'sphinx.ext.autosummary',
'sphinx.ext.inheritance_diagram',
'sphinx.ext.todo',
'sphinx.ext.viewcode',
]
autodoc_typehints = 'description'
autodoc_typehints = 'none'
autosummary_generate = True
autosummary_imported_members = False
autosectionlabel_prefix_document = True
source_suffix = ['.rst', '.md']
exclude_patterns = []
Expand Down Expand Up @@ -65,7 +66,7 @@
}

# -- Napoleon Settings -------------------------------------------------------
napoleon_google_docstring = False
napoleon_google_docstring = True
napoleon_numpy_docstring = True
napoleon_include_init_with_doc = True
napoleon_include_special_with_doc = False
Expand All @@ -74,7 +75,7 @@
napoleon_use_admonition_for_references = True
napoleon_use_ivar = True
napoleon_use_param = True
napoleon_use_rtype = False
napoleon_use_rtype = True
napoleon_preprocess_types = True
napoleon_type_aliases = None
napoleon_attr_annotations = True
napoleon_attr_annotations = True
5 changes: 2 additions & 3 deletions iblrig/base_choice_world.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ class ChoiceWorldSession(
# task_params = ChoiceWorldParams()
base_parameters_file = Path(__file__).parent.joinpath('base_choice_world_params.yaml')

@property
def get_trial_data_model(self):
return ChoiceWorldTrialData

Expand All @@ -129,7 +128,7 @@ def __init__(self, *args, delay_secs=0, **kwargs):
self.block_num = -1
self.block_trial_num = -1
# init the tables, there are 2 of them: a trials table and a ambient sensor data table
self.trials_table = self.get_trial_data_model.preallocate_dataframe(NTRIALS_INIT)
self.trials_table = self.get_trial_data_model().preallocate_dataframe(NTRIALS_INIT)

self.ambient_sensor_table = pd.DataFrame(
{
Expand Down Expand Up @@ -543,7 +542,7 @@ def save_trial_data_to_json(self, bpod_data: dict):
"""
# get trial's data as a dict, validate by passing through pydantic model
trial_data = self.trials_table.iloc[self.trial_num].to_dict()
trial_data = self.get_trial_data_model.model_validate(trial_data).model_dump()
trial_data = self.get_trial_data_model().model_validate(trial_data).model_dump()

# add bpod_data as 'behavior_data'
trial_data['behavior_data'] = bpod_data
Expand Down
12 changes: 6 additions & 6 deletions iblrig/base_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,11 @@
from pythonosc import udp_client

import ibllib.io.session_params as ses_params
import iblrig
import iblrig.graphic as graph
import iblrig.path_helper
import pybpodapi
from ibllib.oneibl.registration import IBLRegistrationClient
from iblrig import net, sound
from iblrig import net, path_helper, sound
from iblrig.constants import BASE_PATH, BONSAI_EXE, PYSPIN_AVAILABLE
from iblrig.frame2ttl import Frame2TTL
from iblrig.hardware import SOFTCODE, Bpod, MyRotaryEncoder, sound_device_factory
Expand Down Expand Up @@ -71,8 +70,8 @@ class BaseSession(ABC):
extractor_tasks: list | None = None
"""list of str: An optional list of pipeline task class names to instantiate when preprocessing task data."""

@abstractmethod
def get_trial_data_model(self) -> type[TrialDataModel]: ...
def get_trial_data_model(self):
return TrialDataModel

def __init__(
self,
Expand Down Expand Up @@ -262,7 +261,7 @@ def _init_paths(self, append: bool = False) -> Bunch:
* SETTINGS_FILE_PATH: contains the task settings
`C:\iblrigv8_data\mainenlab\Subjects\SWC_043\2019-01-01\001\raw_task_data_00\_iblrig_taskSettings.raw.json`
"""
rig_computer_paths = iblrig.path_helper.get_local_and_remote_paths(
rig_computer_paths = path_helper.get_local_and_remote_paths(
local_path=self.iblrig_settings.iblrig_local_data_path,
remote_path=self.iblrig_settings.iblrig_remote_data_path,
lab=self.iblrig_settings.ALYX_LAB,
Expand Down Expand Up @@ -315,7 +314,8 @@ def _setup_loggers(self, level='INFO', level_bpod='WARNING', file=None):
self._logger = setup_logger('iblrig', level=level, file=file) # logger attr used by create_session to determine log level
setup_logger('pybpodapi', level=level_bpod, file=file)

def _remove_file_loggers(self):
@staticmethod
def _remove_file_loggers():
for logger_name in ['iblrig', 'pybpodapi']:
logger = logging.getLogger(logger_name)
file_handlers = [fh for fh in logger.handlers if isinstance(fh, logging.FileHandler)]
Expand Down
4 changes: 2 additions & 2 deletions iblrig/serial_singleton.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ def query(self, query, data_specifier=1):
Parameters
----------
query : any
query : Any
Query to be sent to the serial device.
data_specifier : int or str, default: 1
The number of bytes to receive from the serial device, or a format string
Expand Down Expand Up @@ -222,7 +222,7 @@ def to_bytes(data: Any) -> bytes:
Parameters
----------
data : any
data : Any
Data to be converted to bytestring.
Returns
Expand Down

0 comments on commit 4fdd124

Please sign in to comment.