sl-shared-assets 1.0.0rc14__tar.gz → 1.0.0rc15__tar.gz

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.

Files changed (51) hide show
  1. {sl_shared_assets-1.0.0rc14 → sl_shared_assets-1.0.0rc15}/PKG-INFO +1 -1
  2. {sl_shared_assets-1.0.0rc14 → sl_shared_assets-1.0.0rc15}/docs/source/api.rst +7 -21
  3. {sl_shared_assets-1.0.0rc14 → sl_shared_assets-1.0.0rc15}/pyproject.toml +1 -1
  4. {sl_shared_assets-1.0.0rc14 → sl_shared_assets-1.0.0rc15}/src/sl_shared_assets/__init__.py +21 -9
  5. sl_shared_assets-1.0.0rc15/src/sl_shared_assets/__init__.pyi +71 -0
  6. {sl_shared_assets-1.0.0rc14 → sl_shared_assets-1.0.0rc15}/src/sl_shared_assets/cli.py +1 -1
  7. {sl_shared_assets-1.0.0rc14 → sl_shared_assets-1.0.0rc15}/src/sl_shared_assets/cli.pyi +1 -1
  8. sl_shared_assets-1.0.0rc15/src/sl_shared_assets/data_classes/__init__.py +63 -0
  9. {sl_shared_assets-1.0.0rc14/src/sl_shared_assets → sl_shared_assets-1.0.0rc15/src/sl_shared_assets/data_classes}/__init__.pyi +32 -22
  10. sl_shared_assets-1.0.0rc15/src/sl_shared_assets/data_classes/configuration_data.py +64 -0
  11. sl_shared_assets-1.0.0rc15/src/sl_shared_assets/data_classes/configuration_data.pyi +37 -0
  12. sl_shared_assets-1.0.0rc15/src/sl_shared_assets/data_classes/runtime_data.py +233 -0
  13. sl_shared_assets-1.0.0rc15/src/sl_shared_assets/data_classes/runtime_data.pyi +145 -0
  14. sl_shared_assets-1.0.0rc14/src/sl_shared_assets/data_classes.py → sl_shared_assets-1.0.0rc15/src/sl_shared_assets/data_classes/session_data.py +47 -472
  15. sl_shared_assets-1.0.0rc14/src/sl_shared_assets/data_classes.pyi → sl_shared_assets-1.0.0rc15/src/sl_shared_assets/data_classes/session_data.pyi +10 -282
  16. sl_shared_assets-1.0.0rc15/src/sl_shared_assets/data_classes/surgery_data.py +152 -0
  17. sl_shared_assets-1.0.0rc15/src/sl_shared_assets/data_classes/surgery_data.pyi +89 -0
  18. sl_shared_assets-1.0.0rc15/src/sl_shared_assets/server/__init__.py +8 -0
  19. sl_shared_assets-1.0.0rc15/src/sl_shared_assets/server/__init__.pyi +8 -0
  20. sl_shared_assets-1.0.0rc15/src/sl_shared_assets/server/job.py +140 -0
  21. sl_shared_assets-1.0.0rc15/src/sl_shared_assets/server/job.pyi +94 -0
  22. sl_shared_assets-1.0.0rc15/src/sl_shared_assets/server/server.py +213 -0
  23. sl_shared_assets-1.0.0rc15/src/sl_shared_assets/server/server.pyi +95 -0
  24. sl_shared_assets-1.0.0rc15/src/sl_shared_assets/suite2p/__init__.py +8 -0
  25. sl_shared_assets-1.0.0rc15/src/sl_shared_assets/suite2p/__init__.pyi +4 -0
  26. sl_shared_assets-1.0.0rc15/src/sl_shared_assets/suite2p/multi_day.py +193 -0
  27. sl_shared_assets-1.0.0rc15/src/sl_shared_assets/suite2p/multi_day.pyi +99 -0
  28. sl_shared_assets-1.0.0rc14/src/sl_shared_assets/suite2p.py → sl_shared_assets-1.0.0rc15/src/sl_shared_assets/suite2p/single_day.py +55 -32
  29. sl_shared_assets-1.0.0rc14/src/sl_shared_assets/suite2p.pyi → sl_shared_assets-1.0.0rc15/src/sl_shared_assets/suite2p/single_day.pyi +23 -19
  30. sl_shared_assets-1.0.0rc15/src/sl_shared_assets/tools/__init__.py +8 -0
  31. sl_shared_assets-1.0.0rc15/src/sl_shared_assets/tools/__init__.pyi +5 -0
  32. {sl_shared_assets-1.0.0rc14/src/sl_shared_assets → sl_shared_assets-1.0.0rc15/src/sl_shared_assets/tools}/ascension_tools.py +3 -2
  33. {sl_shared_assets-1.0.0rc14/src/sl_shared_assets → sl_shared_assets-1.0.0rc15/src/sl_shared_assets/tools}/ascension_tools.pyi +1 -1
  34. sl_shared_assets-1.0.0rc14/src/sl_shared_assets/server.py +0 -300
  35. sl_shared_assets-1.0.0rc14/src/sl_shared_assets/server.pyi +0 -117
  36. {sl_shared_assets-1.0.0rc14 → sl_shared_assets-1.0.0rc15}/.gitignore +0 -0
  37. {sl_shared_assets-1.0.0rc14 → sl_shared_assets-1.0.0rc15}/LICENSE +0 -0
  38. {sl_shared_assets-1.0.0rc14 → sl_shared_assets-1.0.0rc15}/README.md +0 -0
  39. {sl_shared_assets-1.0.0rc14 → sl_shared_assets-1.0.0rc15}/docs/Makefile +0 -0
  40. {sl_shared_assets-1.0.0rc14 → sl_shared_assets-1.0.0rc15}/docs/make.bat +0 -0
  41. {sl_shared_assets-1.0.0rc14 → sl_shared_assets-1.0.0rc15}/docs/source/conf.py +0 -0
  42. {sl_shared_assets-1.0.0rc14 → sl_shared_assets-1.0.0rc15}/docs/source/index.rst +0 -0
  43. {sl_shared_assets-1.0.0rc14 → sl_shared_assets-1.0.0rc15}/docs/source/welcome.rst +0 -0
  44. {sl_shared_assets-1.0.0rc14 → sl_shared_assets-1.0.0rc15}/envs/slsa_dev_lin.yml +0 -0
  45. {sl_shared_assets-1.0.0rc14 → sl_shared_assets-1.0.0rc15}/envs/slsa_dev_lin_spec.txt +0 -0
  46. {sl_shared_assets-1.0.0rc14 → sl_shared_assets-1.0.0rc15}/src/sl_shared_assets/py.typed +0 -0
  47. {sl_shared_assets-1.0.0rc14/src/sl_shared_assets → sl_shared_assets-1.0.0rc15/src/sl_shared_assets/tools}/packaging_tools.py +0 -0
  48. {sl_shared_assets-1.0.0rc14/src/sl_shared_assets → sl_shared_assets-1.0.0rc15/src/sl_shared_assets/tools}/packaging_tools.pyi +0 -0
  49. {sl_shared_assets-1.0.0rc14/src/sl_shared_assets → sl_shared_assets-1.0.0rc15/src/sl_shared_assets/tools}/transfer_tools.py +0 -0
  50. {sl_shared_assets-1.0.0rc14/src/sl_shared_assets → sl_shared_assets-1.0.0rc15/src/sl_shared_assets/tools}/transfer_tools.pyi +0 -0
  51. {sl_shared_assets-1.0.0rc14 → sl_shared_assets-1.0.0rc15}/tox.ini +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sl-shared-assets
