Releases: sherpa/sherpa
Sherpa 4.18.0
Release Highlights
This release of Sherpa includes various enhancements, documentation updates, bug fixes, and infrastructure changes. Key changes for this release include:
New features
- Added support for using optimizers from SciPy and Optimagic (#2303)
- Add a version of the CStat statistic (“cstatnegativepenalty”) that can be used if a model can predict negative values (#2294)
- Allow multiple datasets to be plotted with a single call (#1712, #2328)
Enhancements
- Provide easy access to the parameter values tried during a fit (#2315)
- Add support for XSPEC 12.14.1 and 12.15.0 (#2116, #2252)
- The interface to the XSPEC models has been simplified to make it more closely resemble XSPEC for additive models (#2275)
Bug fixes
- Always calculate the covariance matrix when using get_draws and eqwidth, and ensure the correct dataset identifiers are used (#2374)
- Improve the output of save_all for PHA data, in particular when using PHA2 data (#2377, #2382)
- Ensure backend-specific (e.g. matplotlib or bokeh) plotting options can be used (#2371)
- The sampling routines has seen updates related to the choice of the Random Number Generator (#2331), handling of linked parameters (#2333), the clipping of parameters (#2336)
Deprecations
- The sigma parameter has been renamed to scale for normal_sample (#2211)
- XSPEC table models must now be loaded via load_xstable_model and not load_table_model (#2352)
- Remove support for XSPEC 12.12.0 and 12.12.1 (#2329)
Details
#1712 - UI: plot multiple datasets at once
Allow multiple datasets to be plotted in a single call. Fix #1654.
#2211 - Rename the normal sample sigma parameter to scale
Rename the normal_sample sigma parameter to scale, to avoid confusion, and ensure that it works. Fix #2210. Fix #1736.
#2232 - TESTS: mark more that require the group module #2232
Mark several recently-added tests with the requires_group decorator. There is no functional change.
#2237 - BUILD: tweak conda installation environment
Change the installation location of parts of the build environment in the conda GitHub runs. There is no functional change.
#2259 - Add typing statements to the optimization code
Add typing statements to the optimization code. As part of this some of the classes and routines have seen changes in behaviour: use of keyword-only arguments, dropping the incomplete support for statargs and statkwargs, and removal of some optimization code not used by Sherpa. This is only visible to users calling the optimization routines directly.
#2271 - improve test coverage of the optimization code
Improve test coverage for the optimization code. There is no functional change to Sherpa.
#2275 - Internal change to additive XSPEC models
Internal changes to how Sherpa handles the normalization parameter for XSPEC additive models. Users of XSPEC user models will have to regenerate the code needed to build the Python interface code, but general use of Sherpa should not be impacted.
#2278 - Use modelCacher1D (now aliased to modelCacher) for 2D models
Set up caching for 2D models
#2283 - Improve the typing of plot and contour preferences
Be more-explicit about the preferences from plots and contours in typing statements and add or update some typing statements to use Python 3.10 syntax. There is no functional change to the code.
#2292 - Docs for Cash and CStat are wrong about truncate_value
Updated incorrect text to reflect that truncate_value is applied to model
#2293 - Improve docs for hard and soft limits
Hard and soft limits are already explained in the docs, but some details that might be useful for developers extending or building on Sherpa have been added. Since the audience of the added information are developers, and this is not typically an area that users need ot care about, the information has been added to a module docstring
#2294 - Add penalty for negative models to cstat
Add a version of the CStat statistic that provides a variable penalty if the model prediction is negative, rather than use a constant term. Fix #836.
#2298 - Allow building Sherpa without the region or wcssubs libraries
Allow Sherpa to be built without support for the region or wcssubs libraries.
#2302 - update zenodo DOI link for Sherpa 4.17.1
Update Release History entry for new Zenodo DOI number for 4.17.1 release
#2303 - Adding optimizers, options, and docs
Add optional dependencies to Scipy and optimagic and warp those as optimizers. Also adding docs on how to solve common fitting problems.
#2305 - Update pyproject.toml for PEP 639
Update license specification in pyproject.toml for PEP 639
#2306 - Allow restoring of BinaryOpModels
Fix #2301 (can't read saved sessions which contain composite models)
#2307 - Fix GCC version to 14.* for conda recipes
Explicitly sets the version of compiler used. closes #2304
#2308 -Remove pyds9
Remove pyds9 module.
#2309 - Support non-fork methods for multiprocessing
Allow the setting of the multiprocessing_start_method to spawn or forkserver. Note that this can degrade the performance of the code enough that it is then not worth using multiprocessing. Fix #2007
#2315 - Allow fit to be called with the record_steps argument
Allow the record_steps argument, added in #2280, to be used in the sherpa.astro.ui fit call. Fix #2318
#2316 - TESTS: add a test used by the Chandra Source Catalog
Add a test from the CSC code to exercise #2201. There are no functional changes.
#2319 - Allow Sherpa to be built with lib64 or free-threading
Allow Sherpa to be built with the free-threading build or on a platform that uses the lib64 rather than lib as a directory name (e.g. Fedora 42). There is no promise at this time that the free-threaded build is correct.
#2321 - Minor simplification of the extension code
Minor clean up of the extension code. There should be no functional changes.
#2325 - Update docstring for get_xsabundances
Correct the docstring for get_xsabundances so that it uses the term "Parameters" rather than "Parameter".
#2326 - CI: improve the test coverage (handle multiprocessing and add a ncores=1 run)
Update the coverage tests to better-handle the multiprocessing code. Add an explicit test with the ncores=1 option for the sherpa.rc file (rather than the default "ncores: None") for the pip CI runs (this changes an existing run rather than adding a new test). The coverage test reports should now include more lines covered. There is no functional change to Sherpa.
#2328 - Allow plot_fit_xxx to be sent multiple values for an argument to match plot
Allow the plot_fit_xxx and plot_bkg_fit_xxx calls to behave the same as plot("fit", xxx) and plot_model/source_components when sent a plot option as a sequence.
#2329 - XSPEC: drop support for XSPEC 12.12.0 and 12.12.1
Drop support for XSPEC 12.12.0 and 12.12.1.
#2330 - Ensure Fit.method gives the same answer as `F...
Sherpa 4.17.1
Release Highlights
This release of Sherpa includes various enhancements, documentation updates, bug fixes, and infrastructure changes.
-
enhancements:
- improved handling for OGIP products that do not follow the standards (#2235)
- Models can now be combined using arbitrary ufuncs (#2248)
- various updates to XSpec interface (#2281) and support for XSpec 12.15.0 including the additional of 17 new models (#2252)
- added interface to support ArviZ for analysis of Bayesian models (#2286)
-
documentation changes:
- provided option to install python packages needed to build sherpa documentation
-
infrastructure and testing:
- updated tests to work with python 3.13 (#2174)
-
bug fixes:
Details
#2039 - Add a security reporting policy
Added a statement defining plans to deal with security issues and where users should report them
#2047 - Opt Clean up
Improve the typing coverage of the sherpa.optmethods code and internal code clean up.
#2116- Add explicit support for XSPEC 12.14.1
Add models from XSPEC 12.14.1 and change the parameter settings to match those from 12.14.1, where necessary.
#2143 - Improve pre-commit script for ranges of years
Improve pre-commit script for ranges of years
#2156 - Add macOS ARM Conda Package Builds
Add macOS ARM Conda builds
#2164 - XSPEC: fix up error message
Correct the information provided in the unlikely case that an XSPEC model fails.
#2166 -Fix bug in cache code that limited cache size to 1.
Fix bug that limited cache size to 1.
#2170 - DOC: Example changes to Examples
Change the docstring for calc_source and calc_model to use Examples rather than Example.
#2171 - specify DS9 region format used in pytest
Explicitly set region format to use ds9 format for ds9 region pytests
#2174: Allow tests to pass with Python 3.13.0
Allow the tests to pass with Python 3.13.0.
#2178 - Post 4.17.0 update to add DOI info to the README.md
Adding the DOI for the 4.17.0 Release.
#2179 - add build doc option
Provide the doc installation option which will install the python packages needed to build the documentation along with Sherpa.
#2181 - Fix typo in return value
Correctly identify the return value of get_source_components_plot. This does not change the behaviour of the code.
#2182 - DOC: Use "Examples" rather than "Example"
Consistent use of "Examples" to indicate one or more examples in the documentation.
#2188 - TEST: address numpy 2 changes to output for docstring tests
Allow the documentation tests to pass when using NumPy 2.0. There is no change to the actual code.
#2191: TEST: fix test related to issue #800
Clean up a test. There is no functional change to the code.
#2195 - Update ci-conda-workflow to use Miniforge
Install Miniforge for use with ci-conda workflow.
#2198 - Allow both Intel and ARM macOS GitHub runners for the conda builds
Add a macOS ARM build, and update the macOS Intel build to use the macOS-13 runner.
#2201: Change how invalid limits are checked for within the MCMC code
Simplify a safety check within the MCMC proposed-parameter code.
#2203 - Allow pytest 8.3.4 to be used
Allow the tests to pass with pytest version 8.3.4 by changing the test code. The GitHub macOS conda action is updated to macos-13 (for the Intel build). There is no functional change here.
#2204 - Update the GitHub Actions badge for Conda and Pip workflows
Update the GitHub Actions badge in the README.md for the Conda and Pip workflows.
#2207- TESTS: avoid matplotlib version differences (fix #2206)
Allow tests to pass when using matplotlib 3.10.0. This only changes the tests. Fix #2206.
#2208: BUILD: update ds9 from 8.5 to 8.6
Bump to DS9 version 8.6 for testing on GitHub actions (Linux). There is no functional change.
#2209: update to change .bz2 references to .conda to account for changes
Modify workflows to use .conda instead of .bz2
#2213 - Better handle dataspace1d for DataPHA use cases when offset is not 1
The sherpa.astro.ui.utils.dataspace1d call can now be used to generate a channel grid that does not start at 1 for DataPHA data. The arguments are now checked to ensure they are sensible in this case (consecutive integer values).
#2214: Better handle fake_pha when offset is not 1
Allow fake_pha to work with missions where the first channel is not 1. Fix #2212.
#2215 - Minor xspec additions
Minor changes to the XSPEC module, including added documentation to the set_xsabund routine to note the availability of the "felc" table, and set_xsstate no longer requires all fields to be present.
#2226 - Allow user-statistics to be referenced by name to match the documentation.
Allow user-statistics to be set by name. The get_stat_name routine now returns the actual name of the user statistic, rather than the generic value "userstat". Fix #2225.
#2227 - Tests: compare Response1D and MultipleResponse1D behavior
Improve testing of the multi-response code. There is no change in behaviour here.
#2229 - Error out if model names are not strings
Raise an error if a model name is not a string
#2230 - Note that we need the file program to build Sherpa
Note that the file command is needed to build Sherpa (it is used by extern/configure).
#2231 - Two small astropy-related doc changes
Update links to astropy dev docs (that we link to in lieu of writing our own dev docs);
Recommend installing astropy via pip, not conda
#2232 - TESTS: mark more that require the group module
Mark several recently added tests with the requires_group decorator. There is no functional change.
#2233 - BUILD: pin conda-build (and therefore liblief) to last known working version
There's a bug between conda-build and lief that's causing a package build failure. This pins to "conda-
build==25.1.2=*_0", which we've also pinned to in CIAO for this same issue.
related Conda-build issue: conda/conda-build#5626
#2235 - Deal with OGIP products that do not follow the standards
Some OGIP products from missions occasionally do not follow the OGIP and FITS standards. Provide workarounds for two recent cases from NuSTAR and NICER (TLMIN/MAX values were recorded as a string, and a QUALITY array was stored as a boolean array). Fix #2185.
#2239 - REGION: test CXCDM region parser, when available
Allow the region module to know how it was built (whether reading FITS binary region files is supported). This allows for improvements to the tests.
#2240 - Minor typing updates
Minor internal changes to tests and code to improve typing statements and improve test coverage.
#2241 - drop "iterative fit method" in error-estimation screen output when not set
The screen output when calling an error-estimation routine like conf will no longer return the iterative-fit method name when it is set to None.
#2243 - Internal improvements to stats, fit, optimization, and error estimation
Add typing statements and apply minor code cleanup for the statistics, fit, optimization, and error estimation code. There is not expected to be any functional change unless code interacts with low-level details of the Sherpa code base.
#2248 - Allow combinations of models with arbitrary ufuncs
Models can now be combined using arbitrary ufuncs. Before, it was possible to say model1 + model2 to create a combined m...
Sherpa 4.17.0
Sherpa 4.17.0
This release of Sherpa includes various enhancements, documentation updates, bug fixes, and infrastructure changes.
- enhancements:
- add calc_model and calc_source functions to return an evaluated model/source array
- added wstat to plot_pvalue for the likelihood ratio test
- changed XSpec interface to use FunctionUtility C++ API instead of XSFortran API
- improved support for PHA data starting at channel 0 and handling of STAT_ERR and SYS_ERR PHA columns which are set to 0
- improved guess for complex models
- improved filtering handling
- several updates to enhance plotting capabilities and layout
- documentation changes:
- added paper citations to front page of Sherpa Read the Docs documentation
- cleaned up various typos and URL references
- added examples such as use of set_x/y_label
- infrastructure and testing:
- improved test coverage
- many updates to CI
- drop support for Python 3.9 and numpy <1.24
- initial/experimental support for Python 3.12
- bug fixes:
- fixed an issue with plotting 1D data with asymmetric errs after filter
- include the default identifier in save_all output if it has been changed
Details
#1757 - Allow the wstat statistic to be used in the likelihood-ratio test
Allow the Likelihood Ratio Test (as used by plot_value) to be run when
using the WStat statistic. Fix #1745.
#1793 - XSPEC move from the xsFortran API to the FunctionUtility API (where possible)
Internal change to the XSPEC interface to use the FunctionUtility C++ API
rather than the XSFortran API. Fix #1225.
#1921 - Clean up of the IO code
Rework the astro data input and output code so that they take advantage of
the new data representation in sherpa.astro.io.types
#1949 - Initial support for Python 3.12
Initial support for building with Python 3.12
#1997 - Add support for XSPEC 12.14.0
Allow building with XSPEC 12.14.0 and include the 50 new models in it.
#2017 - IO: separate pack and set commands
Replace the logic of the packup argument to the set I/O commands
#2033 - utils: add typing rules to random and parallel
Add typing statements to the sherpa.utils.parallel and sherpa.utils.random
modules
#2035 - stats: add typing rules
Add typing rules to sherpa.stats and minor internal clean up to the module.
#2036 - Update sherpa citations
Add Sherpa 4.16.1 to the citation data.
#2045 - Mark code as deprecated in sherpa.utils
Rework sherpa.utils and mark some symbols as deprecated - func_counter,
is_in, and mysgn - along with suggested replacements.
#2046- Post 4.16.1 update to add DOI info
Adds the Sherpa 4.16.1 DOI info to the README.md.
#2048 - CI: update the weekly arch run to add ppc64le and to use a supported python version
Support the weekly test builds using aarch64 and ppc46le architectures.
This support is considered experimental.
#2052 - XSPEC: do not test bvvnei unless 12.14.0i or later is used
Avoid testing the XSbvvnei model if XSPEC <= 12.14.0i is in use, as the
model can cause a crash in this case.
#2054 - Allow a file handle or Path object to be sent to the outfile parameter of fit
The fit call can now be sent a Path object or a file handle, as well as a
string. Fix issue #2063
#2056 - tests: fix fake_pha test failure on crates
Address test failures when using crates after merging #1684 and to address
a numerical tolerance issue on macOS ARM.
#2057 - Improve the guess routine for PHA data
Allow guess to work for composite models, including those with responses,
and improve the guess routine used for the norm parameter of XSPEC additive
models.
#2058 - Address an error introduced in PR 2025
Fix an error made when addressing NumPy 2.0 changes in issue #2025.
#2059 - Copy over typing annotations to the sherpa.ui and sherpa.astro.ui routines
Ensure that annotations are added to the sherpa.ui and sherpa.astro.ui
routines. Fix #2053
#2060 - Simple typing support for sherpa.data
Add some basic typing rules to the sherpa.data module.
#2061 - Avoid warning messages from AstroPy about unclosed files
Initial cleanup of the astro IO code in preparation for future changes.
This fixes an issue when using the AstroPy IO backend (pyfits) which could
cause Python to report an unclosed file on exit
#2065 - CI: enforce NumPy does not use version 2.0 for the builds
Ensure the CI builds use numpy<2
#2068 - CM-887: Updating macos gitlab runner images to version 12 and update the MacOS SDK to version 11.0
This ups the actions macOS Intel version to 12, and updates the macOS SDK
to version 11.0, which is consistent with CIAO.
#2069 - Allow the tests to pass with NumPy 2.0
Allow the tests to pass when using NumPy 2.0, as long as pytest-doctestplus
is not installed.
#2070 - Migrate to cxc xspec conda test channel
Use the cxc xspec test channel for Sherpa test workflows.
#2072 - Use the correct case for the symbol name in the parameter warning message
Change how the warning message for deprecated parameter names for models
is displayed
#2078 - Include the default identifier in save_all output if it has been changed
Record the default identifier in save_all output if the user has changed
it. Fix #2077
#2079 - minor cleanup of sherpa.optmethods
Internal clean up of the sherpa.optmethods code.
#2081 - minor plot cleanup
Clean up some plot code to make better use of modern Python idioms.
#2086 - data: allow axis labels to be changed
Allow the independent and dependent axis labels to be changed. Addresses
#2083
#2089 - minor cleanup of sherpa.optmethods
Internal change to handling of the optional output file option when calling
fit. There is no functional change.
#2091 - Asymmetric filter plot
Allow 1D data with asymmetric errors to be plotted after a filter. Fixes
#2090.
#2092 - Add a name field to the IO backends
Add a name field to the I/O backends. This is mainly useful for testing
and debugging.
#2094 - Improve messages about invalid file types (PHA)
Tweak the warning messages when files can not be read to better indicate
the type of file being loaded (for PHA related files).
#2102 - Change the URL for XPA
Change the URL used for XPA. Fix #2100.
#2103 - Ensure crates file reads are read-only
Ensure that we read in table data as read-only when using the crates I/O
backend.
#2105 - docs: typo fixes and remove some references.
Fix a typo in a docstring and change how two references are included in
the text.
#2107 - XSPEC: add show_xsabund command
Add the show_xsabund command to the sherpa.astro.ui module and
get_xsabundances to sherpa.astro.xspec.
#2108 - Asymmetric settings
Allow the statistic and optimizer to be changed when re-sampling data with
asymmetric errors. Fixes #2093.
#2109 - Add a set_xsabundances call for XSPEC users
Add a set_xsabundances call to make it easier to change one or more
elemental abundances for the XSPEC models and ensure that both the get
and set calls are available from the sherpa.astro.ui module.
#2111 - IO: ensure NUMELT/GRP are written out as integers for RMF header
Ensure the NUMELT and NUMGRP keywords for RMF files are written out as
integers.
#2112 - Minor typing cleanup
Clean up some of the recently-added typing rules.
#2115 - doc: add examples of using set_xlabel/ylabel
Add documentation showing the new set_xlabel/ylabel functionality from
#2086
#2118 - Improve support for PHA data starting at channel 0
Improve the handling of PHA files that start at channel 0. PHA data that
are read in from such a file no longer renumber the CHANNEL column to start
at 0 rather than 1, which will mean that notice and ignore filter ranges
that are given in channel units will need to be reduced by 1.
#2120 - Improve handling of STAT/SYS_ERR PHA columns
Improve handling of STAT_ERR and SYS_ERR PHA columns which are set to 0.
#2121 - UI: add calc_model/source commands
Add calc_model and calc_source routines to return the model expression
evaluated per bin.
#2123 - Data cleanups
Internal clean up of some of the data code.
#2125 - Allow per plot kwargs for plot_xxx_components calls
Allow per-plot keyword arguments for plot_model_components and
plot_source_components.
#2126 - Allow plot and contour to change the plot layout and have per-plot settings.
Expand the plot and contour commands to allow per-plot options to be given,
matching the plot_model_components/plot_source_components commands.
#2129 - Fix plot overplot
Improve the behaviour of plot() and contour() when called with
overplot=True or overcontour=True respectively. Fix #2128.
#2130 - data: fixup numpy import
Fix up several typing annotations from a recent refactoring.
#2133 - UI: add format and delim arguments to get_filter.
Allow the get_filter call to override the format and delim arguments. Fix
#1277
#2135 - Tests: tweak tolerances for macOS ARM #2135
Updated macOS ARM test tolerances
#2137 - Fix doctests in sherpa.plot.__init__
Changed documentation to match backends as objects instead of modules
#2138 - UI: add documentation for table to show_xsabund
The show_xsabund command now includes a description of the abundance table.
#2139 - Update helpdesk URL
Changed helpdesk link - fixes issue #1931
#2140 - Updated docs for asymmetric errors
Expanded documentation for load_ascii_with_errors to clarify assumptions for elo and ehi settings.
#2141 - Update LaTeX labels and doc...
Sherpa 4.16.1
Sherpa 4.16.1
This release of Sherpa includes various enhancements, documentation updates, bug fixes, and infrastructure changes.
- enhancements:
- minor plotting changes; add support for splitting model expression into
additive components and plot the results; support of log scale axes for
confidence plots; improved error messages for unavailable plot backends - improved RMF plot display to allow choice of energy units
- minor plotting changes; add support for splitting model expression into
- documentation changes:
- updates to fake_pha documentation
- updates to install.rst to fix incorrect links and outdated version references
- updated read the docs documentation to match current code
- bug fixes:
- fixed multi-panel plot issue with Bokeh backend
Details
#1608 - Remove the test setup.py option
Add the test configuration so that we can ensure the necessary testing
packages can be installed when the code is built. Support for running the
tests with 'python setup.py test' has been removed to match changes in the
Python packaging ecosystem.
#1679 - Automatically split a model expression into additive components and plot the results
Add plot_source_components and plot_model_components calls that will split
up a model like gal * (pl + line) into two lines: one for gal * pl and one
for gal * line. There are also corresponding get_source_components_plot and
get_model_components_plot calls, and the "source_components" and
"model_components" arguments can be used with the plot call.
#1684 -Fix fake_pha docs
Fix the documentation and some corner cases of sherpa.astro.fake.fake_pha.
There are several times when the simulated PHA output would not be correct
if the PHA contains at least one background component or a pileup model
was used.
#1926 - Let users know they should use load_xstable_model not load_table_model
Support for XSPEC table models in load_table_model was deprecated in the
4.9 release. Ensure users know that they should be using load_xstable_model
instead by adding a warning message whenever it is used.
#1934 - Zenodo broke the API we were using to request citation details.
Ensure that the sherpa.citation() command can query Zenodo for the release
information. Fix #1933.
#1938 - CI: temporarily remove ds9 tests on macOS
Avoid the DS9 tests on the macOS build to avoid the failure case we
currently often, but not always, trigger.
#1941 - Fix various typos
Updates from running codespell on source distribution
#1945 - Better error checks for table loads
Insure that table models are sent numeric columns, to catch cases like #1943.
#1946 - versioneer: update to version 0.29
Update the vendored copy of versioneer from 0.28 to 0.29.
#1947 - Ensure tests can be run when the group library does not exist
Annotate several tests with the requires_group decorator.
#1952 - Tests: better support of optional region/wcs dependencies
Ensure that the tests can pass if the region or WCS code is not available.
#1954 - CI: avoid failures due to missing pyarrow installation
Allow the CI runs to pass with new changes to pandas warning messages
(completely unrelated to Sherpa but caused the tests to fail).
#1957 - CI: support pytest 8.0.0
Allow the tests to pass when run with pytest 8.0.0.
#1959 - Support logarithmic axes for 1D and 2D confidence plots
The projection and uncertainty plots, for both interval (1D) and region (2D),
now correctly create a logarithmic scale when requested. Fix #1561.
#1962 - Pick up latest Python micro version in conda workflow
This resolves the missing crypt.h issue being seen in the conda test workflow
by picking up the latest micro version of the python packages for the conda
test build workflows.
#1965 - Improve the error message when a plot backend is not available.
Improve the error message when a plot backend is not available. Fix #1964
#1968 - Remove Conda build 3.25 pin from deployments
Removes the conda version specification (3.25) to avoid compatibility issues
#1969 - Tests: group the DS9 tests so they can be run with one worker process
Ensure those tests that use the requires_ds9 decorator all have the same
group marker, so that they will be run within a single worker process when
using pytest-xdist to run tests in parallel. There is no change if
pytest-xdist is not installed.
#1970 - Bump the minimum pytest version
Pytest occasionally changes behavior and it does not seem worth our time to
maintain backwards compatibility with old versions of pytest - see #1960
#1972 - Remove excess brackets in model names
Remove excess brackets from model and parameter expressions. This is purely
a cosmetic change, but hopefully makes complicated model expressions easier
to read. Fix #780.
#1973 - Fix the requires_pylab decorator
Change the testing code to better-handle those tests that want to check
plotting when using the pylab backend. Fix #1971.
#1974 - Allow linked parameters to be fit without including them in the model expression
Treat linked parameters as part of the model expression (via the new lpars
attribute and get_thawed_pars routine) so that they can be included in a
fit without including the linked model as part of the model expression.
Fix #777
#1976 - Fix bug in multi-panel plotting in bokeh
Fix bug in multi-panel plotting in bokeh
#1977 - model: improve examples in docstrings
Allow model.py, parameter.py, and regrid.py to be included in the
docstring pytest run.
#1984 - Rework x errorbar support to better-match community expectations
Improve the "x errorbar" handling for histogram-style data (including PHA),
including support for the wavelength setting (fix #1985), to better match
community expectations (e.g. #1817).
#1994 - Tests: improve coverage of parameter module
Improve the test coverage of the parameter module.
#1996 - docs: update examples to match current behavior
Update the ReadTheDocs documentation to match the current code.
#1998 - Cleanup XSPEC interface
A small number of XSPEC model parameter values have been changed to match
the default frozen state of XSPEC version 12.13.1.
#2000 - CM-481: update codecov action to v4, add upload token
Updates version of codecov being used
#2003 - Minor plot work
Internal clean up of the plotting code in preparation for future changes.
The ARFPlot class will now generate an IOErr rather than PlotErr if sent
a non-PHA dataset (to better match other calls). The DataHistogramPlot
class now treats xerr as a property that can not be changed, and is fixed
to be the half-width of the X bins, although note that this field is not
really used and may be removed at some point in the future.
#2004 - Minor improvements to the RMF plot capability
Improve the RMF plot display so that it recognizes the current units
setting and allows the choice of energies to be over-ridden by the user.
#2006 - Use a separate context when handling multiprocessing calls
Ensure that Sherpa does not change the global multiprocessing state but
instead uses the (new) sherpa.utils.parallel.context attribute. Fix #1015.
#2011 - Specialize the residual-style plots for histogram data
Improve the display of residual-style plots for integrated datasets.
Fix #1817.
#2012 - [CI] Update ci-conda-workflow.yml to pin back to macos-12
Pin back to macos-12. This version is specific to macOS-intel. 13 doesn't
work as conda is removed from it.
#2019 - update clone link and versions and DOI
This is a documentation update to fix the incorrect link in the source
install example. I also updated the version and DOI link in the description
of the source installation.
#2020 - CI: bump the checkout actions versions
Internal change to how the GitHub actions are run for CI.
#2021 - Update Conda Deployment Workflow Action Versions
Updates internal actions in the deployment workflow
#2025 - Improve support for NumPy 2.0
Improvements for running Sherpa with NumPy 2.0.
#2029 - Swap oldest-supported-numpy with numpy in requirements
Sherpa 4.16.0
Sherpa 4.16.0
This release of Sherpa includes various enhancements, documentation updates, bug fixes, and infrastructure changes.
- enhancements:
- the grouping commands like group_counts and group_snr now default to only grouping within the noticed range of channels, which is a change in behaviour
- new plotting backend: Users can now choose between matplotlib and bokeh (experimental) support use of arbitrary python functions when linking model parameters
- updates to fake_pha, save_all, allowing to write out RMF/ARF files
- get_plot_prefs and get_contour_prefs call to simplify access to the plot and contour preferences
- implementation of RMFPlot and DataIMGPlot classes and associated UI functions (plot_rmf, get_rmf_plot)
- update support for XSPEC to include version 12.13.1, allow XSPEC table models which include the ESCALE parameter, and provide experimental support for writing out XSPEC table models.
- documentation changes:
- added doc strings for sherpa data classes
- several updates to in code and RTD documentation
- Infrastructure changes:
- revamp of plotting backends from modules to classes and adding support for multiple backends
- changes to use the NumPy random generator API
- bug fixes:
Details
#1382 - Plot changes: Step 1 A- Draft API for backend classes
Plotting infrastructure changes that make the plotting backends classes
instead of modules.
#1617 - Pass keyword arguments to models
Allow keyword arguments to be passed to models and ensure these arguments
are respected by the model cache.
#1629 - Note when a XSPEC model is changed to F77 form (double precision)
Update a script used when updating the XSPEC support to point out models
that use the double-precision FORTRAN support. There is no functional
change to the code.
#1653 - Allow arbitrary functions for linking parameters
Provide a way to use any Python function to be used for linking
parameters. Fix #1652
#1730 - Update xspec model creation
Update the code created by the sherpa.astro.utils.xspec routines to
account for changes in the XSPEC interface in Sherpa. This only affects
users who call these routines directly.
#1734 - Unify the fake and fake_pha calls
The fake_pha call now accepts a method argument to match the fake call.
#1735 - Allow use of the NumPy random generator API
Take advantage of the NumPy random-number generator classes to provide
random numbers, and move away from using the global state provided by
numpy.random.seed and random.seed routines.
#1738 - Return more-useful information when an XSPEC model fails
Include the model name and parameter values in the error message of a failed XSPEC model.
#1750 - Replace pkg_resources as it is deprecated
Remove the use of the deprecated pkg_resources module and replace with use
of importlib.resources. Fix #1723
#1763 - Allow load_image to change the coordinate system
Ensure that the coordinate setting used in load_image calls is properly
handled (when not set to the default value of "logical"). Fix #1762
#1770 - Drop python2 ism in the fit code
Internal clean up of the fit code to replace a Python 2 method with a
Python 3 version and to use f-strings.
#1771 - utils: make sure OutOfBoundErr is an actual exception
Ensure that OutOfBoundErr is an exception (this is an internal feature).
#1772 - Tweak resample data code
Internal changes to the ReSampleData class to better handle invalid input.
#1773 - Internal clean up of estmethods
Code clean up of sherpa.estmethods.
#1775 - Change a single test to use explicit rather than implicit random state
from NumPy
Simplify a single test. There is no functional change.
#1776 - Move the parallel code into a separate module
Move the parallal_map code from sherpa.utils to the new sherpa.utils.
parallel module (the symbols are still accessible from the original
location but code should be updated to use the new location, including the
renames of _ncpus and _multi to ncpus and multi).#1777 - Change get_sample
to require named arguments
#1778 - Optmethods cleanup
Move testing code out of the optmethods modules and into a separate test,
along with a number of code clean ups. There is no functional change.
#1780 - Fix model plot display when factor is set for grouped PHA data (issue
#1779)
Ensure that model plots can be created for PHA data when set_analysis
routine is used to set factor > 0 and the data is grouped. Fixes #1779 and
#1784
#1781 - utils: remove the numpy_convolve routine
Remove the sherpa.utils.numpy_convolve routine.
#1785 - Add docs to Sherpa data classes
Add docstring to most Sherpa dataclasses.
#1791 - Tests: ensure repeatable test of get_draws
Ensure tests of get_draws use a fixed seed to make the results
reproducible. There is no functional changes in this commit.
#1794 - docs: note requirement on ar for building Sherpa
Add ar to the list of requirements for building Sherpa. Fix #1792
#1795 - Add docs to describe the inputs for the calc function of a user
model
Add docs that describe the arguments of the calc function for user models.
#1797 - model: explicitly send parameter argument to calc
Ensure that the calc method for models begins with the parameter array
(explicitly given) rather than extracting it from the named arguments sent
to the routine. This should not change any user code.
#1800 - utils: minor code clean up
Internal clean up of the sherpa.ui.utils module.
#1805 - Clean up display of dataset ids during fits
Ensure dataset ids are listed without leading brackets in the fit and
staterror string outputs (remove an accidental change made in #1770). Fix
#1804
#1806 - Activate sphinx directive to make plots
Use the Sphinx plot directive to generate (some of) the plots in the docs.
#1807 - NumPy 1.25 support
Remove deprecation warnings seen when using NumPy 1.25.0.
#1808 - Use Sherpa install instead of code only to build docs
Switches from building the documentations from the source directory, to
building it from an installed version of Sherpa.
#1809 - Update the hardcoded Zenodo releases to include the 4.14/4.15 releases
Update the stored Zenodo releases to include the 4.14.* and 4.15.* Sherpa
releases. Users should see no difference (other than avoiding the need for
an http call to retrieve this information) when calling sherpa.citation().
#1810 - RTD: fix script name for XSPEC updates
Improve the documentation on how to update to a new XSPEC version by
ensuring the correct helper script is run in an example.
#1811 - ui: use the default pickle version when dumping the state
Use the default version when pickling data (used by the UI save call)
rather than an old version. Fix #1243
#1812 - Autoupdate copyright year in sphinx docs
Autoupdate copyright year in sphinx docs.
#1813 - Fix ReadTheDocs warnings and then make RTD fail on warnings in CI
Fix ReadTheDocs warnings and then make RTD fail on warnings in CI.
#1819 - CI: hide NumPy 1.25 array ndim>0 deprecation warnings
Allow the tests to run with NumPy 1.25 and with Crates (from CIAO 4.15) as
the I/O backend. There are no functional changes.
#1821 - parallel: tweak ordering of checks for parallelization
Internal change to the decision of whether to use the multiprocessing
module to run code or not.
#1823 - sherpa_test: tweak how pytest/plugins are installed
Internal changes to how we check for test requirements used by the
sherpa_test script.
#1824 - remove non-existent datastack plotting backend initialization attribute
Clean up error condition by removing the sherpa.plot.backend.
initialize_backend attribute as no longer exists.
#1828 - Improve PHA source plots: support type=counts and factor above 1
Source plots for PHA data now follow the rate and factor analysis
settings. Prior to this the rate setting was ignored and the factor
setting produced incorrect values for factor=1 and factor=2). Fix #1825
#1829 - Limit precision in the comparison of string outputs
Update the tests to support running on ARM/AARCH64 platforms where numeric
differences can complicate string comparisons. Fix #1815.
#1832 - astropy: rework RMF input (fix #1344)
Allow the AstroPy backend to read in HRC-I RMF data. Fixes #1344.
#1835 - Note compatibility with XSPEC 12.13.1
Note that Sherpa can be built against XSPEC 12.13.1 and update some
parameter ranges or defaults to match the new values from this release.
#1836 - Allow ARF and RMF to be written out
Support writing out ARF and RMF data to FITS files (and, for ARF, ASCII
files). Fix #1699, #1695, and #203.
#1839 - ui: add get_plot_prefs/get_contour_prefs calls
Add the get_plot_prefs and get_contour_prefs call to simplify access to
the plot and contour preferences.
#1840 - Fix #1828 - histogram plot issue
Fix up the histogram display for the unlikely case when the bin edges have
at least one gap, the low edges are integer values, and the high edges are
floating-point values.
#1841 - Minor refresh of AstroPy I/O code for better FITS and ASCII output
Minor rework of the sherpa.astro.io.pyfits_backend module to improve on
the output (both FITS and ASCII), such as a closer mapping of the data
type used on disk and written out to file, and some chang...
Sherpa 4.15.1
Sherpa 4.15.1
This release of Sherpa includes various enhancements, documentation updates, bug fixes, and infrastructure changes.
- enhancements:
- further improvements to filtering/grouping including reporting a filter change in the UI
- fake_pha can be called with a list of ARF/RMF names
- added linewidth option for line and histogram plots
- documentation changes:
- fixed broken URLs
- improved documentation for templates, plot_pvalue
- added documentation testing with doctestplus
- Infrastructure changes:
- dropped support for Python 3.8
- experimental support of Python 3.11
- supported versions of Xspec are 12.12.0 - 12.13.0
- bug fixes:
- various updates to notice/ignore and group/ungroup code
- fixed issue with show_bkg
- fixed issue when binning values into a 1D histogram
- fixed cache errors with the TableModel class
Details
#1396 - XSPEC minimum version is now 12.10.1
Bump the minimum-supported version of XSPEC from 12.9.0 to 12.10.1.
(superseded by #1609)
#1472 - tests: remove work-around for #1334 from #1336
Remove a test work around for our CI tests failing (issue #1334)
#1486 - Improve filtering/grouping behavior
Changing the grouping array of a PHA dataset (with set_grouping from the UI layer
or by setting the grouping attribute of a DataPHA object) will now re-create the
filter, to fix #1160.
It is suggested that the filter expression (e.g. as returned by the get_filter
routine for uses of the UI layer) is checked to ensure the result is still sensible.
#1502 - Cleanup template code
Improve the documentation and testing of the template-model code. There is no
significant change in behavior, but some use cases will generate more-appropriate
errors than they used to.
#1591 - Document params and return values for root finding functions
Add docstrings for root finding functions
#1607 - Fix an issue when binning values into a 1D histogram
Fix a problem when binning data into a histogram (issue #1605).
#1609 - XSPEC minimum version is now 12.12.0
Bump the minimum supported XSPEC version to version 12.12.0.
#1611 - Post 4.15.0 updates
Add the 4.15.0 DOI to the README.md.
#1613 - Allow testing of the documentation
Adds the ability to run doctests in py and rst files. Those tests will run
automatically, if doctestplus is installed (not on CI in the current setup) and
the file is not explicitly blacklisted for doctestplus.
#1621 - Fix a cache error with TableModel
Fix cache errors with the TableModel class (#1622), add validation of input
values, and minor additions to the documentation.
#1630 - Add support for XSPEC 12.13.0
Add explicit support for XSPEC 12.13.0. Sherpa can be built against XSPEC
12.13.0 without this PR, but this adds in support for the new cglumin
convolution model added in this release.
#1637 - report the filter changes when grouping is changed for the ui
Report the filter when data is grouped with UI commands - such as group,
group_counts, and set_grouping - to match the notice/ignore behavior added in
#1562. The logic for setting the background group flag has been moved from the
UI layer to the DataPHA class. Addresses #1632.
#1644 - Deployments via GH Actions
Dropped support for RH7 and macOS 10.15
#1656 - CIAOX deployments require force. As they deployed for main already.
Based on the current scheme used for the build number, we need to force uploads
for CIAOX as they have already been deployed for main. This was already done for
the previous GitLab builds.
#1660 - Associated group fixes
Clean up of the notice/ignore and group/ungroup code to avoid unnecessary work,
move logic from the UI layer into the DataPHA class, and ensure that if the
grouping field is set to None that the data is not grouped. Fix #1641, #1657,
and #1659
#1662 - Add grouping tests
Add a number of tests to check out corner case behavior, primarily for grouping
PHA data but there's also a number of routines from the UI code that have missed
some tests.
#1664 - Allow save_model/source/resid to work with 2D data (fix #1642)
Fix save_model/source/resid calls when used with 2D data sets. Fix #1642
#1665 - Fix an issue with show_bkg (fix #1645)
The show_bkg routine could fail when the set of backgrounds is not the same for
all datasets (e.g. one has a background and another does not). Fix #1645
#1666 - model-wrapped symbols now reference the actual model (fix #215)
Wrapped models, accessible from the UI layer, now reference the wrapped model
rather than being devoid of any useful information. Fix #215
#1672 - models: f-string changes
Change the models code to use f-strings where appropriate rather than other methods
of string interpolation. There is no change in behavior.
#1675 - Bump ds9 to 8.4.1 - Ubuntu 20 and macOS BigSur
Bump to the latest DS9 version and update to ubuntu20 version. This resolves #1674
#1676 - update model macro definitions for compiled code
Re-work the macro definitions used to build the compiled models and use this to
clean up the handling of the XSPEC models, in particular table models. There is
no functional change.
#1681 - XSPEC test cleanup
Minor clean up to some XSPEC tests to make better use of pytest.
#1689 - Address regression created by #1672
Internal change to the Sherpa-specific logging code, to ensure that logged
message includes all components. This fixes #1688 which was a regression created
when #1672 was recently merged.
#1693 - Test cleanup related to #1334
Complete the cleanup related to removing the #1334 workaround which was added in
#1336. These two tests were missed from #1472 (which was meant to remove these
changes). The two test files have also seen some minor style changes (no change
in behavior).
#1696 - Docs: fix #1694
Correct a link in the RTD documentation.
#1697 - Ds9 test tweaks
Minor cleanup of the DS9 tests (no functional change)
#1698 - Update versioneer to 0.28
Update the version of versioneer included in Sherpa from 0.21 to 0.28. Fix #1677.
#1708 -Ensure string id can be used for the background id in the DataPHA notice/ignore call
Allow a string identifier to be used for the bkg_id argument to the
DataPHA.notice (and ignore) method, fixing #1709 (it does not affect users
using the ui layer).
#1711 - plot: add linewidth option
Add the linewidth option for line and histogram plots (e.g. plot_data,
plot_model, plot_fit) with the matplotlib backend.
#1715 - utils: rework the error-column saving code
Internal clean up of the save_*error routines. There is no change in behavior.
#1716 - utils: tweak internal _save_type routine
Minor internal change to a routine in the utils code. There is no change in
behavior.
#1720 - Fix get_stat_info output for individual components
Fix the get_stat_info output for multiple PHA data when the data has a different
number of background components (fix #1721). The get_bkg_model routine will now
use the source PHA for a response if the background has no response (to match
what fit and fit_bkg do, fix #1724).
#1733 - Allow fake_pha to be called with a list of ARF/RMF names of length 1
Allow fake_pha to be called with a list of ARF and RMF names that only contains
one element. Fix #1722
#1739 - pyfits: be more lenient with FITS files with messed-up headers
Allow some FITS files with an invalid header to be used with the AstroPy I/O
backend.
#1747 - reduce chance of plot_pvalue getting stuck in a bad parameter space
Ensure that each simulation step for the likelihood ratios code, as used by
plot_pvalue, starts with the same parameter values to reduce the chance that the
results can get stuck in certain areas of parameter space. The ratios field of
the LikelihoodRatioResults structure - e.g. the return value of
get_pvalue_results() - can be plotted to see if this has happened (e.g. large
ranges where the ratio is close to zero.
#1751 - Explicitly require attrs module when testing Sherpa
Ensure that the attrs module is available for testing Sherpa.
#1752 - Drop Python 3.8 and Pick up Python 3.11 as a beta
move to be NEP-29 compliant with python version
#1753 - Initial support for Python 3.11
Basic support of Python 3.11.
#1755 - Tests: replace use of attrs package by dataclass
Change a test file to use data classes rather than use the attrs module, which
means that attrs is no-longer needed to test Sherpa. There is no functional
change in this PR.
#1756 - Fix broken URL in docs
Updated URLS which are no longer valid
#1759 - updated plot_pvalue docs
Updated docstring for plot_pvalue to include reference to the algorithm
#1760 - Tweak test tolerances mac arm
Improve test reliance when running on the macOS ARM platform
Sherpa 4.15.0
Sherpa 4.15.0
This release of Sherpa includes various enhancements, documentation updates, bug fixes, and infrastructure changes.
- enhancements:
- Improved validation of arguments when creating Data objects:
- arrays sent to Data objects are now converted to ndarrays
- the independent axis is now made read-only
- the size of a data object is now fixed.
- Filter setting with notice/ignore are reported to the screen for the users of the UI layer.
- Increased test coverage for plotting
- Improved validation of arguments when creating Data objects:
- documentation changes:
- updated readthedocs to use pip and pytest instead of setup.py
- several updates to documentation, including updates to fake_pha, calc_ftest, calc_mlr
- Infrastructure changes:
- Drop support for Python 3.7
- Updates to start creating Python 3.10 Conda packages.
- Use Numpy 1.20 for Python 3.8/3.9 and Numpy 1.21 for Python 3.10.
- Moves toward PEP-517 with some distutils cleanup and more configuration moved from setup.py to setup.cfg
- Various improvements to the GitHub Actions and GitLab workflows
- bug fixes:
- Ensure chi2xspecvar errors match XSPEC when 0 counts are present during background subtraction
- Remove model instances from the global symbol table when clean is called
- Addresses new warnings in the tests for Matplotlib 3.6.0 and AstroPy 5.1
- Minor copy and paste error in fake_pha docstring
- Test issues in test_fake_pha.py due to randomness
Details
#1329 - Build updates (move towards PEP-517 support)
Move the Sherpa build system towards a more static configuration (PEP 517)
#1412 - XSPEC: initialize XSPEC library at load time
Simplify how and when the XSPEC model library is initialized. Fixes #1388
#1477 - Add data validation
Improve the validation of arguments when creating Data objects- Arrays sent to
Data objects are now converted to ndarrays, the independent axis is now made
read-only, the size of a data object is now fixed.
#1504 - CI: rework setup
Update the GitHub workflows for Continuous Integration to better take advantage
of the workflow language.
#1505 - RTD use pip/pytest rather than setup.py for install/develop/test
Change the RTD documentation to use pip and pytest rather than setup.py when
building and testing Sherpa
#1507 - tests: ensure DS9 window is closed after the tests
Ensure that any DS9 process started by the Sherpa tests is closed when the tests
are finished.
#1510 - Tests: improve test coverage of plot code
Improve the testing coverage for several plot routines.
#1513 - Minor UI tweaks
Added validation to the set_xlog/ylog/xlinear/ylinear and updated save_model,
save_source, save_resid, and save_delchi commands from sherpa.ui to not error
out if not given an explicit identifier.
#1516 - Consolidate plot and set_xlog handling
Use the same labels for the plot and set_xlog/set_ylog/set_xlinear/set_ylinear
functions. As a result, a number of names can no-longer be used as an identifier
for a dataset (bkg_chisqr, bkg_delchi, bkg_fit, bkg_model, bkg_ratio, bkg_resid,
bkg_source).
#1519 - Use direct html links instead of using [1] and a reference section
This replaces the use of a "References" section with direct URL links in
particular in cases where the reference is just a plain old HTML website and
not a scholarly publication.
#1523 - Ensure the region-lib code is re-generated when needed
Fix a build issue with clang where the region-library code caused an error
message
#1529 - Add arguments to -i in sed calls in config script
Update sed command in config script for improved portability
#1532 - Add plot related tests
Add more tests to cover corner case scenarios (mostly plotting related).
#1534 - docs: fix calc_ftest/mlr documentation
Note that calc_ftest and calc_mlr can return an array or scalar value, depending
on the input.
#1536 - Tests: add more tests of get_order_plot/plot_order
Add a test for multiple orders and plot_order.
#1537 - Remove model instances from the global symbol table when clean is called
Ensure that models are removed when clean() is called.
#1538 - Ensure chi2xspecvar errors match XSPEC when 0 counts are present during background subtraction
When using the chi2xspecvar statistic for estimating PHA errors, ensure that the
errors match those calculated by XSPEC when the background is subtracted and the
source or background group contains 0 counts
#1540 - Tests: fix the random seed for a fake_pha test
Remove randomness from a test.
#1547 - Fix CI failures from AstroPy 5.1 warning changes
Allow the macOS tests to run on CI with AstroPy 5.1.
#1554 - Install New libxcb Dependencies for Qt
For Linux GitHub Actions, we now install libxcb dependencies required for
Conda's Qt package.
#1555 - Bump the ci-pip-arch workflow to ubuntu-20.04
Update to use ubuntu 20 as GutHub Actions is deprecating ubuntu 18.04
#1562 - report the change in the filter because of calls to notice and ignore
When a notice or ignore call - including the variants like notice_id and
ignore2d - then the change in the filter is reported to the screen (for users
of the ui layer).
#1563 - Add Python 3.10 Conda Builds, Drop Python 3.7 and Numpy <1.20, Switch to Pip for Conda Builds
Drop official support for Python 3.7 and start creating Python 3.10 Conda
packages. Our Conda builds now use Numpy 1.20 for Python 3.8/3.9 and
Numpy 1.21 for Python 3.10.
#1566 - GitLab: Add version info to deploy test, update test OS, and allow interrupt.
Updates to gitlab to support automated tests, save version info, set default to
interruptible to allow canceling pipelines, and switched to source conda instead
of adding it to the path
#1567 - Fix minor copy and paste error in fake_pha docstring
Make UI layer fake_pha work for XMM/RGS by accepting input of arf=None when an
RMF file is given.
#1569 - Minor changes to the fake_pha test added in #1567
Internal changes to the test added for fake_pha in #1567
#1572 - Tests: fix a logical test error
Fix a logical error in a plotting test.
#1574 - Avoid occasional test errors from Tcl_AsyncDelete
Switch the matplotlib tests to use the Agg backend to avoid possible
Tcl_AsyncDelete errors (issue #1509)
#1578 - Gitlab: Reduce artifact retention period
reduces artifact retention from 2 weeks to 3 days due to new gitlab 5gb
restrictions
#1579 - Add back --python removed in #1566
reinserts --python flag that was accidentally removed in #1566
#1580 -add a versionchanged note for the fake_pha command
Update the documentation to note the change to fake_pha in #1567
#1585 - Tests: work around matplotlib 3.6.0 warning
Allow the tests to pass when run with matplotlib version 3.6.0.
#1589 - Set the language when building the documentation
Ensure the language setting is defined for recent versions of Sphinx
#1594 - gitlab-ci: Set build num to 0 if not set
Set the default Sherpa build number to 0 in our GitLab workflow to know which
package to run deploy tests on for official release builds.
#1600 - Change the histogram1d and 2d routines so that they do not sort the input arguments
Address some failures in histogram1d and histogram2d routines by making sure
they copy the input arguments before sorting them.
Caveats
Sherpa 4.14.1
Sherpa 4.14.1
This release of Sherpa includes various enhancements, documentation updates, bug fixes, and infrastructure changes.
- enhancements:
- various plotting backend improvements
- various i/o backend improvements
- data object class improvements
- basic support for Xspec 12.12.1
- beta support for python 3.10
- documentation changes:
- updated build with CIAO documentation
- Add a missing class (DataOgipResponse) to the documentation
- Improves the docstrings for DataPHA
- fixed typos in plot docs
- clean up readthedocs issues such as missing bullets
- Infrastructure changes:
- updates for compatibility with Clang 12.0
- updates to the regression tests
- bug fixes:
- Improve the FITS headers created when writing out a PHA file (to better match OGIP standards)
- addresses delete_model_component call failing if a key does not exist
- fixed issue with writing a PHA dataset as a table rather than a PHA file
- ensure FITS column access is case insensitive
- image handling and image coordinates
Details
#1030 - Update lev3fft test to use PHYSICAL not WCS
Update a 2D image test to use physical rather than WCS coordinates for the fit.
#1185 - Simplify switching the astro.io backend
Add dummy_module, docs, and test case for switching the sherpa.astro.io backend.
io backend are now tried in a default order (crates, pyfits, dummy)
#1191 - Make it easier to switch the plotting backend
Make is easier to switch the plotting backend (note that we currently only have on
backend implemented anyway)
#1207 - Improve OGIP headers in PHA files
Improve the FITS headers created when writing out a PHA file (to better match OGIP
standards). Fixes #488 and #1209
#1314 - test: add requires_data decorator
Add a needed decorator for a test. There's no functional change to the code.
#1317 - Add requires group test decorators
Ensure the tests that require the group library are marked with the requires_group
decorator.
#1318 - Adjust a test for python 3.10
Adjust a test so that it passes with Python 3.10
#1326 - Write-up that environment variable in setup.cfg need to be expanded
Add a detail to developer docs about compiling in a conda ciao environment
#1328 - Versioneer cleanup
Update the versioneer module we use from 0.14 to 0.21 (latest).
#1331 - optmethods: remove Deprecation warning about invalid escape string
Remove a deprecation warning from sherpa.optmethods.optfcts and update some fake_pha
tests to each use a fixed random seed.
#1332 - Add Instrument test
improved the psf tests, adding low-level tests of the tcdData class
#1337 - Fix import statements
Change from using import to importlib.import_module.
#1338 - clean up some C/C++ code in the _psf.cc file
Minor clean up of C/C++ code
#1339 - Add codecov.yml to fix path issue and update codecov uploader
Fix path parsing issue on codecov as well as updated for the new codecov uploader
#1340 - Change how the sherpa config file is accessed
Support environments where the HOME environment variable is not set when accessing
the Sherpa configuration file.
#1347 - Refactored array classes cause std::vector has non-virtual destructor
std::vector has non-virtual destructor so in this PR the refactored Array (1D and 2D)
classes no longer inherit from std::vector
#1348 - Minor internal code cleanup tracking errors
Minor internal changes to how some errors are raised. There should be no
user-visible differences due to this changes.
#1351 - Update the sherpa-test-data repo to the latest from main
updates that reference to the latest copy
#1353 - Fix issue with delete_model_component
The delete_model_component call could fail in certain circumstances, so fix those
cases. Fixes #16
#1355 - Minor cleanup of the I/O code
Minor internal clean-up of the I/O code. There should be no user-visible changes.
#1359 - Improve writing out data objects as a table (fix #47)
Fix writing out of PHA datasets as a generic table (both ASCII and FITS formats).
Fixes #47
#1360 - Add missing export statement to clang 12 note
Update documentation to be clearer on how to build on clang 12 and avoid compiler
error on implicit function declarations
#1361 - Ensure FITS column access is case insensitive for the pyfits I/O backend (fix #143)
Allow FITS colummn access with the pyfits backend to be case insensitive. Fixes #143.
#1365 - Simplify a test (fix #541)
Remove duplicated code in a test (fix #541).
#1370 - Minor tweaks to handling of PHA settings
Improve the checking of the factor and rate settings of set_analysis and the
plot_fac attribute of the DataPHA class, and add a few tests that exercise some
corner cases of the DataPHA class.
#1374 - Address aarch/ppc64le test failures
Update tests to that they pass on aarch64. Fixes #1372
#1376 - Very-minor tweaks to docs/tests
Fix a minor test issue and an unused reference in the documentation.
#1387 - minimize C++ code duplications (rebase)
Remove code duplication in the XSPEC module.
#1399 - Allow conf/covar/proj to be used with XSPEC model parameters (regression)
Ensure that conf, covar, and proj can be called with an XSPEC model parameter.
Fixes #1397.
#1401 - Modified region code to remove implicit prototype error
This change updates the extern region code in sherpa to resolve a missing prototype
which causes build issues with clang 12.0.
#1403 - Updates to fix typos in the plot documentation
Update to fix a few typos in the plot documentation
#1410 - Add script and docs for pre-commit hook to update copyright
Add example script for a git pre-commit hook that checks the copyright is up to date.
#1411 - Add sphinx_rtd_theme to sphinx extensions and set min version
Our readthedocs pages have had some visual issues (in particular, bullets point
where missing from output) for a while. This fixes that by ensuring we are using
a recent version of the sphinx theme.
#1413 - Add more editor/OS exclusions to .gitignore
Add a VSCode workspace summary files and MacOS directory preview files to .gitignore
#1414 - Improve the handling of image coordinates
Address an error when converting between different coordinate systems for images.
Fixes #1380.
#1415 - RTD fix missing and changed symbols
Update the ReadTheDocs build to cope with changes in #1191
#1418 - Fix minor test issues
Address several minor test issues.
#1419 - Keep .rc file backwards compatible
Default rc files will work in older version of sherpa as well.
#1421 - Address usability issues with Data2DInt and DataIMGInt classes
Fix issues using the Data2DInt and DataIMGInt classes (#1379).
#1423 - fix a compiler bug on macOS
update to address compiler issue when compiling on macOS
#1424 - rm primini stat method
This PR removes the primini iterative statistical method. Please see issue #1392
for details
#1425 - Allow users to freeze models
Models can now be frozen or thawed, which just calls the requested on all the
parameters of the model (except for "alwaysfrozen" parameters which are skipped).
This is only relevant for users who are accessing the objects directly since the ui
versions of freeze and thaw already implemented this behavior. Fixes #1080.
#1429 - Tests: fix up test problems shown by pytest 7.0.0
Fix up several tests so they can be run with pytest 7.0.0. Fixes #1428
#1434 - Fix aarch64 test failures
Allow the tests to pass on aarch64 (numerical precision checks).
#1435 - Minor clean up of the data code
Improves the docstrings for DataPHA, adds tests for several corner-cases, and makes
some minor code improvements to the code.
#1440 - Minor clean up of the data routines
Address several minor code-style changes in the data handling (code and tests).
#1441 - Clean up the data tests
Clean up of the data tests which were added as part of the data-class rework in #614.
#1442 - Ensure channel and count fields for PHA are aliases of independent and dependent axes
Ensure that channel and the independent axis and counts and the dependent axis are
synonymous for the DataPHA class.#1451 - Tests: ensure sherpa smoke tests are done
in a clean environment
#1453 - Tests: mark those that require the group module
Note a number of tests that require the group module.
#1454 - RTD: update copyright year and fix WCS library
Update the sphinx build instructions so that changes from PR #1414 will be documented
correctly on systems where the documentation is being built without first compiling
the code (such as read-the-docs).
#1455 - RTD: update the build-from-CIAO documentation
Update the "build with CIAO" documentation to match the CIAO 4.14 conda instructions
and automate the process.
#1458 - Improve several issues when building and testing Sherpa
Minor improvements to the build and test installation. The use of setuptools has
been restricted to match the current advice from NumPy (< 60, from
https://numpy.org/devdocs/reference/distutils_status_migration.html).
#1461 - Minor grouping cleanup
Minor internal change to how the group routines work for PHA objects.
#1462 - Docs: fix up documentation of ui.set_grouping
Fix the documentation for set_grouping to match the code.
#1463 - rm a redundant call to calc_h
Removed a redundant call the the calc_h method in the class fdJac
#1464 - RTD: include the DataOgipResponse class in the documentation
Add a missing class (DataOgipResponse) to the documentation.
#1473 -...
Sherpa 4.14.0
Sherpa 4.14.0
This release of Sherpa includes various documentation updates, bug fixes, enhancements, and infrastructure changes.
- enhancements:
- filtering and grouping area for binned (1D) spectral data has been improved
with changes to the default behavior and many bug fixes resulting in changes
to the statistics, degrees-of-freedom and energy flux in comparison to the
previous version for the same data with the same filter. - updates to allow users to change the hard limits of XSPEC model parameters
- the sample_flux routine now returns correct information for the clip column
- filtering and grouping area for binned (1D) spectral data has been improved
- documentation changes:
- improved PHA simulation documentation
- improved Filtering and grouping of PHA data documentation
- added sherpa.image module documentation
- added section on running tests to developer docs
- Infrastructure Changes:
- updates to support Apple ARM
- update to support Xspec version 12.12
- update fftw from version 3.3.8 to 3.3.9
- clean up of compiler and sphinx warnings
- changes to support gcc 9.3.0 in conda defaults
- updates to support python 3.9 including readline 8.1 upgrade, numpy minimum 1.19 (numpy 1.18 minimum for python 3.7/8)
- test infrastructure clean up and updates
- bug fixes:
- updates to fix several 'unable to parse region string: None' errors
- fix issue where save_all() of a loaded image with no region filter would fail on reload
- fixed issue with plot_model() being called before notice or ignore could lead to filters not getting applied
- fix to error out instead of crash when grouping data using an unsupported method
Details
#1031 - Update fwhm calculation
Update the estimation of FWHM for 1D profiles, and hence the guess method for
Gauss1D and related routines. The 2D models use the same routine so see these
changes.
#1073 - Allow fake_pha to be called with an identifier of None
The fake_pha command now treats id=None as the default id. This addresses #1064.
#1106 - The sample_flux routine now returns the correct information for the clip column
The sample_flux routine now returns correct information for the clip column
(that is, it matches the clipping done by this routine). There may be changes to
the reported error ranges because of this change.
#1107 - Add some grating related keywords for repr_html for ARF, RMF, PHA
Add keywords to the default output in the repr_html for some X-ray classes.
#1113 - XSPEC: support etable table models
Allow XSPEC ETABLE table model files to be read by load_xstable_model by
setting the etable parameter.
#1118 - Improve test cases for source plots with PHA data
Add additional test cases for source plots with PHA data to check out
rarely-used combinations.
#1127 - PHA filtering changes
Improve some corner cases for filtering PHA data, including fixing #921 (channel
bounds are integers, not half-integers).
#1131 - Test: fix a test failure when XSPEC installed but no fits backend
Avoid running a test we know to fail for an uncommon combination of options.
#1134 - This is a doc-string only update for load_multi_XXX
The previous example implied that a spectrum may contain both positive and
negative orders in the same spectrum. That can happen only after coadding -
and in that case one would co-add the arfs as well.
#1135 - Added docstring and removed unused no-op class
Remove sherpa.astro.models.MultiResponseSumModel which did nothing and seems
to be unused (except in a test that explicitly skip this class).
#1136 - Replace error message "too few columns" with a more generic word
Change the wording of an error message. Potentially breaking if someone tests
for the wording of the error message in their code, but certainly more correct.
#1137 - Correct docstring for fake_pha
The old docstring claims that the background is just scaled and not simulated,
but there is definitely a call to poisson_noise for the background in the code.
#1138 - Address NumPy 1.20 bool/int/float deprecation warnings
NumPy 1.20 notes that numpy.bool, numpy.int, and numpy.float will be removed
and users should just use bool, int, and float instead, so these symbols have
been changed. This is a follow on to #1092
#1140 - Fix some remaining master/main renames
clean up references to master with main
#1143 - add basic test and documentation for Integrate1D
Add basic testing of the integrate1d model class and improve its documentation.
#1144 - A minor cleanup of estmethods
A minor cleanup of the sherpa.estmethods code.
#1147 - Tests: support use of data directory being local, not absolute
Allow a test to pass when given a relative path for the test data directory.
#1154 - Update docs on RTD builds
Update docs on how the docs are build in CI
#1155 - Remove Meta class for fits hdu headers
Remove Meta class for header information that is used only rudimentary and
acts almost, but not quite, like a dict
#1163 - XMM/RGS triggers a notice/ignore bug because channels are in reverse-energy order in RMF
Recent work on the ignore / notice logic in #1127 implicitly assumes that the
energy grid in PHA/ARF/RMF files is in increasing order, which does not hold
true for XMM/RGS data
#1164 - Fix plots with wavelength general:visualization type:bug
For some data files, plots with a reversed grid (i.e. plots in wavelength) were
drawn with disjoint lines since #906.
#1165 - Add a section on running the tests to the developer docs
Add a section on running the tests to the developer docs
#1168 - Logging tweaks
Include the sherpa.utils.logging module in the documentation and update a test
to use the caplog feature of pytest (the code had been written to work with
python 2.7 version of unittest).
#1170 - Update Python and particularly number versions in documentation
Updates to doc pages that list dangerously old numpy versions
#1171- Improve the grouping/filtering tests
Add a number of tests for corner cases of filtering and grouping of PHA data.
#1172 - Improve data pha docs
Improve the documentation of the filtering and grouping of PHA data.
#1173 - Improve DataPha documentation
Minor improvements to the documentation of the DataPHA class.
#1175 - Store UI contour plots in a dictionary, not directly
Change the internal storage handling of contour objects
#1177 - minor rework of image handling for ui layer
Change the internal storage handling of image objects and improved testing
#1178 - Define physical constant hc in fewer places
hc (as in "Planck constant * speed of light") is a physical constant that does
not depend on the DataPHA and thus it should not be defined as a class attribute.
#1180 - Minor improvements to model/parameter documentation
Minor fixes and improvements to the documentation (both docstrings and RTD)
for the model- and parameter-related code.
#1182 - Simulations with multiple responses
Enable simulations with multiple ARF/RMF present (e.g. LETG/HRC).
#1183 - Check parameter link behavior
Minor tweaks to the parameter tests.
#1184 - Better pha model component plotting (fix #1020)
The use of plot_model_component and get_model_component will now automatically
add the response for PHA data sets, if there is one. Model expressions which
contain a response will not be changed. Fixes #1020.
#1187 - Conda GCC 9.3.0 update issue
update to support environment changes due to conda defaults updates for
gcc 9.3.0
#1192 - Remove Python 3.6 and add Python 3.9
updates to switch python support to python 3.7-3.9
#1194 - datastack: Improve show_stack and add repr_html for stack
Improve datastack display (via show_stack and in the notebook) for datastacks.
#1198 - XSPEC test cleanup
Very minor improvement to the XSPEC test suite.
#1199 - Move the regrid code out into a separate method
Very minor code reorganization for the regrid code.
#1203 - Update GitLab Conda recipe to numpy 1.19
updates gitlab conda recipe to python 1.19+ and adds run time pin
#1204 - region lib updates for CIAO 4.14
updates to fold in changes to CIAO region lib for CIAO 4.14. Specifically,
fixes for SM-89: bug in pie shape (extent/inside logic), SL-243: region -
deprecate obsoleted Warning.
#1205 - Remove the SherpaTestCase class
Remove the SherpaTestCase class from sherpa.utils.testing and switch the tests
that used it to use pytest functionality where appropriate.
#1208 - Fix get_xerr for Data1DInt when all data is filtered
The get_xerr method of Data1DInt would fail if all bins had been ignored and
it now returns the empty list.
#1215 - Restrict the values used in PHA notice/filter calls
Ensure that the low and high limits for notice and ignore calls for DataPHA
objects are sensible (hi >= lo and that for energy or wavelength filters they
are >= 0). When filtering DataPHA objects in channel units the lo and hi
arguments must be integers otherwise an error is raised.
#1216 - filter improvements for DataPHA and Data1DInt
Energy and wavelength filters (with notice and ignore) for PHA data are now
treated as lo <= x < hi in all cases, and channel filters are lo <= x <= hi
(where the channel values must be integers). For Data1DInt cases the notice
and ignore filters are treated as lo <= x < hi. This changes address a number
of corner cases.
This can result in slightly different fit results because the data used in the
fit can be changed and hence changing the number of degrees of freedom (by one
o...
Sherpa 4.13.1
Sherpa 4.13.1
This release of Sherpa includes various documentation updates, bug fixes, and infrastructure changes. The default branch in github has been migrated from master to main.
- documentation changes:
- updates to documentation for TableModel, Notice2D, cache support for evaluating models, and low level optimization code
- jupyter notebook uopdates
- Infrastructure Changes:
- the master branch has been migrated from master to main
- updates to support numpy 1.20
- updates to support astropy 4.2.1
- updates to support matplotlib 3.4
- test infrastructure clean up and updates
- bug fixes:
- fix an issue with cache evaluation on 1D models using integrated bins
- fix for aarch64 build issue
- fix to sherpa citation command
- fix to honor clearwindow setting for plot_source
- fix errors from save_data when the output file exists
- fix build issues using gcc 7.3 with -Werror=format-security compilation flag
- fix for reg_proj and reg_unc erroring out when the min or max arguments are tuples rather than lists
Details
#754 - sample_flux now returns statistic values for each row
The sample_flux command now returns a statistic value for each iteration,
even if those rows are not used in the reported flux distribution. Fixes #751.
#769 - add basic cache tracking
Adds the cache_status and cache_clear methods to models for verifying the
cache behavior (this is only expected to be used in rare cases). The cache
code has seen documentation improvements.
#946 - rework stats tests
Update the stats tests to use pytest.
#960 - Fix model evaluation when changing the integrate setting (fix #958)
Fixes an issue with cache evaluation on 1D models using integrated bins and
the user has changed the integrate setting of the model.
#978 - Use C99 def for INFINITY, NAN, isfinite and isnan to build on aarch64 (fix issue #970)
Use the math constants (IFINITIY, NAN) and funcs (isfinite, isnan, signbit)
from a C99 compliant compiler if the compiler option -std=c99 or greater is
used, otherwise use the quantities as defined by the library.
#991 - lint changes
Applies a number of flake8-reported warnings to the code base (e.g. excessive
or missing spaces and new lines).
#1000 - Improve sherpa.citation (fix #994 #987)
Fixes the sherpa.citation() command with its default argument (issue #994) and
adds release 4.12.2 to the hard-coded list of releases. A typo in a warning
message was fixed (#987).
#1001 - Allow command-line arguments for sherpa_test
Allow command-line arguments to be passed to the sherpa_test script. This allows
running optional tests (e.g. the --runzenodo argument) and to configure the
pytest configuration (e.g. to run coverage checks with --cov sherpa).
#1002 - Fix error with clobber=False for paging - issue #996
Fix an error with clobber=False when the output file exists for several paging
commands (e.g. show_data and sherpa.citation). Instead of getting a Sherpa IOErr
being raised a NameError was being raised.
#1003 - Fix serialization of iter method data - issue #997
If set_iter_fit_method has been called with a value other than 'none' then the
output of save_all would be incorrect for the options for the iter-fit method.
#1004- flake8 F811 - fix repeated test names
Clean up of several test files to fix repeated test names.
#1005 - Add explicit get/set_datadir routines to sherpa.utils.testing
Internal changes to how the test data directory location is set and queried,
including removing direct support from SherpaTestCase. Added tests for some
of this functionality, and updated several test files to remove SherpaTestCase
or use the new datadir functionality.
#1008 - rm warning msgs, fix issue #980
Fix the compiler warning messages, by defining kwlist to be static const then
use the C++ const_cast to remove the const to conform to PyArg_ParseTupleAnd
Keywords prototype
#1012 - Tests: allow test_ui tests to be run with pytest-xdist
Allow the tests to be run with pytest-xdist.
#1016 - Jupyter notebook representation not ideal if model components don't have unique names - issue: #1013
Fix an error in the HTML display of a model (used in the notebook) when two
model components have the same name.
#1017 - reword remark on normalization of Lorentz function
Updated the comments pertaining to Lorentz function for clarity
#1018 - Fix ShekelModifiedInit missing init par vals
This PR fixes the missing initial fitted parameter values for the
ShekelModifiedInit function. A fix for issue #1011
#1028 - Update region lib code to correct build issues with gcc 7.3.0 compile
Corrects issue building with gcc 7.3.0+ compilers with the
-Werror=format-security compilation flag
#1034 - Add contextmanager and docs on how to control the output level of sherpa
Sherpa uses logging for much of its output, this adds a docs and a context
manager for controlling the output level for a particular piece of code.
#1039 - Add docs for basic.TableModel
Added missing documentation for TableModel class
#1049 - CI: pip submodule test to report coverage
Report the coverage data from the pip CI run. This only changes the GitHub
Actions runs.
#1053 - Release 4.13.0
Updates to support the 4.13.0 release
#1054 - Post 4.13.0 updates
Updates the Zenodo DOI reference in the README.md to include 4.13.0.
#1057 - Fix plot_source clearwindow setting
The plot_source function was ignoring the clearwindow parameter (always using
True) in calls to plot_source for non-PHA data. This was only for
sherpa.astro.ui.plot_source (so sherpa.ui.plot_source did not have this problem).
#1058 - Store the opstr of model combinations (unary and binary)
Store the operator string as well as the operator when creating the unary and
binary operator expressions for models.
#1062 - Minor code cleanup of sherpa.astro.ui.utils
The sherpa.astro.ui.utils module has seen a number of minor clean-ups, addressing
pylint-reported issues.
#1067 - Improve testing of sherpa.astro.ui.utils
Improve coverage of the sherpa.astro.ui.utils and require pytest 3.9.0 or later
for testing Sherpa.
#1068 - clean up typos in sherpa/plot code
Fixed several typos noticed while reviewing plot related fix for #1057
#1072 - Update load_data to match load_pha for PHA2 data
Ensure that load_data behaves like load_pha when given a PHA2 dataset.
#1076 - sample_flux now uses the id argument
The sample_flux routine now uses the id argument rather than always using the
data from the default dataset. Fixes #752
#1078 - Add error checking for exceptional cases for sample_flux
Ensure that sample_flux errors out if the Xrays argument is False (as this code
path is currently broken) or if the confidence argument is invalid.
#1082 - Improve documentation for notice2d
Minor improvements to the documentation of notice2d and ignore2d set of commands.
Fixes #1059
#1086 - Use the logging infrastructure for sample_flux output
The screen output from sample_flux is now generated by the Sherpa logger and
so can be hidden by the user if required.
#1088 - Allow two optimization test to pass
Address an issue in the optimization tests that meant two tests were failing.
This only changes the test code and makes no change to the behavior of the
optimizers.
#1092- Numpy 1.20 warnings
Avoid test failures due to new warnings added by NumPy 1.20
#1094 - Cleanup multi-plot code
Rework the code that handles the plot_fit_xxx and plot_bkg_fit_xxx calls.
There should be no user-visible changes.
#1096 - Reduce direct access to plot objects
Changes to the internals of the plot code, to access information via methods
rather than direct access, which improves encapsulation and reduces code
repetition.
#1098 - Bump DS9 version to 8.2 for CI
Bump DS9 version used in CI tests from 8.1 to 8.2.
#1100 - Address reg_proj and reg_unc failures (fix #1093)
Calls to reg_proj and reg_unc could error out when the min or max arguments
were set to tuples rather than lists. The code now converts these attributes
to lists, which can result in changes to the string output of the objects (use
of '[]' brackets rather than '()'). Fixes #1093
#1101 - Address upper limit issues with sample_flux (fix #457)
sample_flux no-longer excludes samples at the parameter bounds (soft) when
calculating the flux distribution. This could lead to an over-estimation of
the flux for upper limits (Fix #457).
#1104 - Add basic documentation for the low-level optimization code
Add and update documentation on the interfaces used by the low-level
optimization code. Ensure that the plot classes are fully included in the
documentation.
#1105 - Consolidate and harmonize the validation of dataset identifiers
Simplify the code used to validate dataset identifiers. Several names can
no-longer be used as an identifier ('astrocompmodel', 'astrocompsource',
'astrodata', 'astromodel', 'astrosource', 'model_component', and
'source_component') and two can now be used ('energy' and 'photon').
#1108 - Read RMFs where N_CHAN is an array
Allow the pyfits backend to read a wider range of RMF files
#1111 - Minor test updates
Minor updates to the test code, including a small enhancement to the tests run by
the smoke_test command.
#1112: XSPEC: require model evaluation to be sent low and high grid values
XSPEC model classes must now be evaluated with bin edges - that is with
...