nwb-video-widgets 0.1.2__tar.gz → 0.1.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.
Files changed (36) hide show
  1. nwb_video_widgets-0.1.4/CHANGELOG.md +22 -0
  2. {nwb_video_widgets-0.1.2 → nwb_video_widgets-0.1.4}/PKG-INFO +1 -1
  3. {nwb_video_widgets-0.1.2 → nwb_video_widgets-0.1.4}/pyproject.toml +1 -1
  4. {nwb_video_widgets-0.1.2 → nwb_video_widgets-0.1.4}/src/nwb_video_widgets/dandi_pose_widget.py +3 -2
  5. {nwb_video_widgets-0.1.2 → nwb_video_widgets-0.1.4}/src/nwb_video_widgets/dandi_video_widget.py +3 -2
  6. {nwb_video_widgets-0.1.2 → nwb_video_widgets-0.1.4}/src/nwb_video_widgets/video_widget.py +3 -2
  7. nwb_video_widgets-0.1.4/tests/integration/test_dandi_path_construction.py +38 -0
  8. {nwb_video_widgets-0.1.2 → nwb_video_widgets-0.1.4}/.github/workflows/auto-publish.yml +0 -0
  9. {nwb_video_widgets-0.1.2 → nwb_video_widgets-0.1.4}/.github/workflows/tests.yml +0 -0
  10. {nwb_video_widgets-0.1.2 → nwb_video_widgets-0.1.4}/.gitignore +0 -0
  11. {nwb_video_widgets-0.1.2 → nwb_video_widgets-0.1.4}/LICENSE +0 -0
  12. {nwb_video_widgets-0.1.2 → nwb_video_widgets-0.1.4}/README.md +0 -0
  13. {nwb_video_widgets-0.1.2 → nwb_video_widgets-0.1.4}/assets/pose_estimation_preprocessed.gif +0 -0
  14. {nwb_video_widgets-0.1.2 → nwb_video_widgets-0.1.4}/assets/video_widget_preprocessed.gif +0 -0
  15. {nwb_video_widgets-0.1.2 → nwb_video_widgets-0.1.4}/documentation/design/intro.md +0 -0
  16. {nwb_video_widgets-0.1.2 → nwb_video_widgets-0.1.4}/documentation/design/pose_estimation_widget/intro.md +0 -0
  17. {nwb_video_widgets-0.1.2 → nwb_video_widgets-0.1.4}/documentation/design/video_widget/intro.md +0 -0
  18. {nwb_video_widgets-0.1.2 → nwb_video_widgets-0.1.4}/documentation/design/video_widget/local_video_serving.md +0 -0
  19. {nwb_video_widgets-0.1.2 → nwb_video_widgets-0.1.4}/documentation/design/video_widget/video_synchronization.md +0 -0
  20. {nwb_video_widgets-0.1.2 → nwb_video_widgets-0.1.4}/src/nwb_video_widgets/__init__.py +0 -0
  21. {nwb_video_widgets-0.1.2 → nwb_video_widgets-0.1.4}/src/nwb_video_widgets/_utils.py +0 -0
  22. {nwb_video_widgets-0.1.2 → nwb_video_widgets-0.1.4}/src/nwb_video_widgets/local_pose_widget.py +0 -0
  23. {nwb_video_widgets-0.1.2 → nwb_video_widgets-0.1.4}/src/nwb_video_widgets/local_video_widget.py +0 -0
  24. {nwb_video_widgets-0.1.2 → nwb_video_widgets-0.1.4}/src/nwb_video_widgets/pose_widget.css +0 -0
  25. {nwb_video_widgets-0.1.2 → nwb_video_widgets-0.1.4}/src/nwb_video_widgets/pose_widget.js +0 -0
  26. {nwb_video_widgets-0.1.2 → nwb_video_widgets-0.1.4}/src/nwb_video_widgets/video_widget.css +0 -0
  27. {nwb_video_widgets-0.1.2 → nwb_video_widgets-0.1.4}/src/nwb_video_widgets/video_widget.js +0 -0
  28. {nwb_video_widgets-0.1.2 → nwb_video_widgets-0.1.4}/tests/__init__.py +0 -0
  29. {nwb_video_widgets-0.1.2 → nwb_video_widgets-0.1.4}/tests/conftest.py +0 -0
  30. {nwb_video_widgets-0.1.2 → nwb_video_widgets-0.1.4}/tests/fixtures/__init__.py +0 -0
  31. {nwb_video_widgets-0.1.2 → nwb_video_widgets-0.1.4}/tests/fixtures/synthetic_nwb.py +0 -0
  32. {nwb_video_widgets-0.1.2 → nwb_video_widgets-0.1.4}/tests/fixtures/synthetic_video.py +0 -0
  33. {nwb_video_widgets-0.1.2 → nwb_video_widgets-0.1.4}/tests/integration/__init__.py +0 -0
  34. {nwb_video_widgets-0.1.2 → nwb_video_widgets-0.1.4}/tests/integration/test_local_roundtrip.py +0 -0
  35. {nwb_video_widgets-0.1.2 → nwb_video_widgets-0.1.4}/tests/test_local_video_widget.py +0 -0
  36. {nwb_video_widgets-0.1.2 → nwb_video_widgets-0.1.4}/tests/test_utils.py +0 -0
