sl-shared-assets 1.0.0rc14__py3-none-any.whl → 1.0.0rc15__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of sl-shared-assets might be problematic. Click here for more details.
- sl_shared_assets/__init__.py +21 -9
- sl_shared_assets/__init__.pyi +26 -6
- sl_shared_assets/cli.py +1 -1
- sl_shared_assets/cli.pyi +1 -1
- sl_shared_assets/data_classes/__init__.py +63 -0
- sl_shared_assets/data_classes/__init__.pyi +61 -0
- sl_shared_assets/data_classes/configuration_data.py +64 -0
- sl_shared_assets/data_classes/configuration_data.pyi +37 -0
- sl_shared_assets/data_classes/runtime_data.py +233 -0
- sl_shared_assets/data_classes/runtime_data.pyi +145 -0
- sl_shared_assets/{data_classes.py → data_classes/session_data.py} +47 -472
- sl_shared_assets/{data_classes.pyi → data_classes/session_data.pyi} +10 -282
- sl_shared_assets/data_classes/surgery_data.py +152 -0
- sl_shared_assets/data_classes/surgery_data.pyi +89 -0
- sl_shared_assets/server/__init__.py +8 -0
- sl_shared_assets/server/__init__.pyi +8 -0
- sl_shared_assets/server/job.py +140 -0
- sl_shared_assets/server/job.pyi +94 -0
- sl_shared_assets/server/server.py +213 -0
- sl_shared_assets/server/server.pyi +95 -0
- sl_shared_assets/suite2p/__init__.py +8 -0
- sl_shared_assets/suite2p/__init__.pyi +4 -0
- sl_shared_assets/suite2p/multi_day.py +193 -0
- sl_shared_assets/suite2p/multi_day.pyi +99 -0
- sl_shared_assets/{suite2p.py → suite2p/single_day.py} +55 -32
- sl_shared_assets/{suite2p.pyi → suite2p/single_day.pyi} +23 -19
- sl_shared_assets/tools/__init__.py +8 -0
- sl_shared_assets/tools/__init__.pyi +5 -0
- sl_shared_assets/{ascension_tools.py → tools/ascension_tools.py} +3 -2
- sl_shared_assets/{ascension_tools.pyi → tools/ascension_tools.pyi} +1 -1
- {sl_shared_assets-1.0.0rc14.dist-info → sl_shared_assets-1.0.0rc15.dist-info}/METADATA +1 -1
- sl_shared_assets-1.0.0rc15.dist-info/RECORD +40 -0
- sl_shared_assets/server.py +0 -300
- sl_shared_assets/server.pyi +0 -117
- sl_shared_assets-1.0.0rc14.dist-info/RECORD +0 -22
- /sl_shared_assets/{packaging_tools.py → tools/packaging_tools.py} +0 -0
- /sl_shared_assets/{packaging_tools.pyi → tools/packaging_tools.pyi} +0 -0
- /sl_shared_assets/{transfer_tools.py → tools/transfer_tools.py} +0 -0
- /sl_shared_assets/{transfer_tools.pyi → tools/transfer_tools.pyi} +0 -0
- {sl_shared_assets-1.0.0rc14.dist-info → sl_shared_assets-1.0.0rc15.dist-info}/WHEEL +0 -0
- {sl_shared_assets-1.0.0rc14.dist-info → sl_shared_assets-1.0.0rc15.dist-info}/entry_points.txt +0 -0
- {sl_shared_assets-1.0.0rc14.dist-info → sl_shared_assets-1.0.0rc15.dist-info}/licenses/LICENSE +0 -0
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
from dataclasses import dataclass
|
|
2
|
+
|
|
3
|
+
from ataraxis_data_structures import YamlConfig
|
|
4
|
+
|
|
5
|
+
@dataclass()
|
|
6
|
+
class HardwareConfiguration(YamlConfig):
|
|
7
|
+
"""This class is used to save the runtime hardware configuration parameters as a .yaml file.
|
|
8
|
+
|
|
9
|
+
This information is used to read and decode the data saved to the .npz log files during runtime as part of data
|
|
10
|
+
processing.
|
|
11
|
+
|
|
12
|
+
Notes:
|
|
13
|
+
All fields in this dataclass initialize to None. During log processing, any log associated with a hardware
|
|
14
|
+
module that provides the data stored in a field will be processed, unless that field is None. Therefore, setting
|
|
15
|
+
any field in this dataclass to None also functions as a flag for whether to parse the log associated with the
|
|
16
|
+
module that provides this field's information.
|
|
17
|
+
|
|
18
|
+
This class is automatically configured by MesoscopeExperiment and BehaviorTraining classes from sl-experiment
|
|
19
|
+
library to facilitate log parsing.
|
|
20
|
+
"""
|
|
21
|
+
|
|
22
|
+
cue_map: dict[int, float] | None = ...
|
|
23
|
+
cm_per_pulse: float | None = ...
|
|
24
|
+
maximum_break_strength: float | None = ...
|
|
25
|
+
minimum_break_strength: float | None = ...
|
|
26
|
+
lick_threshold: int | None = ...
|
|
27
|
+
valve_scale_coefficient: float | None = ...
|
|
28
|
+
valve_nonlinearity_exponent: float | None = ...
|
|
29
|
+
torque_per_adc_unit: float | None = ...
|
|
30
|
+
screens_initially_on: bool | None = ...
|
|
31
|
+
recorded_mesoscope_ttl: bool | None = ...
|
|
32
|
+
|
|
33
|
+
@dataclass()
|
|
34
|
+
class LickTrainingDescriptor(YamlConfig):
|
|
35
|
+
"""This class is used to save the description information specific to lick training sessions as a .yaml file.
|
|
36
|
+
|
|
37
|
+
The information stored in this class instance is filled in two steps. The main runtime function fills most fields
|
|
38
|
+
of the class, before it is saved as a .yaml file. After runtime, the experimenter manually fills leftover fields,
|
|
39
|
+
such as 'experimenter_notes,' before the class instance is transferred to the long-term storage destination.
|
|
40
|
+
|
|
41
|
+
The fully filled instance data is also used during preprocessing to write the water restriction log entry for the
|
|
42
|
+
trained animal.
|
|
43
|
+
"""
|
|
44
|
+
|
|
45
|
+
experimenter: str
|
|
46
|
+
mouse_weight_g: float
|
|
47
|
+
dispensed_water_volume_ml: float
|
|
48
|
+
minimum_reward_delay: int
|
|
49
|
+
maximum_reward_delay_s: int
|
|
50
|
+
maximum_water_volume_ml: float
|
|
51
|
+
maximum_training_time_m: int
|
|
52
|
+
experimenter_notes: str = ...
|
|
53
|
+
experimenter_given_water_volume_ml: float = ...
|
|
54
|
+
|
|
55
|
+
@dataclass()
|
|
56
|
+
class RunTrainingDescriptor(YamlConfig):
|
|
57
|
+
"""This class is used to save the description information specific to run training sessions as a .yaml file.
|
|
58
|
+
|
|
59
|
+
The information stored in this class instance is filled in two steps. The main runtime function fills most fields
|
|
60
|
+
of the class, before it is saved as a .yaml file. After runtime, the experimenter manually fills leftover fields,
|
|
61
|
+
such as 'experimenter_notes,' before the class instance is transferred to the long-term storage destination.
|
|
62
|
+
|
|
63
|
+
The fully filled instance data is also used during preprocessing to write the water restriction log entry for the
|
|
64
|
+
trained animal.
|
|
65
|
+
"""
|
|
66
|
+
|
|
67
|
+
experimenter: str
|
|
68
|
+
mouse_weight_g: float
|
|
69
|
+
dispensed_water_volume_ml: float
|
|
70
|
+
final_run_speed_threshold_cm_s: float
|
|
71
|
+
final_run_duration_threshold_s: float
|
|
72
|
+
initial_run_speed_threshold_cm_s: float
|
|
73
|
+
initial_run_duration_threshold_s: float
|
|
74
|
+
increase_threshold_ml: float
|
|
75
|
+
run_speed_increase_step_cm_s: float
|
|
76
|
+
run_duration_increase_step_s: float
|
|
77
|
+
maximum_water_volume_ml: float
|
|
78
|
+
maximum_training_time_m: int
|
|
79
|
+
experimenter_notes: str = ...
|
|
80
|
+
experimenter_given_water_volume_ml: float = ...
|
|
81
|
+
|
|
82
|
+
@dataclass()
|
|
83
|
+
class MesoscopeExperimentDescriptor(YamlConfig):
|
|
84
|
+
"""This class is used to save the description information specific to experiment sessions as a .yaml file.
|
|
85
|
+
|
|
86
|
+
The information stored in this class instance is filled in two steps. The main runtime function fills most fields
|
|
87
|
+
of the class, before it is saved as a .yaml file. After runtime, the experimenter manually fills leftover fields,
|
|
88
|
+
such as 'experimenter_notes,' before the class instance is transferred to the long-term storage destination.
|
|
89
|
+
|
|
90
|
+
The fully filled instance data is also used during preprocessing to write the water restriction log entry for the
|
|
91
|
+
animal participating in the experiment runtime.
|
|
92
|
+
"""
|
|
93
|
+
|
|
94
|
+
experimenter: str
|
|
95
|
+
mouse_weight_g: float
|
|
96
|
+
dispensed_water_volume_ml: float
|
|
97
|
+
experimenter_notes: str = ...
|
|
98
|
+
experimenter_given_water_volume_ml: float = ...
|
|
99
|
+
|
|
100
|
+
@dataclass()
|
|
101
|
+
class ZaberPositions(YamlConfig):
|
|
102
|
+
"""This class is used to save Zaber motor positions as a .yaml file to reuse them between sessions.
|
|
103
|
+
|
|
104
|
+
The class is specifically designed to store, save, and load the positions of the LickPort and HeadBar motors
|
|
105
|
+
(axes). It is used to both store Zaber motor positions for each session for future analysis and to restore the same
|
|
106
|
+
Zaber motor positions across consecutive runtimes for the same project and animal combination.
|
|
107
|
+
|
|
108
|
+
Notes:
|
|
109
|
+
All positions are saved using native motor units. All class fields initialize to default placeholders that are
|
|
110
|
+
likely NOT safe to apply to the VR system. Do not apply the positions loaded from the file unless you are
|
|
111
|
+
certain they are safe to use.
|
|
112
|
+
|
|
113
|
+
Exercise caution when working with Zaber motors. The motors are powerful enough to damage the surrounding
|
|
114
|
+
equipment and manipulated objects. Do not modify the data stored inside the .yaml file unless you know what you
|
|
115
|
+
are doing.
|
|
116
|
+
"""
|
|
117
|
+
|
|
118
|
+
headbar_z: int = ...
|
|
119
|
+
headbar_pitch: int = ...
|
|
120
|
+
headbar_roll: int = ...
|
|
121
|
+
lickport_z: int = ...
|
|
122
|
+
lickport_x: int = ...
|
|
123
|
+
lickport_y: int = ...
|
|
124
|
+
|
|
125
|
+
@dataclass()
|
|
126
|
+
class MesoscopePositions(YamlConfig):
|
|
127
|
+
"""This class is used to save the real and virtual Mesoscope objective positions as a .yaml file to reuse it
|
|
128
|
+
between experiment sessions.
|
|
129
|
+
|
|
130
|
+
Primarily, the class is used to help the experimenter to position the Mesoscope at the same position across
|
|
131
|
+
multiple imaging sessions. It stores both the physical (real) position of the objective along the motorized
|
|
132
|
+
X, Y, Z, and Roll axes and the virtual (ScanImage software) tip, tilt, and fastZ focus axes.
|
|
133
|
+
|
|
134
|
+
Notes:
|
|
135
|
+
Since the API to read and write these positions automatically is currently not available, this class relies on
|
|
136
|
+
the experimenter manually entering all positions and setting the mesoscope to these positions when necessary.
|
|
137
|
+
"""
|
|
138
|
+
|
|
139
|
+
mesoscope_x_position: float = ...
|
|
140
|
+
mesoscope_y_position: float = ...
|
|
141
|
+
mesoscope_roll_position: float = ...
|
|
142
|
+
mesoscope_z_position: float = ...
|
|
143
|
+
mesoscope_fast_z_position: float = ...
|
|
144
|
+
mesoscope_tip_position: float = ...
|
|
145
|
+
mesoscope_tilt_position: float = ...
|