Quasars / orange-spectroscopy

Other
51 stars 58 forks source link

Make Integrate Spectra play nice with Feature Constructor #679

Open markotoplak opened 1 year ago

markotoplak commented 1 year ago

My workflow includes the three following widgets: preprocessing, integrate spectra and feature constructor. With it I'm building certain spectral ratios. In the preprocessing, I cut the region of interest and I also correct for the baseline.

The issue comes when I adjust the integration limits in the second widget: for example, if I delete one of the integrals, all the features that I created in the feature constructor disappear; the same if I modify the limits of one existing integral, all of them disappear. One small way around it that I found is to use two feature constructors: in one I name the bands I integrate, and in the second I define the ratios of these bands. It is not perfect, as sometimes some ratios or bands disappear as well. I think that changing the preprocessing spectra does not affect the features, only if I do modifications in the integrate spectra widget.

Feature Constructor works from the given domain. The problem here is that the Integrate widget changes feature names depending on the ranges. I think this was a bad decision.

We should change how integrals are named and offer users the option to rename them too. Limits could then be the attributes of the attributes: these can be seen in the Table widget and we could also show them elsewhere.

When fixing this we should also consider backward compatibility: any saved integrate workflows should get the same old names.

stuart-cls commented 1 month ago

Summarizing status if anyone starts on this:

The context matching in Formula is fixed in https://github.com/biolab/orange3/pull/6801 , but the formulas will still break.

We should still do custom names ( #635 ) and put limits in attributes. This will also be nice for Peak Fit, which inherits from Integrate.