@@ -0,0 +1,22 @@
1
+ # v0.1.4 (Upcoming)
2
+
3
+ ## Removals, Deprecations and Changes
4
+
5
+ ## Bug Fixes
6
+
7
+ ## Features
8
+
9
+ ## Improvements
10
+
11
+ # v0.1.3 (2025-02-2)
12
+
13
+ ## Removals, Deprecations and Changes
14
+
15
+ ## Bug Fixes
16
+
17
+ * Fixed DANDI widget path construction on Windows. On Windows, `pathlib.Path` produces backslashes when converting to string, but DANDI asset paths always use forward slashes. Switched to `PurePosixPath` for DANDI path construction. [PR #2](https://github.com/catalystneuro/nwb-video-widgets/pull/2)
18
+
19
+ ## Features
20
+
21
+ ## Improvements
22
+
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: nwb-video-widgets
3
- Version: 0.1.2
3
+ Version: 0.1.4
4
4
  Summary: Interactive Jupyter widgets for NWB video and pose visualization
5
5
  Project-URL: Homepage, https://github.com/catalystneuro/nwb-video-widgets
6
6
  Project-URL: Repository, https://github.com/catalystneuro/nwb-video-widgets
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "nwb-video-widgets"
7
- version = "0.1.2"
7
+ version = "0.1.4"
8
8
  description = "Interactive Jupyter widgets for NWB video and pose visualization"
9
9
  readme = "README.md"
10
10
  license = "MIT"
@@ -3,7 +3,7 @@
3
3
  from __future__ import annotations
4
4
 
5
5
  import pathlib
6
- from pathlib import Path
6
+ from pathlib import PurePosixPath
7
7
  from typing import TYPE_CHECKING, Optional
8
8
 
9
9
  import anywidget
@@ -283,7 +283,8 @@ class NWBDANDIPoseEstimationWidget(anywidget.AnyWidget):
283
283
  client = DandiAPIClient()
284
284
  dandiset = client.get_dandiset(asset.dandiset_id, asset.version_id)
285
285
 
286
- nwb_parent = Path(asset.path).parent
286
+ # Use PurePosixPath because DANDI paths always use forward slashes
287
+ nwb_parent = PurePosixPath(asset.path).parent
287
288
  video_series = discover_video_series(nwbfile)
288
289
  video_urls = {}
289
290
 
@@ -3,7 +3,7 @@
3
3
  from __future__ import annotations
4
4
 
5
5
  import pathlib
6
- from pathlib import Path
6
+ from pathlib import PurePosixPath
7
7
  from typing import TYPE_CHECKING, Optional
8
8
 
9
9
  import anywidget
@@ -195,7 +195,8 @@ class NWBDANDIVideoPlayer(anywidget.AnyWidget):
195
195
  client = DandiAPIClient()
196
196
  dandiset = client.get_dandiset(asset.dandiset_id, asset.version_id)
197
197
 
198
- nwb_parent = Path(asset.path).parent
198
+ # Use PurePosixPath because DANDI paths always use forward slashes
199
+ nwb_parent = PurePosixPath(asset.path).parent
199
200
  video_series = discover_video_series(nwbfile)
200
201
  video_urls = {}
201
202
 
@@ -108,14 +108,15 @@ class NWBFileVideoPlayer(anywidget.AnyWidget):
108
108
  ... nwbfile_raw, dandi_asset
109
109
  ... )
110
110
  """
111
- from pathlib import Path
111
+ from pathlib import PurePosixPath
112
112
 
113
113
  from pynwb.image import ImageSeries
114
114
 
115
115
  # Derive dandiset from dandi_asset
116
116
  dandiset = dandi_asset.client.get_dandiset(dandi_asset.dandiset_id)
117
117
 
118
- nwb_parent = Path(dandi_asset.path).parent
118
+ # Use PurePosixPath because DANDI paths always use forward slashes
119
+ nwb_parent = PurePosixPath(dandi_asset.path).parent
119
120
  video_urls = {}
120
121
 
121
122
  for name, obj in nwbfile_raw.acquisition.items():
@@ -0,0 +1,38 @@
1
+ """Integration test for DANDI path construction on Windows.
2
+
3
+ Regression test for: https://github.com/CodyCBakerPhD/dandi-open-data-tutorial/pull/5
4
+
5
+ On Windows, pathlib.Path produces backslashes when converting to string,
6
+ but DANDI asset paths always use forward slashes. This test verifies that
7
+ video asset paths are constructed correctly on all platforms.
8
+ """
9
+
10
+ import pytest
11
+
12
+ from nwb_video_widgets import NWBDANDIPoseEstimationWidget
13
+
14
+
15
+ @pytest.mark.integration
16
+ def test_dandi_video_path_construction():
17
+ """Test that DANDI video paths are constructed with forward slashes on any OS."""
18
+ from dandi.dandiapi import DandiAPIClient
19
+
20
+ client = DandiAPIClient()
21
+ dandiset = client.get_dandiset("000409", "draft")
22
+
23
+ session_eid = "64e3fb86-928c-4079-865c-b364205b502e"
24
+ session_assets = [asset for asset in dandiset.get_assets() if session_eid in asset.path]
25
+ raw_asset = next((asset for asset in session_assets if "desc-raw" in asset.path), None)
26
+ processed_asset = next((asset for asset in session_assets if "desc-processed" in asset.path), None)
27
+
28
+ # This would fail on Windows before the fix with:
29
+ # NotFoundError: No asset at path 'sub-NYU-46\\sub-NYU-46_ses-...\\video.mp4'
30
+ widget = NWBDANDIPoseEstimationWidget(
31
+ asset=processed_asset,
32
+ video_asset=raw_asset,
33
+ )
34
+
35
+ # Verify video URLs were resolved (paths constructed correctly)
36
+ assert len(widget.video_name_to_url) > 0
37
+ for url in widget.video_name_to_url.values():
38
+ assert url.startswith("https://")