From 9762a193c707fe97bb6c062ca3aec25c5bd5a231 Mon Sep 17 00:00:00 2001 From: MilagrosMarin Date: Fri, 22 Mar 2024 17:33:14 +0100 Subject: [PATCH 1/3] delete PyPI release --- .github/workflows/release.yaml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 6d081e2..1db6f58 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -4,14 +4,6 @@ on: jobs: make_github_release: uses: datajoint/.github/.github/workflows/make_github_release.yaml@main - pypi_release: - needs: make_github_release - uses: datajoint/.github/.github/workflows/pypi_release.yaml@main - secrets: - TWINE_USERNAME: ${{secrets.TWINE_USERNAME}} - TWINE_PASSWORD: ${{secrets.TWINE_PASSWORD}} - with: - UPLOAD_URL: ${{needs.make_github_release.outputs.release_upload_url}} mkdocs_release: uses: datajoint/.github/.github/workflows/mkdocs_release.yaml@main permissions: From a5ec467e1d5f6a446bb988f4f691466fc57c6587 Mon Sep 17 00:00:00 2001 From: MilagrosMarin Date: Fri, 22 Mar 2024 17:33:28 +0100 Subject: [PATCH 2/3] blackformatting tests --- tests/conftest.py | 31 +++++++++++++++++-------------- tests/test_pipeline.py | 35 ++++++++++++++++++++++------------- tests/tutorial_pipeline.py | 9 +-------- 3 files changed, 40 insertions(+), 35 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index 9c1724f..60c3615 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -38,7 +38,7 @@ def pipeline(): "session": pipeline.session, "model": pipeline.model, "train": pipeline.train, - "Device": pipeline.Device + "Device": pipeline.Device, } if _tear_down: @@ -80,14 +80,17 @@ def insert_upstreams(pipeline): model.VideoRecording.insert1( {**recording_key, "device": "Camera1"}, skip_duplicates=True ) - + video_files = [ - "./example_data/inbox/from_top_tracking-DataJoint-2023-10-11/videos/train1.mp4" + "./example_data/inbox/from_top_tracking-DataJoint-2023-10-11/videos/train1.mp4" ] model.VideoRecording.File.insert( - [{**recording_key, "file_id": v_idx, "file_path": Path(f)} - for v_idx, f in enumerate(video_files)], skip_duplicates=True + [ + {**recording_key, "file_id": v_idx, "file_path": Path(f)} + for v_idx, f in enumerate(video_files) + ], + skip_duplicates=True, ) yield @@ -115,19 +118,19 @@ def insert_dlc_model(pipeline): config_file_rel = "from_top_tracking-DataJoint-2023-10-11/config.yaml" model.Model.insert_new_model( - model_name="from_top_tracking_model_test", - dlc_config=config_file_rel, - shuffle=1, - trainingsetindex=0, - model_description="Model in example data: from_top_tracking model", - prompt=False - ) + model_name="from_top_tracking_model_test", + dlc_config=config_file_rel, + shuffle=1, + trainingsetindex=0, + model_description="Model in example data: from_top_tracking model", + prompt=False, + ) yield if _tear_down: model.Model.delete() - + @pytest.fixture(scope="session") def insert_pose_estimation_task(pipeline, recording_info, insert_dlc_model): @@ -139,7 +142,7 @@ def insert_pose_estimation_task(pipeline, recording_info, insert_dlc_model): "recording_id": "1", } task_key = {**recording_key, "model_name": "from_top_tracking_model_test"} - + model.PoseEstimationTask.insert1( { **task_key, diff --git a/tests/test_pipeline.py b/tests/test_pipeline.py index 07f4b35..8faf2bf 100644 --- a/tests/test_pipeline.py +++ b/tests/test_pipeline.py @@ -19,25 +19,30 @@ def test_generate_pipeline(pipeline): assert "trainingsetindex" in model.Model.heading.secondary_attributes assert "x_pos" in model.PoseEstimation.BodyPartPosition.heading.secondary_attributes assert "y_pos" in model.PoseEstimation.BodyPartPosition.heading.secondary_attributes - assert "likelihood" in model.PoseEstimation.BodyPartPosition.heading.secondary_attributes + assert ( + "likelihood" + in model.PoseEstimation.BodyPartPosition.heading.secondary_attributes + ) assert len(train.schema.list_tables()) == 5 def test_recording_info(pipeline, recording_info): model = pipeline["model"] - expected_rec_info = {'subject': 'subject6', - 'session_datetime': datetime.datetime(2021, 6, 2, 14, 4, 22), - 'recording_id': 1, - 'px_height': 500, - 'px_width': 500, - 'nframes': 60000, - 'fps': 60, - 'recording_datetime': None, - 'recording_duration': 1000.0} + expected_rec_info = { + "subject": "subject6", + "session_datetime": datetime.datetime(2021, 6, 2, 14, 4, 22), + "recording_id": 1, + "px_height": 500, + "px_width": 500, + "nframes": 60000, + "fps": 60, + "recording_datetime": None, + "recording_duration": 1000.0, + } rec_info = model.RecordingInfo.fetch1() - + assert rec_info == expected_rec_info @@ -48,8 +53,12 @@ def test_pose_estimation(pipeline, pose_estimation): assert set(body_parts) == {"head", "tailbase"} - head_x = (model.PoseEstimation.BodyPartPosition & {"body_part": "head"}).fetch1("x_pos") - tail_y = (model.PoseEstimation.BodyPartPosition & {"body_part": "tailbase"}).fetch1("y_pos") + head_x = (model.PoseEstimation.BodyPartPosition & {"body_part": "head"}).fetch1( + "x_pos" + ) + tail_y = (model.PoseEstimation.BodyPartPosition & {"body_part": "tailbase"}).fetch1( + "y_pos" + ) assert len(head_x) == len(tail_y) assert (round(head_x.std())) == 129 diff --git a/tests/tutorial_pipeline.py b/tests/tutorial_pipeline.py index 8469a02..dd502d3 100644 --- a/tests/tutorial_pipeline.py +++ b/tests/tutorial_pipeline.py @@ -56,14 +56,7 @@ def get_dlc_processed_data_dir() -> str: return None -__all__ = [ - "lab", - "subject", - "session", - "train", - "model", - "Device" -] +__all__ = ["lab", "subject", "session", "train", "model", "Device"] # Activate schemas ------------- From 9f8b21229873a2f12f5b2bd9f1241d5c11e97a21 Mon Sep 17 00:00:00 2001 From: MilagrosMarin Date: Fri, 22 Mar 2024 17:33:41 +0100 Subject: [PATCH 3/3] add last PR to CHANGELOG and bump version --- CHANGELOG.md | 11 +++++++++-- element_deeplabcut/version.py | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4f5057c..5efaef4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,13 +3,20 @@ Observes [Semantic Versioning](https://semver.org/spec/v2.0.0.html) standard and [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) convention. -## [0.2.11] - 2023-01-04 +## [0.2.12] - 2024-03-22 + ++ Add - pytest ++ Fix - minor bugfix in tests ++ Update - clean up notebook ++ Update - Elements installed directly from GitHub instead of PyPI ++ Update - Black formatting `tests` + +## [0.2.11] - 2024-01-04 + Fix - docstring typo + Fix - `dj.config()` setup moved to `tutorial_pipeline.py` instead of `__init__.py` + Bugfix - Resolved AttributeError from the latest update of the YAML dependency + Update - Flowchart images to increase consistency with other DataJoint Elements -+ Update - Elements installed directly from GitHub instead of PyPI ## [0.2.10] - 2023-11-20 diff --git a/element_deeplabcut/version.py b/element_deeplabcut/version.py index 1ce9d0b..9d31bd6 100644 --- a/element_deeplabcut/version.py +++ b/element_deeplabcut/version.py @@ -1,4 +1,4 @@ """ Package metadata """ -__version__ = "0.2.11" +__version__ = "0.2.12"