Skip to content

Commit b31c795

Browse files
authored
Merge pull request #34 from jgieseler/new_package_template
adapt to new openastronomy package template
2 parents 87a9506 + 769b81a commit b31c795

19 files changed

+291
-252
lines changed

.github/workflows/pytest.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ name: pytest
55

66
on:
77
push:
8-
branches: [ "main" ]
8+
# branches: [ "main" ]
99
pull_request:
10-
branches: [ "main" ]
10+
# branches: [ "main" ]
1111

1212
jobs:
1313
build:
@@ -16,7 +16,7 @@ jobs:
1616
strategy:
1717
fail-fast: false
1818
matrix:
19-
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
19+
python-version: ["3.9", "3.10", "3.11", "3.12"]
2020

2121
steps:
2222
- uses: actions/checkout@v4
@@ -28,7 +28,8 @@ jobs:
2828
run: |
2929
python -m pip install --upgrade pip
3030
python -m pip install flake8 pytest pytest-doctestplus pytest-cov
31-
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
31+
# if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
32+
pip install .
3233
- name: Lint with flake8
3334
run: |
3435
# stop the build if there are Python syntax errors or undefined names

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ wheels/
2929
*.egg
3030
MANIFEST
3131

32+
# file generated by setuptools_scm
33+
_version.py
34+
3235
# PyInstaller
3336
# Usually these files are written by a python script from a template
3437
# before PyInstaller builds the exe, so as to inject date/other infos into it.

MANIFEST.in

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,8 @@
44
prune build
55
prune docs/_build
66
prune docs/api
7-
prune .circleci
8-
prune .github
9-
prune .jupyter
10-
prune binder
11-
# exclude a bunch of common hidden files, you probably want to add your own here
12-
exclude .mailmap
13-
exclude .gitignore
14-
exclude .gitattributes
15-
exclude .editorconfig
16-
exclude .zenodo.json
17-
exclude *.yml
18-
exclude *.yaml
7+
global-exclude *.pyc *.o
8+
9+
# This subpackage is only used in development checkouts
10+
# and should not be included in built tarballs
11+
prune solo_epd_loader/_dev

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ This software is provided "as is", with no guarantee. It is no official data sou
3636
Installation
3737
------------
3838

39-
solo_epd_loader requires python >= 3.6.
39+
solo_epd_loader requires python >= 3.9.
4040

4141
It can be installed either from `PyPI <https://pypi.org/project/solo-epd-loader/>`_ using:
4242

docs/conf.py

Lines changed: 39 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,82 @@
1-
# -*- coding: utf-8 -*-
2-
#
31
# Configuration file for the Sphinx documentation builder.
42
#
53
# This file does only contain a selection of the most common options. For a
64
# full list see the documentation:
75
# http://www.sphinx-doc.org/en/master/config
86

7+
import datetime
98

109
# -- Project information -----------------------------------------------------
1110

12-
project = 'solo-epd-loader'
13-
copyright = '2021, Jan Gieseler'
14-
author = 'Jan Gieseler'
15-
1611
# The full version, including alpha/beta/rc tags
1712
from solo_epd_loader import __version__
13+
1814
release = __version__
1915

16+
project = "solo_epd_loader"
17+
author = "Jan Gieseler"
18+
copyright = f"{datetime.datetime.now().year}, {author}" # noqa: A001
19+
2020
# -- General configuration ---------------------------------------------------
2121

2222
# Add any Sphinx extension module names here, as strings. They can be
23-
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
23+
# extensions coming with Sphinx (named "sphinx.ext.*") or your custom
2424
# ones.
2525
extensions = [
26-
'sphinx.ext.autodoc',
27-
'sphinx.ext.intersphinx',
28-
'sphinx.ext.todo',
29-
'sphinx.ext.coverage',
30-
'sphinx.ext.inheritance_diagram',
31-
'sphinx.ext.viewcode',
32-
'sphinx.ext.napoleon',
33-
'sphinx.ext.doctest',
34-
'sphinx.ext.mathjax',
35-
'sphinx_automodapi.automodapi',
36-
'sphinx_automodapi.smart_resolver',
26+
"sphinx.ext.autodoc",
27+
"sphinx.ext.intersphinx",
28+
"sphinx.ext.todo",
29+
"sphinx.ext.coverage",
30+
"sphinx.ext.inheritance_diagram",
31+
"sphinx.ext.viewcode",
32+
"sphinx.ext.napoleon",
33+
"sphinx.ext.doctest",
34+
"sphinx.ext.mathjax",
35+
"sphinx_automodapi.automodapi",
36+
"sphinx_automodapi.smart_resolver",
3737
]
3838

3939
# Add any paths that contain templates here, relative to this directory.
40-
# templates_path = ['_templates']
40+
# templates_path = ["_templates"]
4141

4242
# List of patterns, relative to source directory, that match files and
4343
# directories to ignore when looking for source files.
4444
# This pattern also affects html_static_path and html_extra_path.
45-
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
45+
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
4646

4747
# The suffix(es) of source filenames.
4848
# You can specify multiple suffix as a list of string:
49-
source_suffix = '.rst'
49+
source_suffix = ".rst"
5050

5151
# The master toctree document.
52-
master_doc = 'index'
52+
master_doc = "index"
53+
54+
# Treat everything in single ` as a Python reference.
55+
default_role = 'py:obj'
5356

5457
# -- Options for intersphinx extension ---------------------------------------
5558

5659
# Example configuration for intersphinx: refer to the Python standard library.
57-
intersphinx_mapping = {'https://docs.python.org/': None}
60+
intersphinx_mapping = {"python": ("https://docs.python.org/", None)}
5861

5962
# -- Options for HTML output -------------------------------------------------
6063

6164
# The theme to use for HTML and HTML Help pages. See the documentation for
6265
# a list of builtin themes.
63-
html_theme = 'alabaster'
66+
html_theme = "alabaster"
6467

6568
# Add any paths that contain custom static files (such as style sheets) here,
6669
# relative to this directory. They are copied after the builtin static files,
6770
# so a file named "default.css" will overwrite the builtin "default.css".
68-
# html_static_path = ['_static']
71+
# html_static_path = ["_static"]
72+
73+
# By default, when rendering docstrings for classes, sphinx.ext.autodoc will
74+
# make docs with the class-level docstring and the class-method docstrings,
75+
# but not the __init__ docstring, which often contains the parameters to
76+
# class constructors across the scientific Python ecosystem. The option below
77+
# will append the __init__ docstring to the class-level docstring when rendering
78+
# the docs. For more options, see:
79+
# https://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html#confval-autoclass_content
80+
autoclass_content = "both"
81+
82+
# -- Other options ----------------------------------------------------------

docs/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Solar Orbiter EPD Loader Documentation
2-
-----------------------------
2+
--------------------------------------
33

44
This is the documentation for solo-epd-loader.
55

docs/make.bat

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,35 @@
1-
@ECHO OFF
2-
3-
pushd %~dp0
4-
5-
REM Command file for Sphinx documentation
6-
7-
if "%SPHINXBUILD%" == "" (
8-
set SPHINXBUILD=sphinx-build
9-
)
10-
set SOURCEDIR=.
11-
set BUILDDIR=_build
12-
13-
if "%1" == "" goto help
14-
15-
%SPHINXBUILD% >NUL 2>NUL
16-
if errorlevel 9009 (
17-
echo.
18-
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
19-
echo.installed, then set the SPHINXBUILD environment variable to point
20-
echo.to the full path of the 'sphinx-build' executable. Alternatively you
21-
echo.may add the Sphinx directory to PATH.
22-
echo.
23-
echo.If you don't have Sphinx installed, grab it from
24-
echo.http://sphinx-doc.org/
25-
exit /b 1
26-
)
27-
28-
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
29-
goto end
30-
31-
:help
32-
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
33-
34-
:end
35-
popd
1+
@ECHO OFF
2+
3+
pushd %~dp0
4+
5+
REM Command file for Sphinx documentation
6+
7+
if "%SPHINXBUILD%" == "" (
8+
set SPHINXBUILD=sphinx-build
9+
)
10+
set SOURCEDIR=.
11+
set BUILDDIR=_build
12+
13+
if "%1" == "" goto help
14+
15+
%SPHINXBUILD% >NUL 2>NUL
16+
if errorlevel 9009 (
17+
echo.
18+
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
19+
echo.installed, then set the SPHINXBUILD environment variable to point
20+
echo.to the full path of the 'sphinx-build' executable. Alternatively you
21+
echo.may add the Sphinx directory to PATH.
22+
echo.
23+
echo.If you don't have Sphinx installed, grab it from
24+
echo.http://sphinx-doc.org/
25+
exit /b 1
26+
)
27+
28+
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
29+
goto end
30+
31+
:help
32+
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
33+
34+
:end
35+
popd

gh2021_fig_2.png

-518 KB
Binary file not shown.

gh2021_fig_2a.png

-518 KB
Binary file not shown.

pyproject.toml

