Skip to content

Commit

Permalink
Merge sherpa#1997 (DougBurke) - Add support for XSPEC 12.14.0
Browse files Browse the repository at this point in the history
Add support for XSPEC 12.14.0
  • Loading branch information
wmclaugh committed May 24, 2024
2 parents db4aadb + 150f65c commit a0d2319
Show file tree
Hide file tree
Showing 12 changed files with 4,779 additions and 958 deletions.
13 changes: 2 additions & 11 deletions .github/scripts/setup_xspec.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,8 @@ xspec_library_path=${xspec_root}/lib/
xspec_include_path=${xspec_root}/include/

case "${XSPECVER}" in
12.13.1*)
xspec_version_string="12.13.1"
;;
12.13.0*)
xspec_version_string="12.13.0"
;;
12.12.1*)
xspec_version_string="12.12.1"
;;
12.12.0*)
xspec_version_string="12.12.0"
12.1*.* )
xspec_version_string="${XSPECVER:0:7}"
;;
*)
echo "Xspec version listed currently unsupported in GitHub Actions jobs."
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/ci-conda-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
fits: astropy
test-data: submodule
matplotlib-version: 3
xspec-version: 12.13.1
xspec-version: 12.14.0h

- name: Linux Minimum Setup (Python 3.9)
os: ubuntu-latest
Expand All @@ -54,7 +54,7 @@ jobs:
test-data: submodule
matplotlib-version: 3
bokeh-version: 3
xspec-version: 12.13.1
xspec-version: 12.14.0h

- name: Linux Full Build (Python 3.10)
os: ubuntu-latest
Expand All @@ -63,7 +63,7 @@ jobs:
fits: astropy
test-data: submodule
matplotlib-version: 3
xspec-version: 12.13.0c
xspec-version: 12.13.1

- name: Linux Full Build (Python 3.9)
os: ubuntu-latest
Expand Down Expand Up @@ -228,4 +228,4 @@ jobs:
token: ${{ secrets.CODECOV_TOKEN }}
files: ${{ github.workspace }}/coverage.xml
verbose: true


8 changes: 5 additions & 3 deletions docs/developer/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -335,8 +335,8 @@ Update the XSPEC bindings?
--------------------------

The :py:mod:`sherpa.astro.xspec` module currently supports
:term:`XSPEC` versions 12.13.1, 12.13.0, 12.12.1, and 12.12.0. It may
build against newer versions, but if it does it will not provide
:term:`XSPEC` versions 12.14.0, 12.13.1, 12.13.0, 12.12.1, and 12.12.0.
It may build against newer versions, but if it does it will not provide
access to any new models in the release. The following sections of the
`XSPEC manual
<https://heasarc.gsfc.nasa.gov/xanadu/xspec/manual/XspecManual.html>`__
Expand Down Expand Up @@ -797,7 +797,9 @@ available.
https://heasarc.gsfc.nasa.gov/xanadu/xspec/manual/XSmodel<Name>.html

where ``<Name>`` is the capitalised version of the model name (e.g.
``Agnsed``).
``Agnsed``), although it only works for the "default" version of
a model name (e.g. ``Apec`` covers the ``vapec``, ``vvapec``,
``bapec``, ... variants)..

* Models that are not in older versions of XSPEC should be marked with
the ``version_at_least`` decorator (giving it the minimum supported
Expand Down
4 changes: 2 additions & 2 deletions docs/indices.rst
Original file line number Diff line number Diff line change
Expand Up @@ -151,5 +151,5 @@ Glossary
`models from XSPEC
<https://heasarc.gsfc.nasa.gov/xanadu/xspec/manual/XSappendixExternal.html>`_.

Sherpa can be built to use XSPEC versions 12.13.1, 12.13.0,
12.12.1, and 12.12.0.
Sherpa can be built to use XSPEC versions 12.14.0, 12.13.1,
12.13.0, 12.12.1, and 12.12.0.
25 changes: 19 additions & 6 deletions docs/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,20 @@ by the actual path to the HEADAS installation, and the versions of
the libraries - such as ``CCfits_2.6`` - may need to be changed to
match the contents of the XSPEC installation.

1. If the full XSPEC 12.13.1 system has been built then use::
1. If the full XSPEC 12.14.0 system has been built then use::

with-xspec = True
xspec_version = 12.14.0
xspec_lib_dirs = $HEADAS/lib
xspec_include_dirs = $HEADAS/include
xspec_libraries = XSFunctions XSUtil XS hdsp_6.33
ccfits_libraries = CCfits_2.6
wcslib_libraries = wcs-8.2.1

where the version numbers were taken from version 6.33.1 of HEASOFT and
may need updating with a newer release.

2. If the full XSPEC 12.13.1 system has been built then use::

with-xspec = True
xspec_version = 12.13.1
Expand All @@ -263,7 +276,7 @@ match the contents of the XSPEC installation.
where the version numbers were taken from version 6.32 of HEASOFT and
may need updating with a newer release.

2. If the full XSPEC 12.13.0 system has been built then use::
3. If the full XSPEC 12.13.0 system has been built then use::

with-xspec = True
xspec_version = 12.13.0
Expand All @@ -273,7 +286,7 @@ match the contents of the XSPEC installation.
ccfits_libraries = CCfits_2.6
wcslib_libraries = wcs-7.7

3. If the full XSPEC 12.12.1 system has been built then use::
4. If the full XSPEC 12.12.1 system has been built then use::

with-xspec = True
xspec_version = 12.12.1
Expand All @@ -283,7 +296,7 @@ match the contents of the XSPEC installation.
ccfits_libraries = CCfits_2.6
wcslib_libraries = wcs-7.7

4. If the full XSPEC 12.12.0 system has been built then use::
5. If the full XSPEC 12.12.0 system has been built then use::

with-xspec = True
xspec_version = 12.12.0
Expand All @@ -293,7 +306,7 @@ match the contents of the XSPEC installation.
ccfits_libraries = CCfits_2.6
wcslib_libraries = wcs-7.3.1

4. If the model-only build of XSPEC - created with the
6. If the model-only build of XSPEC - created with the
``--enable-xs-models-only`` flag when building HEASOFT - has been
installed, then the configuration is similar, but the library names
may not need version numbers and locations, depending on how the
Expand All @@ -318,7 +331,7 @@ module, but a quick check of an installed version can be made with
the following command::

% python -c 'from sherpa.astro import xspec; print(xspec.get_xsversion())'
12.13.0
12.14.0b

Other options
^^^^^^^^^^^^^
Expand Down
65 changes: 63 additions & 2 deletions docs/model_classes/astro_xspec.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,36 +23,77 @@ The sherpa.astro.xspec module
XSacisabs
XSagauss
XSagnsed
XSagnslim
XSapec
XSbapec
XSbbody
XSbbodyrad
XSbcempow
XSbcheb6
XSbcie
XSbcoolflow
XSbcph
XSbequil
XSbexpcheb6
XSbexrav
XSbexriv
XSbgadem
XSbgnei
XSbkn2pow
XSbknpower
XSbmc
XSbnei
XSbnpshock
XSbpshock
XSbremss
XSbrnei
XSbsedov
XSbsnapec
XSbtapec
XSbvapec
XSbvcempow
XSbvcheb6
XSbvcie
XSbvcoolflow
XSbvcph
XSbvequil
XSbvexpcheb6
XSbvgadem
XSbvgnei
XSbvnei
XSbvnpshock
XSbvpshock
XSbvrnei
XSbvsedov
XSbvtapec
XSbvvapec
XSbvvcie
XSbvvgadem
XSbvvgnei
XSbvvnei
XSbvvnpshock
XSbvvpshock
XSbvvrnei
XSbvvsedov
XSbvvtapec
XSbvvwdem
XSbvwdem
XSbwcycl
XSbwdem
XSc6mekl
XSc6pmekl
XSc6pvmkl
XSc6vmekl
XScabs
XScarbatm
XScemekl
XScempow
XScevmkl
XScflow
XScflux
XScglumin
XScheb6
XScie
XSclumin
XScompLS
XScompPS
Expand All @@ -63,6 +104,7 @@ The sherpa.astro.xspec module
XScomptb
XScompth
XSconstant
XScoolflow
XScpflux
XScph
XScplinear
Expand All @@ -78,11 +120,13 @@ The sherpa.astro.xspec module
XSdiskpn
XSdust
XSedge
XSeebremss
XSeplogpar
XSeqpair
XSeqtherm
XSequil
XSexpabs
XSexpcheb6
XSexpdec
XSexpfac
XSezdiskbb
Expand All @@ -92,6 +136,7 @@ The sherpa.astro.xspec module
XSgnei
XSgrad
XSgrbcomp
XSgrbjet
XSgrbm
XSgsmooth
XShatm
Expand All @@ -100,6 +145,7 @@ The sherpa.astro.xspec module
XShrefl
XSireflect
XSismabs
XSismdust
XSjet
XSkdblur
XSkdblur2
Expand All @@ -111,6 +157,8 @@ The sherpa.astro.xspec module
XSkyrline
XSlaor
XSlaor2
XSlog10con
XSlogconst
XSlogpar
XSlorentz
XSlsmooth
Expand All @@ -130,6 +178,7 @@ The sherpa.astro.xspec module
XSnsx
XSnteea
XSnthComp
XSolivineabs
XSoptxagn
XSoptxagnf
XSpartcov
Expand Down Expand Up @@ -175,8 +224,13 @@ The sherpa.astro.xspec module
XSvarabs
XSvashift
XSvbremss
XSvcempow
XSvcheb6
XSvcie
XSvcoolflow
XSvcph
XSvequil
XSvexpcheb6
XSvgadem
XSvgnei
XSvmcflow
Expand All @@ -193,14 +247,19 @@ The sherpa.astro.xspec module
XSvsedov
XSvtapec
XSvvapec
XSvvcie
XSvvgadem
XSvvgnei
XSvvnei
XSvvnpshock
XSvvpshock
XSvvrnei
XSvvsedov
XSvvtapec
XSvvwdem
XSvwdem
XSwabs
XSwdem
XSwndabs
XSxilconv
XSxion
Expand All @@ -218,6 +277,7 @@ The sherpa.astro.xspec module
XSzgauss
XSzhighect
XSzigm
XSzkerrbb
XSzlogpar
XSzmshift
XSzpcfabs
Expand All @@ -230,15 +290,16 @@ The sherpa.astro.xspec module
XSzvphabs
XSzwabs
XSzwndabs
XSzxipab
XSzxipcf

Class Inheritance Diagram
=========================

.. inheritance-diagram:: XSagauss XSagnsed XSagnslim XSapec XSbapec XSbbody XSbbodyrad XSbexrav XSbexriv XSbkn2pow XSbknpower XSbmc XSbremss XSbrnei XSbtapec XSbvapec XSbvrnei XSbvtapec XSbvvapec XSbvvrnei XSbvvtapec XSbwcycl XSc6mekl XSc6pmekl XSc6pvmkl XSc6vmekl XScarbatm XScemekl XScevmkl XScflow XScompLS XScompPS XScompST XScompTT XScompbb XScompmag XScomptb XScompth XScph XScplinear XScutoffpl XSdisk XSdiskbb XSdiskir XSdiskline XSdiskm XSdisko XSdiskpbb XSdiskpn XSeplogpar XSeqpair XSeqtherm XSequil XSexpdec XSezdiskbb XSgadem XSgaussian XSgnei XSgrad XSgrbcomp XSgrbm XShatm XSjet XSkerrbb XSkerrd XSkerrdisk XSkyrline XSlaor XSlaor2 XSlogpar XSlorentz XSmeka XSmekal XSmkcflow XSnei XSnlapec XSnpshock XSnsa XSnsagrav XSnsatmos XSnsmax XSnsmaxg XSnsx XSnteea XSnthComp XSoptxagn XSoptxagnf XSpegpwrlw XSpexmon XSpexrav XSpexriv XSplcabs XSposm XSpowerlaw XSpshock XSqsosed XSraymond XSredge XSrefsch XSrnei XSsedov XSsirf XSslimbh XSsnapec XSsrcut XSsresc XSssa XSstep XStapec XSvapec XSvbremss XSvcph XSvequil XSvgadem XSvgnei XSvmcflow XSvmeka XSvmekal XSvnei XSvnpshock XSvoigt XSvpshock XSvraymond XSvrnei XSvsedov XSvtapec XSvvapec XSvvgnei XSvvnei XSvvnpshock XSvvpshock XSvvrnei XSvvsedov XSvvtapec XSzagauss XSzbbody XSzbknpower XSzbremss XSzcutoffpl XSzgauss XSzkerrbb XSzlogpar XSzpowerlw
.. inheritance-diagram:: XSagauss XSagnsed XSagnslim XSapec XSbapec XSbbody XSbbodyrad XSbcempow XSbcheb6 XSbcie XSbcoolflow XSbcph XSbequil XSbexpcheb6 XSbexrav XSbexriv XSbgadem XSbgnei XSbkn2pow XSbknpower XSbmc XSbnei XSbnpshock XSbpshock XSbremss XSbrnei XSbsedov XSbsnapec XSbtapec XSbvapec XSbvcempow XSbvcheb6 XSbvcie XSbvcoolflow XSbvcph XSbvequil XSbvexpcheb6 XSbvgadem XSbvgnei XSbvnei XSbvnpshock XSbvpshock XSbvrnei XSbvsedov XSbvtapec XSbvvapec XSbvvcie XSbvvgadem XSbvvgnei XSbvvnei XSbvvnpshock XSbvvpshock XSbvvrnei XSbvvsedov XSbvvtapec XSbvvwdem XSbvwdem XSbwcycl XSbwdem XSc6mekl XSc6pmekl XSc6pvmkl XSc6vmekl XScarbatm XScemekl XScempow XScevmkl XScflow XScheb6 XScie XScompLS XScompPS XScompST XScompTT XScompbb XScompmag XScomptb XScompth XScoolflow XScph XScplinear XScutoffpl XSdisk XSdiskbb XSdiskir XSdiskline XSdiskm XSdisko XSdiskpbb XSdiskpn XSeebremss XSeplogpar XSeqpair XSeqtherm XSequil XSexpcheb6 XSexpdec XSezdiskbb XSgadem XSgaussian XSgnei XSgrad XSgrbcomp XSgrbjet XSgrbm XShatm XSjet XSkerrbb XSkerrd XSkerrdisk XSkyrline XSlaor XSlaor2 XSlogpar XSlorentz XSmeka XSmekal XSmkcflow XSnei XSnlapec XSnpshock XSnsa XSnsagrav XSnsatmos XSnsmax XSnsmaxg XSnsx XSnteea XSnthComp XSoptxagn XSoptxagnf XSpegpwrlw XSpexmon XSpexrav XSpexriv XSplcabs XSposm XSpowerlaw XSpshock XSqsosed XSraymond XSredge XSrefsch XSrnei XSsedov XSsirf XSslimbh XSsnapec XSsrcut XSsresc XSssa XSstep XStapec XSvapec XSvbremss XSvcempow XSvcheb6 XSvcie XSvcoolflow XSvcph XSvequil XSvexpcheb6 XSvgadem XSvgnei XSvmcflow XSvmeka XSvmekal XSvnei XSvnpshock XSvoigt XSvpshock XSvraymond XSvrnei XSvsedov XSvtapec XSvvapec XSvvcie XSvvgadem XSvvgnei XSvvnei XSvvnpshock XSvvpshock XSvvrnei XSvvsedov XSvvtapec XSvvwdem XSvwdem XSwdem XSzagauss XSzbbody XSzbknpower XSzbremss XSzcutoffpl XSzgauss XSzkerrbb XSzlogpar XSzpowerlw
:parts: 1

.. inheritance-diagram:: XSSSS_ice XSTBabs XSTBfeo XSTBgas XSTBgrain XSTBpcf XSTBrel XSTBvarabs XSabsori XSacisabs XScabs XSconstant XScyclabs XSdust XSedge XSexpabs XSexpfac XSgabs XSheilin XShighecut XShrefl XSismabs XSismdust XSlog10con XSlogconst XSlyman XSnotch XSolivineabs XSpcfabs XSphabs XSplabs XSpwab XSredden XSsmedge XSspexpcut XSspline XSswind1 XSuvred XSvarabs XSvphabs XSwabs XSwndabs XSxion XSxscat XSzTBabs XSzbabs XSzdust XSzedge XSzhighect XSzigm XSzpcfabs XSzphabs XSzredden XSzsmdust XSzvarabs XSzvfeabs XSzvphabs XSzwabs XSzwndabs XSzxipcf
.. inheritance-diagram:: XSSSS_ice XSTBabs XSTBfeo XSTBgas XSTBgrain XSTBpcf XSTBrel XSTBvarabs XSabsori XSacisabs XScabs XSconstant XScyclabs XSdust XSedge XSexpabs XSexpfac XSgabs XSheilin XShighecut XShrefl XSismabs XSismdust XSlog10con XSlogconst XSlyman XSnotch XSolivineabs XSpcfabs XSphabs XSplabs XSpwab XSredden XSsmedge XSspexpcut XSspline XSswind1 XSuvred XSvarabs XSvphabs XSwabs XSwndabs XSxion XSxscat XSzTBabs XSzbabs XSzdust XSzedge XSzhighect XSzigm XSzpcfabs XSzphabs XSzredden XSzsmdust XSzvarabs XSzvfeabs XSzvphabs XSzwabs XSzwndabs XSzxipab XSzxipcf
:parts: 1

.. inheritance-diagram:: XScflux XScglumin XSclumin XScpflux XSgsmooth XSireflect XSkdblur XSkdblur2 XSkerrconv XSkyconv XSlsmooth XSpartcov XSrdblur XSreflect XSrfxconv XSrgsxsrc XSsimpl XSthcomp XSvashift XSvmshift XSxilconv XSzashift XSzmshift
Expand Down
5 changes: 3 additions & 2 deletions helpers/xspec_config.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (C) 2014-2017, 2018, 2020, 2021, 2022, 2023
# Copyright (C) 2014 - 2018, 2020 - 2024
# Smithsonian Astrophysical Observatory
#
#
Expand Down Expand Up @@ -29,7 +29,8 @@
# "c" in "12.12.0c" as that is not helpful to track here.
#
SUPPORTED_VERSIONS = [(12, 12, 0), (12, 12, 1),
(12, 13, 0), (12, 13, 1)]
(12, 13, 0), (12, 13, 1),
(12, 14, 0)]


