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

Output of accessor function as NumericList ? #20

Open
philouail opened this issue Jul 30, 2024 · 5 comments
Open

Output of accessor function as NumericList ? #20

philouail opened this issue Jul 30, 2024 · 5 comments
Assignees
Labels
question Further information is requested

Comments

@philouail
Copy link
Collaborator

If we follow the Spectra package structure the accessor function rtime() and intensity() should give an ouput as a NumericList

I always will check in the validPeaksData() function that we have numeric data anyway so is it necessary ? NumericList are a bit less efficient.

just wondering if there is any reason to keep it that way and what would be the drawbacks to just have a list ?
Could a future ChromBackend implementation need this ?

@philouail philouail added the question Further information is requested label Jul 30, 2024
@jorainer
Copy link
Member

I have no strong opinion here - with a slight preference to use list of numeric instead of NumericList.

@philouail
Copy link
Collaborator Author

image

Some extra info: here are the results of a microbenchmark with and without having a NumericList as an output instead of normal list output.... It's not just a bit less efficient, this is pretty consequential.

@jorainer
Copy link
Member

I would go for a list of numeric for now. The backend needs to ensure that the list it returns is indeed a list of numeric (not some random logical or character in it), but that's something that the backend can check e.g. when initialized.

Worst case we can always wrap an additional NumericList() call around the returned list...

it is just important that we properly define and document the (expected) type of the return value of methods (this should go into the documentation of the ChromBackend.

@philouail
Copy link
Collaborator Author

Yes as of now I find it more easy to implement and it seems that it is just more efficient in general. Also I implement a .CORE_PEAKS_VARIABLES which defines the names and class of these, which makes it easy for me to check that they are indeed numeric.

If something comes up I'll add to the discussion :)

@jorainer
Copy link
Member

Excellent, yes, I agree to split/distinguish between core chromatogram variables and core peaks variables.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants