Skip to content

Remove unused setUp method from test_MSSpectrum.py - #8426

Merged
timosachsenberg merged 2 commits into
feature/drift_time_os_specfrom
copilot/sub-pr-8423-another-one
Dec 4, 2025
Merged

timosachsenberg merged 2 commits into
feature/drift_time_os_specfrom
copilot/sub-pr-8423-another-one

Conversation

Copilot AI commented Dec 4, 2025 •

Copy link
Copy Markdown
Contributor

Addresses review feedback on #8423 to clean up test file by removing dead code.

Changes

  • Remove empty setUp method that only defined an unused dirname variable
  • Remove import os which was only used by the removed method

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@coderabbitai

coderabbitai Bot commented Dec 4, 2025

Copy link
Copy Markdown
Contributor

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Comment @coderabbitai help to get the list of available commands and usage tips.

Copilot AI changed the title [WIP] WIP address feedback on removing method from accessors Remove unused setUp method from test_MSSpectrum.py Dec 4, 2025
Copilot AI requested a review from timosachsenberg December 4, 2025 13:06
@timosachsenberg
timosachsenberg marked this pull request as ready for review December 4, 2025 13:16
@timosachsenberg
timosachsenberg merged commit cc5c90c into feature/drift_time_os_spec Dec 4, 2025
@timosachsenberg
timosachsenberg deleted the copilot/sub-pr-8423-another-one branch December 4, 2025 13:16
timosachsenberg added a commit that referenced this pull request Dec 6, 2025
…8423)

* [FEATURE] also allow access to drift time

* [FEATURE] allow memory-view access to arrays

* [FEATURE] allow access to all data arrays

* [FEATURE] allow access to all data arrays

* [FEATURE] faster access to all data arrays

* [FEATURE] fast access to data in DataArrays

* [FIX] bugfix, actually copy the numpy data

* [FIX] get data arrays without copy

* [FEATURE] add setDataArrays() function

* [FEATURE] update pxd file

* [TEST] add tests

* [DOC] add performance tests

* add doc

* Address code review feedback for PR #6352

- Remove unnecessary semicolons from test file (lines 50, 63, 134)
- Add documentation for setDataArrays() methods in DataStructures.h
- Add docstrings for getData() and getData_mv() in OSBinaryDataArray.pyx

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>

* Fix empty array handling in OSSpectrum/OSChromatogram

Handle the case where arrays are empty when creating memory views.
When data.size() is 0, data.data() returns NULL, and trying to
create a Cython memory view from NULL causes ValueError.

This fix:
- Returns np.empty(0) for copy methods (getMZArray, getIntensityArray, etc.)
- Returns None for memory view methods (*_mv) when array is empty
- Adds size check before creating memory view

Fixes test failure in test_ChromatogramExtractorAlgorithm.py

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>

* Add MSSpectrum array accessors and improve pyOpenMS data array methods

- Add get_mz_array(), get_intensity_array(), get_drift_time_array() to MSSpectrum
- Add get_drift_time_array_mv() and get_drift_time_unit() for ion mobility data
- Optimize get_peaks() with direct indexing instead of iterator
- Standardize FloatDataArray: get_data() returns copy, get_data_mv() returns view
- Add docstrings to OSSpectrum, OSChromatogram, OSBinaryDataArray addon methods
- Use snake_case naming convention consistent with existing pyOpenMS style
- Fix empty array handling (copy methods return empty array, view methods return None)
- Update unit tests for new method signatures and semantics

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>

* Rename test_MSSpectrumAndRichSpectrum to test_MSSpectrum

RichSpectrum class no longer exists in OpenMS - update test file name
to reflect that it only tests MSSpectrum.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>

* [WIP] Update benchmark snippets to use snake_case Python method names (#8424)

* Initial plan

* Update benchmark snippets to use snake_case Python method names

Co-authored-by: timosachsenberg <[email protected]>

---------

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: timosachsenberg <[email protected]>

* Fix docstring example to demonstrate get_drift_time_array_mv() method (#8425)

* Initial plan

* Update docstring example to use get_drift_time_array_mv() method

Co-authored-by: timosachsenberg <[email protected]>

---------

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: timosachsenberg <[email protected]>

* Remove unused setUp method from test_MSSpectrum.py (#8426)

* Initial plan

* Remove unused setUp method and os import from test_MSSpectrum.py

Co-authored-by: timosachsenberg <[email protected]>

---------

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: timosachsenberg <[email protected]>

* Fix Cython nogil syntax and update tests to use snake_case API

- Fix Cython `nogil` position in OpenSwathDataStructures.pxd (use `except + nogil` not `nogil except +`)
- Update pyOpenMS tests to use new snake_case method names:
  - getMZArray() → get_mz_array()
  - getIntensityArray() → get_intensity_array()
  - setMZArray() → set_mz_array()
  - setIntensityArray() → set_intensity_array()
  - getTimeArray() → get_time_array()

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>

---------

Co-authored-by: Hannes Roest <[email protected]>
Co-authored-by: Samuel Wein <[email protected]>
Co-authored-by: Claude <[email protected]>
Co-authored-by: Copilot <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants