sl-shared-assets 1.0.0rc20__py3-none-any.whl → 1.0.0rc21__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.

Files changed (35) hide show
  1. sl_shared_assets/__init__.py +27 -27
  2. sl_shared_assets/__init__.pyi +24 -22
  3. sl_shared_assets/cli.py +266 -40
  4. sl_shared_assets/cli.pyi +73 -14
  5. sl_shared_assets/data_classes/__init__.py +23 -20
  6. sl_shared_assets/data_classes/__init__.pyi +18 -18
  7. sl_shared_assets/data_classes/configuration_data.py +407 -26
  8. sl_shared_assets/data_classes/configuration_data.pyi +172 -15
  9. sl_shared_assets/data_classes/runtime_data.py +49 -43
  10. sl_shared_assets/data_classes/runtime_data.pyi +37 -40
  11. sl_shared_assets/data_classes/session_data.py +168 -914
  12. sl_shared_assets/data_classes/session_data.pyi +55 -350
  13. sl_shared_assets/data_classes/surgery_data.py +3 -3
  14. sl_shared_assets/data_classes/surgery_data.pyi +2 -2
  15. sl_shared_assets/tools/__init__.py +8 -1
  16. sl_shared_assets/tools/__init__.pyi +11 -1
  17. sl_shared_assets/tools/ascension_tools.py +27 -26
  18. sl_shared_assets/tools/ascension_tools.pyi +5 -5
  19. sl_shared_assets/tools/packaging_tools.py +14 -1
  20. sl_shared_assets/tools/packaging_tools.pyi +4 -0
  21. sl_shared_assets/tools/project_management_tools.py +164 -0
  22. sl_shared_assets/tools/project_management_tools.pyi +48 -0
  23. {sl_shared_assets-1.0.0rc20.dist-info → sl_shared_assets-1.0.0rc21.dist-info}/METADATA +21 -4
  24. sl_shared_assets-1.0.0rc21.dist-info/RECORD +36 -0
  25. sl_shared_assets-1.0.0rc21.dist-info/entry_points.txt +8 -0
  26. sl_shared_assets/suite2p/__init__.py +0 -8
  27. sl_shared_assets/suite2p/__init__.pyi +0 -4
  28. sl_shared_assets/suite2p/multi_day.py +0 -224
  29. sl_shared_assets/suite2p/multi_day.pyi +0 -104
  30. sl_shared_assets/suite2p/single_day.py +0 -564
  31. sl_shared_assets/suite2p/single_day.pyi +0 -220
  32. sl_shared_assets-1.0.0rc20.dist-info/RECORD +0 -40
  33. sl_shared_assets-1.0.0rc20.dist-info/entry_points.txt +0 -4
  34. {sl_shared_assets-1.0.0rc20.dist-info → sl_shared_assets-1.0.0rc21.dist-info}/WHEEL +0 -0
  35. {sl_shared_assets-1.0.0rc20.dist-info → sl_shared_assets-1.0.0rc21.dist-info}/licenses/LICENSE +0 -0
sl_shared_assets/cli.pyi CHANGED
@@ -1,28 +1,87 @@
1
- from .tools import ascend_tyche_data as ascend_tyche_data
1
+ from .tools import (
2
+ ascend_tyche_data as ascend_tyche_data,
3
+ verify_session_checksum as verify_session_checksum,
4
+ generate_project_manifest as generate_project_manifest,
5
+ )
2
6
  from .server import generate_server_credentials as generate_server_credentials
3
- from .data_classes import replace_root_path as replace_root_path
7
+ from .data_classes import (
8
+ ExperimentState as ExperimentState,
9
+ ProjectConfiguration as ProjectConfiguration,
10
+ MesoscopeSystemConfiguration as MesoscopeSystemConfiguration,
11
+ MesoscopeExperimentConfiguration as MesoscopeExperimentConfiguration,
12
+ get_system_configuration_data as get_system_configuration_data,
13
+ set_system_configuration_file as set_system_configuration_file,
14
+ )
4
15
 
5
- def replace_local_root_directory(path: str) -> None:
6
- """Replaces the root directory used to store all lab projects on the local PC with the specified directory.
16
+ def verify_session_integrity(session_path: str) -> None:
17
+ """Checks the integrity of the target session's raw data (contents of the raw_data directory).
7
18
 
8
- To ensure all projects are saved in the same location, this library resolves and saves the absolute path to the
9
- project directory the first time ProjectConfiguration class instance is created on a new PC. All future projects
10
- automatically reuse the same 'root' directory path. Since this information is stored in a typically hidden user
11
- directory, this CLI can be used to replace the local directory path, if necessary.
19
+ This command assumes that the data has been checksummed during acquisition and contains an ax_checksum.txt file
20
+ that stores the data checksum generated before transferring the data to long-term storage destination. This function
21
+ always verified the integrity of the 'raw_data' directory. It does not work with 'processed_data' or any other
22
+ directories. If the session data was corrupted, the command removes the 'telomere.bin' file, marking the session as
23
+ 'incomplete' and automatically excluding it from all further automated processing runtimes.
24
+ """
25
+
26
+ def generate_project_manifest_file(
27
+ project_path: str, output_directory: str, project_processed_path: str | None
28
+ ) -> None:
29
+ """Generates the manifest .feather file that provides information about the data-processing state of all available
30
+ project sessions.
31
+
32
+ The manifest file is typically used when batch-processing session data on the remote compute server. It contains the
33
+ comprehensive snapshot of the available project's data in a table-compatible format that can also be transferred
34
+ between machines (as it is cached in a file).
35
+ """
36
+
37
+ def generate_system_configuration_file(output_directory: str, acquisition_system: str) -> None:
38
+ """Generates a precursor system configuration file for the target acquisition system and configures all local
39
+ Sun lab libraries to use that file to load the acquisition system configuration data.
40
+
41
+ This command is typically used when setting up a new data acquisition system in the lab. The system configuration
42
+ only needs to be specified on the machine (PC) that runs the sl-experiment library and manages the acquisition
43
+ runtime if the system uses multiple machines (PCs). Once the system configuration .yaml file is created via this
44
+ command, editing the configuration parameters in the file will automatically take effect during all following
45
+ runtimes.
12
46
  """
13
47
 
14
48
  def generate_server_credentials_file(output_directory: str, host: str, username: str, password: str) -> None:
15
49
  """Generates a new server_credentials.yaml file under the specified directory, using input information.
16
50
 
17
- This CLI is used to set up new PCs to work with the lab BioHPC server. While this is primarily intended for the
18
- VRPC, any machined that interacts with BioHPC server can use this CLI to build the access credentials file.
51
+ This command is used to set up access to compute servers and clusters on new machines (PCs). The data stored inside
52
+ the server_credentials.yaml file generated by this command is used by the Server and Job classes used in many Sun
53
+ lab data processing libraries.
54
+ """
55
+
56
+ def generate_project_configuration_file(project: str, surgery_log_id: str, water_restriction_log_id: str) -> None:
57
+ """Generates a new project directory hierarchy and writes its configuration as a project_configuration.yaml file.
58
+
59
+ This command creates new Sun lab projects. Until a project is created in this fashion, all data-acquisition and
60
+ data-processing commands from sl-experiment and sl-forgery libraries targeting the project will not work. This
61
+ command is intended to be called on the main computer of the data-acquisition system(s) used by the project. Note,
62
+ this command assumes that the local machine (PC) is the main PC of the data acquisition system and has a valid
63
+ acquisition system configuration .yaml file.
64
+ """
65
+
66
+ def generate_experiment_configuration_file(project: str, experiment: str, state_count: int) -> None:
67
+ """Generates a precursor experiment configuration .yaml file for the target experiment inside the project's
68
+ configuration folder.
69
+
70
+ This command assists users in creating new experiment configurations, by statically resolving the structure (layout)
71
+ of the appropriate experiment configuration file for the acquisition system of the local machine (PC). Specifically,
72
+ the generated precursor will contain the correct number of experiment state entries initialized to nonsensical
73
+ default value. The user needs to manually edit the configuration file to properly specify their experiment runtime
74
+ parameters and state transitions before running the experiment. In a sense, this command acts as an 'experiment
75
+ template' generator.
19
76
  """
20
77
 
21
- def ascend_tyche_directory(path: str, output_directory: str, server_directory: str) -> None:
22
- """Restructures old Tyche project data to use the modern Sun lab data structure.
78
+ def ascend_tyche_directory(input_directory: str) -> None:
79
+ """Restructures old Tyche project data to use the modern Sun lab data structure and uploads them to the processing
80
+ server.
23
81
 
24
- This CLI is used to convert ('ascend') the old Tyche project data to the modern Sun lab structure. After
82
+ This command is used to convert ('ascend') the old Tyche project data to the modern Sun lab structure. After
25
83
  ascension, the data can be processed and analyzed using all modern Sun lab (sl-) tools and libraries. Note, this
26
84
  process expects the input data to be preprocessed using an old Sun lab mesoscope data preprocessing pipeline. It
27
- will not work for any other project or data.
85
+ will not work for any other project or data. Also, this command will only work on a machine (PC) that belongs to a
86
+ valid Sun lab data acquisition system, such as VRPC of the Mesoscope-VR system.
28
87
  """
@@ -1,28 +1,21 @@
1
1
  """This package provides the classes used to store data acquired at various stages of the data workflow and to
2
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."""
3
+ preprocessing, and processing in the lab that run on multiple machines (PCs). Many classes in this package are designed
4
+ to be saved to disk as .yaml files and restored from the .yaml files as needed."""
5
5
 
6
6
  from .runtime_data import (
7
7
  ZaberPositions,
8
8
  MesoscopePositions,
9
- HardwareConfiguration,
10
9
  RunTrainingDescriptor,
11
10
  LickTrainingDescriptor,
11
+ MesoscopeHardwareState,
12
12
  MesoscopeExperimentDescriptor,
13
13
  )
14
14
  from .session_data import (
15
15
  RawData,
16
16
  SessionData,
17
- MesoscopeData,
18
17
  ProcessedData,
19
- DeepLabCutData,
20
- VRPCDestinations,
21
- ConfigurationData,
22
- VRPCPersistentData,
23
18
  ProjectConfiguration,
24
- ScanImagePCPersistentData,
25
- replace_root_path,
26
19
  )
27
20
  from .surgery_data import (
28
21
  DrugData,
@@ -32,7 +25,17 @@ from .surgery_data import (
32
25
  InjectionData,
33
26
  ProcedureData,
34
27
  )
35
- from .configuration_data import ExperimentState, ExperimentConfiguration
28
+ from .configuration_data import (
29
+ MesoscopePaths,
30
+ ExperimentState,
31
+ MesoscopeCameras,
32
+ MesoscopeMicroControllers,
33
+ MesoscopeAdditionalFirmware,
34
+ MesoscopeSystemConfiguration,
35
+ MesoscopeExperimentConfiguration,
36
+ get_system_configuration_data,
37
+ set_system_configuration_file,
38
+ )
36
39
 
37
40
  __all__ = [
38
41
  "DrugData",
@@ -40,12 +43,6 @@ __all__ = [
40
43
  "SessionData",
41
44
  "RawData",
42
45
  "ProcessedData",
43
- "ConfigurationData",
44
- "DeepLabCutData",
45
- "VRPCPersistentData",
46
- "ScanImagePCPersistentData",
47
- "MesoscopeData",
48
- "VRPCDestinations",
49
46
  "SubjectData",
50
47
  "SurgeryData",
51
48
  "InjectionData",
@@ -54,10 +51,16 @@ __all__ = [
54
51
  "ExperimentState",
55
52
  "MesoscopePositions",
56
53
  "ProjectConfiguration",
57
- "HardwareConfiguration",
54
+ "MesoscopeHardwareState",
58
55
  "RunTrainingDescriptor",
59
56
  "LickTrainingDescriptor",
60
- "ExperimentConfiguration",
57
+ "MesoscopeExperimentConfiguration",
61
58
  "MesoscopeExperimentDescriptor",
62
- "replace_root_path",
59
+ "MesoscopeSystemConfiguration",
60
+ "set_system_configuration_file",
61
+ "get_system_configuration_data",
62
+ "MesoscopePaths",
63
+ "MesoscopeCameras",
64
+ "MesoscopeMicroControllers",
65
+ "MesoscopeAdditionalFirmware",
63
66
  ]
@@ -1,23 +1,16 @@
1
1
  from .runtime_data import (
2
2
  ZaberPositions as ZaberPositions,
3
3
  MesoscopePositions as MesoscopePositions,
4
- HardwareConfiguration as HardwareConfiguration,
5
4
  RunTrainingDescriptor as RunTrainingDescriptor,
6
5
  LickTrainingDescriptor as LickTrainingDescriptor,
6
+ MesoscopeHardwareState as MesoscopeHardwareState,
7
7
  MesoscopeExperimentDescriptor as MesoscopeExperimentDescriptor,
8
8
  )
9
9
  from .session_data import (
10
10
  RawData as RawData,
11
11
  SessionData as SessionData,
12
- MesoscopeData as MesoscopeData,
13
12
  ProcessedData as ProcessedData,
14
- DeepLabCutData as DeepLabCutData,
15
- VRPCDestinations as VRPCDestinations,
16
- ConfigurationData as ConfigurationData,
17
- VRPCPersistentData as VRPCPersistentData,
18
13
  ProjectConfiguration as ProjectConfiguration,
19
- ScanImagePCPersistentData as ScanImagePCPersistentData,
20
- replace_root_path as replace_root_path,
21
14
  )
22
15
  from .surgery_data import (
23
16
  DrugData as DrugData,
@@ -28,8 +21,15 @@ from .surgery_data import (
28
21
  ProcedureData as ProcedureData,
29
22
  )
30
23
  from .configuration_data import (
24
+ MesoscopePaths as MesoscopePaths,
31
25
  ExperimentState as ExperimentState,
32
- ExperimentConfiguration as ExperimentConfiguration,
26
+ MesoscopeCameras as MesoscopeCameras,
27
+ MesoscopeMicroControllers as MesoscopeMicroControllers,
28
+ MesoscopeAdditionalFirmware as MesoscopeAdditionalFirmware,
29
+ MesoscopeSystemConfiguration as MesoscopeSystemConfiguration,
30
+ MesoscopeExperimentConfiguration as MesoscopeExperimentConfiguration,
31
+ get_system_configuration_data as get_system_configuration_data,
32
+ set_system_configuration_file as set_system_configuration_file,
33
33
  )
34
34
 
35
35
  __all__ = [
@@ -38,12 +38,6 @@ __all__ = [
38
38
  "SessionData",
39
39
  "RawData",
40
40
  "ProcessedData",
41
- "ConfigurationData",
42
- "DeepLabCutData",
43
- "VRPCPersistentData",
44
- "ScanImagePCPersistentData",
45
- "MesoscopeData",
46
- "VRPCDestinations",
47
41
  "SubjectData",
48
42
  "SurgeryData",
49
43
  "InjectionData",
@@ -52,10 +46,16 @@ __all__ = [
52
46
  "ExperimentState",
53
47
  "MesoscopePositions",
54
48
  "ProjectConfiguration",
55
- "HardwareConfiguration",
49
+ "MesoscopeHardwareState",
56
50
  "RunTrainingDescriptor",
57
51
  "LickTrainingDescriptor",
58
- "ExperimentConfiguration",
52
+ "MesoscopeExperimentConfiguration",
59
53
  "MesoscopeExperimentDescriptor",
60
- "replace_root_path",
54
+ "MesoscopeSystemConfiguration",
55
+ "set_system_configuration_file",
56
+ "get_system_configuration_data",
57
+ "MesoscopePaths",
58
+ "MesoscopeCameras",
59
+ "MesoscopeMicroControllers",
60
+ "MesoscopeAdditionalFirmware",
61
61
  ]