diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b961885ede..838926f5f2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -112,7 +112,7 @@ jobs: run: | git clone --depth=50 --branch=master https://github.com/SasView/sasdata.git ../sasdata git clone --depth=50 --branch=master https://github.com/SasView/sasmodels.git ../sasmodels - git clone --depth=50 --branch=master https://github.com/bumps/bumps.git ../bumps + git clone --depth=50 --branch=v0.9.3 https://github.com/bumps/bumps.git ../bumps - name: Build and install sasdata run: | diff --git a/build_tools/requirements.txt b/build_tools/requirements.txt index 5bff233141..fab5feb3a4 100644 --- a/build_tools/requirements.txt +++ b/build_tools/requirements.txt @@ -1,6 +1,5 @@ # Alphabetized list of OS and version agnostic dependencies appdirs -bumps cffi docutils dominate @@ -14,16 +13,19 @@ lxml mako matplotlib numba +numpy periodictable pybind11 pylint pyopengl pyparsing +PySide6 pytest pytest_qt pytest-mock pytools qtconsole +scipy six sphinx superqt @@ -38,6 +40,4 @@ zope pywin32; platform_system == "Windows" # Alphabetized list of version-pinned packages -numpy==1.26.4 # 2.0.0 deprecates many functions used in the codebase (and potentially in dependencies) -PySide6==6.4.3 # Later versions do not mesh well with pyinstaller < 6.0 -scipy==1.13.1 # 1.14 deprecates some functions used in the codebase (and potentially in dependencies) +bumps==0.* # v1.+ is very experimental diff --git a/src/sas/sascalc/fit/BumpsFitting.py b/src/sas/sascalc/fit/BumpsFitting.py index 985cff3f15..9d75816f8b 100644 --- a/src/sas/sascalc/fit/BumpsFitting.py +++ b/src/sas/sascalc/fit/BumpsFitting.py @@ -316,7 +316,14 @@ def fit(self, msg_q=None, # Check if uncertainty is missing for any parameter uncertainty_warning = False - for fitness in problem.models: + for fitting_module in problem.models: + # CRUFT: This makes BumpsFitting compatible with bumps v0.9 and v1.0 + if isinstance(fitting_module, SasFitness): + # Bumps v1.x+ - A Fitness object is returned + fitness = fitting_module + else: + # Bumps v0.x - A module is returned that holds the Fitness object + fitness = fitting_module.fitness pars = fitness.fitted_pars + fitness.computed_pars par_names = fitness.fitted_par_names + fitness.computed_par_names @@ -346,8 +353,8 @@ def fit(self, msg_q=None, # TODO: Let the GUI decided how to handle success/failure. if not fitting_result.success: - fitting_result.stderr[:] = np.NaN - fitting_result.fitness = np.NaN + fitting_result.stderr[:] = np.nan + fitting_result.fitness = np.nan all_results.append(fitting_result) @@ -398,7 +405,7 @@ def abort_test(): try: best, fbest = fitdriver.fit() except Exception as exc: - best, fbest = None, np.NaN + best, fbest = None, np.nan errors.extend([str(exc), traceback.format_exc()]) finally: mapper.stop_mapper(fitdriver.mapper)