Skip to content

Commit 12a1beb

Browse files
authored
Merge pull request #241 from zblz/remove-stale-files
Remove stale files
2 parents 30578c3 + 6e4396f commit 12a1beb

File tree

11 files changed

+30
-130
lines changed

11 files changed

+30
-130
lines changed

.landscape.yaml

Lines changed: 0 additions & 8 deletions
This file was deleted.

docs/conf.py

Lines changed: 9 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@
2828
import datetime
2929
import os
3030
import sys
31+
from pathlib import Path
3132

33+
import tomllib
3234
from pkg_resources import get_distribution
3335

3436
try:
@@ -39,12 +41,9 @@
3941
)
4042
sys.exit(1)
4143

42-
# Get configuration information from setup.cfg
43-
from configparser import ConfigParser
44-
45-
conf = ConfigParser()
46-
conf.read([os.path.join(os.path.dirname(__file__), "..", "setup.cfg")])
47-
setup_cfg = dict(conf.items("metadata"))
44+
# Grab minversion from pyproject.toml
45+
with (Path(__file__).parents[1] / "pyproject.toml").open("rb") as f:
46+
pyproject = tomllib.load(f)
4847

4948
# -- General configuration ----------------------------------------------------
5049

@@ -54,7 +53,6 @@
5453
# If your documentation needs a minimal Sphinx version, state it here.
5554
needs_sphinx = "1.3"
5655

