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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

s.units['waverange'] and s.conditions['waveunit'] are duplicate #621

Open
dcmvdbekerom opened this issue Sep 3, 2023 · 0 comments
Open
Labels
bug Something isn't working

Comments

@dcmvdbekerom
Copy link
Member

dcmvdbekerom commented Sep 3, 2023

馃悰 Describe the bug

E: the issue is broader than just the duplication of the waveunits. Units are checked and passed by a number of functions, which is not an ideal situation imho.

I would suggest to have keep one storage for the canonical units (could be s.units), which may only be modified by a setter which performs sanity checks and conversions during setting. All other functions read from this place, and do not explicitly require units to be passes as arguments (at least for all spectrum methods).

Old post:
We have two attributes that describe the waveunit.
We should get rid of one of them to prevent confusion.

馃挕 Possible solutions

Pro's to keep s.conditions['waveunit']:

  • it's used almost exclusively already
  • It's in a place where the user is likely to find it

Pro's to keep s.units['waverange']:

  • it would be weird if it wasn't represented in s.units
  • it's in a place that makes sense

My preference would be to keep s.units['waverange']

馃幉 Radis version

0.14

馃捇 Operating system

Windows

@dcmvdbekerom dcmvdbekerom added the bug Something isn't working label Sep 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant