Package updates - #104
Conversation
WalkthroughFive testing snapshot extension modules had private attributes and methods made public (leading underscores removed); Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
🔇 Additional comments (4)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (2)
pyopenms_viz/testing/NumpySnapshotExtension.py (1)
35-36: Consider using more specific exception handling.The bare
exceptclause catches all exceptions, including system-exiting exceptions likeKeyboardInterruptandSystemExit. Consider catching specific exceptions (e.g.,AssertionError,ValueError,TypeError) for better debugging.- except: + except (AssertionError, ValueError, TypeError): return Falsepyopenms_viz/testing/PandasSnapshotExtension.py (1)
31-32: Consider using more specific exception handling.The bare
exceptclause catches all exceptions. For better error diagnosis, consider catching specific exception types.- except: + except (AssertionError, ValueError, TypeError): return False
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (6)
pyopenms_viz/testing/BokehSnapshotExtension.py(3 hunks)pyopenms_viz/testing/MatplotlibSnapshotExtension.py(3 hunks)pyopenms_viz/testing/NumpySnapshotExtension.py(3 hunks)pyopenms_viz/testing/PandasSnapshotExtension.py(2 hunks)pyopenms_viz/testing/PlotlySnapshotExtension.py(4 hunks)requirements.txt(4 hunks)
🧰 Additional context used
🧬 Code graph analysis (3)
pyopenms_viz/testing/PlotlySnapshotExtension.py (4)
pyopenms_viz/testing/BokehSnapshotExtension.py (3)
compare_json(83-137)read_snapshot_data_from_location(139-148)write_snapshot_collection(151-161)pyopenms_viz/testing/MatplotlibSnapshotExtension.py (2)
read_snapshot_data_from_location(31-41)write_snapshot_collection(44-54)pyopenms_viz/testing/NumpySnapshotExtension.py (2)
read_snapshot_data_from_location(38-45)write_snapshot_collection(48-57)pyopenms_viz/testing/PandasSnapshotExtension.py (2)
read_snapshot_data_from_location(34-41)write_snapshot_collection(44-52)
pyopenms_viz/testing/MatplotlibSnapshotExtension.py (4)
pyopenms_viz/testing/NumpySnapshotExtension.py (2)
read_snapshot_data_from_location(38-45)write_snapshot_collection(48-57)pyopenms_viz/testing/BokehSnapshotExtension.py (2)
read_snapshot_data_from_location(139-148)write_snapshot_collection(151-161)pyopenms_viz/testing/PandasSnapshotExtension.py (2)
read_snapshot_data_from_location(34-41)write_snapshot_collection(44-52)pyopenms_viz/testing/PlotlySnapshotExtension.py (2)
read_snapshot_data_from_location(62-71)write_snapshot_collection(74-84)
pyopenms_viz/testing/NumpySnapshotExtension.py (4)
pyopenms_viz/testing/MatplotlibSnapshotExtension.py (3)
matches(19-29)read_snapshot_data_from_location(31-41)write_snapshot_collection(44-54)pyopenms_viz/testing/BokehSnapshotExtension.py (3)
matches(46-66)read_snapshot_data_from_location(139-148)write_snapshot_collection(151-161)pyopenms_viz/testing/PandasSnapshotExtension.py (4)
matches(21-32)read_snapshot_data_from_location(34-41)write_snapshot_collection(44-52)diff_lines(57-68)pyopenms_viz/testing/PlotlySnapshotExtension.py (3)
matches(17-20)read_snapshot_data_from_location(62-71)write_snapshot_collection(74-84)
🪛 Ruff (0.14.8)
pyopenms_viz/testing/PlotlySnapshotExtension.py
63-63: Unused method argument: snapshot_name
(ARG002)
63-63: Unused method argument: session_id
(ARG002)
pyopenms_viz/testing/PandasSnapshotExtension.py
31-31: Do not use bare except
(E722)
54-54: Unused method argument: kwargs
(ARG002)
62-67: Consider iterable unpacking instead of concatenation
Replace with iterable unpacking
(RUF005)
pyopenms_viz/testing/NumpySnapshotExtension.py
35-35: Do not use bare except
(E722)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: build
🔇 Additional comments (7)
pyopenms_viz/testing/MatplotlibSnapshotExtension.py (1)
17-17: LGTM! Consistent API migration.The changes correctly expose previously private methods as public APIs, matching the pattern across all snapshot extensions in this PR.
Also applies to: 31-41, 44-54
pyopenms_viz/testing/BokehSnapshotExtension.py (1)
44-44: LGTM! Consistent API migration.The API visibility changes align with the syrupy 5.0.0 migration pattern applied uniformly across all snapshot extensions.
Also applies to: 139-148, 151-161
pyopenms_viz/testing/PlotlySnapshotExtension.py (1)
15-15: LGTM! Consistent API migration.The public API exposure aligns with the syrupy 5.0.0 migration. The unused method arguments (
snapshot_name,session_id) flagged by static analysis are required by the base class interface and should not be removed.Also applies to: 62-71, 74-84
pyopenms_viz/testing/PandasSnapshotExtension.py (1)
19-19: LGTM! Consistent API migration.The changes correctly expose the required public APIs for syrupy 5.0.0 compatibility, following the same pattern as the other snapshot extensions.
Also applies to: 34-41, 44-52
requirements.txt (2)
269-270: Syrupy 5.0.0 update drives the API changes.The upgrade to syrupy 5.0.0 is the primary driver for making the snapshot extension methods public (removing underscore prefixes). The code changes in the snapshot extensions correctly address this breaking change.
157-157: No action required—the codebase is already compatible with Pandas 2.3.3. The code uses modern Pandas patterns (pd.concat instead of append, standard indexing with .loc/.iloc) and avoids deprecated APIs that were removed in Pandas 2.0+. Dtype handling via pandas.core.dtypes modules, StringDtype, and astype() are all compatible with Pandas 2.x.pyopenms_viz/testing/NumpySnapshotExtension.py (1)
19-19: Correct! API changes align with syrupy 5.0.0 breaking changes.The migration from underscore-prefixed to public methods (
_file_extension→file_extension,_read_snapshot_data_from_location→read_snapshot_data_from_location, and_write_snapshot_collection→write_snapshot_collection) is required by syrupy 5.0.0 for custom snapshot extensions. The implementation logic remains unchanged.
|
📖 Documentation Preview The documentation for this PR has been built and is available at: This preview will be updated automatically when you push new commits to this PR. Preview built from commit: |
version 2.3.0 of numpy breaks the snapshots
|
CI tests pass. Will fix documentation failure in other PR |
Update packages that perform the testing on by updating the requirements.txt file.
Fix breaking changes in snapshot extensions as a result to syrupy 5.0.0
Summary by CodeRabbit
Refactor
Chores
✏️ Tip: You can customize this high-level summary in your review settings.