Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bumps master branch no longer compatible with SasView #3109

Open
krzywon opened this issue Sep 10, 2024 · 4 comments
Open

Bumps master branch no longer compatible with SasView #3109

krzywon opened this issue Sep 10, 2024 · 4 comments

Comments

@krzywon
Copy link
Contributor

krzywon commented Sep 10, 2024

Describe the bug
A recent, major, update has overhauled bumps. This has broken fitting on our end. I am still investigating the underlying issue. @pkienzle would like to keep backwards compatibility, and said he is planning to run old bumps tests against the latest bumps to see what has changed.

Error when running a SasView fit using sasview main branch and bumps master branch:

sas.qtgui.Perspectives.Fitting.FitThread - ERROR - Fitting failed: Traceback (most recent call last):
File "sasview\src\sas\qtgui\Perspectives\Fitting\FitThread.py", line 79, in compute
result = list(map(map_apply, inputs))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "sasview\src\sas\qtgui\Perspectives\Fitting\FitThread.py", line 19, in map_apply
return arguments0
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "sasview\src\sas\qtgui\Perspectives\Fitting\FitThread.py", line 16, in map_getattr
return getattr(classInstance, classFunc)(*args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "sasview\src\sas\sascalc\fit\BumpsFitting.py", line 260, in fit
models.append(SasFitness(model=dataset.get_model(), data=dataset.get_data(), constraints=dataset.constraints,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "sasview\src\sas\sascalc\fit\BumpsFitting.py", line 120, in init
self._define_pars()
File "sasview\src\sas\sascalc\fit\BumpsFitting.py", line 138, in _define_pars
self._pars[k] = parameter.Parameter(value=value, bounds=bounds,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "bumps\bumps\parameter.py", line 595, in init
bounds = (float(bounds[0]), float(bounds[1]))
^^^^^^^^^^^^^^^^
TypeError: float() argument must be a string or a real number, not 'NoneType'
14:43:48 - root - ERROR - float() argument must be a string or a real number, not 'NoneType'
None
14:43:48 - sas.qtgui.Perspectives.Fitting.FittingWidget - ERROR - Traceback (most recent call last):
File "sasview\src\sas\qtgui\Perspectives\Fitting\FittingWidget.py", line 2115, in fitComplete
self.chi2 = res.fitness
^^^^^^^^^^^
AttributeError: 'str' object has no attribute 'fitness'

Expected behavior
The fit should run without errors.

SasView version (please complete the following information):

  • Version: main branch

Additional context
This does not affect the release branch due to the version pin we have there.

@krzywon
Copy link
Contributor Author

krzywon commented Sep 10, 2024

Talking with @pkienzle, the hope was for bumps to be backward compatible. That isn't true at this point.

Issues found so far:

  • passing [None, None] as the parameter bounds throws the error shown above. (Coerce individual bounds bumps/bumps#155)
  • Iterating through all FitProblems in a MultiFitProblem returns the SasFitness object. Previously, the return was a BaseFitProblem object. (3109: Bumps FitProblem fix #3110)
  • Parameter values in bumps are now assumed to be a float value, but SasView is passing uncertainties.ufloat objects. When bumps attempts to coerce param values to a float, the uncertainties package throws an error.

@krzywon
Copy link
Contributor Author

krzywon commented Sep 10, 2024

The bumps build process has changed. setup.py no longer exists, so our build system will have to be modernized.

@krzywon
Copy link
Contributor Author

krzywon commented Sep 11, 2024

Bumps no longer includes the gui package as part of its distribution. Based on discussions with @bmaranville, this was likely an oversight and will be fixed in bumps. I thought of just moving those views into SasView, but the back-end bumps API is likely to change, as related to the dream output, so might have to keep chasing their changes everytime bumps is updated if we go that route.

@bmaranville
Copy link
Contributor

bumps.gui is included in the bumps package as of 88b1fa65e5d235565fc99df2613c3fe34cfea210

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants