From c634948e2b662ea58b584365210dabf8037cdf30 Mon Sep 17 00:00:00 2001 From: Heberto Mayorquin Date: Fri, 6 Sep 2024 16:37:13 -0600 Subject: [PATCH 01/10] add mac latest to CI --- .github/workflows/doctests.yml | 2 +- .github/workflows/testing.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/doctests.yml b/.github/workflows/doctests.yml index c3e467fe0..42af37800 100644 --- a/.github/workflows/doctests.yml +++ b/.github/workflows/doctests.yml @@ -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 diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 1d0fb9429..2e6528e4a 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -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 From f64fe7ad712de800ed563e9866326a5e90bda583 Mon Sep 17 00:00:00 2001 From: Heberto Mayorquin Date: Fri, 6 Sep 2024 18:39:06 -0600 Subject: [PATCH 02/10] remove pytables from deep lab cut dependencies --- .../datainterfaces/behavior/deeplabcut/requirements.txt | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/neuroconv/datainterfaces/behavior/deeplabcut/requirements.txt b/src/neuroconv/datainterfaces/behavior/deeplabcut/requirements.txt index 03e0ee0b0..73aa32089 100644 --- a/src/neuroconv/datainterfaces/behavior/deeplabcut/requirements.txt +++ b/src/neuroconv/datainterfaces/behavior/deeplabcut/requirements.txt @@ -1,4 +1,2 @@ -tables<3.9.2;sys_platform=="darwin" -tables;sys_platform=="linux" or sys_platform=="win32" ndx-pose==0.1.1 neuroconv[video] From b0516732c204055c557c588eaaa6530252de2a43 Mon Sep 17 00:00:00 2001 From: Heberto Mayorquin Date: Fri, 6 Sep 2024 20:52:18 -0600 Subject: [PATCH 03/10] try the latest version of pytables --- .../datainterfaces/behavior/deeplabcut/_dlc_utils.py | 4 +++- .../datainterfaces/behavior/deeplabcut/requirements.txt | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/neuroconv/datainterfaces/behavior/deeplabcut/_dlc_utils.py b/src/neuroconv/datainterfaces/behavior/deeplabcut/_dlc_utils.py index 26c5b15fe..7113f4c73 100644 --- a/src/neuroconv/datainterfaces/behavior/deeplabcut/_dlc_utils.py +++ b/src/neuroconv/datainterfaces/behavior/deeplabcut/_dlc_utils.py @@ -379,7 +379,9 @@ 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) + data_frame_from_hdf5 = pd.read_hdf(h5file) + + 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: diff --git a/src/neuroconv/datainterfaces/behavior/deeplabcut/requirements.txt b/src/neuroconv/datainterfaces/behavior/deeplabcut/requirements.txt index 73aa32089..9f4e807a3 100644 --- a/src/neuroconv/datainterfaces/behavior/deeplabcut/requirements.txt +++ b/src/neuroconv/datainterfaces/behavior/deeplabcut/requirements.txt @@ -1,2 +1,3 @@ +tables>=3.10.1.;sys_platform=="darwin" ndx-pose==0.1.1 neuroconv[video] From 413cd281fbd0a2bb96d5b4448fc73606ea9e09ba Mon Sep 17 00:00:00 2001 From: Heberto Mayorquin Date: Fri, 6 Sep 2024 21:05:41 -0600 Subject: [PATCH 04/10] try requirements again --- .../datainterfaces/behavior/deeplabcut/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/neuroconv/datainterfaces/behavior/deeplabcut/requirements.txt b/src/neuroconv/datainterfaces/behavior/deeplabcut/requirements.txt index 9f4e807a3..f44ec746c 100644 --- a/src/neuroconv/datainterfaces/behavior/deeplabcut/requirements.txt +++ b/src/neuroconv/datainterfaces/behavior/deeplabcut/requirements.txt @@ -1,3 +1,3 @@ -tables>=3.10.1.;sys_platform=="darwin" +tables>=3.10.1 ndx-pose==0.1.1 neuroconv[video] From 65c5a6584e824a7ec4cc39c1b39b5ec318544db9 Mon Sep 17 00:00:00 2001 From: Heberto Mayorquin Date: Fri, 6 Sep 2024 21:47:37 -0600 Subject: [PATCH 05/10] fix conditions --- .github/workflows/live-service-testing.yml | 2 +- CHANGELOG.md | 1 + .../behavior/deeplabcut/requirements.txt | 4 ++-- .../behavior/test_behavior_interfaces.py | 12 ++++++++++++ 4 files changed, 16 insertions(+), 3 deletions(-) diff --git a/.github/workflows/live-service-testing.yml b/.github/workflows/live-service-testing.yml index 28be2d94a..c35cf8a06 100644 --- a/.github/workflows/live-service-testing.yml +++ b/.github/workflows/live-service-testing.yml @@ -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 diff --git a/CHANGELOG.md b/CHANGELOG.md index cd1580540..8265456ec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ ### Improvements * Using ruff to enforce existence of public classes' docstrings [PR #1034](https://github.com/catalystneuro/neuroconv/pull/1034) * Separated tests that use external data by modality [PR #1049](https://github.com/catalystneuro/neuroconv/pull/1049) +* Testing on mac sillicon [PR #1061](https://github.com/catalystneuro/neuroconv/pull/1061) diff --git a/src/neuroconv/datainterfaces/behavior/deeplabcut/requirements.txt b/src/neuroconv/datainterfaces/behavior/deeplabcut/requirements.txt index f44ec746c..3a5f2fd19 100644 --- a/src/neuroconv/datainterfaces/behavior/deeplabcut/requirements.txt +++ b/src/neuroconv/datainterfaces/behavior/deeplabcut/requirements.txt @@ -1,3 +1,3 @@ -tables>=3.10.1 +tables>=3.10.1; platform_system == 'Darwin' and python_version >= '3.10' +tables; platform_system != 'Darwin' ndx-pose==0.1.1 -neuroconv[video] diff --git a/tests/test_on_data/behavior/test_behavior_interfaces.py b/tests/test_on_data/behavior/test_behavior_interfaces.py index 348d37c49..559a9fe75 100644 --- a/tests/test_on_data/behavior/test_behavior_interfaces.py +++ b/tests/test_on_data/behavior/test_behavior_interfaces.py @@ -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( From 5b95ba8e40fbe992016511effdff8386ab1da066 Mon Sep 17 00:00:00 2001 From: Heberto Mayorquin Date: Mon, 9 Sep 2024 09:18:14 -0600 Subject: [PATCH 06/10] add missing skips --- tests/test_on_data/behavior/test_behavior_interfaces.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/test_on_data/behavior/test_behavior_interfaces.py b/tests/test_on_data/behavior/test_behavior_interfaces.py index 559a9fe75..8e3e01d61 100644 --- a/tests/test_on_data/behavior/test_behavior_interfaces.py +++ b/tests/test_on_data/behavior/test_behavior_interfaces.py @@ -377,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( @@ -403,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( From 56ffb55fafa5b4d6230e04114d20ed5c10a21ed4 Mon Sep 17 00:00:00 2001 From: Heberto Mayorquin Date: Wed, 11 Sep 2024 18:41:47 -0600 Subject: [PATCH 07/10] fix version comparison --- CHANGELOG.md | 2 +- docs/conversion_examples_gallery/conftest.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e2cdf44e8..e811d6ba6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,7 @@ # Upcoming ## Bug Fixes -Fixed a setup bug introduced in `v0.6.2` where installation process created a directory instead of a file for test configuration file [PR #1070](https://github.com/catalystneuro/neuroconv/pull/1070) +* Fixed a setup bug introduced in `v0.6.2` where installation process created a directory instead of a file for test configuration file [PR #1070](https://github.com/catalystneuro/neuroconv/pull/1070) ## Deprecations diff --git a/docs/conversion_examples_gallery/conftest.py b/docs/conversion_examples_gallery/conftest.py index 454fb0cae..91b530024 100644 --- a/docs/conversion_examples_gallery/conftest.py +++ b/docs/conversion_examples_gallery/conftest.py @@ -22,16 +22,16 @@ def add_data_space(doctest_namespace, tmp_path): doctest_namespace["path_to_save_nwbfile"] = Path(tmp_path) / "file.nwb" doctest_namespace["output_folder"] = Path(tmp_path) -# Hook to conditionally skip doctests in deeplabcut.rst for Python 3.9 on macOS (Darwin) + 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.9") and os == "Darwin": + 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") From 00b9ce8c43ca0e262313f06c08ca5d97a40aed5c Mon Sep 17 00:00:00 2001 From: Heberto Mayorquin Date: Fri, 13 Sep 2024 11:25:02 -0600 Subject: [PATCH 08/10] Update src/neuroconv/datainterfaces/behavior/deeplabcut/_dlc_utils.py --- src/neuroconv/datainterfaces/behavior/deeplabcut/_dlc_utils.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/neuroconv/datainterfaces/behavior/deeplabcut/_dlc_utils.py b/src/neuroconv/datainterfaces/behavior/deeplabcut/_dlc_utils.py index 7113f4c73..b2199f4ca 100644 --- a/src/neuroconv/datainterfaces/behavior/deeplabcut/_dlc_utils.py +++ b/src/neuroconv/datainterfaces/behavior/deeplabcut/_dlc_utils.py @@ -379,7 +379,6 @@ def add_subject_to_nwbfile( video_name, scorer = h5file.stem.split("DLC") scorer = "DLC" + scorer - data_frame_from_hdf5 = pd.read_hdf(h5file) df = _ensure_individuals_in_header(data_frame_from_hdf5, individual_name) From 2c74840d0043d7dd7060b18db4686473735223d4 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 13 Sep 2024 17:25:33 +0000 Subject: [PATCH 09/10] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/neuroconv/datainterfaces/behavior/deeplabcut/_dlc_utils.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/neuroconv/datainterfaces/behavior/deeplabcut/_dlc_utils.py b/src/neuroconv/datainterfaces/behavior/deeplabcut/_dlc_utils.py index b2199f4ca..ac35f6e58 100644 --- a/src/neuroconv/datainterfaces/behavior/deeplabcut/_dlc_utils.py +++ b/src/neuroconv/datainterfaces/behavior/deeplabcut/_dlc_utils.py @@ -379,7 +379,6 @@ def add_subject_to_nwbfile( video_name, scorer = h5file.stem.split("DLC") scorer = "DLC" + scorer - 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 From e0770a85c0398ce91e7f3f3ce2b7f7b561813c0f Mon Sep 17 00:00:00 2001 From: Heberto Mayorquin Date: Fri, 13 Sep 2024 14:44:08 -0600 Subject: [PATCH 10/10] restore thing that I dumbly removed --- src/neuroconv/datainterfaces/behavior/deeplabcut/_dlc_utils.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/neuroconv/datainterfaces/behavior/deeplabcut/_dlc_utils.py b/src/neuroconv/datainterfaces/behavior/deeplabcut/_dlc_utils.py index ac35f6e58..9e368fb39 100644 --- a/src/neuroconv/datainterfaces/behavior/deeplabcut/_dlc_utils.py +++ b/src/neuroconv/datainterfaces/behavior/deeplabcut/_dlc_utils.py @@ -379,6 +379,9 @@ def add_subject_to_nwbfile( video_name, scorer = h5file.stem.split("DLC") scorer = "DLC" + scorer + # TODO probably could be read directly with h5py + # This requires pytables + data_frame_from_hdf5 = pd.read_hdf(h5file) 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