3
- Version: 1.0.0rc14
3
+ Version: 1.0.0rc15
4
4
  Summary: Stores assets shared between multiple Sun (NeuroAI) lab data pipelines.
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/
@@ -21,29 +21,22 @@ Command Line Interfaces
21
21
  :prog: sl-ascend
22
22
  :nested: full
23
23
 
24
- Packaging Tools
25
- ===============
26
- .. automodule:: sl_shared_assets.packaging_tools
24
+ Tools
25
+ =====
26
+ .. automodule:: sl_shared_assets.tools
27
27
  :members:
28
28
  :undoc-members:
29
29
  :show-inheritance:
30
30
 
31
- Transfer Tools
32
- ==============
33
- .. automodule:: sl_shared_assets.transfer_tools
34
- :members:
35
- :undoc-members:
36
- :show-inheritance:
37
-
38
- Suite2P Configuration Classes
39
- =============================
31
+ Suite2P Configuration
32
+ =====================
40
33
  .. automodule:: sl_shared_assets.suite2p
41
34
  :members:
42
35
  :undoc-members:
43
36
  :show-inheritance:
44
37
 
45
- General Configuration and Data Storage Classes
46
- ==============================================
38
+ General Data and Configuration Classes
39
+ ======================================
47
40
  .. automodule:: sl_shared_assets.data_classes
