sl-shared-assets 1.0.0rc1__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 +96 -0
- sl_shared_assets/__init__.pyi +87 -0
- sl_shared_assets/cli.py +72 -0
- sl_shared_assets/cli.pyi +17 -0
- sl_shared_assets/data_classes.py +1435 -0
- sl_shared_assets/data_classes.pyi +646 -0
- sl_shared_assets/packaging_tools.py +133 -0
- sl_shared_assets/packaging_tools.pyi +52 -0
- sl_shared_assets/py.typed +0 -0
- sl_shared_assets/server.py +293 -0
- sl_shared_assets/server.pyi +112 -0
- sl_shared_assets/suite2p.py +449 -0
- sl_shared_assets/suite2p.pyi +188 -0
- sl_shared_assets/transfer_tools.py +119 -0
- sl_shared_assets/transfer_tools.pyi +53 -0
- sl_shared_assets-1.0.0rc1.dist-info/METADATA +849 -0
- sl_shared_assets-1.0.0rc1.dist-info/RECORD +20 -0
- sl_shared_assets-1.0.0rc1.dist-info/WHEEL +4 -0
- sl_shared_assets-1.0.0rc1.dist-info/entry_points.txt +3 -0
- sl_shared_assets-1.0.0rc1.dist-info/licenses/LICENSE +674 -0
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
"""A Python library that stores assets shared between multiple Sun (NeuroAI) lab data pipelines.
|
|
2
|
+
|
|
3
|
+
See https://github.com/Sun-Lab-NBB/sl-shared-assets for more details.
|
|
4
|
+
API documentation: https://sl-shared-assets-api-docs.netlify.app/
|
|
5
|
+
Authors: Ivan Kondratyev (Inkaros), Kushaan Gupta, Yuantao Deng
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from .server import Server, ServerCredentials
|
|
9
|
+
from .suite2p import (
|
|
10
|
+
Main,
|
|
11
|
+
FileIO,
|
|
12
|
+
Output,
|
|
13
|
+
Channel2,
|
|
14
|
+
NonRigid,
|
|
15
|
+
ROIDetection,
|
|
16
|
+
Registration,
|
|
17
|
+
Classification,
|
|
18
|
+
OnePRegistration,
|
|
19
|
+
SignalExtraction,
|
|
20
|
+
CellposeDetection,
|
|
21
|
+
SpikeDeconvolution,
|
|
22
|
+
Suite2PConfiguration,
|
|
23
|
+
)
|
|
24
|
+
from .data_classes import (
|
|
25
|
+
RawData,
|
|
26
|
+
DrugData,
|
|
27
|
+
ImplantData,
|
|
28
|
+
SessionData,
|
|
29
|
+
SubjectData,
|
|
30
|
+
SurgeryData,
|
|
31
|
+
Destinations,
|
|
32
|
+
InjectionData,
|
|
33
|
+
MesoscopeData,
|
|
34
|
+
ProcedureData,
|
|
35
|
+
ProcessedData,
|
|
36
|
+
PersistentData,
|
|
37
|
+
ZaberPositions,
|
|
38
|
+
ExperimentState,
|
|
39
|
+
MesoscopePositions,
|
|
40
|
+
ProjectConfiguration,
|
|
41
|
+
HardwareConfiguration,
|
|
42
|
+
RunTrainingDescriptor,
|
|
43
|
+
LickTrainingDescriptor,
|
|
44
|
+
ExperimentConfiguration,
|
|
45
|
+
MesoscopeExperimentDescriptor,
|
|
46
|
+
replace_root_path,
|
|
47
|
+
)
|
|
48
|
+
from .transfer_tools import transfer_directory
|
|
49
|
+
from .packaging_tools import calculate_directory_checksum
|
|
50
|
+
|
|
51
|
+
__all__ = [
|
|
52
|
+
# Server module
|
|
53
|
+
"Server",
|
|
54
|
+
"ServerCredentials",
|
|
55
|
+
# Suite2p module
|
|
56
|
+
"Main",
|
|
57
|
+
"FileIO",
|
|
58
|
+
"Output",
|
|
59
|
+
"Channel2",
|
|
60
|
+
"NonRigid",
|
|
61
|
+
"ROIDetection",
|
|
62
|
+
"Registration",
|
|
63
|
+
"Classification",
|
|
64
|
+
"OnePRegistration",
|
|
65
|
+
"SignalExtraction",
|
|
66
|
+
"CellposeDetection",
|
|
67
|
+
"SpikeDeconvolution",
|
|
68
|
+
"Suite2PConfiguration",
|
|
69
|
+
# Data classes module
|
|
70
|
+
"RawData",
|
|
71
|
+
"DrugData",
|
|
72
|
+
"ImplantData",
|
|
73
|
+
"SessionData",
|
|
74
|
+
"SubjectData",
|
|
75
|
+
"SurgeryData",
|
|
76
|
+
"Destinations",
|
|
77
|
+
"InjectionData",
|
|
78
|
+
"MesoscopeData",
|
|
79
|
+
"ProcedureData",
|
|
80
|
+
"ProcessedData",
|
|
81
|
+
"PersistentData",
|
|
82
|
+
"ZaberPositions",
|
|
83
|
+
"ExperimentState",
|
|
84
|
+
"MesoscopePositions",
|
|
85
|
+
"ProjectConfiguration",
|
|
86
|
+
"HardwareConfiguration",
|
|
87
|
+
"RunTrainingDescriptor",
|
|
88
|
+
"LickTrainingDescriptor",
|
|
89
|
+
"ExperimentConfiguration",
|
|
90
|
+
"MesoscopeExperimentDescriptor",
|
|
91
|
+
"replace_root_path",
|
|
92
|
+
# Transfer tools module
|
|
93
|
+
"transfer_directory",
|
|
94
|
+
# Packaging tools module
|
|
95
|
+
"calculate_directory_checksum",
|
|
96
|
+
]
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
from .server import (
|
|
2
|
+
Server as Server,
|
|
3
|
+
ServerCredentials as ServerCredentials,
|
|
4
|
+
)
|
|
5
|
+
from .suite2p import (
|
|
6
|
+
Main as Main,
|
|
7
|
+
FileIO as FileIO,
|
|
8
|
+
Output as Output,
|
|
9
|
+
Channel2 as Channel2,
|
|
10
|
+
NonRigid as NonRigid,
|
|
11
|
+
ROIDetection as ROIDetection,
|
|
12
|
+
Registration as Registration,
|
|
13
|
+
Classification as Classification,
|
|
14
|
+
OnePRegistration as OnePRegistration,
|
|
15
|
+
SignalExtraction as SignalExtraction,
|
|
16
|
+
CellposeDetection as CellposeDetection,
|
|
17
|
+
SpikeDeconvolution as SpikeDeconvolution,
|
|
18
|
+
Suite2PConfiguration as Suite2PConfiguration,
|
|
19
|
+
)
|
|
20
|
+
from .data_classes import (
|
|
21
|
+
RawData as RawData,
|
|
22
|
+
DrugData as DrugData,
|
|
23
|
+
ImplantData as ImplantData,
|
|
24
|
+
SessionData as SessionData,
|
|
25
|
+
SubjectData as SubjectData,
|
|
26
|
+
SurgeryData as SurgeryData,
|
|
27
|
+
Destinations as Destinations,
|
|
28
|
+
InjectionData as InjectionData,
|
|
29
|
+
MesoscopeData as MesoscopeData,
|
|
30
|
+
ProcedureData as ProcedureData,
|
|
31
|
+
ProcessedData as ProcessedData,
|
|
32
|
+
PersistentData as PersistentData,
|
|
33
|
+
ZaberPositions as ZaberPositions,
|
|
34
|
+
ExperimentState as ExperimentState,
|
|
35
|
+
MesoscopePositions as MesoscopePositions,
|
|
36
|
+
ProjectConfiguration as ProjectConfiguration,
|
|
37
|
+
HardwareConfiguration as HardwareConfiguration,
|
|
38
|
+
RunTrainingDescriptor as RunTrainingDescriptor,
|
|
39
|
+
LickTrainingDescriptor as LickTrainingDescriptor,
|
|
40
|
+
ExperimentConfiguration as ExperimentConfiguration,
|
|
41
|
+
MesoscopeExperimentDescriptor as MesoscopeExperimentDescriptor,
|
|
42
|
+
replace_root_path as replace_root_path,
|
|
43
|
+
)
|
|
44
|
+
from .transfer_tools import transfer_directory as transfer_directory
|
|
45
|
+
from .packaging_tools import calculate_directory_checksum as calculate_directory_checksum
|
|
46
|
+
|
|
47
|
+
__all__ = [
|
|
48
|
+
"Server",
|
|
49
|
+
"ServerCredentials",
|
|
50
|
+
"Main",
|
|
51
|
+
"FileIO",
|
|
52
|
+
"Output",
|
|
53
|
+
"Channel2",
|
|
54
|
+
"NonRigid",
|
|
55
|
+
"ROIDetection",
|
|
56
|
+
"Registration",
|
|
57
|
+
"Classification",
|
|
58
|
+
"OnePRegistration",
|
|
59
|
+
"SignalExtraction",
|
|
60
|
+
"CellposeDetection",
|
|
61
|
+
"SpikeDeconvolution",
|
|
62
|
+
"Suite2PConfiguration",
|
|
63
|
+
"RawData",
|
|
64
|
+
"DrugData",
|
|
65
|
+
"ImplantData",
|
|
66
|
+
"SessionData",
|
|
67
|
+
"SubjectData",
|
|
68
|
+
"SurgeryData",
|
|
69
|
+
"Destinations",
|
|
70
|
+
"InjectionData",
|
|
71
|
+
"MesoscopeData",
|
|
72
|
+
"ProcedureData",
|
|
73
|
+
"ProcessedData",
|
|
74
|
+
"PersistentData",
|
|
75
|
+
"ZaberPositions",
|
|
76
|
+
"ExperimentState",
|
|
77
|
+
"MesoscopePositions",
|
|
78
|
+
"ProjectConfiguration",
|
|
79
|
+
"HardwareConfiguration",
|
|
80
|
+
"RunTrainingDescriptor",
|
|
81
|
+
"LickTrainingDescriptor",
|
|
82
|
+
"ExperimentConfiguration",
|
|
83
|
+
"MesoscopeExperimentDescriptor",
|
|
84
|
+
"replace_root_path",
|
|
85
|
+
"transfer_directory",
|
|
86
|
+
"calculate_directory_checksum",
|
|
87
|
+
]
|
sl_shared_assets/cli.py
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"""This module stores the Command-Line Interfaces (CLIs) exposes by the library as part of the installation process.
|
|
2
|
+
Primarily, these CLIs are used when setting up or reconfiguring the VRPC and other machines in the lab to work with
|
|
3
|
+
sl-experiment and sl-forgery libraries."""
|
|
4
|
+
|
|
5
|
+
from pathlib import Path
|
|
6
|
+
|
|
7
|
+
import click
|
|
8
|
+
|
|
9
|
+
from .server import generate_server_credentials
|
|
10
|
+
from .data_classes import replace_root_path
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
@click.command()
|
|
14
|
+
@click.option(
|
|
15
|
+
"-p",
|
|
16
|
+
"--path",
|
|
17
|
+
type=click.Path(exists=True, file_okay=False, dir_okay=True, path_type=Path),
|
|
18
|
+
required=True,
|
|
19
|
+
prompt="Enter the path to the new local directory where to store all project subdirectories: ",
|
|
20
|
+
help="The path to the new local directory where to store all project subdirectories.",
|
|
21
|
+
)
|
|
22
|
+
def replace_local_root_directory(path: str) -> None:
|
|
23
|
+
"""Replaces the root directory used to store all lab projects on the local PC with the specified directory.
|
|
24
|
+
|
|
25
|
+
To ensure all projects are saved in the same location, this library resolves and saves the absolute path to the
|
|
26
|
+
project directory when it is used for the first time. All future projects reuse the same 'root' path. Since this
|
|
27
|
+
information is stored in a typically hidden user directory, this CLI can be used to replace the local directory
|
|
28
|
+
path, if necessary.
|
|
29
|
+
"""
|
|
30
|
+
replace_root_path(path=Path(path))
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
@click.command()
|
|
34
|
+
@click.option(
|
|
35
|
+
"-o",
|
|
36
|
+
"--output_directory",
|
|
37
|
+
type=click.Path(exists=True, file_okay=False, dir_okay=True, path_type=Path),
|
|
38
|
+
required=True,
|
|
39
|
+
prompt="Enter the path to the directory where to create the credentials file: ",
|
|
40
|
+
help="The path to the directory where to create the credentials file.",
|
|
41
|
+
)
|
|
42
|
+
@click.option(
|
|
43
|
+
"-h",
|
|
44
|
+
"--host",
|
|
45
|
+
type=str,
|
|
46
|
+
show_default=True,
|
|
47
|
+
required=True,
|
|
48
|
+
default="cbsuwsun.biohpc.cornell.edu",
|
|
49
|
+
help="The host name or IP address of the server to connect to.",
|
|
50
|
+
)
|
|
51
|
+
@click.option(
|
|
52
|
+
"-u",
|
|
53
|
+
"--username",
|
|
54
|
+
type=str,
|
|
55
|
+
required=True,
|
|
56
|
+
help="The username to use for server authentication.",
|
|
57
|
+
)
|
|
58
|
+
@click.option(
|
|
59
|
+
"-p",
|
|
60
|
+
"--password",
|
|
61
|
+
type=str,
|
|
62
|
+
required=True,
|
|
63
|
+
help="The password to use for server authentication.",
|
|
64
|
+
)
|
|
65
|
+
def generate_server_credentials_file(output_directory: str, host: str, username: str, password: str) -> None:
|
|
66
|
+
"""Generates a new server_credentials.yaml file under the specified directory, using input information.
|
|
67
|
+
|
|
68
|
+
This CLI is used during the initial PC setup (typically, VRPC) to allow it to access the lab BioHPC server.
|
|
69
|
+
"""
|
|
70
|
+
generate_server_credentials(
|
|
71
|
+
output_directory=Path(output_directory), username=username, password=password, host=host
|
|
72
|
+
)
|
sl_shared_assets/cli.pyi
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
from .server import generate_server_credentials as generate_server_credentials
|
|
2
|
+
from .data_classes import replace_root_path as replace_root_path
|
|
3
|
+
|
|
4
|
+
def replace_local_root_directory(path: str) -> None:
|
|
5
|
+
"""Replaces the root directory used to store all lab projects on the local PC with the specified directory.
|
|
6
|
+
|
|
7
|
+
To ensure all projects are saved in the same location, this library resolves and saves the absolute path to the
|
|
8
|
+
project directory when it is used for the first time. All future projects reuse the same 'root' path. Since this
|
|
9
|
+
information is stored in a typically hidden user directory, this CLI can be used to replace the local directory
|
|
10
|
+
path, if necessary.
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
def generate_server_credentials_file(output_directory: str, host: str, username: str, password: str) -> None:
|
|
14
|
+
"""Generates a new server_credentials.yaml file under the specified directory, using input information.
|
|
15
|
+
|
|
16
|
+
This CLI is used during the initial PC setup (typically, VRPC) to allow it to access the lab BioHPC server.
|
|
17
|
+
"""
|