Repository navigation
Closed
Labels
Description
This issue complements #208 (comment).
Most of the functions that directly process @wavelength should start with prefix wl_. There are several wavelength-related functions in hyperSpec that, I'm certain, should be renamed (group A):
| Status | Current name | Suggested name | Comment |
|---|---|---|---|
| ❗ needs discussion | all_wl |
wl_all |
|
| ❗ needs discussion | any_wl |
wl_any |
These will be solved in issue #309:
| Status | Current name | Suggested name | Comment |
|---|---|---|---|
| moved to #309 | orderwl |
wl_sort |
base::sort() than with base::order(). |
| moved to #309 | wl.eval |
wl_eval |
|
| moved to #309 | wlconv |
wl_convert_units |
numeric, integer, and hyerSpec. 3. I'd like to rename the arguments, e.g., points → obj or x, src → from, dst → to, laser → reference_wl. |
| moved to #309 | guess.wavelength |
extract_numbers |
readr::parse_number(). |
These wavelength-related functions should not be renamed (group B):
a. wl
b. nwl
c. wl2i
d. i2wl
I feel ambivalent about renaming these functions (group C), but to be more consistent, they should also start with wl_ (it would be easier to find these functions by using auto-completion). On the other hand, they are wrapped with wlconv()/wl_convert_units().
ev2freqev2invcmev2nmev2ramanfreq2evfreq2invcmfreq2nmfreq2ramaninvcm2evinvcm2freqinvcm2nminvcm2ramannm2evnm2freqnm2invcmnm2ramanraman2evraman2freqraman2invcmraman2nm
Reacted by RKiselev
Activity
[-]Rename functions: wl_[/-][+]Rename functions (2): wl_[/+]bryanhanson commentedon Feb 15, 2021
The proposed changes to group A & B make perfect sense to me. Group C: are these functions exported? I don't think I have run into them.
cbeleites commentedon Feb 15, 2021
all_wl()andany_wl()as they are: they are in a sense methodsall()andany()for the wavelength slot. Only that the wavelength slot isn't a particular class, of course.freqmay becomeHzbecause that's the actual unit behindfreq, andev->eVsince volts get a capital V. Not sure whetherramanshould stay as it is? (The more so, as the unit there is prone to flame wars)GegznaV commentedon Feb 15, 2021
@bryanhanson yes, they are exported
GegznaV commentedon Feb 24, 2021
At least for now I'll leave the current names of
all_wlandany_wlbut at least temporarily deprecate unit conversion functions.GegznaV commentedon Jul 27, 2021
This issue is solved.
We leave
all_wl()andany_wl()as they work on logical matrix-like object and not on@wavelengthslot of a hyperSpec object.