48
41
  :members:
49
42
  :undoc-members:
@@ -55,10 +48,3 @@ Compute Server Tools
55
48
  :members:
56
49
  :undoc-members:
57
50
  :show-inheritance:
58
-
59
- Ascension Tools
60
- ===============
61
- .. automodule:: sl_shared_assets.ascension_tools
62
- :members:
63
- :undoc-members:
64
- :show-inheritance:
@@ -8,7 +8,7 @@ build-backend = "hatchling.build"
8
8
  # Project metdata section. Provides the genral ID information about the project.
9
9
  [project]
10
10
  name = "sl-shared-assets"
11
- version = "1.0.0rc14"
11
+ version = "1.0.0rc15"
12
12
  description = "Stores assets shared between multiple Sun (NeuroAI) lab data pipelines."
13
13
  readme = "README.md"
14
14
  license = { file = "LICENSE" }
@@ -7,31 +7,35 @@ Authors: Ivan Kondratyev (Inkaros), Kushaan Gupta, Yuantao Deng
7
7
 
8
8
  from ataraxis_base_utilities import console
9
9
 
10
+ from .tools import transfer_directory, calculate_directory_checksum
10
11
  from .server import Server, ServerCredentials
11
- from .suite2p import (
12
- Suite2PConfiguration,
13
- )
12
+ from .suite2p import MultiDayS2PConfiguration, SingleDayS2PConfiguration
14
13
  from .data_classes import (
14
+ RawData,
15
15
  DrugData,
16
16
  ImplantData,
17
17
  SessionData,
18
18
  SubjectData,
19
19
  SurgeryData,
20
20
  InjectionData,
21
+ MesoscopeData,
21
22
  ProcedureData,
23
+ ProcessedData,
24
+ DeepLabCutData,
22
25
  ZaberPositions,
23
26
  ExperimentState,
24
- ProcessingTracker,
27
+ VRPCDestinations,
28
+ ConfigurationData,
25
29
  MesoscopePositions,
30
+ VRPCPersistentData,
26
31
  ProjectConfiguration,
27
32
  HardwareConfiguration,
28
33
  RunTrainingDescriptor,
29
34
  LickTrainingDescriptor,
30
35
  ExperimentConfiguration,
36
+ ScanImagePCPersistentData,
31
37
  MesoscopeExperimentDescriptor,
32
38
  )
33
- from .transfer_tools import transfer_directory
34
- from .packaging_tools import calculate_directory_checksum
35
39
 
36
40
  # Ensures console is enabled when this library is imported
37
41
  if not console.enabled:
