Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dependency management #118

Merged
merged 6 commits into from
Sep 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ dependencies:
- ffmpeg
- imageio
- imageio-ffmpeg >=0.5.0
- av
- attrs
- pandas
- simplejson
Expand All @@ -17,7 +16,7 @@ dependencies:
- numpy
- opencv
- pynwb
- ndx-pose
- ndx-pose<0.2.0
- pytest
- pytest-cov
- black
Expand Down
11 changes: 2 additions & 9 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,11 @@ dependencies = [
"attrs",
"h5py>=3.8.0",
"pynwb",
"ndx-pose",
"ndx-pose<0.2.0",
"pandas",
"simplejson",
"imageio",
"imageio-ffmpeg>=0.5.0",
"av"]
"imageio-ffmpeg>=0.5.0"]
dynamic = ["version", "readme"]

[tool.setuptools.dynamic]
Expand Down Expand Up @@ -67,9 +66,3 @@ line-length = 88
[pydocstyle]
convention = "google"
match-dir = "sleap_io"

[tool.coverage.run]
source = ["livecov"]

[tool.pytest.ini_options]
addopts = "--cov sleap_io --cov-report=lcov:lcov.info --cov-report=term"
2 changes: 1 addition & 1 deletion sleap_io/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

# Define package version.
# This is read dynamically by setuptools in pyproject.toml to determine the release version.
__version__ = "0.1.8"
__version__ = "0.1.9"
36 changes: 22 additions & 14 deletions tests/io/test_video_backends.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ def test_get_frame(centered_pair_low_quality_path):

@pytest.mark.parametrize("keep_open", [False, True])
def test_mediavideo(centered_pair_low_quality_path, keep_open):
# Test with FFMPEG backend
backend = VideoBackend.from_filename(
centered_pair_low_quality_path, plugin="FFMPEG", keep_open=keep_open
)
Expand All @@ -74,21 +75,28 @@ def test_mediavideo(centered_pair_low_quality_path, keep_open):
else:
assert backend._open_reader is None

backend = VideoBackend.from_filename(
centered_pair_low_quality_path, plugin="pyav", keep_open=keep_open
)
assert type(backend) == MediaVideo
assert backend.filename == centered_pair_low_quality_path
assert backend.shape == (1100, 384, 384, 1)
assert backend[0].shape == (384, 384, 1)
assert backend[:3].shape == (3, 384, 384, 1)
if keep_open:
assert backend._open_reader is not None
assert backend[0].shape == (384, 384, 1)
assert type(backend._open_reader).__name__ == "PyAVPlugin"
else:
assert backend._open_reader is None
# Test with pyav backend (if installed)
try:
import av

backend = VideoBackend.from_filename(
centered_pair_low_quality_path, plugin="pyav", keep_open=keep_open
)
assert type(backend) == MediaVideo
assert backend.filename == centered_pair_low_quality_path
assert backend.shape == (1100, 384, 384, 1)
assert backend[0].shape == (384, 384, 1)
assert backend[:3].shape == (3, 384, 384, 1)
if keep_open:
assert backend._open_reader is not None
assert backend[0].shape == (384, 384, 1)
assert type(backend._open_reader).__name__ == "PyAVPlugin"
else:
assert backend._open_reader is None
except ImportError:
pass

# Test with opencv backend
backend = VideoBackend.from_filename(
centered_pair_low_quality_path, plugin="opencv", keep_open=keep_open
)
Expand Down
Loading