Ulm-IQO / qudi-core

A framework for modular measurement applications.
GNU General Public License v3.0
28 stars 21 forks source link

Fitmodel loading bugfix #79

Closed Neverhorst closed 10 months ago

Neverhorst commented 11 months ago

Description

Fixes a bug where all fit configurations for a fit model/container fail to load upon activation of a module because the fit model saved in AppData is no longer available. Throws a warning now instead and ignores the respective fit configuration.

Motivation and Context

Resolves #59 Also fixes a deprecated usage of the numpy.float() constructor.

How Has This Been Tested?

Types of changes

Checklist:

LukePiewalker commented 11 months ago

Had a hard time so far to reproduce the error even without the fix in this PR (except for changing the deprecated np.float part).

At what point should one delete the fit? Deleting from the dumped StatusVariable file in AppData? Or should one delete the subclass of FitModelBase in the qudi-core code?? ... Kind of lost, to be honest. Maybe I am missing something with regards to the "custom fit models", mentioned in Issue #59 on how to include those?

Neverhorst commented 10 months ago

Had a hard time so far to reproduce the error even without the fix in this PR (except for changing the deprecated np.float part).

Yeah it is a bit tricky. For example you can perform the following steps to reproduce the issue:

  1. Open any GUI where you can adjust the fit functions (e.g. ODMR)
  2. Open the "Fit Configuration" from the menu bar
  3. Configure a fit model that is not yet used in the default fit configuration, e.g. ExponentialDecay
  4. Quit qudi in an orderly fashion (do NOT restart immediately)
  5. Find the corresponding qudi.util.fit_models.model.FitModelBase subclass in qudi.util.fit_models (e.g. qudi.util.fit_models.exp_decay.ExponentialDecay in qudi-core) and comment out this class
  6. Start qudi and the same GUI module as before
  7. ???
  8. Profit!