# We could use packaging.versions.Version here, but for our needs we
Expand Down
16 changes: 8 additions & 8 deletions sherpa/astro/ui/tests/test_serialize.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,14 +231,14 @@
src.Abundanc.units = ""
src.Abundanc.frozen = True
src.redshift.default_val = 0.0
src.redshift.default_min = -0.999
src.redshift.default_max = 10.0
src.redshift.val = 0.0
src.redshift.min = -0.999
src.redshift.max = 10.0
src.redshift.units = ""
src.redshift.frozen = True
src.Redshift.default_val = 0.0
src.Redshift.default_min = -0.999
src.Redshift.default_max = 10.0
src.Redshift.val = 0.0
src.Redshift.min = -0.999
src.Redshift.max = 10.0
src.Redshift.units = ""
src.Redshift.frozen = True
src.norm.default_val = 1.0
src.norm.default_min = 0.0
Expand Down
3 changes: 2 additions & 1 deletion sherpa/astro/utils/xspec.py
Original file line number Diff line number Diff line change
Expand Up @@ -1115,7 +1115,8 @@ def marker(label):
# This needs to be kept in sync with helpers/xspec_config.py
#
SUPPORTED_VERSIONS = [(12, 12, 0), (12, 12, 1),
(12, 13, 0)]
(12, 13, 0), (12, 13, 1),
(12, 14, 0)]

xspec_version = (int(match[1]), int(match[2]), int(match[3]))
for version in SUPPORTED_VERSIONS:
Expand Down
Loading

0 comments on commit a0d2319

Please sign in to comment.