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

2897, 2922: Use latest version of external (numpy, scipy, PySide) packages #3141

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand All @@ -136,6 +137,13 @@ jobs:
rm -rf dist
python -m pip install --no-deps .

- name: Build and install periodictable
krzywon marked this conversation as resolved.
Show resolved Hide resolved
run: |
cd ../periodictable
rm -rf build
rm -rf dist
python -m pip install --no-deps .

### Document the build environment

- name: Python package version list
Expand Down
8 changes: 4 additions & 4 deletions build_tools/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Alphabetized list of OS and version agnostic dependencies
appdirs
bumps
cffi
docutils
dominate
Expand All @@ -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
Expand All @@ -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
15 changes: 11 additions & 4 deletions src/sas/sascalc/fit/BumpsFitting.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -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)
Expand Down
Loading