Lines changed: 122 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,125 @@
11
[build-system]
2+
requires = [
3+
"setuptools>=62.1",
4+
"setuptools_scm[toml]>=8.0.0",
5+
"wheel",]
6+
build-backend = "setuptools.build_meta"
27

3-
requires = ["setuptools",
4-
"setuptools_scm",
5-
"wheel"]
8+
[project]
9+
name = "solo_epd_loader"
10+
description = "Data loader for Solar Orbiter/EPD energetic charged particle sensors EPT, HET, and STEP."
11+
requires-python = ">=3.9"
12+
readme = { file = "README.rst", content-type = "text/x-rst" }
13+
license = { file = "licenses/LICENSE.rst" }
14+
authors = [
15+
{ name = "Jan Gieseler", email = "[email protected]" },
16+
]
17+
dependencies = [
18+
"astropy",
19+
"cdflib",
20+
"drms",
21+
"h5netcdf",
22+
"lxml",
23+
"matplotlib",
24+
"numpy",
25+
"pandas",
26+
"requests",
27+
"sunpy>=4.1.0",
28+
"tqdm",
29+
"zeep",
30+
]
31+
dynamic = ["version"]
32+
classifiers = [
33+
"Intended Audience :: Science/Research",
34+
"License :: OSI Approved :: BSD License",
35+
"Natural Language :: English",
36+
"Operating System :: OS Independent",
37+
"Programming Language :: Python",
38+
"Programming Language :: Python :: 3.8",
39+
"Programming Language :: Python :: 3.9",
40+
"Programming Language :: Python :: 3.10",
41+
"Programming Language :: Python :: 3.11",
42+
"Programming Language :: Python :: 3.12",
43+
"Topic :: Scientific/Engineering :: Physics",
44+
]
645

7-
build-backend = 'setuptools.build_meta'
46+
[project.optional-dependencies]
47+
test = [
48+
"pytest",
49+
"pytest-doctestplus",
50+
"pytest-cov"
51+
]
52+
docs = [
53+
"sphinx",
54+
"sphinx-automodapi",
55+
]
56+
[project.urls]
57+
repository = "https://github.com/jgieseler/solo-epd-loader"
58+
59+
[tool.setuptools]
60+
zip-safe = false
61+
include-package-data = true
62+
63+
[tool.setuptools.packages.find]
64+
include = ["solo_epd_loader*"]
65+
exclude = ["solo_epd_loader._dev*"]
66+
67+
[tool.setuptools_scm]
68+
version_file = "solo_epd_loader/_version.py"
69+
70+
[tool.pytest.ini_options]
71+
testpaths = [
72+
"solo_epd_loader",
73+
"docs",
74+
]
75+
doctest_plus = "enabled"
76+
text_file_format = "rst"
77+
addopts = [
78+
"--doctest-rst",
79+
"--ignore=solo_epd_loader/_dev",
80+
]
81+
python_files = [
82+
"test_*.py",
83+
"*_test.py",
84+
"test.py",
85+
"tests.py",
86+
]
87+
88+
[tool.coverage.run]
89+
omit = [
90+
"solo_epd_loader/__init*",
91+
"solo_epd_loader/conftest.py",
92+
"solo_epd_loader/*setup_package*",
93+
"solo_epd_loader/tests/*",
94+
"solo_epd_loader/*/tests/*",
95+
"solo_epd_loader/extern/*",
96+
"solo_epd_loader/version*",
97+
"*/solo_epd_loader/__init*",
98+
"*/solo_epd_loader/conftest.py",
99+
"*/solo_epd_loader/*setup_package*",
100+
"*/solo_epd_loader/tests/*",
101+
"*/solo_epd_loader/*/tests/*",
102+
"*/solo_epd_loader/extern/*",
103+
"*/solo_epd_loader/version*",
104+
]
105+
106+
[tool.coverage.report]
107+
exclude_lines = [
108+
# Have to re-enable the standard pragma
109+
"pragma: no cover",
110+
# Don't complain about packages we have installed
111+
"except ImportError",
112+
# Don't complain if tests don't hit assertions
113+
"raise AssertionError",
114+
"raise NotImplementedError",
115+
# Don't complain about script hooks
116+
"def main(.*):",
117+
# Ignore branches that don't pertain to this version of Python
118+
"pragma: py{ignore_python_version}",
119+
# Don't complain about IPython completion helper
120+
"def _ipython_key_completions_",
121+
# typing.TYPE_CHECKING is False at runtime
122+
"if TYPE_CHECKING:",
123+
# Ignore typing overloads
124+
"@overload",
125+
]

0 commit comments

Comments
 (0)