From 6c6448f98bc7bf763838e8167957808262934cf2 Mon Sep 17 00:00:00 2001 From: krzywon Date: Mon, 28 Oct 2024 15:28:12 -0400 Subject: [PATCH 1/5] Update requirements.txt to allow latest versions of numpy, scipy, and PySide, while keeping bumps less than 1.0 --- build_tools/requirements.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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 From 56a02256672c9451389e074cee08605886375fc8 Mon Sep 17 00:00:00 2001 From: krzywon Date: Mon, 28 Oct 2024 15:28:34 -0400 Subject: [PATCH 2/5] numpy.NaN -> numpy.nan --- src/sas/sascalc/fit/BumpsFitting.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/sas/sascalc/fit/BumpsFitting.py b/src/sas/sascalc/fit/BumpsFitting.py index 985cff3f15..7fbc96067a 100644 --- a/src/sas/sascalc/fit/BumpsFitting.py +++ b/src/sas/sascalc/fit/BumpsFitting.py @@ -346,8 +346,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 +398,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) From fd26edb0abdb8c2383c6f48ed32a5dc3fe9d05ee Mon Sep 17 00:00:00 2001 From: krzywon Date: Mon, 28 Oct 2024 15:36:34 -0400 Subject: [PATCH 3/5] Apply compatibility patch to BumpsFitting.py to allow for bumps v0 and v1 --- src/sas/sascalc/fit/BumpsFitting.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/sas/sascalc/fit/BumpsFitting.py b/src/sas/sascalc/fit/BumpsFitting.py index 7fbc96067a..c933290514 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: + # This makes BumpsFitting compatible with both bumps v0.9 and v1.0 + if isinstance(fitting_module, SasFitness): + # Bumps v1+ - A Fitness object is returned + fitness = fitting_module + else: + # Bumps v0 - 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 From 0ca1b82a5bd78f599df208d5bbe282a8cbf7aac3 Mon Sep 17 00:00:00 2001 From: krzywon Date: Mon, 28 Oct 2024 15:59:41 -0400 Subject: [PATCH 4/5] Include periodictable in parallel repos until next version is released --- .github/workflows/ci.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b961885ede..f092613528 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -112,7 +112,8 @@ 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 + git clone --depth=50 --branch=master https://github.com/pkienzle/periodictable.git ../periodictable - name: Build and install sasdata run: | @@ -136,6 +137,13 @@ jobs: rm -rf dist python -m pip install --no-deps . + - name: Build and install periodictable + run: | + cd ../periodictable + rm -rf build + rm -rf dist + python -m pip install --no-deps . + ### Document the build environment - name: Python package version list From e17d2d6c4518c26cd1cfd3b7e4f13097faa7b0be Mon Sep 17 00:00:00 2001 From: krzywon Date: Mon, 28 Oct 2024 16:30:59 -0400 Subject: [PATCH 5/5] Go back to using pip installed version of periodictable --- .github/workflows/ci.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f092613528..838926f5f2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -113,7 +113,6 @@ jobs: 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=v0.9.3 https://github.com/bumps/bumps.git ../bumps - git clone --depth=50 --branch=master https://github.com/pkienzle/periodictable.git ../periodictable - name: Build and install sasdata run: | @@ -137,13 +136,6 @@ jobs: rm -rf dist python -m pip install --no-deps . - - name: Build and install periodictable - run: | - cd ../periodictable - rm -rf build - rm -rf dist - python -m pip install --no-deps . - ### Document the build environment - name: Python package version list