sl-shared-assets 4.0.1__py3-none-any.whl → 5.0.1__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 (39) hide show
  1. sl_shared_assets/__init__.py +48 -41
  2. sl_shared_assets/command_line_interfaces/__init__.py +3 -0
  3. sl_shared_assets/command_line_interfaces/configure.py +173 -0
  4. sl_shared_assets/command_line_interfaces/manage.py +226 -0
  5. sl_shared_assets/data_classes/__init__.py +33 -32
  6. sl_shared_assets/data_classes/configuration_data.py +267 -79
  7. sl_shared_assets/data_classes/session_data.py +226 -289
  8. sl_shared_assets/server/__init__.py +24 -4
  9. sl_shared_assets/server/job.py +6 -7
  10. sl_shared_assets/server/pipeline.py +585 -0
  11. sl_shared_assets/server/server.py +57 -25
  12. sl_shared_assets/tools/__init__.py +9 -8
  13. sl_shared_assets/tools/packaging_tools.py +14 -25
  14. sl_shared_assets/tools/project_management_tools.py +602 -523
  15. sl_shared_assets/tools/transfer_tools.py +88 -23
  16. {sl_shared_assets-4.0.1.dist-info → sl_shared_assets-5.0.1.dist-info}/METADATA +46 -203
  17. sl_shared_assets-5.0.1.dist-info/RECORD +23 -0
  18. sl_shared_assets-5.0.1.dist-info/entry_points.txt +3 -0
  19. sl_shared_assets/__init__.pyi +0 -91
  20. sl_shared_assets/cli.py +0 -501
  21. sl_shared_assets/cli.pyi +0 -106
  22. sl_shared_assets/data_classes/__init__.pyi +0 -75
  23. sl_shared_assets/data_classes/configuration_data.pyi +0 -235
  24. sl_shared_assets/data_classes/runtime_data.pyi +0 -157
  25. sl_shared_assets/data_classes/session_data.pyi +0 -379
  26. sl_shared_assets/data_classes/surgery_data.pyi +0 -89
  27. sl_shared_assets/server/__init__.pyi +0 -11
  28. sl_shared_assets/server/job.pyi +0 -205
  29. sl_shared_assets/server/server.pyi +0 -298
  30. sl_shared_assets/tools/__init__.pyi +0 -19
  31. sl_shared_assets/tools/ascension_tools.py +0 -265
  32. sl_shared_assets/tools/ascension_tools.pyi +0 -68
  33. sl_shared_assets/tools/packaging_tools.pyi +0 -58
  34. sl_shared_assets/tools/project_management_tools.pyi +0 -239
  35. sl_shared_assets/tools/transfer_tools.pyi +0 -53
  36. sl_shared_assets-4.0.1.dist-info/RECORD +0 -36
  37. sl_shared_assets-4.0.1.dist-info/entry_points.txt +0 -7
  38. {sl_shared_assets-4.0.1.dist-info → sl_shared_assets-5.0.1.dist-info}/WHEEL +0 -0
  39. {sl_shared_assets-4.0.1.dist-info → sl_shared_assets-5.0.1.dist-info}/licenses/LICENSE +0 -0
@@ -1,8 +1,28 @@
1
- """This package provides the classes and methods used by all Sun lab libraries to submit remote jobs to the BioHPC
2
- and other compute servers. This package is also used across all Sun lab members' private code to interface with the
3
- shared server."""
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__ = ["Server", "ServerCredentials", "generate_server_credentials", "Job", "JupyterJob"]
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
+ ]
@@ -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 BioHPC cluster.
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, relative to the remote
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)" > {}'.format(self.connection_info_file))
277
- self.add_command('echo "PORT: {}" >> {}'.format(self.port, self.connection_info_file))
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" >> {}'.format(self.connection_info_file))
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(info_file, "r") as f:
314
+ with info_file.open() as f:
316
315
  content = f.read()
317
316
 
318
317
  # Extracts information using regex