Skip to content

Commit efd7982

Browse files
authored
Maint: Update project configuration and add zenodo and mailman configs (#81)
* Move inforamtion from setup.cfg to project.toml, .isort.cfg, pytest.ini etc and remove setup.cfg and slim down setup.py * Update build and versions settings * Add zenodo.json * Add .mailmap * Tox updates
1 parent f4e6042 commit efd7982

21 files changed

+327
-235
lines changed

.codespellrc

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
[codespell]
2+
skip = ,*.fits,*.fts,*.header,*.json,*.xsh,*cache*,*egg*,*extern*,.git,.idea,.tox,_build,*truncated,*.svg,.asv_env,.history
3+
ignore-words-list =
4+
alog,
5+
nd,
6+
nin,
7+
observ,
8+
ot,
9+
te,
10+
upto,
11+
afile,
12+
precessed,
13+
process,
14+
technik,
15+
thirdparty,
16+
lamba

.coveragerc

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
[run]
2+
omit =
3+
xrayvision/_sunpy_init*
4+
xrayvision/conftest.py
5+
xrayvision/*setup_package*
6+
xrayvision/tests/*
7+
xrayvision/*/tests/*
8+
xrayvision/extern/*
9+
xrayvision/version*
10+
*/xrayvision/_sunpy_init*
11+
*/xrayvision/conftest.py
12+
*/xrayvision/*setup_package*
13+
*/xrayvision/tests/*
14+
*/xrayvision/*/tests/*
15+
*/xrayvision/extern/*
16+
*/xrayvision/version*
17+
18+
[report]
19+
exclude_lines =
20+
# Have to re-enable the standard pragma
21+
pragma: no cover
22+
# Don't complain about packages we have installed
23+
except ImportError
24+
# Don't complain if tests don't hit assertions
25+
raise AssertionError
26+
raise NotImplementedError
27+
# Don't complain about script hooks
28+
def main\(.*\):
29+
# Ignore branches that don't pertain to this version of Python
30+
pragma: py{ignore_python_version}
31+
# Don't complain about IPython completion helper
32+
def _ipython_key_completions_
33+
# typing.TYPE_CHECKING is False at runtime
34+
if TYPE_CHECKING:
35+
# Ignore typing overloads
36+
@overload

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ share/python-wheels/
2626
.installed.cfg
2727
*.egg
2828
MANIFEST
29+
xrayvision/_version.py
2930

3031
# PyInstaller
3132
# Usually these files are written by a python script from a template
@@ -147,7 +148,7 @@ docs/_build
147148
docs/generated
148149
docs/api
149150
docs/whatsnew/latest_changelog.txt
150-
xrayvision/version.py
151+
xrayvision/_version.py
151152
htmlcov/
152153
sg_execution_times.rst
153154

.isort.cfg

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[settings]
2+
line_length = 120
3+
balanced_wrapping = true
4+
extend_skip =
5+
docs/conf.py,
6+
xrayvision/__init__.py,
7+
default_section = THIRDPARTY
8+
include_trailing_comma = true
9+
known_first_party = xrayvision
10+
length_sort = false
11+
length_sort_sections = stdlib
12+
multi_line_output = 3
13+
no_lines_before = LOCALFOLDER
14+
sections = STDLIB, THIRDPARTY, FIRSTPARTY, LOCALFOLDER

.mailmap

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Daniel F. Ryan <ryand5@tcd.ie> Dan Ryan <ryand5@tcd.ie>
2+
Daniel F. Ryan <ryand5@tcd.ie> DanRyanIrish <ryand5@tcd.ie>
3+
David Pérez-Suárez <dps.helio@gmail.com> David Perez-Suarez <d.perez-suarez@ucl.ac.uk>
4+
David Pérez-Suárez <dps.helio@gmail.com> David Perez-Suarez <dps.helio@gmail.com>
5+
David Pérez-Suárez <dps.helio@gmail.com> David PS <dps.helio@gmail.com>
6+
David Pérez-Suárez <dps.helio@gmail.com> DavidPS <dps.helio@gmail.com>
7+
David Pérez-Suárez <dps.helio@gmail.com> dpshelio <dps.helio@gmail.com>
8+
Gábor Péterffy <peterffy95@gmail.com> pgabor <peterffy95@gmail.com>
9+
Shane Maloney <shane.maloney@dias.ie> Shane Maloney <maloneys@tcd.ie> Shane Maloney
10+
Shane Maloney <shane.maloney@dias.ie> Shane Maloney <shane.maloney@tcd.ie> Shane Maloney
11+
Shane Maloney <shane.maloney@dias.ie> Shane Maloney <shane@phy218152.wlan.tcd.ie>
12+
Shane Maloney <shane.maloney@dias.ie> samaloney <shane.maloney@tcd.ie>
13+
Shane Maloney <shane.maloney@dias.ie> Shane Maloney <shane@SilverSurfer.local>

.pre-commit-config.yaml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,37 @@
1+
exclude: ".*(.csv|.fits|.fts|.fit|.header|.txt|tca.*|.json|.asdf)$|^CITATION.rst|tools\/"
12
repos:
23
# This should be before any formatting hooks like isort
34
- repo: https://github.com/astral-sh/ruff-pre-commit
4-
rev: "v0.8.6"
5+
rev: "v0.11.2"
56
hooks:
67
- id: ruff
78
args: ["--fix"]
89
# Run the formatter.
910
- id: ruff-format
1011
- repo: https://github.com/PyCQA/isort
11-
rev: 5.13.2
12+
rev: 6.0.1
1213
hooks:
1314
- id: isort
14-
exclude: ".*(.fits|.fts|.fit|.header|.txt|tca.*|extern.*)$"
1515
- repo: https://github.com/pre-commit/pre-commit-hooks
1616
rev: v5.0.0
1717
hooks:
1818
- id: check-ast
1919
- id: check-case-conflict
2020
- id: trailing-whitespace
21-
exclude: ".*(.fits|.fts|.fit|.header|.txt)$"
2221
- id: check-yaml
2322
- id: debug-statements
2423
- id: check-added-large-files
2524
args: ["--enforce-all", "--maxkb=1054"]
25+
exclude: ""
2626
- id: end-of-file-fixer
27-
exclude: ".*(.fits|.fts|.fit|.header|.txt|tca.*|.json)$|^CITATION.rst$"
2827
- id: mixed-line-ending
29-
exclude: ".*(.fits|.fts|.fit|.header|.txt|tca.*)$"
3028
- repo: https://github.com/pre-commit/mirrors-mypy
31-
rev: "v1.14.1"
29+
rev: "v1.15.0"
3230
hooks:
3331
- id: mypy
3432
additional_dependencies: [ "types-setuptools" ]
3533
- repo: https://github.com/codespell-project/codespell
36-
rev: v2.3.0
34+
rev: v2.4.1
3735
hooks:
3836
- id: codespell
3937
additional_dependencies:

.zenodo.json

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"description": "xrayvision is a software library that provides image reconstruction methods for indirect or Fourier based instruments in Python",
3+
"license": "BSD-3-Clause",
4+
"title": "xrayvision",
5+
"upload_type": "software",
6+
"creators": [
7+
{
8+
"name": "Shane Maloney",
9+
"orcid": "0000-0002-4715-1805",
10+
"affiliation": "Dublin Institute for Advanced Studies"
11+
},
12+
{
13+
"name": "Gábor Péterffy",
14+
"orcid": "",
15+
"affiliation": ""
16+
},
17+
{
18+
"name": "Daniel F. Ryan",
19+
"orcid": "0000-0001-8661-3825",
20+
"affiliation": "University College London, Mullard Space Science Laboratory (UCL/MSSL)"
21+
},
22+
{
23+
"name": "David Pérez-Suárez",
24+
"orcid": "0000-0003-0784-6909",
25+
"affiliation": "University College London"
26+
},
27+
{
28+
"name": "Paolo Massa",
29+
"orcid": "0000-0002-0993-1974"
30+
"affiliation": "University of Applied Sciences and Arts Northwestern Switzerland (FHNW)",
31+
32+
},
33+
{
34+
"name": "Volpara, Anna",
35+
"orcid": "0000-0003-1479-0827"
36+
"affiliation": "Università degli Studi di Genova, Dipartimento di Matematica"
37+
}
38+
],
39+
"access_right": "open"
40+
}

