sl-shared-assets 3.0.0rc8__py3-none-any.whl → 3.0.0rc9__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.

@@ -72,8 +72,15 @@ class ExperimentTrial:
72
72
  """The length of the trial cue sequence, in Unity units."""
73
73
  trial_length_cm: float
74
74
  """The length of the trial cue sequence in centimeters."""
75
- trial_reward_size_ul: float = 5.0
75
+ trial_reward_size_ul: float
76
76
  """The volume of water, in microliters, to be dispensed when the animal successfully completes the trial task."""
77
+ reward_zone_start_cm: float
78
+ """Specifies the starting boundary of the trial reward zone, in centimeters."""
79
+ reward_zone_end_cm: float
80
+ """Specifies the ending boundary of the trial reward zone, in centimeters."""
81
+ guidance_trigger_location_cm: float
82
+ """Specifies the location of the invisible boundary (wall) with which the animal must collide to elicit automated
83
+ water reward during guided trials."""
77
84
 
78
85
 
79
86
  # noinspection PyArgumentList
@@ -101,7 +108,7 @@ class MesoscopeExperimentConfiguration(YamlConfig):
101
108
  environment to its length in real-world centimeters. It is used to map each VR cue to the distance the animal needs
102
109
  to travel to fully traverse the wall cue region from start to end."""
103
110
  cue_offset_cm: float = 10.0
104
- """Specifies the positive offset distance, in centimeters, by which the animal's starting position is shifted
111
+ """Specifies the positive offset distance, in centimeters, by which the animal's running track is shifted
105
112
  relative to experiment environment onset. Due to how the VR environment is revealed to the animal, most runtimes
106
113
  need to shift the animal slightly forward relative to the track origin (0), to prevent it from seeing the area
107
114
  before the first VR wall cue when the task starts and when the animal is teleported to the beginning of the track.
@@ -141,10 +148,13 @@ class MesoscopeExperimentConfiguration(YamlConfig):
141
148
  trial_structures: dict[str, ExperimentTrial] = field(
142
149
  default_factory=lambda: {
143
150
  "cyclic_4_cue": ExperimentTrial(
144
- cue_sequence=[0, 1, 0, 2, 0, 3, 0, 4],
151
+ cue_sequence=[1, 0, 2, 0, 3, 0, 4, 0],
145
152
  trial_length_unity_unit=24.0,
146
153
  trial_length_cm=240.0,
147
154
  trial_reward_size_ul=5.0,
155
+ reward_zone_start_cm=208.0,
156
+ reward_zone_end_cm=222.0,
157
+ guidance_trigger_location_cm=208.0,
148
158
  )
149
159
  }
150
160
  )
@@ -245,9 +255,6 @@ class MesoscopeMicroControllers:
245
255
  """Determines whether to run the managed acquisition system in the 'debug mode'. This mode should be disabled
246
256
  during most runtimes. It is used during initial system calibration and testing and prints a lot of generally
247
257
  redundant information into the terminal."""
248
- mesoscope_ttl_pulse_duration_ms: int = 10
249
- """The duration of the HIGH phase of all outgoing TTL pulses that target the Mesoscope (enable or disable mesoscope
250
- frame acquisition), in milliseconds."""
251
258
  minimum_break_strength_g_cm: float = 43.2047
252
259
  """The minimum torque applied by the running wheel break in gram centimeter. This is the torque the break delivers
253
260
  at minimum voltage (break is disabled)."""
@@ -267,8 +274,10 @@ class MesoscopeMicroControllers:
267
274
  """The minimum absolute difference in raw analog units recorded by a 12-bit Analog-to-Digital-Converter (ADC) for
268
275
  the change to be reported to the PC. This is used to prevent reporting repeated non-lick or lick readouts to the
269
276
  PC, conserving communication bandwidth."""
270
- lick_averaging_pool_size: int = 10
271
- """The number of lick sensor readouts to average together to produce the final lick sensor readout value."""
277
+ lick_averaging_pool_size: int = 1
278
+ """The number of lick sensor readouts to average together to produce the final lick sensor readout value. Note,
279
+ when using a Teensy controller, this number is multiplied by the built-in analog readout averaging (default is 4).
280
+ """
272
281
  torque_baseline_voltage_adc: int = 2046
273
282
  """The voltage level, in raw analog units measured by 3.3v Analog-to-Digital-Converter (ADC) at 12-bit resolution
