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

refactor Spectrum class #193

Merged
merged 30 commits into from
Dec 19, 2023
Merged

refactor Spectrum class #193

merged 30 commits into from
Dec 19, 2023

Conversation

CunliangGeng
Copy link
Member

@CunliangGeng CunliangGeng commented Dec 4, 2023

Refactor the whole Spectrum class. There are quite some commits, but the major idea of these changes are simple:

  • remove attributes, properties and methods that are not used anywhere
  • change attribute to property if necessary
  • update class arguments and their order
  • update the order of attributes and methods
  • add typings
  • add docstrings
  • add unit tests for all methods

You could find more details about the changes in each commit.

@CunliangGeng CunliangGeng force-pushed the 11-27-remove_SingletonFamily_and_id branch from 5ad51fe to a0d5ea7 Compare December 14, 2023 08:33
@CunliangGeng CunliangGeng force-pushed the 11-27-refactor_Spectrum branch from 7b7fed8 to 87caba4 Compare December 14, 2023 08:33
`parent_mz` refers to `precursor_mz` in the context, so removing `parent_mz` and keep `precursor_mz`.
Remove `id` and use `spectrum_id` as the unique identifier of spectrum.
- add optional arguments `metadata` and `annotations`
- update and order the attributes
- add docstring and typings
method `__cmp__` is not supported in python 3.
Property can be used as a way to provide computed attribute.
The specific method `keep_top_k` is only required by class `SpecLib`, so better to move it there.
- remove `None` from typing and keep only `float`
- change default value to  0
- update spectrum loader
- remove argument `annotations`
- remove property `gnps_annotations`
- add attribute `gnps_annotations`
@CunliangGeng CunliangGeng force-pushed the 11-27-refactor_Spectrum branch from f2f89ad to ab84fab Compare December 19, 2023 13:28
@CunliangGeng CunliangGeng merged commit 49d7e22 into dev Dec 19, 2023
1 check failed
@CunliangGeng CunliangGeng deleted the 11-27-refactor_Spectrum branch December 19, 2023 13:30
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