npc-sync 0.2.2__tar.gz → 0.2.4__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: npc-sync
3
- Version: 0.2.2
3
+ Version: 0.2.4
4
4
  Summary: Repackaging of AllenSDK.SyncDataset with extra functionality, compatible with data in the cloud.
5
5
  Author-email: Ben Hardcastle <ben.hardcastle@alleninstitue.org>
6
6
  License: MIT
@@ -16,7 +16,7 @@ dependencies = [
16
16
  "scipy>=1.13.1",
17
17
  "npc-stim>=0.1.14",
18
18
  ]
19
- version = "0.2.2"
19
+ version = "0.2.4"
20
20
  classifiers = [
21
21
  "Development Status :: 3 - Alpha",
22
22
  "Programming Language :: Python :: 3",
@@ -222,7 +222,8 @@ class SyncDataset:
222
222
  stim_paths: Iterable[npc_io.PathLike] | None = None,
223
223
  ) -> None:
224
224
  if isinstance(path, self.__class__):
225
- self = path
225
+ self.path = path.path
226
+ self.dfile = path.dfile
226
227
  else:
227
228
  self.path = npc_io.from_pathlike(path)
228
229
  self.dfile = self.load(path)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: npc-sync
3
- Version: 0.2.2
3
+ Version: 0.2.4
4
4
  Summary: Repackaging of AllenSDK.SyncDataset with extra functionality, compatible with data in the cloud.
5
5
  Author-email: Ben Hardcastle <ben.hardcastle@alleninstitue.org>
6
6
  License: MIT
@@ -0,0 +1,30 @@
1
+ import npc_sync
2
+
3
+
4
+ def test_import_package():
5
+ pass
6
+
7
+
8
+ def test_no_stim_paths_and_meta_data() -> None:
9
+ """Constructing SyncDataset without stim_paths leaves stim_paths as None,
10
+ and meta_data is accessible and contains expected keys."""
11
+ s = npc_sync.SyncDataset(
12
+ "s3://aind-ephys-data/ecephys_662892_2023-08-21_12-43-45/behavior/20230821T124345.h5"
13
+ )
14
+ assert s.stim_paths is None
15
+ meta = s.meta_data
16
+ assert isinstance(meta, dict)
17
+ assert "line_labels" in meta
18
+
19
+
20
+ def test_init_from_instance_and_meta_data() -> None:
21
+ """Constructing SyncDataset from an existing instance reuses it,
22
+ and meta_data is still accessible with expected keys."""
23
+ s = npc_sync.SyncDataset(
24
+ "s3://aind-ephys-data/ecephys_662892_2023-08-21_12-43-45/behavior/20230821T124345.h5"
25
+ )
26
+ s2 = npc_sync.SyncDataset(s)
27
+ assert s2.stim_paths is None
28
+ meta = s2.meta_data
29
+ assert isinstance(meta, dict)
30
+ assert "line_labels" in meta
@@ -1,5 +0,0 @@
1
- import npc_sync
2
-
3
-
4
- def test_import_package():
5
- pass
File without changes
File without changes
File without changes
File without changes
File without changes