Skip to content

Commit 2d84a68

Browse files
committed
Deprecate legacy and separate example galleries
1 parent c9740cd commit 2d84a68

15 files changed

+48
-35
lines changed

docs/conf.py

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# http://www.sphinx-doc.org/en/master/config
66

77
import datetime
8-
import pathlib
8+
from pathlib import Path
99

1010
from packaging.version import Version
1111

@@ -76,10 +76,10 @@
7676
# Example configuration for intersphinx: refer to the Python standard library.
7777
intersphinx_mapping = {
7878
"python": ("https://docs.python.org/3/", (None, "http://data.astropy.org/intersphinx/python3.inv")),
79-
"numpy": ("https://docs.scipy.org/doc/numpy/", (None, "http://data.astropy.org/intersphinx/numpy.inv")),
80-
"scipy": ("https://docs.scipy.org/doc/scipy/reference/", (None, "http://data.astropy.org/intersphinx/scipy.inv")),
81-
"matplotlib": ("https://matplotlib.org/", (None, "http://data.astropy.org/intersphinx/matplotlib.inv")),
82-
"astropy": ("http://docs.astropy.org/en/stable/", None),
79+
"numpy": ("https://docs.scipy.org/doc/numpy/", (None, "https://numpy.org/doc/stable/objects.inv")),
80+
"scipy": ("https://docs.scipy.org/doc/scipy/reference/", (None, "https://docs.scipy.org/doc/scipy/objects.inv")),
81+
"matplotlib": ("https://matplotlib.org/", (None, "https://matplotlib.org/stable/objects.inv")),
82+
"astropy": ("http://docs.astropy.org/en/stable/", (None, "https://docs.astropy.org/en/stable/objects.inv")),
8383
"sunpy": ("https://docs.sunpy.org/en/stable/", None),
8484
}
8585

@@ -117,18 +117,15 @@
117117

118118
# -- Options for the Sphinx gallery -------------------------------------------
119119

120-
path = pathlib.Path.cwd()
121-
example_dir = path.parent.joinpath("examples")
122120
sphinx_gallery_conf = {
123-
"backreferences_dir": str(path.joinpath("generated", "modules")),
121+
"backreferences_dir": str(Path("generated") / "modules"),
124122
"filename_pattern": "^((?!skip_).)*$",
125-
"examples_dirs": example_dir,
126-
"gallery_dirs": path.joinpath("generated", "gallery"),
123+
"examples_dirs": str(Path("..") / "examples"),
124+
"gallery_dirs": str(Path("generated") / "gallery"),
127125
"abort_on_example_error": False,
128-
"plot_gallery": "True",
129126
"remove_config_comments": True,
130127
"only_warn_on_example_error": True,
131-
'pypandoc': True
128+
"parallel": True,
132129
}
133130

134131
# -- Other options ----------------------------------------------------------

docs/how_to/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ you quickly accomplish common tasks.
1111
:maxdepth: 1
1212

1313
../generated/gallery/index
14+
../generated/gallery/legacy/index

docs/reference/legacy.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Legacy (`sunkit_spex.legacy`)
22
*****************************
33

44
.. warning::
5-
The legacy module contains legacy code which will no longer be maintained and will be removed in the near future.
5+
The legacy module has been deprecated since version 0.4 and will be removed in a future version.
66

77
.. automodapi:: sunkit_spex.legacy
88
.. automodapi:: sunkit_spex.legacy.thermal

examples/legacy/README.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Legacy Examples
2+
---------------

examples/fitting_NuSTAR_spectra-duncan2021.py renamed to examples/legacy/fitting_NuSTAR_spectra-duncan2021.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,15 @@
5757
]
5858

5959
for fname in file_names:
60-
dl.enqueue_file(base_url + fname, path="./nustar/Duncan2021/")
60+
dl.enqueue_file(base_url + fname, path="../../nustar/Duncan2021/")
6161
files = dl.download()
6262

6363

