sl-shared-assets 5.1.0__tar.gz → 5.1.2__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 (36) hide show
  1. {sl_shared_assets-5.1.0 → sl_shared_assets-5.1.2}/PKG-INFO +1 -1
  2. {sl_shared_assets-5.1.0 → sl_shared_assets-5.1.2}/envs/slsa_dev_lin.yml +1 -1
  3. {sl_shared_assets-5.1.0 → sl_shared_assets-5.1.2}/envs/slsa_dev_lin_spec.txt +2 -2
  4. {sl_shared_assets-5.1.0 → sl_shared_assets-5.1.2}/pyproject.toml +1 -1
  5. {sl_shared_assets-5.1.0 → sl_shared_assets-5.1.2}/src/sl_shared_assets/__init__.py +3 -2
  6. {sl_shared_assets-5.1.0 → sl_shared_assets-5.1.2}/src/sl_shared_assets/command_line_interfaces/manage.py +4 -2
  7. {sl_shared_assets-5.1.0 → sl_shared_assets-5.1.2}/src/sl_shared_assets/tools/__init__.py +0 -2
  8. {sl_shared_assets-5.1.0 → sl_shared_assets-5.1.2}/src/sl_shared_assets/tools/project_management_tools.py +0 -233
  9. {sl_shared_assets-5.1.0 → sl_shared_assets-5.1.2}/.gitignore +0 -0
  10. {sl_shared_assets-5.1.0 → sl_shared_assets-5.1.2}/LICENSE +0 -0
  11. {sl_shared_assets-5.1.0 → sl_shared_assets-5.1.2}/README.md +0 -0
  12. {sl_shared_assets-5.1.0 → sl_shared_assets-5.1.2}/docs/Makefile +0 -0
  13. {sl_shared_assets-5.1.0 → sl_shared_assets-5.1.2}/docs/make.bat +0 -0
  14. {sl_shared_assets-5.1.0 → sl_shared_assets-5.1.2}/docs/source/api.rst +0 -0
  15. {sl_shared_assets-5.1.0 → sl_shared_assets-5.1.2}/docs/source/conf.py +0 -0
  16. {sl_shared_assets-5.1.0 → sl_shared_assets-5.1.2}/docs/source/index.rst +0 -0
  17. {sl_shared_assets-5.1.0 → sl_shared_assets-5.1.2}/docs/source/welcome.rst +0 -0
  18. {sl_shared_assets-5.1.0 → sl_shared_assets-5.1.2}/envs/slsa_dev_osx.yml +0 -0
  19. {sl_shared_assets-5.1.0 → sl_shared_assets-5.1.2}/envs/slsa_dev_osx_spec.txt +0 -0
  20. {sl_shared_assets-5.1.0 → sl_shared_assets-5.1.2}/envs/slsa_dev_win.yml +0 -0
  21. {sl_shared_assets-5.1.0 → sl_shared_assets-5.1.2}/envs/slsa_dev_win_spec.txt +0 -0
  22. {sl_shared_assets-5.1.0 → sl_shared_assets-5.1.2}/src/sl_shared_assets/command_line_interfaces/__init__.py +0 -0
  23. {sl_shared_assets-5.1.0 → sl_shared_assets-5.1.2}/src/sl_shared_assets/command_line_interfaces/configure.py +0 -0
  24. {sl_shared_assets-5.1.0 → sl_shared_assets-5.1.2}/src/sl_shared_assets/data_classes/__init__.py +0 -0
  25. {sl_shared_assets-5.1.0 → sl_shared_assets-5.1.2}/src/sl_shared_assets/data_classes/configuration_data.py +0 -0
  26. {sl_shared_assets-5.1.0 → sl_shared_assets-5.1.2}/src/sl_shared_assets/data_classes/runtime_data.py +0 -0
  27. {sl_shared_assets-5.1.0 → sl_shared_assets-5.1.2}/src/sl_shared_assets/data_classes/session_data.py +0 -0
  28. {sl_shared_assets-5.1.0 → sl_shared_assets-5.1.2}/src/sl_shared_assets/data_classes/surgery_data.py +0 -0
  29. {sl_shared_assets-5.1.0 → sl_shared_assets-5.1.2}/src/sl_shared_assets/py.typed +0 -0
  30. {sl_shared_assets-5.1.0 → sl_shared_assets-5.1.2}/src/sl_shared_assets/server/__init__.py +0 -0
  31. {sl_shared_assets-5.1.0 → sl_shared_assets-5.1.2}/src/sl_shared_assets/server/job.py +0 -0
  32. {sl_shared_assets-5.1.0 → sl_shared_assets-5.1.2}/src/sl_shared_assets/server/pipeline.py +0 -0
  33. {sl_shared_assets-5.1.0 → sl_shared_assets-5.1.2}/src/sl_shared_assets/server/server.py +0 -0
  34. {sl_shared_assets-5.1.0 → sl_shared_assets-5.1.2}/src/sl_shared_assets/tools/packaging_tools.py +0 -0
  35. {sl_shared_assets-5.1.0 → sl_shared_assets-5.1.2}/src/sl_shared_assets/tools/transfer_tools.py +0 -0
  36. {sl_shared_assets-5.1.0 → sl_shared_assets-5.1.2}/tox.ini +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sl-shared-assets
3
- Version: 5.1.0
3
+ Version: 5.1.2
4
4
  Summary: Provides data acquisition and processing assets shared between Sun (NeuroAI) lab libraries.
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/
@@ -6,7 +6,7 @@ dependencies:
6
6
  - _openmp_mutex=4.5=2_gnu
7
7
  - bzip2=1.0.8=h4bc722e_7
8
8
  - ca-certificates=2025.8.3=hbd8a1cb_0
9
- - cachetools=6.1.0=pyhd8ed1ab_0
9
+ - cachetools=6.2.0=pyhd8ed1ab_0
10
10
  - chardet=5.2.0=pyhd8ed1ab_3
11
11
  - colorama=0.4.6=pyhd8ed1ab_1
12
12
  - distlib=0.4.0=pyhd8ed1ab_0
@@ -1,10 +1,10 @@
1
- List of packages in environment: "/home/cybermouse/miniforge3/envs/slsa_dev_lin"
1
+ List of packages in environment: "/home/cyberaxolotl/miniforge3/envs/slsa_dev_lin"
2
2
 
3
3
  https://conda.anaconda.org/conda-forge/linux-64/_libgcc_mutex-0.1-conda_forge.tar.bz2
4
4
  https://conda.anaconda.org/conda-forge/linux-64/_openmp_mutex-4.5-2_gnu.tar.bz2
5
5
  https://conda.anaconda.org/conda-forge/linux-64/bzip2-1.0.8-h4bc722e_7.conda
6
6
  https://conda.anaconda.org/conda-forge/noarch/ca-certificates-2025.8.3-hbd8a1cb_0.conda
7
- https://conda.anaconda.org/conda-forge/noarch/cachetools-6.1.0-pyhd8ed1ab_0.conda
7
+ https://conda.anaconda.org/conda-forge/noarch/cachetools-6.2.0-pyhd8ed1ab_0.conda
8
8
  https://conda.anaconda.org/conda-forge/noarch/chardet-5.2.0-pyhd8ed1ab_3.conda
9
9
  https://conda.anaconda.org/conda-forge/noarch/colorama-0.4.6-pyhd8ed1ab_1.conda
10
10
  https://conda.anaconda.org/conda-forge/noarch/distlib-0.4.0-pyhd8ed1ab_0.conda
@@ -6,7 +6,7 @@ build-backend = "hatchling.build"
6
6
  # Project metdata section. Provides the genral ID information about the project.
7
7
  [project]
8
8
  name = "sl-shared-assets"
9
- version = "5.1.0"
9
+ version = "5.1.2"
10
10
  description = "Provides data acquisition and processing assets shared between Sun (NeuroAI) lab libraries."
11
11
  readme = "README.md"
12
12
  license = { file = "LICENSE" }
@@ -8,7 +8,6 @@ Authors: Ivan Kondratyev (Inkaros), Kushaan Gupta, Natalie Yeung
8
8
  from ataraxis_base_utilities import console
9
9
 
