Skip to content

Remove wrapping of nested classes in Biosaur2Algorithm.pxd - #8388

Merged
timosachsenberg merged 5 commits into
biosaur2from
copilot/sub-pr-8385-again
Nov 24, 2025
Merged

timosachsenberg merged 5 commits into
biosaur2from
copilot/sub-pr-8385-again

Conversation

Copilot AI commented Nov 23, 2025 •

Copy link
Copy Markdown
Contributor
  • Remove second run overload that uses Hill and PeptideFeature
  • Remove writeTSV method that uses PeptideFeature
  • Remove writeHills method that uses Hill
  • Keep only methods that don't reference unwrapped nested types

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@coderabbitai

coderabbitai Bot commented Nov 23, 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] Address feedback on nested cdefs in Biosaur2 draft PR Fix nested cdef declarations in Biosaur2Algorithm.pxd Nov 23, 2025
@jpfeuffer

jpfeuffer commented Nov 23, 2025 •

Copy link
Copy Markdown
Contributor

I guess it's better. I am not sure if nestedness might have worked with the cppclasses nested inside the same cdef as described in the cython docs.

Right now the python classes will not be nested. You will call oms.BisaurAlgorithm and oms.Hill.
If you go the separate cdef route and want the same API you must wrap-attach the classes

@timosachsenberg

Copy link
Copy Markdown
Contributor

@copilot just don't wrap the nested classes and members that return them.

Copilot AI commented Nov 24, 2025

Copy link
Copy Markdown
Contributor Author

@copilot just don't wrap the nested classes and members that return them.

Removed all nested class declarations (Hill, IsotopeCandidate, PeptideFeature) and methods that use them (second run overload, writeTSV, writeHills). Only the simple run(MSExperiment, FeatureMap) method is now wrapped.

Commit: b778ea0

Copilot AI changed the title Fix nested cdef declarations in Biosaur2Algorithm.pxd Remove wrapping of nested classes in Biosaur2Algorithm.pxd Nov 24, 2025
@timosachsenberg
timosachsenberg marked this pull request as ready for review November 24, 2025 08:48
@timosachsenberg

Copy link
Copy Markdown
Contributor

@copilot also remove void run(FeatureMap& feature_map,
libcpp_vector[Hill]& hills,
libcpp_vector[PeptideFeature]& features) except + nogil # wrap-doc:Run the algorithm and capture intermediate hills as well as peptide feature records
void writeTSV(const libcpp_vector[PeptideFeature]& features,
const String& filename) except + nogil # wrap-doc:Write detected peptide features to a Biosaur2-compatible TSV file

    void writeHills(const libcpp_vector[Hill]& hills,
                    const String& filename) except + nogil  # wrap-doc:Export the detected hills into a TSV  

because types are not wrapped

Copilot AI commented Nov 24, 2025

Copy link
Copy Markdown
Contributor Author

@copilot also remove void run(FeatureMap& feature_map,
libcpp_vector[Hill]& hills,
libcpp_vector[PeptideFeature]& features) except + nogil # wrap-doc:Run t...

Removed the second run overload, writeTSV, and writeHills methods that reference the unwrapped Hill and PeptideFeature types.

Commit: b809eff

@timosachsenberg
timosachsenberg merged commit a1ddc1c into biosaur2 Nov 24, 2025
@timosachsenberg
timosachsenberg deleted the copilot/sub-pr-8385-again branch November 24, 2025 09:06
timosachsenberg added a commit that referenced this pull request Nov 28, 2025
…ation (#8385)

* added biosaur2 imp

* move to algo

* add more tests

* inital tests (probably still wrong)

* forgot files

* reuse median calculation

* test update

* doc

* Fix FAIMS drift time validation in Biosaur2Algorithm (#8387)

* Initial plan

* Fix FAIMS validation to only throw for true ion mobility

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

* Refactor: extract shouldThrowForMissingIM helper method

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

---------

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

* Replace hardcoded proton mass with Constants::PROTON_MASS_U (#8391)

* Initial plan

* Replace hardcoded proton mass with Constants::PROTON_MASS_U

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

---------

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

* Add error handling for file output operations in Biosaur2Algorithm (#8390)

* Initial plan

* Add error handling for file output operations in writeTSV and writeHills

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

---------

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

* Refactor Biosaur2Algorithm to follow FeatureFinderIdentification pattern and eliminate unnecessary MSExperiment copies (#8389)

* Initial plan

* Optimize MSExperiment copy to avoid unnecessary memory allocation

Only copy the input MSExperiment when modifications are actually needed (MS level filtering, profile mode, or TOF mode). Use a const reference to the input when no modifications are required, avoiding costly deep copies for large LC-MS datasets.

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

* Refactor Biosaur2Algorithm to follow FeatureFinderIdentification pattern

- Add setMSData() methods (const& and &&) for copy/move semantics
- Add getMSData() methods for accessing internal MS data
- Store MS data as member variable ms_data_
- Update run() methods to work on internal data instead of taking MSExperiment parameter
- Update TOPP tool to load data directly into algorithm via getMSData()
- Update Python bindings to reflect new API
- Simplifies data flow and enables move semantics to avoid copies when loading data

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

---------

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

* Remove wrapping of nested classes in Biosaur2Algorithm.pxd (#8388)

* Initial plan

* Fix nested cdefs in Biosaur2Algorithm.pxd by moving to module level with qualified names

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

* Remove wrapping of nested classes and methods that use them

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

* Remove methods using unwrapped nested types (Hill, PeptideFeature)

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

---------

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

* closer to python implementation

* closer to python

* fix: put into neighboring bins

* rt apex check

* improve FAIMS support

* minor refactoring

* Add progress logging to Biosaur2 tool (#8392)

* Add progress logging to Biosaur2 tool

* Add timing logs for Biosaur2 subalgorithms

* add some output message

* speed up apex selection

* performance fix

* add doc

* reduce test size

* fix name (wrong in python)

* minor clarifications

* refactor out some functions

* fix non unique ID assignment

* simplify indexing code

* move debug code

* proper FAIMS parallelization

* greatly simplify FAIMS logic

* rename

* write out FAIMS_CV

* break complex functions down into smaller ones

* make avg calculation thread safe

* pasef seems to work

* minor corner case

* fix shift calculation

* Fix TOPP_Biosaur2 references to TOPP_FeatureFinderLFQ in documentation (#8397)

* Initial plan

* Fix tool name in TOPP.doxygen from TOPP_Biosaur2 to TOPP_FeatureFinderLFQ

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

* Fix TOPP_Biosaur2 reference in Biosaur2Algorithm.h to TOPP_FeatureFinderLFQ

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

---------

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

* fix simd (#8402)

* Initial plan

* Add /openmp:experimental flag for MSVC to support #pragma omp simd

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

* Improve comments explaining /openmp:experimental as superset of /openmp

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

---------

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: timosachsenberg <[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.

3 participants