6464
#####################################################
6565
#
6666
# First, load in your data files, here we load in 2 spectra
6767

68-
_dir = "./nustar/Duncan2021/"
68+
_dir = "../../nustar/Duncan2021/"
6969
spec = Fitter(pha_file=[_dir + "nu80410201001A06_1618_p_chu2_N_sr.pha", _dir + "nu80410201001B06_1618_p_chu2_N_sr.pha"])
7070

7171
#####################################################

examples/fitting_NuSTAR_spectra-general.py renamed to examples/legacy/fitting_NuSTAR_spectra-general.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
]
4848

4949
for fname in file_names:
50-
dl.enqueue_file(base_url + fname, path="./nustar/m3_time2628/")
50+
dl.enqueue_file(base_url + fname, path="../../nustar/m3_time2628/")
5151
files = dl.download()
5252

5353
#####################################################
@@ -56,7 +56,7 @@
5656

5757

5858
# First, load in your data files, here we load in 1 spectrum
59-
_dir = "./nustar/m3_time2628/"
59+
_dir = "../../nustar/m3_time2628/"
6060
spec = Fitter(pha_file=[_dir + "nu80414202001A06_chu23_S_cl_grade0_sr.pha"])
6161

6262
#####################################################

examples/fitting_NuSTAR_spectra-glesener2020.py renamed to examples/legacy/fitting_NuSTAR_spectra-glesener2020.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,14 @@
6262
]
6363

6464
for fname in file_names:
65-
dl.enqueue_file(base_url + fname, path="./nustar/Glesener2020/")
65+
dl.enqueue_file(base_url + fname, path="../../nustar/Glesener2020/")
6666
files = dl.download()
6767

6868

6969
#####################################################
7070
#
7171
# First, load in your data files, here we load in 2 spectra
72-
_dir = "./nustar/Glesener2020/"
72+
_dir = "../../nustar/Glesener2020/"
7373
# In the files here, the ARF and RMF file have different names to the PHA files so cannot use the PHA file name to help find the others so...
7474
spec = Fitter(
7575
pha_file=_dir + "nu20312001001B06_cl_grade0_sr_grp.pha",
@@ -141,7 +141,7 @@
141141
# In the original Figure 3(c), a broken power law is used as the cold thick target does not exist ins XPSEC.
142142
#
143143
# First, load in your data files, here we load in 2 spectra
144-
_dir = "./nustar/Glesener2020/"
144+
_dir = "../../nustar/Glesener2020/"
145145
spec = Fitter(
146146
pha_file=[_dir + "nu20312001001A06_cl_grade0_sr_grp.pha", _dir + "nu20312001001B06_cl_grade0_sr_grp.pha"],
147147
arf_file=[_dir + "nu20312001001A06_cl_grade0_sr.arf", _dir + "nu20312001001B06_cl_grade0_sr.arf"],
@@ -227,7 +227,7 @@
227227
#
228228
# First, load in your data files, here we load in 1 spectrum
229229

230-
_dir = "./nustar/Glesener2020/"
230+
_dir = "../../nustar/Glesener2020/"
231231
spec = Fitter(
232232
pha_file=_dir + "nu20312001001B06_cl_grade0_sr_grp.pha",
233233
arf_file=_dir + "nu20312001001B06_cl_grade0_sr.arf",
@@ -286,7 +286,7 @@
286286
#
287287
# First, load in your data files, here we load in 2 spectra
288288

289-
_dir = "./nustar/Glesener2020/"
289+
_dir = "../../nustar/Glesener2020/"
290290
spec = Fitter(
291291
pha_file=[_dir + "nu20312001001A06_cl_grade0_sr_grp.pha", _dir + "nu20312001001B06_cl_grade0_sr_grp.pha"],
292292
arf_file=[_dir + "nu20312001001A06_cl_grade0_sr.arf", _dir + "nu20312001001B06_cl_grade0_sr.arf"],

examples/fitting_NuSTAR_spectra-simultaneously.py renamed to examples/legacy/fitting_NuSTAR_spectra-simultaneously.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,14 @@
5050
]
5151

5252
for fname in file_names:
53-
dl.enqueue_file(base_url + fname, path="./nustar/m10_1616_1620/")
53+
dl.enqueue_file(base_url + fname, path="../../nustar/m10_1616_1620/")
5454
files = dl.download()
5555

5656
#####################################################
5757
#
5858
# Load in your data files, here we load in 2 spectra
5959

60-
_dir = "./nustar/m10_1616_1620/"
60+
_dir = "../../nustar/m10_1616_1620/"
6161
spec = Fitter(
6262
pha_file=[_dir + "nu80415202001A06_chu13_N_cl_grade0_sr.pha", _dir + "nu80415202001B06_chu13_N_cl_grade0_sr.pha"]
6363
)
Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
file_names = ["20021005_103800_spec.fits", "20021005_103800_srm.fits"]
4444

4545
for fname in file_names:
46-
dl.enqueue_file(base_url + fname, path="./rhessi/")
46+
dl.enqueue_file(base_url + fname, path="../../rhessi/")
4747
files = dl.download()
4848

4949
#####################################################
@@ -61,7 +61,9 @@
6161
#
6262
# Load in the data...
6363

64-
rhess_spec = RhessiLoader(spectrum_fn="./rhessi/20021005_103800_spec.fits", srm_fn="./rhessi/20021005_103800_srm.fits")
64+
rhess_spec = RhessiLoader(
65+
spectrum_fn="../../rhessi/20021005_103800_spec.fits", srm_fn="../../rhessi/20021005_103800_srm.fits"
66+
)
6567

6668
#####################################################
6769
#
@@ -358,7 +360,7 @@
358360
# ----------------
359361
#
360362

361-
save_filename = "./sunxspexRhessiSpectralFitting.pickle"
363+
save_filename = "../sunxspexRhessiSpectralFitting.pickle"
362364
fitter.save(save_filename)
363365

364366
#####################################################
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
]
6363

6464
for fname in file_names:
65-
dl.enqueue_file(base_url + fname, path="./stix/")
65+
dl.enqueue_file(base_url + fname, path="../../stix/")
6666
files = dl.download()
6767

6868
#####################################################
@@ -83,7 +83,7 @@
8383
# Load in the data...
8484

8585
stix_spec = STIXLoader(
86-
spectrum_file="./stix/stx_spectrum_2410019944_IM.fits", srm_file="./stix/stx_srm_2410019944_IM.fits"
86+
spectrum_file="../../stix/stx_spectrum_2410019944_IM.fits", srm_file="../../stix/stx_srm_2410019944_IM.fits"
8787
)
8888

8989
#####################################################
@@ -202,7 +202,7 @@
202202
# ----------------
203203
#
204204

205-
save_filename = "./stix/sunkitspexSTIXpectralFitting.pickle"
205+
save_filename = "../../stix/sunkitspexSTIXpectralFitting.pickle"
206206
fitter.save(save_filename)
207207

208208
#####################################################
@@ -266,8 +266,8 @@
266266
# ========================================================
267267
# Loading the data into the fitter loader
268268
#
269-
spec_bg, srm_bg = "./stix/stx_spectrum_2410019944_BKG.fits", "./stix/stx_srm_2410019944_BKG.fits"
270-
spec_im, srm_im = "./stix/stx_spectrum_2410019944_IM.fits", "./stix/stx_srm_2410019944_IM.fits"
269+
spec_bg, srm_bg = "../../stix/stx_spectrum_2410019944_BKG.fits", "../../stix/stx_srm_2410019944_BKG.fits"
270+
spec_im, srm_im = "../../stix/stx_spectrum_2410019944_IM.fits", "../../stix/stx_srm_2410019944_IM.fits"
271271

272272
spec_joint = Fitter(pha_file=[spec_bg, spec_im], srm_file=[srm_bg, srm_im])
273273

0 commit comments

Comments
 (0)