274
283
  after the AD620 amplifier, that corresponds to no (0) torque readout. Usually, for a 3.3v ADC, this would be
@@ -292,8 +301,10 @@ class MesoscopeMicroControllers:
292
301
  """The minimum absolute difference in raw analog units recorded by a 12-bit Analog-to-Digital-Converter (ADC) for
293
302
  the change to be reported to the PC. This is used to prevent reporting repeated static torque readouts to the
294
303
  PC, conserving communication bandwidth."""
295
- torque_averaging_pool_size: int = 10
296
- """The number of torque sensor readouts to average together to produce the final torque sensor readout value."""
304
+ torque_averaging_pool_size: int = 1
305
+ """The number of torque sensor readouts to average together to produce the final torque sensor readout value. Note,
306
+ when using a Teensy controller, this number is multiplied by the built-in analog readout averaging (default is 4).
307
+ """
297
308
  wheel_encoder_ppr: int = 8192
298
309
  """The resolution of the managed quadrature encoder, in Pulses Per Revolution (PPR). This is the number of
299
310
  quadrature pulses the encoder emits per full 360-degree rotation."""
@@ -41,7 +41,10 @@ class ExperimentTrial:
41
41
  cue_sequence: list[int]
42
42
  trial_length_unity_unit: float
43
43
  trial_length_cm: float
44
- trial_reward_size_ul: float = ...
44
+ trial_reward_size_ul: float
45
+ reward_zone_start_cm: float
46
+ reward_zone_end_cm: float
47
+ guidance_trigger_location_cm: float
45
48
 
46
49
  @dataclass()
47
50
  class MesoscopeExperimentConfiguration(YamlConfig):
@@ -107,7 +110,6 @@ class MesoscopeMicroControllers:
107
110
  sensor_port: str = ...
108
111
  encoder_port: str = ...
109
112
  debug: bool = ...
110
- mesoscope_ttl_pulse_duration_ms: int = ...
111
113
  minimum_break_strength_g_cm: float = ...
112
114
  maximum_break_strength_g_cm: float = ...
113
115
  wheel_diameter_cm: float = ...
@@ -414,6 +414,11 @@ class SessionData(YamlConfig):
414
414
  )
415
415
  sh.copy2(experiment_configuration_path, instance.raw_data.experiment_configuration_path)
416
416
 
417
+ # All newly created sessions are marked with the 'nk.bin' file. If the marker is not removed during runtime,
418
+ # the session becomes a valid target for deletion (purging) runtimes operating from the main acquisition
419
+ # machine of any data acquisition system.
420
+ instance.raw_data.nk_path.touch()
421
+
417
422
  # Returns the initialized SessionData instance to caller
418
423
  return instance
419
424
 
@@ -493,6 +498,15 @@ class SessionData(YamlConfig):
493
498
  # Returns the initialized SessionData instance to caller
494
499
  return instance
495
500
 
501
+ def mark_initialization(self) -> None:
502
+ """Ensures that the 'nk.bin' marker file is removed from the session's raw_dat folder.
503
+
504
+ This marker is generated as part of the SessionData initialization (creation) process to mark sessions that did
505
+ not fully initialize during runtime. Call this method after fully initializing the data acquisition runtime
506
+ control class to ensure that the session is not marker for automated deletion upon runtime completion.
507
+ """
508
+ self.raw_data.nk_path.unlink(missing_ok=True)
509
+
496
510
  def _save(self) -> None:
497
511
  """Saves the instance data to the 'raw_data' directory of the managed session as a 'session_data.yaml' file.
498
512
 
@@ -191,6 +191,13 @@ class SessionData(YamlConfig):
191
191
  Raises:
192
192
  FileNotFoundError: If the 'session_data.yaml' file is not found under the session_path/raw_data/ subfolder.
193
193
 
194
+ """
195
+ def mark_initialization(self) -> None:
196
+ """Ensures that the 'nk.bin' marker file is removed from the session's raw_dat folder.
197
+
198
+ This marker is generated as part of the SessionData initialization (creation) process to mark sessions that did
199
+ not fully initialize during runtime. Call this method after fully initializing the data acquisition runtime
200
+ control class to ensure that the session is not marker for automated deletion upon runtime completion.
194
201
  """
