You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Typing spectrum.dataset.x etc gets tiresome.
By overriding __getattr__ and __setattr__ it should be quite easy to redirect spectrum.x into returning spectrum.dataset.x (and of course all the other attributes of the dataset).
The text was updated successfully, but these errors were encountered:
I don't think a property decorator would do that, but is it really good to expose all the members of dataset to the spectrum class? If so what about making spectrum to o be a subclass of dataset?
Yes, that would be another option. But we did not do this, since we envisioned, that there could be several types of different spectra. So the importer fo CSV could be used to load an UVSpectra, an IRSpectra etc... And dataset was the decoupling element, since all importers return a dataset and all spectra/exporters accept a dataset.
Actually the __getattr__ trick is very similar to subclassing (what would be the diffrences?) while allowing us maximum flexibility.
Typing
spectrum.dataset.x
etc gets tiresome.By overriding
__getattr__
and__setattr__
it should be quite easy to redirectspectrum.x
into returningspectrum.dataset.x
(and of course all the other attributes of the dataset).The text was updated successfully, but these errors were encountered: