Skip to content

Commit

Permalink
Merge branch 'main' into merge-6-0-0-into-main
Browse files Browse the repository at this point in the history
  • Loading branch information
krzywon authored Dec 3, 2024
2 parents 8d006f8 + 8864264 commit a64b582
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 18 deletions.
12 changes: 2 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,34 +112,28 @@ 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: |
cd ../sasdata
rm -rf build
rm -rf dist
python setup.py clean
python setup.py build
mv build/lib/sasdata/example_data/* ../sasview/src/sas/example_data/
mv sasdata/example_data/* ../sasview/src/sas/example_data/
python -m pip install --no-deps .
- name: Build and install sasmodels
run: |
cd ../sasmodels
rm -rf build
rm -rf dist
python setup.py clean
python setup.py build
python -m pip install --no-deps .
- name: Build and install bumps
run: |
cd ../bumps
rm -rf build
rm -rf dist
python setup.py clean
python setup.py build
python -m pip install --no-deps .
### Document the build environment
Expand All @@ -156,8 +150,6 @@ jobs:
githash=$( git rev-parse HEAD )
sed -i.bak s/GIT_COMMIT/$githash/g src/sas/sasview/__init__.py
# BUILD SASVIEW
python setup.py clean
python setup.py build
python -m pip install --no-deps .
### Run tests (if enabled)
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
14 changes: 10 additions & 4 deletions src/sas/sascalc/fit/BumpsFitting.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,13 @@ def fit(self, msg_q=None,
uncertainty_warning = False

for fitting_module in problem.models:
fitness = fitting_module.fitness
# 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

Expand Down Expand Up @@ -350,8 +356,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 @@ -402,7 +408,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

0 comments on commit a64b582

Please sign in to comment.