57-
5856
intersphinx_mapping["emcee"] = (
5957
"https://emcee.readthedocs.io/en/stable/",
6058
None,
@@ -73,15 +71,15 @@
7371
# -- Project information ------------------------------------------------------
7472

7573
# This does not *have* to match the package name, but typically does
76-
project = setup_cfg["name"]
77-
author = setup_cfg["author"]
78-
copyright = "{0}, {1}".format(datetime.datetime.now().year, setup_cfg["author"])
74+
project = pyproject["project"]["name"]
75+
author = pyproject["project"]["authors"][0]["name"]
76+
copyright = "{0}, {1}".format(datetime.datetime.now().year, author)
7977

8078
# The version info for the project you're documenting, acts as replacement for
8179
# |version| and |release|, also used in various other places throughout the
8280
# built documents.
8381

84-
package_version = get_distribution(setup_cfg["name"]).version
82+
package_version = get_distribution(project).version
8583

8684
# The short X.Y version.
8785
version = package_version.split("-", 1)[0]
@@ -91,13 +89,6 @@
9189

9290
# -- Options for HTML output ---------------------------------------------------
9391

94-
# A NOTE ON HTML THEMES
95-
# The global astropy configuration uses a custom theme, 'bootstrap-astropy',
96-
# which is installed along with astropy. A different theme can be used or
97-
# the options for this theme can be modified by overriding some of the
98-
# variables set in the global configuration. The variables set in the
99-
# global configuration are listed below, commented out.
100-
10192
# Add any paths that contain custom themes here, relative to this directory.
10293
# To use a different custom theme, add the directory containing the theme.
10394
# html_theme_path = []
@@ -160,19 +151,3 @@
160151
# One entry per manual page. List of tuples
161152
# (source start file, name, description, authors, manual section).
162153
man_pages = [("index", project.lower(), project + " Documentation", [author], 1)]
163-
164-
165-
## -- Options for the edit_on_github extension ----------------------------------------
166-
167-
if eval(setup_cfg.get("edit_on_github")):
168-
extensions += ["sphinx_astropy.ext.edit_on_github"]
169-
170-
versionmod = __import__(setup_cfg["name"] + ".version")
171-
edit_on_github_project = setup_cfg["github_project"]
172-
if versionmod.version.release:
173-
edit_on_github_branch = "v" + versionmod.version.version
174-
else:
175-
edit_on_github_branch = "master"
176-
177-
edit_on_github_source_root = ""
178-
edit_on_github_doc_root = "docs"

pyproject.toml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,24 @@
22
name = "naima"
33
description = "Derivation of non-thermal particle distributions through MCMC spectral fitting"
44
readme = "README.rst"
5+
authors = [{ name = "Víctor Zabalza", email = "[email protected]" }]
56
license = "MIT"
67
requires-python = ">=3.10"
78
dynamic = ["version"]
89
dependencies = [
910
"astropy>=6.1",
10-
"emcee",
11-
"corner",
12-
"matplotlib>=1.4.0",
13-
"scipy",
11+
"corner>=2.0",
12+
"emcee>=3.0",
13+
"h5py>=3.14.0",
14+
"matplotlib>=3.10.0",
1415
"numpy>=2.0",
15-
"h5py",
16-
"pyyaml",
16+
"pyyaml>=6.0.2",
17+
"scipy>=1.15.3",
1718
]
1819

20+
[dependency-groups]
21+
dev = ["pytest>=8.3.5", "sphinx>=8.0", "sphinx-astropy>=1.9.1"]
22+
1923
[tool.hatch.version]
2024
source = "vcs"
2125

setup.cfg

Lines changed: 0 additions & 46 deletions
This file was deleted.

setup.py

Lines changed: 0 additions & 26 deletions
This file was deleted.

src/naima/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# Licensed under a 3-clause BSD style license - see LICENSE.rst
2+
23
"""
34
`naima` is a Python package for computation of non-thermal radiation from
45
relativistic particle populations. It includes tools to perform MCMC fitting of

tests/test_functionfit.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Licensed under a 3-clause BSD style license - see LICENSE.rst
2-
from pathlib import Path
32
import warnings
43
from importlib.util import find_spec
4+
from pathlib import Path
55

66
import astropy.units as u
77
import numpy as np

tests/test_models.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
# Licensed under a 3-clause BSD style license - see LICENSE.rst
2-
import importlib
2+
from importlib.util import find_spec
3+
34
import numpy as np
45
from astropy import units as u
56
from astropy.constants import c, hbar, m_e, sigma_sb
67
from astropy.modeling.physical_models import BlackBody
78
from astropy.table import QTable, Table
89
from astropy.tests.helper import pytest
910
from numpy.testing import assert_allclose
10-
from importlib.util import find_spec
1111

1212
from naima.models import (
1313
Bremsstrahlung,

tests/test_saveread.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11
# Licensed under a 3-clause BSD style license - see LICENSE.rst
22
import os
3+
from pathlib import Path
34

45
import astropy.units as u
56
import numpy as np
67
from astropy.io import ascii
78
from astropy.tests.helper import pytest
8-
from pathlib import Path
99

1010
from naima.analysis import read_run, save_run
1111
from naima.model_fitter import InteractiveModelFitter
1212
from naima.plot import plot_chain, plot_data, plot_fit
1313
from naima.utils import validate_data_table
1414

15-
1615
try:
1716
import matplotlib
1817

@@ -53,9 +52,9 @@ def test_roundtrip(simple_sampler, tmp_path):
5352
new_blobs = nresult.get_blobs()
5453
assert sampler_blobs.shape == new_blobs.shape
5554
j, k = nwalkers // 2, nsteps // 2
56-
for l in range(len(sampler_blobs[j][k])):
57-
b0 = sampler_blobs[j][k][l]
58-
b1 = new_blobs[j][k][l]
55+
for l_index in range(len(sampler_blobs[j][k])):
56+
b0 = sampler_blobs[j][k][l_index]
57+
b1 = new_blobs[j][k][l_index]
5958
if isinstance(b0, tuple) or isinstance(b0, list):
6059
for b0m, b1m in zip(b0, b1):
6160
assert np.allclose(b0m, b1m)

tests/test_utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
# Licensed under a 3-clause BSD style license - see LICENSE.rst
2+
from pathlib import Path
3+
24
import astropy.units as u
35
import numpy as np
46
from astropy.io import ascii
57
from astropy.tests.helper import pytest
6-
from pathlib import Path
78
from numpy.testing import assert_allclose
89

910
from naima.utils import (

0 commit comments

Comments
 (0)