Closed GegznaV closed 3 years ago
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.
all_wl()
and any_wl()
as they are: they are in a sense methods all()
and any()
for the wavelength slot. Only that the wavelength slot isn't a particular class, of course.freq
may become Hz
because that's the actual unit behind freq
, and ev
-> eV
since volts get a capital V. Not sure whether raman
should stay as it is? (The more so, as the unit there is prone to flame wars)@bryanhanson yes, they are exported
At least for now I'll leave the current names of all_wl
and any_wl
but at least temporarily deprecate unit conversion functions.
This issue is solved.
We leave all_wl()
and any_wl()
as they work on logical matrix-like object and not on @wavelength
slot of a hyperSpec object.
This issue complements https://github.com/cbeleites/hyperSpec/issues/208#issuecomment-684085699.
Most of the functions that directly process
@wavelength
should start with prefixwl_
. There are several wavelength-related functions inhyperSpec
that, I'm certain, should be renamed (group A):all_wl
wl_all
any_wl
wl_any
These will be solved in issue #309:
orderwl
wl_sort
The output is more consistent withbase::sort()
than withbase::order()
.wl.eval
wl_eval
wlconv
wl_convert_units
1. More explicit name gives more clarity. 2. I'd like to make this function S3 generic with method fornumeric
,integer
, andhyerSpec
. 3. I'd like to rename the arguments, e.g.,points
→obj
orx
,src
→from
,dst
→to
,laser
→reference_wl
.guess.wavelength
extract_numbers
Function is applicable not only to extract wavelengths but also numbers in general. So the new name explains the essence of the function better. Equivalent function: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 withwlconv()
/wl_convert_units()
.ev2freq
ev2invcm
ev2nm
ev2raman
freq2ev
freq2invcm
freq2nm
freq2raman
invcm2ev
invcm2freq
invcm2nm
invcm2raman
nm2ev
nm2freq
nm2invcm
nm2raman
raman2ev
raman2freq
raman2invcm
raman2nm