sl-shared-assets 4.0.0__py3-none-any.whl → 5.0.0__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 +45 -42
- sl_shared_assets/command_line_interfaces/__init__.py +3 -0
- sl_shared_assets/command_line_interfaces/configure.py +173 -0
- sl_shared_assets/command_line_interfaces/manage.py +226 -0
- sl_shared_assets/data_classes/__init__.py +33 -32
- sl_shared_assets/data_classes/configuration_data.py +267 -79
- sl_shared_assets/data_classes/runtime_data.py +11 -11
- sl_shared_assets/data_classes/session_data.py +226 -289
- sl_shared_assets/data_classes/surgery_data.py +6 -6
- sl_shared_assets/server/__init__.py +24 -4
- sl_shared_assets/server/job.py +6 -7
- sl_shared_assets/server/pipeline.py +570 -0
- sl_shared_assets/server/server.py +57 -25
- sl_shared_assets/tools/__init__.py +9 -8
- sl_shared_assets/tools/packaging_tools.py +14 -25
- sl_shared_assets/tools/project_management_tools.py +602 -523
- sl_shared_assets/tools/transfer_tools.py +88 -23
- {sl_shared_assets-4.0.0.dist-info → sl_shared_assets-5.0.0.dist-info}/METADATA +46 -202
- sl_shared_assets-5.0.0.dist-info/RECORD +23 -0
- sl_shared_assets-5.0.0.dist-info/entry_points.txt +3 -0
- sl_shared_assets/__init__.pyi +0 -91
- sl_shared_assets/cli.py +0 -500
- sl_shared_assets/cli.pyi +0 -106
- sl_shared_assets/data_classes/__init__.pyi +0 -75
- sl_shared_assets/data_classes/configuration_data.pyi +0 -235
- sl_shared_assets/data_classes/runtime_data.pyi +0 -157
- sl_shared_assets/data_classes/session_data.pyi +0 -379
- sl_shared_assets/data_classes/surgery_data.pyi +0 -89
- sl_shared_assets/server/__init__.pyi +0 -11
- sl_shared_assets/server/job.pyi +0 -205
- sl_shared_assets/server/server.pyi +0 -298
- sl_shared_assets/tools/__init__.pyi +0 -19
- sl_shared_assets/tools/ascension_tools.py +0 -265
- sl_shared_assets/tools/ascension_tools.pyi +0 -68
- sl_shared_assets/tools/packaging_tools.pyi +0 -58
- sl_shared_assets/tools/project_management_tools.pyi +0 -239
- sl_shared_assets/tools/transfer_tools.pyi +0 -53
- sl_shared_assets-4.0.0.dist-info/RECORD +0 -36
- sl_shared_assets-4.0.0.dist-info/entry_points.txt +0 -7
- {sl_shared_assets-4.0.0.dist-info → sl_shared_assets-5.0.0.dist-info}/WHEEL +0 -0
- {sl_shared_assets-4.0.0.dist-info → sl_shared_assets-5.0.0.dist-info}/licenses/LICENSE +0 -0
|
@@ -65,7 +65,7 @@ class ImplantData:
|
|
|
65
65
|
"""The descriptive name of the implant."""
|
|
66
66
|
implant_target: str
|
|
67
67
|
"""The name of the brain region or cranium section targeted by the implant."""
|
|
68
|
-
implant_code:
|
|
68
|
+
implant_code: str
|
|
69
69
|
"""The manufacturer code or internal reference code for the implant. This code is used to identify the implant in
|
|
70
70
|
additional datasheets and lab ordering documents."""
|
|
71
71
|
implant_ap_coordinate_mm: float
|
|
@@ -89,7 +89,7 @@ class InjectionData:
|
|
|
89
89
|
"""The name of the brain region targeted by the injection."""
|
|
90
90
|
injection_volume_nl: float
|
|
91
91
|
"""The volume of substance, in nanoliters, delivered during the injection."""
|
|
92
|
-
injection_code:
|
|
92
|
+
injection_code: str
|
|
93
93
|
"""The manufacturer code or internal reference code for the injected substance. This code is used to identify the
|
|
94
94
|
substance in additional datasheets and lab ordering documents."""
|
|
95
95
|
injection_ap_coordinate_mm: float
|
|
@@ -108,22 +108,22 @@ class DrugData:
|
|
|
108
108
|
|
|
109
109
|
lactated_ringers_solution_volume_ml: float
|
|
110
110
|
"""Stores the volume of Lactated Ringer's Solution (LRS) administered during surgery, in ml."""
|
|
111
|
-
lactated_ringers_solution_code:
|
|
111
|
+
lactated_ringers_solution_code: str
|
|
112
112
|
"""Stores the manufacturer code or internal reference code for Lactated Ringer's Solution (LRS). This code is used
|
|
113
113
|
to identify the LRS batch in additional datasheets and lab ordering documents."""
|
|
114
114
|
ketoprofen_volume_ml: float
|
|
115
115
|
"""Stores the volume of ketoprofen diluted with saline administered during surgery, in ml."""
|
|
116
|
-
ketoprofen_code:
|
|
116
|
+
ketoprofen_code: str
|
|
117
117
|
"""Stores the manufacturer code or internal reference code for ketoprofen. This code is used to identify the
|
|
118
118
|
ketoprofen batch in additional datasheets and lab ordering documents."""
|
|
119
119
|
buprenorphine_volume_ml: float
|
|
120
120
|
"""Stores the volume of buprenorphine diluted with saline administered during surgery, in ml."""
|
|
121
|
-
buprenorphine_code:
|
|
121
|
+
buprenorphine_code: str
|
|
122
122
|
"""Stores the manufacturer code or internal reference code for buprenorphine. This code is used to identify the
|
|
123
123
|
buprenorphine batch in additional datasheets and lab ordering documents."""
|
|
124
124
|
dexamethasone_volume_ml: float
|
|
125
125
|
"""Stores the volume of dexamethasone diluted with saline administered during surgery, in ml."""
|
|
126
|
-
dexamethasone_code:
|
|
126
|
+
dexamethasone_code: str
|
|
127
127
|
"""Stores the manufacturer code or internal reference code for dexamethasone. This code is used to identify the
|
|
128
128
|
dexamethasone batch in additional datasheets and lab ordering documents."""
|
|
129
129
|
|
|
@@ -1,8 +1,28 @@
|
|
|
1
|
-
"""This package provides the classes and methods used by all Sun lab libraries to
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"""This package provides the classes and methods used by all Sun lab libraries to work with the data stored on remote
|
|
2
|
+
compute servers, such as the BioHPC server. It provides tools for submitting and monitoring jobs, running complex
|
|
3
|
+
processing pipelines and interactively working with the data via a Jupyter lab server."""
|
|
4
4
|
|
|
5
5
|
from .job import Job, JupyterJob
|
|
6
6
|
from .server import Server, ServerCredentials, generate_server_credentials
|
|
7
|
+
from .pipeline import (
|
|
8
|
+
ProcessingStatus,
|
|
9
|
+
TrackerFileNames,
|
|
10
|
+
ProcessingTracker,
|
|
11
|
+
ProcessingPipeline,
|
|
12
|
+
ProcessingPipelines,
|
|
13
|
+
generate_manager_id,
|
|
14
|
+
)
|
|
7
15
|
|
|
8
|
-
__all__ = [
|
|
16
|
+
__all__ = [
|
|
17
|
+
"Job",
|
|
18
|
+
"JupyterJob",
|
|
19
|
+
"ProcessingPipeline",
|
|
20
|
+
"ProcessingPipelines",
|
|
21
|
+
"ProcessingStatus",
|
|
22
|
+
"ProcessingTracker",
|
|
23
|
+
"Server",
|
|
24
|
+
"ServerCredentials",
|
|
25
|
+
"TrackerFileNames",
|
|
26
|
+
"generate_manager_id",
|
|
27
|
+
"generate_server_credentials",
|
|
28
|
+
]
|
sl_shared_assets/server/job.py
CHANGED
|
@@ -7,7 +7,6 @@ Since version 3.0.0, this module also provides the specialized JupyterJob class
|
|
|
7
7
|
notebook servers.
|
|
8
8
|
"""
|
|
9
9
|
|
|
10
|
-
# noinspection PyProtectedMember
|
|
11
10
|
import re
|
|
12
11
|
from pathlib import Path
|
|
13
12
|
import datetime
|
|
@@ -49,7 +48,7 @@ class _JupyterConnectionInfo:
|
|
|
49
48
|
|
|
50
49
|
|
|
51
50
|
class Job:
|
|
52
|
-
"""Aggregates the data of a single SLURM-managed job to be executed on the Sun lab
|
|
51
|
+
"""Aggregates the data of a single SLURM-managed job to be executed on the Sun lab's remote compute server.
|
|
53
52
|
|
|
54
53
|
This class provides the API for constructing any server-side job in the Sun lab. Internally, it wraps an instance
|
|
55
54
|
of a Slurm class to package the job data into the format expected by the SLURM job manager. All jobs managed by this
|
|
@@ -222,7 +221,7 @@ class JupyterJob(Job):
|
|
|
222
221
|
connection_info: Stores the JupyterConnectionInfo instance after the Jupyter server is instantiated.
|
|
223
222
|
host: Stores the hostname of the remote server.
|
|
224
223
|
user: Stores the username used to connect with the remote server.
|
|
225
|
-
connection_info_file: The absolute path to the file that stores connection information
|
|
224
|
+
connection_info_file: The absolute path to the file that stores connection information relative to the remote
|
|
226
225
|
server root.
|
|
227
226
|
_command: Stores the shell command for launching the Jupyter server.
|
|
228
227
|
"""
|
|
@@ -273,12 +272,12 @@ class JupyterJob(Job):
|
|
|
273
272
|
"""Builds the command to launch the Jupyter notebook server on the remote Sun lab server."""
|
|
274
273
|
|
|
275
274
|
# Gets the hostname of the compute node and caches it in the connection data file. Also caches the port name.
|
|
276
|
-
self.add_command('echo "COMPUTE_NODE: $(hostname)" > {
|
|
277
|
-
self.add_command('echo "PORT: {}" >> {
|
|
275
|
+
self.add_command(f'echo "COMPUTE_NODE: $(hostname)" > {self.connection_info_file}')
|
|
276
|
+
self.add_command(f'echo "PORT: {self.port}" >> {self.connection_info_file}')
|
|
278
277
|
|
|
279
278
|
# Generates a random access token for security and caches it in the connection data file.
|
|
280
279
|
self.add_command("TOKEN=$(openssl rand -hex 24)")
|
|
281
|
-
self.add_command('echo "TOKEN: $TOKEN" >> {
|
|
280
|
+
self.add_command(f'echo "TOKEN: $TOKEN" >> {self.connection_info_file}')
|
|
282
281
|
|
|
283
282
|
# Builds Jupyter startup command.
|
|
284
283
|
jupyter_cmd = [
|
|
@@ -312,7 +311,7 @@ class JupyterJob(Job):
|
|
|
312
311
|
information to be parsed.
|
|
313
312
|
"""
|
|
314
313
|
|
|
315
|
-
with open(
|
|
314
|
+
with info_file.open() as f:
|
|
316
315
|
content = f.read()
|
|
317
316
|
|
|
318
317
|
# Extracts information using regex
|