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

Enable testing arm64 Mac architecture in the CI. #1061

Merged
merged 19 commits into from
Sep 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
c634948
add mac latest to CI
h-mayorquin Sep 6, 2024
f64fe7a
remove pytables from deep lab cut dependencies
h-mayorquin Sep 7, 2024
b051673
try the latest version of pytables
h-mayorquin Sep 7, 2024
413cd28
try requirements again
h-mayorquin Sep 7, 2024
65c5a65
fix conditions
h-mayorquin Sep 7, 2024
016282e
Merge branch 'main' into enable_support_for_latest_mac_architecture
h-mayorquin Sep 7, 2024
5b95ba8
add missing skips
h-mayorquin Sep 9, 2024
74e5d12
skip with conftest
h-mayorquin Sep 10, 2024
1110201
Merge branch 'main' into enable_support_for_latest_mac_architecture
h-mayorquin Sep 11, 2024
409b73d
Merge branch 'main' into enable_support_for_latest_mac_architecture
h-mayorquin Sep 12, 2024
56ffb55
fix version comparison
h-mayorquin Sep 12, 2024
92c19f5
Merge remote-tracking branch 'refs/remotes/origin/enable_support_for_…
h-mayorquin Sep 12, 2024
75b1602
Merge branch 'main' into enable_support_for_latest_mac_architecture
h-mayorquin Sep 12, 2024
00b9ce8
Update src/neuroconv/datainterfaces/behavior/deeplabcut/_dlc_utils.py
h-mayorquin Sep 13, 2024
0edbf85
Merge branch 'main' into enable_support_for_latest_mac_architecture
h-mayorquin Sep 13, 2024
2c74840
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 13, 2024
e0770a8
restore thing that I dumbly removed
h-mayorquin Sep 13, 2024
69e3ddf
Merge branch 'main' into enable_support_for_latest_mac_architecture
h-mayorquin Sep 16, 2024
e4461c2
Merge branch 'main' into enable_support_for_latest_mac_architecture
h-mayorquin Sep 16, 2024
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
2 changes: 1 addition & 1 deletion .github/workflows/doctests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]
os: [ubuntu-latest, macos-13, windows-latest]
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v4
- run: git fetch --prune --unshallow --tags
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/live-service-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]
os: [ubuntu-latest, macos-13, windows-latest]
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v4
- run: git fetch --prune --unshallow --tags
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]
os: [ubuntu-latest, macos-13, windows-latest]
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v4
- run: git fetch --prune --unshallow --tags
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@


## Improvements
* Testing on mac sillicon [PR #1061](https://github.com/catalystneuro/neuroconv/pull/1061)
* Add writing to zarr test for to the test on data [PR #1056](https://github.com/catalystneuro/neuroconv/pull/1056)
* Modified the CI to avoid running doctests twice [PR #1077](https://github.com/catalystneuro/neuroconv/pull/#1077)

Expand Down
16 changes: 16 additions & 0 deletions docs/conversion_examples_gallery/conftest.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import platform
from pathlib import Path

import pytest
from packaging import version

from tests.test_on_data.setup_paths import (
BEHAVIOR_DATA_PATH,
Expand All @@ -19,3 +21,17 @@ def add_data_space(doctest_namespace, tmp_path):

doctest_namespace["path_to_save_nwbfile"] = Path(tmp_path) / "doctest_file.nwb"
doctest_namespace["output_folder"] = Path(tmp_path)



python_version = platform.python_version()
os = platform.system()
# Hook to conditionally skip doctests in deeplabcut.rst for Python 3.9 on macOS (Darwin)
def pytest_runtest_setup(item):
if isinstance(item, pytest.DoctestItem):
# Check if we are running the doctest from deeplabcut.rst
test_file = Path(item.fspath)
if test_file.name == "deeplabcut.rst":
# Check if Python version is 3.9 and platform is Darwin (macOS)
if version.parse(python_version) < version.parse("3.10") and os == "Darwin":
pytest.skip("Skipping doctests for deeplabcut.rst on Python 3.9 and macOS")
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,10 @@ def add_subject_to_nwbfile(
video_name, scorer = h5file.stem.split("DLC")
scorer = "DLC" + scorer

df = _ensure_individuals_in_header(pd.read_hdf(h5file), individual_name)
# TODO probably could be read directly with h5py
# This requires pytables
data_frame_from_hdf5 = pd.read_hdf(h5file)
h-mayorquin marked this conversation as resolved.
Show resolved Hide resolved
df = _ensure_individuals_in_header(data_frame_from_hdf5, individual_name)

# Note the video here is a tuple of the video path and the image shape
if config_file is not None:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
tables<3.9.2;sys_platform=="darwin"
tables;sys_platform=="linux" or sys_platform=="win32"
tables>=3.10.1; platform_system == 'Darwin' and python_version >= '3.10'
tables; platform_system != 'Darwin'
ndx-pose==0.1.1
neuroconv[video]
20 changes: 20 additions & 0 deletions tests/test_on_data/behavior/test_behavior_interfaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,18 @@ class TestFicTracDataInterfaceTiming(TemporalAlignmentMixin):
save_directory = OUTPUT_PATH


from platform import python_version

from packaging import version

python_version = version.parse(python_version())
from sys import platform


@pytest.mark.skipif(
platform == "darwin" and python_version < version.parse("3.10"),
reason="interface not supported on macOS with Python < 3.10",
)
class TestDeepLabCutInterface(DeepLabCutInterfaceMixin):
data_interface_cls = DeepLabCutInterface
interface_kwargs = dict(
Expand Down Expand Up @@ -365,6 +377,10 @@ def check_read_nwb(self, nwbfile_path: str):
assert all(expected_pose_estimation_series_are_in_nwb_file)


@pytest.mark.skipif(
platform == "darwin" and python_version < version.parse("3.10"),
reason="interface not supported on macOS with Python < 3.10",
)
class TestDeepLabCutInterfaceNoConfigFile(DataInterfaceTestMixin):
data_interface_cls = DeepLabCutInterface
interface_kwargs = dict(
Expand All @@ -391,6 +407,10 @@ def check_read_nwb(self, nwbfile_path: str):
assert all(expected_pose_estimation_series_are_in_nwb_file)


@pytest.mark.skipif(
platform == "darwin" and python_version < version.parse("3.10"),
reason="interface not supported on macOS with Python < 3.10",
)
class TestDeepLabCutInterfaceSetTimestamps(DeepLabCutInterfaceMixin):
data_interface_cls = DeepLabCutInterface
interface_kwargs = dict(
Expand Down
Loading