changelog/81.trivial.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Update project configuration move to `project.toml` and individual config files for each tool (isort, ruff, pytest, etc) and add zenodo config file and mailmap.

examples/rhessi.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@
2121
# file
2222

2323
hdul = fits.open(
24-
"https://hesperia.gsfc.nasa.gov/rhessi_extras/visibility_fits_v2/"
25-
"2002/02/21/hsi_vis_20020221_2357_0054_46tx3e.fits"
24+
"https://hesperia.gsfc.nasa.gov/rhessi_extras/visibility_fits_v2/2002/02/21/hsi_vis_20020221_2357_0054_46tx3e.fits"
2625
)
2726

2827
###############################################################################

pyproject.toml

Lines changed: 88 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,98 @@
11
[build-system]
22

33
requires = [
4-
"setuptools>=56,!=61.0.0",
5-
"setuptools_scm[toml]>=6.2",
4+
"setuptools>=62.0.0",
5+
"setuptools_scm[toml]>=8.0.1",
66
"wheel"
77
]
8-
98
build-backend = 'setuptools.build_meta'
109

10+
[project]
11+
name = "xrayvisim"
12+
description = "An open-source Python library for Fourier or synthesis X-Ray imaging instruments."
13+
requires-python = ">=3.9"
14+
readme = {file = "README.rst", content-type="text/x-rst"}
15+
license = "BSD-3-Clause"
16+
license-files = ["LICENSE.rst"]
17+
authors = [{name="Shane Maloney", email = "shane.maloney@dias.ie"}]
18+
dependencies = [
19+
"astropy>=6.0.0",
20+
"numpy>=1.24.0",
21+
"packaging>=23.0",
22+
"scipy>=1.13",
23+
"xarray>=2023.5.0"
24+
]
25+
dynamic = ["version"]
26+
keywords = ["solar", "physics", "solar", "sun", "x-rays"]
27+
classifiers = [
28+
"Development Status :: 3 - Alpha",
29+
"Intended Audience :: Science/Research",
30+
"Natural Language :: English",
31+
"Operating System :: OS Independent",
32+
"Programming Language :: Python",
33+
"Programming Language :: Python :: 3",
34+
"Programming Language :: Python :: 3.9",
35+
"Programming Language :: Python :: 3.10",
36+
"Programming Language :: Python :: 3.11",
37+
"Programming Language :: Python :: 3.12",
38+
"Topic :: Scientific/Engineering :: Physics"
39+
]
40+
41+
[project.optional-dependencies]
42+
map = [
43+
"sunpy[map]>=5.1.0"
44+
]
45+
all = ["xrayvisim[map]"]
46+
tests = [
47+
"matplotlib>=3.8.0",
48+
"pytest-astropy>=0.11.0",
49+
"pytest-mpl>=0.16",
50+
"pytest-xdist>=3.0.2",
51+
"pytest>=7.1.0"
52+
]
53+
docs = [
54+
"sphinx>=6.0.0",
55+
"sphinx-automodapi>=0.14.1",
56+
"packaging>=23.0",
57+
"sphinx-changelog>=1.5.0",
58+
"sphinx-design>=0.2.0",
59+
"sphinx-gallery>=0.13.0",
60+
"sphinxext-opengraph>=0.6.0",
61+
"xrayvisim[all]",
62+
"pydata-sphinx-theme>=0.16.0"
63+
]
64+
dev = ["xrayvisim[tests,docs]"]
65+
66+
67+
[project.urls]
68+
Homepage = "https://xrayvision.readthedocs.io"
69+
"Source Code" = "https://github.com/TCDSolar/xrayvision"
70+
Download = "https://pypi.org/project/xrayvisim"
71+
Documentation = "https://xrayvision.readthedocs.io/"
72+
Changelog = "https://xrayvision.readthedocs.io/en/latest/whatsnew/changelog.html"
73+
"Issue Tracker" = "https://github.com/TCDSolar/xrayvision/issues"
74+
75+
76+
[tool.setuptools]
77+
zip-safe = false
78+
include-package-data = true
79+
platforms = ["any"]
80+
provides = ["xrayvisim"]
81+
82+
[tool.setuptools.packages.find]
83+
include = ["xrayvision*"]
84+
exclude = ["xrayvision._dev*"]
85+
86+
[tool.setuptools.package-data]
87+
xrayvisim = ["data/*"]
88+
89+
[tool.setuptools_scm]
90+
version_file = "xrayvision/_version.py"
91+
92+
[tool.mypy]
93+
disable_error_code = "import-untyped"
94+
python_version = "py39"
95+
1196
[ tool.gilesbot ]
1297

1398
[ tool.gilesbot.pull_requests ]

0 commit comments

Comments
 (0)