10
10
  from .tools import (
11
- ProjectManifest,
12
11
  acquire_lock,
13
12
  release_lock,
14
13
  delete_directory,
@@ -86,8 +85,10 @@ __all__ = [
86
85
  "MesoscopeSystemConfiguration",
87
86
  "ProcedureData",
88
87
  "ProcessedData",
88
+ "ProcessingPipeline",
89
+ "ProcessingPipelines",
90
+ "ProcessingStatus",
89
91
  "ProcessingTracker",
90
- "ProjectManifest",
91
92
  "RawData",
92
93
  "RunTrainingDescriptor",
93
94
  "Server",
@@ -37,8 +37,10 @@ def manage() -> None:
37
37
  "--session-path",
38
38
  type=click.Path(exists=True, file_okay=False, dir_okay=True, path_type=Path),
39
39
  required=True,
40
- help="The absolute path to the root session directory to process. This directory must contain the 'raw_data' "
41
- "subdirectory.",
40
+ help=(
41
+ "The absolute path to the root session directory to process. This directory must contain the 'raw_data' "
42
+ "subdirectory."
43
+ ),
42
44
  )
43
45
  @click.option(
44
46
  "-pdr",
@@ -4,7 +4,6 @@ integrity of the data. The tools from this package are used by most other data p
4
4
  from .transfer_tools import delete_directory, transfer_directory
5
5
  from .packaging_tools import calculate_directory_checksum
6
6
  from .project_management_tools import (
7
- ProjectManifest,
8
7
  acquire_lock,
9
8
  release_lock,
10
9
  archive_session,
@@ -14,7 +13,6 @@ from .project_management_tools import (
14
13
  )
15
14
 
16
15
  __all__ = [
17
- "ProjectManifest",
18
16
  "acquire_lock",
19
17
  "archive_session",
20
18
  "calculate_directory_checksum",
@@ -661,236 +661,3 @@ def generate_project_manifest(
661
661
  # If the tracker indicates that the processing is still running, the runtime has encountered an error.
662
662
  if runtime_tracker.is_running:
663
663
  tracker.error(manager_id=manager_id)
664
-
665
-
666
- class ProjectManifest:
667
- """Wraps the contents of a Sun lab project manifest .feather file and exposes methods for visualizing and
668
- working with the data stored inside the file.
669
-
670
- This class functions as a high-level API for working with Sun lab projects. It is used both to visualize the
671
- current state of various projects and during automated data processing to determine which processing steps to
672
- apply to different sessions.
673
-
674
- Args:
675
- manifest_file: The path to the .feather manifest file that stores the target project's state data.
676
-
677
- Attributes:
678
- _data: Stores the manifest data as a Polars DataFrame.
679
- _animal_string: Determines whether animal IDs are stored as strings or unsigned integers.
680
- """
681
-
682
- def __init__(self, manifest_file: Path):
683
- # Reads the data from the target manifest file into the class attribute
684
- self._data: pl.DataFrame = pl.read_ipc(source=manifest_file, use_pyarrow=True)
685
-
686
- # Determines whether animal IDs are stored as strings or as numbers
687
- self._animal_string = False
688
- schema = self._data.collect_schema()
689
- if isinstance(schema["animal"], pl.String):
690
- self._animal_string = True
691
-
692
- def print_data(self) -> None:
693
- """Prints the entire contents of the manifest file to the terminal."""
694
- with pl.Config(
695
- set_tbl_rows=-1, # Displays all rows (-1 means unlimited)
696
- set_tbl_cols=-1, # Displays all columns (-1 means unlimited)
697
- set_tbl_hide_column_data_types=True,
698
- set_tbl_cell_alignment="LEFT",
699
- set_tbl_width_chars=250, # Sets table width to 200 characters
700
- set_fmt_str_lengths=600, # Allows longer strings to display properly (default is 32)
701
- ):
702
- print(self._data)
703
-
704
- def print_summary(self, animal: str | int | None = None) -> None:
705
- """Prints a summary view of the manifest file to the terminal, excluding the 'experimenter notes' data for
706
- each session.
707
-
708
- This data view is optimized for tracking which processing steps have been applied to each session inside the
709
- project.
710
-
711
- Args:
712
- animal: The ID of the animal for which to display the data. If an ID is provided, this method will only
713
- display the data for that animal. Otherwise, it will display the data for all animals.
714
- """
715
- summary_cols = [
716
- "animal",
717
- "date",
718
- "session",
719
- "type",
720
- "system",
721
- "complete",
722
- "integrity",
723
- "prepared",
724
- "suite2p",
725
- "behavior",
726
- "video",
727
- "archived",
728
- ]
729
-
730
- # Retrieves the data
731
- df = self._data.select(summary_cols)
732
-
733
- # Optionally filters the data for the target animal
734
- if animal is not None:
735
- # Ensures that the 'animal' argument has the same type as the data inside the DataFrame.
736
- if self._animal_string:
737
- animal = str(animal)
738
- else:
739
- animal = int(animal)
740
- df = df.filter(pl.col("animal") == animal)
741
-
742
- # Ensures the data displays properly
743
- with pl.Config(
744
- set_tbl_rows=-1,
745
- set_tbl_cols=-1,
746
- set_tbl_width_chars=250,
747
- set_tbl_hide_column_data_types=True,
748
- set_tbl_cell_alignment="CENTER",
749
- ):
750
- print(df)
751
-
752
- def print_notes(self, animal: str | int | None = None) -> None:
753
- """Prints only animal, session, and notes data from the manifest file.
754
-
755
- This data view is optimized for experimenters to check what sessions have been recorded for each animal in the
756
- project and refresh their memory on the outcomes of each session using experimenter notes.
757
-
758
- Args:
759
- animal: The ID of the animal for which to display the data. If an ID is provided, this method will only
760
- display the data for that animal. Otherwise, it will display the data for all animals.
761
- """
762
-
763
- # Pre-selects the columns to display
764
- df = self._data.select(["animal", "date", "session", "type", "system", "notes"])
765
-
766
- # Optionally filters the data for the target animal
767
- if animal is not None:
768
- # Ensures that the 'animal' argument has the same type as the data inside the DataFrame.
769
- if self._animal_string:
770
- animal = str(animal)
771
- else:
772
- animal = int(animal)
773
-
774
- df = df.filter(pl.col("animal") == animal)
775
-
776
- # Prints the extracted data
777
- with pl.Config(
778
- set_tbl_rows=-1,
779
- set_tbl_cols=-1,
780
- set_tbl_hide_column_data_types=True,
781
- set_tbl_cell_alignment="LEFT",
782
- set_tbl_width_chars=100, # Wider columns for notes
783
- set_fmt_str_lengths=800, # Allows very long strings for notes
784
- ):
785
- print(df)
786
-
787
- @property
788
- def animals(self) -> tuple[str, ...]:
789
- """Returns all unique animal IDs stored inside the manifest file.
790
-
791
- This provides a tuple of all animal IDs participating in the target project.
792
- """
793
-
794
- # If animal IDs are stored as integers, converts them to string to support consistent return types.
795
- return tuple(
796
- [str(animal) for animal in self._data.select("animal").unique().sort("animal").to_series().to_list()]
797
- )
798
-
799
- def _get_filtered_sessions(
800
- self,
801
- animal: str | int | None = None,
802
- exclude_incomplete: bool = True,
803
- ) -> tuple[str, ...]:
804
- """This worker method is used to get a list of sessions with optional filtering.
805
-
806
- User-facing methods call this worker under-the-hood to fetch the filtered tuple of sessions.
807
-
808
- Args:
809
- animal: An optional animal ID to filter the sessions. If set to None, the method returns sessions for all
810
- animals.
811
- exclude_incomplete: Determines whether to exclude sessions not marked as 'complete' from the output
812
- list.
813
-
814
- Returns:
815
- The tuple of session IDs matching the filter criteria.
816
-
817
- Raises:
818
- ValueError: If the specified animal is not found in the manifest file.
819
- """
820
- data = self._data
821
-
822
- # Filter by animal if specified
823
- if animal is not None:
824
- # Ensures that the 'animal' argument has the same type as the data inside the DataFrame.
825
- if self._animal_string:
826
- animal = str(animal)
827
- else:
828
- animal = int(animal)
829
-
830
- if animal not in self.animals:
831
- message = f"Animal ID '{animal}' not found in the project manifest. Available animals: {self.animals}."
832
- console.error(message=message, error=ValueError)
833
-
834
- data = data.filter(pl.col("animal") == animal)
835
-
836
- # Optionally filters out incomplete sessions
837
- if exclude_incomplete:
838
- data = data.filter(pl.col("complete") == 1)
839
-
840
- # Formats and returns session IDs to the caller
841
- sessions = data.select("session").sort("session").to_series().to_list()
842
- return tuple(sessions)
843
-
844
- @property
845
- def sessions(self) -> tuple[str, ...]:
846
- """Returns all session IDs stored inside the manifest file.
847
-
848
- This property provides a tuple of all sessions, independent of the participating animal, that were recorded as
849
- part of the target project. Use the get_sessions() method to get the list of session tuples with filtering.
850
- """
851
- return self._get_filtered_sessions(animal=None, exclude_incomplete=False)
852
-
853
- def get_sessions(
854
- self,
855
- animal: str | int | None = None,
856
- exclude_incomplete: bool = True,
857
- ) -> tuple[str, ...]:
858
- """Returns requested session IDs based on selected filtering criteria.
859
-
860
- This method provides a tuple of sessions based on the specified filters. If no animal is specified, returns
861
- sessions for all animals in the project.
862
-
863
- Args:
864
- animal: An optional animal ID to filter the sessions. If set to None, the method returns sessions for all
865
- animals.
866
- exclude_incomplete: Determines whether to exclude sessions not marked as 'complete' from the output
867
- list.
868
-
869
- Returns:
870
- The tuple of session IDs matching the filter criteria.
871
-
872
- Raises:
873
- ValueError: If the specified animal is not found in the manifest file.
874
- """
875
- return self._get_filtered_sessions(
876
- animal=animal,
877
- exclude_incomplete=exclude_incomplete,
878
- )
879
-
880
- def get_session_info(self, session: str) -> pl.DataFrame:
881
- """Returns a Polars DataFrame that stores detailed information for the specified session.
882
-
883
- Since session IDs are unique, it is expected that filtering by session ID is enough to get the requested
884
- information.
885
-
886
- Args:
887
- session: The ID of the session for which to retrieve the data.
888
-
889
- Returns:
890
- A Polars DataFrame with the following columns: 'animal', 'date', 'notes', 'session', 'type', 'system',
891
- 'complete', 'integrity', 'suite2p', 'behavior', 'video', 'archived'.
892
- """
893
-
894
- df = self._data
895
- df = df.filter(pl.col("session").eq(session))
896
- return df