@@ -41,12 +45,21 @@ __all__ = [
41
45
  # Server module
42
46
  "Server",
43
47
  "ServerCredentials",
44
- # Suite2p module
45
- "Suite2PConfiguration",
48
+ # Suite2p package
49
+ "SingleDayS2PConfiguration",
50
+ "MultiDayS2PConfiguration",
46
51
  # Data classes module
47
52
  "DrugData",
48
53
  "ImplantData",
49
54
  "SessionData",
55
+ "RawData",
56
+ "ProcessedData",
57
+ "ConfigurationData",
58
+ "DeepLabCutData",
59
+ "VRPCPersistentData",
60
+ "ScanImagePCPersistentData",
61
+ "MesoscopeData",
62
+ "VRPCDestinations",
50
63
  "SubjectData",
51
64
  "SurgeryData",
52
65
  "InjectionData",
@@ -60,7 +73,6 @@ __all__ = [
60
73
  "LickTrainingDescriptor",
61
74
  "ExperimentConfiguration",
62
75
  "MesoscopeExperimentDescriptor",
63
- "ProcessingTracker",
64
76
  # Transfer tools module
65
77
  "transfer_directory",
66
78
  # Packaging tools module
@@ -0,0 +1,71 @@
1
+ from .tools import (
2
+ transfer_directory as transfer_directory,
3
+ calculate_directory_checksum as calculate_directory_checksum,
4
+ )
5
+ from .server import (
6
+ Server as Server,
7
+ ServerCredentials as ServerCredentials,
8
+ )
9
+ from .suite2p import (
10
+ MultiDayS2PConfiguration as MultiDayS2PConfiguration,
11
+ SingleDayS2PConfiguration as SingleDayS2PConfiguration,
12
+ )
13
+ from .data_classes import (
14
+ RawData as RawData,
15
+ DrugData as DrugData,
16
+ ImplantData as ImplantData,
17
+ SessionData as SessionData,
18
+ SubjectData as SubjectData,
19
+ SurgeryData as SurgeryData,
20
+ InjectionData as InjectionData,
21
+ MesoscopeData as MesoscopeData,
22
+ ProcedureData as ProcedureData,
23
+ ProcessedData as ProcessedData,
24
+ DeepLabCutData as DeepLabCutData,
25
+ ZaberPositions as ZaberPositions,
26
+ ExperimentState as ExperimentState,
27
+ VRPCDestinations as VRPCDestinations,
28
+ ConfigurationData as ConfigurationData,
29
+ MesoscopePositions as MesoscopePositions,
30
+ VRPCPersistentData as VRPCPersistentData,
31
+ ProjectConfiguration as ProjectConfiguration,
32
+ HardwareConfiguration as HardwareConfiguration,
33
+ RunTrainingDescriptor as RunTrainingDescriptor,
34
+ LickTrainingDescriptor as LickTrainingDescriptor,
35
+ ExperimentConfiguration as ExperimentConfiguration,
36
+ ScanImagePCPersistentData as ScanImagePCPersistentData,
37
+ MesoscopeExperimentDescriptor as MesoscopeExperimentDescriptor,
38
+ )
39
+
40
+ __all__ = [
41
+ "Server",
42
+ "ServerCredentials",
43
+ "SingleDayS2PConfiguration",
44
+ "MultiDayS2PConfiguration",
45
+ "DrugData",
46
+ "ImplantData",
47
+ "SessionData",
48
+ "RawData",
49
+ "ProcessedData",
50
+ "ConfigurationData",
51
+ "DeepLabCutData",
52
+ "VRPCPersistentData",
53
+ "ScanImagePCPersistentData",
54
+ "MesoscopeData",
55
+ "VRPCDestinations",
56
+ "SubjectData",
57
+ "SurgeryData",
58
+ "InjectionData",
59
+ "ProcedureData",
60
+ "ZaberPositions",
61
+ "ExperimentState",
62
+ "MesoscopePositions",
63
+ "ProjectConfiguration",
64
+ "HardwareConfiguration",
65
+ "RunTrainingDescriptor",
66
+ "LickTrainingDescriptor",
67
+ "ExperimentConfiguration",
68
+ "MesoscopeExperimentDescriptor",
69
+ "transfer_directory",
70
+ "calculate_directory_checksum",
71
+ ]
@@ -4,9 +4,9 @@ from pathlib import Path
4
4
 
5
5
  import click
6
6
 
7
+ from .tools import ascend_tyche_data
7
8
  from .server import generate_server_credentials
8
9
  from .data_classes import replace_root_path
9
- from .ascension_tools import ascend_tyche_data
10
10
 
11
11
 
12
12
  @click.command()
@@ -1,6 +1,6 @@
1
+ from .tools import ascend_tyche_data as ascend_tyche_data
1
2
  from .server import generate_server_credentials as generate_server_credentials
2
3
  from .data_classes import replace_root_path as replace_root_path
3
- from .ascension_tools import ascend_tyche_data as ascend_tyche_data
4
4
 
5
5
  def replace_local_root_directory(path: str) -> None:
6
6
  """Replaces the root directory used to store all lab projects on the local PC with the specified directory.
@@ -0,0 +1,63 @@
1
+ """This package provides the classes used to store data acquired at various stages of the data workflow and to
2
+ configure various pipelines used in the Sun lab. These classes are used across all stages of data acquisition,
3
+ preprocessing, and processing in the lab, across multiple machines (PCs). Many classes in this package are designed to
4
+ be saved to disk as .yaml files and restored from the .yaml files as needed."""
5
+
6
+ from .runtime_data import (
7
+ ZaberPositions,
8
+ MesoscopePositions,
9
+ HardwareConfiguration,
10
+ RunTrainingDescriptor,
11
+ LickTrainingDescriptor,
12
+ MesoscopeExperimentDescriptor,
13
+ )
14
+ from .session_data import (
15
+ RawData,
16
+ SessionData,
17
+ MesoscopeData,
18
+ ProcessedData,
19
+ DeepLabCutData,
20
+ VRPCDestinations,
21
+ ConfigurationData,
22
+ VRPCPersistentData,
23
+ ProjectConfiguration,
24
+ ScanImagePCPersistentData,
25
+ replace_root_path,
26
+ )
27
+ from .surgery_data import (
28
+ DrugData,
29
+ ImplantData,
30
+ SubjectData,
31
+ SurgeryData,
32
+ InjectionData,
33
+ ProcedureData,
34
+ )
35
+ from .configuration_data import ExperimentState, ExperimentConfiguration
36
+
37
+ __all__ = [
38
+ "DrugData",
39
+ "ImplantData",
40
+ "SessionData",
41
+ "RawData",
42
+ "ProcessedData",
43
+ "ConfigurationData",
44
+ "DeepLabCutData",
45
+ "VRPCPersistentData",
46
+ "ScanImagePCPersistentData",
47
+ "MesoscopeData",
48
+ "VRPCDestinations",
49
+ "SubjectData",
50
+ "SurgeryData",
51
+ "InjectionData",
52
+ "ProcedureData",
53
+ "ZaberPositions",
54
+ "ExperimentState",
55
+ "MesoscopePositions",
56
+ "ProjectConfiguration",
57
+ "HardwareConfiguration",
58
+ "RunTrainingDescriptor",
59
+ "LickTrainingDescriptor",
60
+ "ExperimentConfiguration",
61
+ "MesoscopeExperimentDescriptor",
62
+ "replace_root_path",
63
+ ]
@@ -1,37 +1,49 @@
1
- from .server import (
2
- Server as Server,
3
- ServerCredentials as ServerCredentials,
1
+ from .runtime_data import (
2
+ ZaberPositions as ZaberPositions,
3
+ MesoscopePositions as MesoscopePositions,
4
+ HardwareConfiguration as HardwareConfiguration,
5
+ RunTrainingDescriptor as RunTrainingDescriptor,
6
+ LickTrainingDescriptor as LickTrainingDescriptor,
7
+ MesoscopeExperimentDescriptor as MesoscopeExperimentDescriptor,
8
+ )
9
+ from .session_data import (
10
+ RawData as RawData,
11
+ SessionData as SessionData,
12
+ MesoscopeData as MesoscopeData,
13
+ ProcessedData as ProcessedData,
14
+ DeepLabCutData as DeepLabCutData,
15
+ VRPCDestinations as VRPCDestinations,
16
+ ConfigurationData as ConfigurationData,
17
+ VRPCPersistentData as VRPCPersistentData,
18
+ ProjectConfiguration as ProjectConfiguration,
19
+ ScanImagePCPersistentData as ScanImagePCPersistentData,
20
+ replace_root_path as replace_root_path,
4
21
  )
5
- from .suite2p import Suite2PConfiguration as Suite2PConfiguration
6
- from .data_classes import (
22
+ from .surgery_data import (
7
23
  DrugData as DrugData,
8
24
  ImplantData as ImplantData,
9
- SessionData as SessionData,
10
25
  SubjectData as SubjectData,
11
26
  SurgeryData as SurgeryData,
12
27
  InjectionData as InjectionData,
13
28
  ProcedureData as ProcedureData,
14
- ZaberPositions as ZaberPositions,
29
+ )
30
+ from .configuration_data import (
15
31
  ExperimentState as ExperimentState,
16
- ProcessingTracker as ProcessingTracker,
17
- MesoscopePositions as MesoscopePositions,
18
- ProjectConfiguration as ProjectConfiguration,
19
- HardwareConfiguration as HardwareConfiguration,
20
- RunTrainingDescriptor as RunTrainingDescriptor,
21
- LickTrainingDescriptor as LickTrainingDescriptor,
22
32
  ExperimentConfiguration as ExperimentConfiguration,
23
- MesoscopeExperimentDescriptor as MesoscopeExperimentDescriptor,
24
33
  )
25
- from .transfer_tools import transfer_directory as transfer_directory
26
- from .packaging_tools import calculate_directory_checksum as calculate_directory_checksum
27
34
 
28
35
  __all__ = [
29
- "Server",
30
- "ServerCredentials",
31
- "Suite2PConfiguration",
32
36
  "DrugData",
33
37
  "ImplantData",
34
38
  "SessionData",
39
+ "RawData",
40
+ "ProcessedData",
41
+ "ConfigurationData",
42
+ "DeepLabCutData",
43
+ "VRPCPersistentData",
44
+ "ScanImagePCPersistentData",
45
+ "MesoscopeData",
46
+ "VRPCDestinations",
35
47
  "SubjectData",
36
48
  "SurgeryData",
37
49
  "InjectionData",
@@ -45,7 +57,5 @@ __all__ = [
45
57
  "LickTrainingDescriptor",
46
58
  "ExperimentConfiguration",
47
59
  "MesoscopeExperimentDescriptor",
48
- "ProcessingTracker",
49
- "transfer_directory",
50
- "calculate_directory_checksum",
60
+ "replace_root_path",
51
61
  ]
@@ -0,0 +1,64 @@
1
+ """This module provides classes used to configure data acquisition and processing runtimes in the Sun lab.
2
+ Classes from this library are saved as .yaml files to be edited by the user when a new project and / or session
3
+ is created by the sl-experiment library. The runtime settings are then loaded from user-edited .yaml files by various
4
+ lab pipelines."""
5
+
6
+ import copy
7
+ from pathlib import Path
8
+ from dataclasses import field, dataclass
9
+
10
+ from ataraxis_data_structures import YamlConfig
11
+
12
+
13
+ @dataclass()
14
+ class ExperimentState:
15
+ """Encapsulates the information used to set and maintain the desired experiment and Mesoscope-VR system state.
16
+
17
+ Primarily, experiment runtime logic (task logic) is resolved by the Unity game engine. However, the Mesoscope-VR
18
+ system configuration may also need to change throughout the experiment to optimize the runtime by disabling or
19
+ reconfiguring specific hardware modules. For example, some experiment stages may require the running wheel to be
20
+ locked to prevent the animal from running, and other may require the VR screens to be turned off.
21
+ """
22
+
23
+ experiment_state_code: int
24
+ """The integer code of the experiment state. Experiment states do not have a predefined meaning, Instead, each
25
+ project is expected to define and follow its own experiment state code mapping. Typically, the experiment state
26
+ code is used to denote major experiment stages, such as 'baseline', 'task', 'cooldown', etc. Note, the same
27
+ experiment state code can be used by multiple sequential ExperimentState instances to change the VR system states
28
+ while maintaining the same experiment state."""
29
+ vr_state_code: int
30
+ """One of the supported VR system state-codes. Currently, the Mesoscope-VR system supports two state codes. State
31
+ code '1' denotes 'REST' state and code '2' denotes 'RUN' state. Note, multiple consecutive ExperimentState
32
+ instances with different experiment state codes can reuse the same VR state code."""
33
+ state_duration_s: float
34
+ """The time, in seconds, to maintain the current combination of the experiment and VR states."""
35
+
36
+
37
+ @dataclass()
38
+ class ExperimentConfiguration(YamlConfig):
39
+ """Stores the configuration of a single experiment runtime.
40
+
41
+ Primarily, this includes the sequence of experiment and Virtual Reality (Mesoscope-VR) states that defines the flow
42
+ of the experiment runtime. During runtime, the main runtime control function traverses the sequence of states
43
+ stored in this class instance start-to-end in the exact order specified by the user. Together with custom Unity
44
+ projects that define the task logic (how the system responds to animal interactions with the VR system) this class
45
+ allows flexibly implementing a wide range of experiments.
46
+
47
+ Each project should define one or more experiment configurations and save them as .yaml files inside the project
48
+ 'configuration' folder. The name for each configuration file is defined by the user and is used to identify and load
49
+ the experiment configuration when 'sl-run-experiment' CLI command exposed by the sl-experiment library is executed.
50
+ """
51
+
52
+ cue_map: dict[int, float] = field(default_factory=lambda: {0: 30.0, 1: 30.0, 2: 30.0, 3: 30.0, 4: 30.0})
53
+ """A dictionary that maps each integer-code associated with a wall cue used in the Virtual Reality experiment
54
+ environment to its length in real-world centimeters. It is used to map each VR cue to the distance the animal needs
55
+ to travel to fully traverse the wall cue region from start to end."""
56
+ experiment_states: dict[str, ExperimentState] = field(
57
+ default_factory=lambda: {
58
+ "baseline": ExperimentState(experiment_state_code=1, vr_state_code=1, state_duration_s=30),
59
+ "experiment": ExperimentState(experiment_state_code=2, vr_state_code=2, state_duration_s=120),
60
+ "cooldown": ExperimentState(experiment_state_code=3, vr_state_code=1, state_duration_s=15),
61
+ }
62
+ )
63
+ """A dictionary that uses human-readable state-names as keys and ExperimentState instances as values. Each
64
+ ExperimentState instance represents a phase of the experiment."""
@@ -0,0 +1,37 @@
1
+ from pathlib import Path as Path
2
+ from dataclasses import field, dataclass
3
+
4
+ from _typeshed import Incomplete
5
+ from ataraxis_data_structures import YamlConfig
6
+
7
+ @dataclass()
8
+ class ExperimentState:
9
+ """Encapsulates the information used to set and maintain the desired experiment and Mesoscope-VR system state.
10
+
11
+ Primarily, experiment runtime logic (task logic) is resolved by the Unity game engine. However, the Mesoscope-VR
12
+ system configuration may also need to change throughout the experiment to optimize the runtime by disabling or
13
+ reconfiguring specific hardware modules. For example, some experiment stages may require the running wheel to be
14
+ locked to prevent the animal from running, and other may require the VR screens to be turned off.
15
+ """
16
+
17
+ experiment_state_code: int
18
+ vr_state_code: int
19
+ state_duration_s: float
20
+
21
+ @dataclass()
22
+ class ExperimentConfiguration(YamlConfig):
23
+ """Stores the configuration of a single experiment runtime.
24
+
25
+ Primarily, this includes the sequence of experiment and Virtual Reality (Mesoscope-VR) states that defines the flow
26
+ of the experiment runtime. During runtime, the main runtime control function traverses the sequence of states
27
+ stored in this class instance start-to-end in the exact order specified by the user. Together with custom Unity
28
+ projects that define the task logic (how the system responds to animal interactions with the VR system) this class
29
+ allows flexibly implementing a wide range of experiments.
30
+
31
+ Each project should define one or more experiment configurations and save them as .yaml files inside the project
32
+ 'configuration' folder. The name for each configuration file is defined by the user and is used to identify and load
33
+ the experiment configuration when 'sl-run-experiment' CLI command exposed by the sl-experiment library is executed.
34
+ """
35
+
36
+ cue_map: dict[int, float] = field(default_factory=Incomplete)
37
+ experiment_states: dict[str, ExperimentState] = field(default_factory=Incomplete)