195
202
  def _save(self) -> None:
196
203
  """Saves the instance data to the 'raw_data' directory of the managed session as a 'session_data.yaml' file.
@@ -226,6 +226,9 @@ def ascend_tyche_data(root_directory: Path) -> None:
226
226
  experiment_name=None,
227
227
  )
228
228
 
229
+ # Since this runtime reprocesses already acquired data, marks the session as fully initialized.
230
+ session_data.mark_initialization()
231
+
229
232
  # Moves the data from the old hierarchy to the new hierarchy. If the process runs as expected, and
230
233
  # fully empties the source acquisition folder, destroys the folder. Otherwise, notifies the user that
231
234
  # the runtime did not fully process the session data and requests intervention.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sl-shared-assets
3
- Version: 3.0.0rc8
3
+ Version: 3.0.0rc9
4
4
  Summary: Provides data acquisition and processing assets shared between Sun (NeuroAI) lab libraries.
5
5
  Project-URL: Homepage, https://github.com/Sun-Lab-NBB/sl-shared-assets
6
6
  Project-URL: Documentation, https://sl-shared-assets-api-docs.netlify.app/
@@ -5,12 +5,12 @@ sl_shared_assets/cli.pyi,sha256=8ZJK56_jh2QlF3XCN6c7fI6Z022XtehB0eCrQDJbAsU,5515
5
5
  sl_shared_assets/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
6
  sl_shared_assets/data_classes/__init__.py,sha256=SUDN7gFngUPEa7Da_G0PjXwnF9Q0S4EgvjpKe3KSr5g,1852
7
7
  sl_shared_assets/data_classes/__init__.pyi,sha256=J-tUXAtGEasacVU1qGFFksvfB1tFdEO-GKs90vSTAcg,2022
8
- sl_shared_assets/data_classes/configuration_data.py,sha256=0uKfFrUO-9xI3MvWNf2xxGZ_RuxJ7MW3yjHXAqPNPeA,34782
9
- sl_shared_assets/data_classes/configuration_data.pyi,sha256=DNsz6HCs0cPBP7Sn7G_-Y9z_fTFd0ub2s-97wlrPcb4,10723
8
+ sl_shared_assets/data_classes/configuration_data.py,sha256=73IP9e8bESHbYlr0sCCLktU3JScofuSTuLE8N4MIwjs,35389
9
+ sl_shared_assets/data_classes/configuration_data.pyi,sha256=Jg4TmrDjEBtQn7zH0140-6pQ1J9ljSuzC0tiysx4qBM,10772
10
10
  sl_shared_assets/data_classes/runtime_data.py,sha256=O98BZg7i7cEUlpIE16JswKOwQNRsS5RxVdBzXYvAw00,16543
11
11
  sl_shared_assets/data_classes/runtime_data.pyi,sha256=i8CuZd9p0Nu43xhpE62pB07AiovZIgtMZYN5wQjz-r0,6861
12
- sl_shared_assets/data_classes/session_data.py,sha256=3MwnDSUJt4PLMcFfQMg7gt5ogoxP2kuc6n98qYFldOc,44699
13
- sl_shared_assets/data_classes/session_data.pyi,sha256=rgab48TLjWMtSIg2qIuXRG1rQhs_2WfItjEl-MaRW8U,13654
12
+ sl_shared_assets/data_classes/session_data.py,sha256=nvGW8TagsGmxH3Eh63zosKHJAfOT4U_2ukfxy3frum8,45575
13
+ sl_shared_assets/data_classes/session_data.pyi,sha256=QEoxKdcaa0lwJ8Bv4rsvAiC32lwpagcsnsnRK1x0AqA,14152
14
14
  sl_shared_assets/data_classes/surgery_data.py,sha256=qsMj3NkjhylAT9b_wHBY-1XwTu2xsZcZatdECmkA7Bs,7437
15
15
  sl_shared_assets/data_classes/surgery_data.pyi,sha256=rf59lJ3tGSYKHQlEGXg75MnjajBwl0DYhL4TClAO4SM,2605
16
16
  sl_shared_assets/server/__init__.py,sha256=w7y73RXXjBrWQsjU5g1QNCv_gsXDYnHos3NpOoR2AHA,452
@@ -21,7 +21,7 @@ sl_shared_assets/server/server.py,sha256=MGk1v49aEFeIChMDsiR7CXjVkWwDpD9kA1TK0fw
21
21
  sl_shared_assets/server/server.pyi,sha256=5Yxq4txhjtd9w-6U9fPehzMeIZL5GcprVCHd9mPP6FI,15113
22
22
  sl_shared_assets/tools/__init__.py,sha256=NktXk62E_HHOrO_93z_MVmSd6-Oir3mE4xE9Yr8Qa7U,682
23
23
  sl_shared_assets/tools/__init__.pyi,sha256=0UXorfCXXmHQOP5z7hODpsqEX0DAkOta5VZqN6FSS-w,623
24
- sl_shared_assets/tools/ascension_tools.py,sha256=o5R-M0VCJg1RwH6-2fYjMK-9yBgzJ22YVLQee17Mmw0,14431
24
+ sl_shared_assets/tools/ascension_tools.py,sha256=XdJC3nibtgqpmH0KG6Q-YZkOLTK3TexZHWVglqW0pl4,14595
25
25
  sl_shared_assets/tools/ascension_tools.pyi,sha256=c-SI9TYJ1vmJXMV2pSW9Nri4mlySF8MtXqrvRvz5C8s,3705
26
26
  sl_shared_assets/tools/packaging_tools.py,sha256=QikjeaE_A8FyVJi3cnWLeW-hUXy1-FF1N23muA5VfT4,7526
27
27
  sl_shared_assets/tools/packaging_tools.pyi,sha256=vgGbAQCExwg-0A5F72MzEhzHxu97Nqg1yuz-5P89ycU,3118
@@ -29,8 +29,8 @@ sl_shared_assets/tools/project_management_tools.py,sha256=Z_U0R26w9Le1O-u66gyF5C
29
29
  sl_shared_assets/tools/project_management_tools.pyi,sha256=4kok98nOZ4KnT-Sg-ZCZYg-WIM5qZqiyK8g1XiiDjHM,10375
30
30
  sl_shared_assets/tools/transfer_tools.py,sha256=J26kwOp_NpPSY0-xu5FTw9udte-rm_mW1FJyaTNoqQI,6606
31
31
  sl_shared_assets/tools/transfer_tools.pyi,sha256=FoH7eYZe7guGHfPr0MK5ggO62uXKwD2aJ7h1Bu7PaEE,3294
32
- sl_shared_assets-3.0.0rc8.dist-info/METADATA,sha256=pvUOjPIynm4Ue5yT2eV4eg4-cNw8_fGT_HPot8lbRcE,49309
33
- sl_shared_assets-3.0.0rc8.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
34
- sl_shared_assets-3.0.0rc8.dist-info/entry_points.txt,sha256=UmO1rl7ly9N7HWPwWyP9E0b5KBUStpBo4TRoqNtizDY,430
35
- sl_shared_assets-3.0.0rc8.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
36
- sl_shared_assets-3.0.0rc8.dist-info/RECORD,,
32
+ sl_shared_assets-3.0.0rc9.dist-info/METADATA,sha256=ld-V567zlZD-KHbtRdqSIMivD--AjX_VW-l9WV4Wyuk,49309
33
+ sl_shared_assets-3.0.0rc9.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
34
+ sl_shared_assets-3.0.0rc9.dist-info/entry_points.txt,sha256=UmO1rl7ly9N7HWPwWyP9E0b5KBUStpBo4TRoqNtizDY,430
35
+ sl_shared_assets-3.0.0rc9.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
36
+ sl_shared_assets-3.0.0rc9.dist-info/RECORD,,