Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve translation of Spectra object to python data structures #17

Closed
jorainer opened this issue Jan 16, 2025 · 2 comments
Closed

Improve translation of Spectra object to python data structures #17

jorainer opened this issue Jan 16, 2025 · 2 comments

Comments

@jorainer
Copy link
Member

At present (version 0.2.0) the Python list of matchms Spectrum objects is created in a loop (https://github.com/rformassspectrometry/SpectriPy/blob/main/R/conversion.R#L100-L101), i.e. the R Spectra is converted one element by one element into a Spectrum. Ideally, we should make use of the strength of Spectra, i.e. that it is a collection of spectra, not a single spectrum and convert the full object at once.

Options:

  • extract the full data from a Spectra as plain R objects, translate them to Python object using reticulate and iterate over the items in Python to create the list.
  • any other efficient way to create a list of Spectrum, not one by one, but using a large set of data?

See also issue #3 for a discussion of the original implementation.

@jorainer
Copy link
Member Author

jorainer commented Feb 5, 2025

Instead of improving the translation efficiency we're also investigating the possibility of not having to translate the data all the time. This is related to issue #33

@jorainer
Copy link
Member Author

Improved conversion is implemented in PR #50

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant