Skip to content

Commit 86f9426

Browse files
vuillautmaxnoe
andauthored
use seaborn-v0_8 as style, seaborn being deprecated (#201)
* use seaborn-v0_8 as style, seaborn being deprecated * request matplotlib >3.5 * stop testing python 3.7 * docs requirements as well * docs req python>=3.8 * modify .readthedocs.yml * use np.float32 instead of deprecated np.float * set language * python 3.11 for docs * force sphinx<7 * revert to python 3.8 * Update rtd config * Fix docs build * Add share to static files so they are available in the docs * force sphinx 5.3 --------- Co-authored-by: Maximilian Linhoff <[email protected]>
1 parent 2bba757 commit 86f9426

File tree

10 files changed

+45
-35
lines changed

10 files changed

+45
-35
lines changed

.github/workflows/continuousintegration.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jobs:
77
runs-on: ubuntu-latest
88
strategy:
99
matrix:
10-
python-version: [3.7, 3.8, 3.9, "3.10", "3.11"]
10+
python-version: [3.8, 3.9, "3.10", "3.11"]
1111

1212
steps:
1313
- uses: actions/checkout@v2

.readthedocs.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
version: 2
22

3+
build:
4+
os: ubuntu-22.04
5+
tools:
6+
python: "3.11"
7+
38
python:
49
install:
510
- requirements: docs/requirements.txt
611
- method: pip
7-
path: .
12+
path: .

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ As many experiments results can be overlaid.
119119
When an experiment is deselected, it simply is removed from the plots.
120120

121121

122-
.. image:: /share/gammaboard.gif
122+
.. image:: share/gammaboard.gif
123123
:alt: gammaboard_demo
124124

125125

ctaplot/plots/style.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def context(style='notebook'):
3535
>>> plt.plot([1, 2, 4])
3636
"""
3737
style_path = get(f'ctaplot-{style}')
38-
with mpl.style.context(['seaborn-deep', style_path]):
38+
with mpl.style.context(['seaborn-v0_8-deep', style_path]):
3939
if not check_latex():
4040
mpl.rcParams['text.usetex'] = False
4141
yield
@@ -53,7 +53,7 @@ def set_style(style='notebook'):
5353
"""
5454

5555
style_path = get(f'ctaplot-{style}')
56-
mpl.pyplot.style.use(['seaborn-deep', style_path])
56+
mpl.pyplot.style.use(['seaborn-v0_8-deep', style_path])
5757

5858
if not check_latex():
5959
mpl.rcParams['text.usetex'] = False

docs/_static/share

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../share

docs/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ def get_property(prop, project):
8282
#
8383
# This is also used if you do content translation via gettext catalogs.
8484
# Usually you set "language" from the command line for these cases.
85-
language = None
85+
language = 'en'
8686

8787
# List of patterns, relative to source directory, that match files and
8888
# directories to ignore when looking for source files.
@@ -112,7 +112,7 @@ def get_property(prop, project):
112112
# Add any paths that contain custom static files (such as style sheets) here,
113113
# relative to this directory. They are copied after the builtin static files,
114114
# so a file named "default.css" will overwrite the builtin "default.css".
115-
html_static_path = []
115+
html_static_path = ["_static"]
116116

117117
# Custom sidebar templates, must be a dictionary that maps document names
118118
# to template names.

docs/data_format.rst

Lines changed: 28 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,10 @@ Columns names:
4545

4646

4747
* `triggered_events` - optional
48+
4849
Single column table containing the list of triggered events energies:
4950

51+
5052
Column name:
5153
::
5254

@@ -86,22 +88,23 @@ Contains the reconstructed values
8688

8789
Column names: same as the GammaBoard format (see above) OR :
8890
::
89-
`mc_alt`: float
90-
`mc_az`: float
91-
`mc_core_distance`: float
92-
`mc_core_x`: float
93-
`mc_core_y`: float
94-
`mc_energy`: float
95-
`mc_h_first_int`: float
96-
`mc_type`: : int following the simtel convention: 0 for gamma, 1 for electron, 101 for protons
97-
`mc_x_max`: float
98-
`reco_energy`: float
99-
`reco_src_x`: float
100-
`reco_src_y`: float
101-
`reco_alt`: float
102-
`reco_az`: float
103-
`reco_type`: int following the simtel convention: 0 for gamma, 1 for electron, 101 for protons
104-
`gammaness`: float between 0 and 1
91+
92+
`mc_alt`: float
93+
`mc_az`: float
94+
`mc_core_distance`: float
95+
`mc_core_x`: float
96+
`mc_core_y`: float
97+
`mc_energy`: float
98+
`mc_h_first_int`: float
99+
`mc_type`: : int following the simtel convention: 0 for gamma, 1 for electron, 101 for protons
100+
`mc_x_max`: float
101+
`reco_energy`: float
102+
`reco_src_x`: float
103+
`reco_src_y`: float
104+
`reco_alt`: float
105+
`reco_az`: float
106+
`reco_type`: int following the simtel convention: 0 for gamma, 1 for electron, 101 for protons
107+
`gammaness`: float between 0 and 1
105108

106109

107110
* `simulation/run_config` - mandatory to plot the effective area
@@ -110,14 +113,15 @@ Contains the simulation information from each simulation file used (1 file per l
110113

111114
Column names:
112115
::
113-
`energy_range_max`
114-
`energy_range_min`
115-
`max_alt`
116-
`max_scatter_range`
117-
`min_alt`
118-
`num_showers`
119-
`shower_reuse`
120-
`spectral_index`
116+
117+
`energy_range_max`
118+
`energy_range_min`
119+
`max_alt`
120+
`max_scatter_range`
121+
`min_alt`
122+
`num_showers`
123+
`shower_reuse`
124+
`spectral_index`
121125

122126

123127

docs/requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
numpy>1.16
2-
matplotlib>=2.0
2+
matplotlib>=3.6
33
scipy>=0.19
44
astropy
55
tables
@@ -8,6 +8,6 @@ scikit-learn
88
jupyter
99
ipywidgets
1010
recommonmark
11-
sphinx>=4.2
11+
sphinx==5.3.0
1212
nbsphinx
1313
sphinx_rtd_theme

examples/notebooks/roc_curves.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@
157157
"source": [
158158
"reco_proba = {}\n",
159159
"for p in particles:\n",
160-
" reco_proba[p] = np.ones_like(mc_type, dtype=np.float)\n",
160+
" reco_proba[p] = np.ones_like(mc_type, dtype=np.float32)\n",
161161
" reco_proba[p][mc_type==p] = fake_reco_distri(len(mc_type[mc_type==p]), good=True)\n",
162162
" reco_proba[p][mc_type!=p] = fake_reco_distri(len(mc_type[mc_type!=p]), good=False)"
163163
]

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def get_property(prop, project):
2929
version=get_property('__version__', 'ctaplot'),
3030
install_requires=[
3131
'numpy>1.16',
32-
'matplotlib>=2.0',
32+
'matplotlib>=3.6',
3333
'scipy>=0.19',
3434
'astropy',
3535
'tables',

0 commit comments

Comments
 (0)