Skip to content

Commit 4e85644

Browse files
authored
Move to pyproject.toml, reorganize documentation, and refactor interpolation function on Strand (#193)
* move away from setup.cfg/setup.py * more fixes to pyproject * some refactoring of interp functions, move read time function * reorganize docs, use pydata theme * fix tox file * fix datetime deprecation * don't lint bat files * make precommit happy * add fixture back * fix docstring
1 parent 84719bc commit 4e85644

35 files changed

+655
-445
lines changed

.coveragerc

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

.github/workflows/test.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ jobs:
1818
envs: |
1919
- macos: py312
2020
- windows: py312
21-
- linux: py310
2221
- linux: py311
2322
- linux: py312
2423
- linux: py313

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,4 +67,4 @@ target/
6767
.pytest_cache
6868

6969
# Project specific
70-
pydrad/_version.py
70+
pydrad/version.py

.pre-commit-config.yaml

Lines changed: 26 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,71 +1,43 @@
1+
ci:
2+
autofix_prs: false
3+
autoupdate_schedule: quarterly
4+
15
repos:
2-
# The warnings/errors we check for here are:
3-
# E101 - mix of tabs and spaces
4-
# W191 - use of tabs
5-
# W291 - trailing whitespace
6-
# W292 - no newline at end of file
7-
# W293 - trailing whitespace
8-
# W391 - blank line at end of file
9-
# E111 - 4 spaces per indentation level
10-
# E112 - 4 spaces per indentation level
11-
# E113 - 4 spaces per indentation level
12-
# E303 - too many blank lines (3)
13-
# E304 - blank lines found after function decorator
14-
# E305 - expected 2 blank lines after class or function definition
15-
# E306 - expected 1 blank line before a nested definition
16-
# E502 - the backslash is redundant between brackets
17-
# E722 - do not use bare except
18-
# E901 - SyntaxError or IndentationError
19-
# E902 - IOError
20-
# F822: undefined name in __all__
21-
# F823: local variable name referenced before assignment
22-
- repo: https://github.com/pycqa/flake8
23-
rev: 6.0.0
6+
- repo: https://github.com/astral-sh/ruff-pre-commit
7+
rev: "v0.12.7"
248
hooks:
25-
- id: flake8
26-
additional_dependencies: [flake8-use-pathlib]
27-
args: ['--count', '--select', 'E101,W191,W291,W292,W293,W391,E111,E112,E113,E303,E304,E306,E502,E722,E901,E902,F822,F823,PL100,PL102,PL103,PL104,PL105,PL110,PL112,PL113,PL18,PL120,PL122,PL123']
9+
- id: ruff
10+
args: ["--fix"]
11+
12+
- repo: https://github.com/PyCQA/isort
13+
rev: 6.0.1
14+
hooks:
15+
- id: isort
16+
name: isort
17+
entry: isort
18+
require_serial: true
19+
language: python
20+
types:
21+
- python
2822

2923
- repo: https://github.com/pre-commit/pre-commit-hooks
30-
rev: v4.4.0
24+
rev: v5.0.0
3125
hooks:
3226
- id: check-ast
3327
- id: check-case-conflict
3428
- id: trailing-whitespace
35-
exclude: ".*(.fits|.fts|.fit|.txt|.pro)$|pydrad/configure/(templates|data)/.*"
29+
exclude: ".*(.fits|.fts|.fit|.txt|.pro|.asdf|.json|.dat|.cfg|.h|.bat)$"
3630
- id: check-yaml
3731
- id: debug-statements
3832
- id: check-added-large-files
3933
- id: end-of-file-fixer
40-
exclude: ".*(.fits|.fts|.fit|.txt|.pro|.bib|tca.*)$|pydrad/configure/(templates|data)/.*"
34+
exclude: ".*(.fits|.fts|.fit|.txt|.pro|.asdf|.json|.bib|tca.*|.dat|.cfg|.h|.bat)$"
4135
- id: mixed-line-ending
42-
exclude: ".*(.fits|.fts|.fit|.txt|.bib|tca.*)$|pydrad/configure/(templates|data)/.*"
43-
44-
- repo: https://github.com/asottile/pyupgrade
45-
rev: v3.3.1
46-
hooks:
47-
- id: pyupgrade
48-
args: [--keep-runtime-typing, --py38-plus]
49-
files: ^fiasco/
36+
exclude: ".*(.fits|.fts|.fit|.txt|.bib|.pro|.asdf|.json|tca.*|.dat|.cfg|.h|.bat)$"
5037

5138
- repo: https://github.com/codespell-project/codespell
52-
rev: v2.2.2
39+
rev: v2.4.1
5340
hooks:
5441
- id: codespell
55-
args: ['--config setup.cfg']
56-
57-
- repo: https://github.com/MarcoGorelli/absolufy-imports
58-
rev: v0.3.1
59-
hooks:
60-
- id: absolufy-imports
61-
62-
- repo: https://github.com/PyCQA/isort
63-
rev: 5.12.0
64-
hooks:
65-
- id: isort
66-
name: isort
67-
entry: isort
68-
require_serial: true
69-
language: python
70-
types:
71-
- python
42+
additional_dependencies:
43+
- tomli

.readthedocs.yml

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,30 @@
1-
# .readthedocs.yml
2-
# Read the Docs configuration file
3-
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
4-
5-
# Required
61
version: 2
72

8-
# Set the version of Python and other tools you might need
93
build:
10-
os: ubuntu-22.04
4+
os: ubuntu-lts-latest
115
tools:
12-
python: "3.11"
6+
python: "mambaforge-latest"
7+
jobs:
8+
post_checkout:
9+
- git fetch --unshallow || true
10+
pre_install:
11+
- git update-index --assume-unchanged .rtd-environment.yml docs/conf.py
12+
13+
conda:
14+
environment: .rtd-environment.yml
1315

14-
# Build documentation in the docs/ directory with Sphinx
1516
sphinx:
17+
builder: html
1618
configuration: docs/conf.py
19+
fail_on_warning: false
20+
21+
formats:
22+
- htmlzip
1723

18-
# Optionally set the version of Python and requirements required to build your docs
1924
python:
2025
install:
21-
- method: pip
22-
path: .
23-
extra_requirements:
24-
- docs
25-
- all
26+
- method: pip
27+
extra_requirements:
28+
- all
29+
- docs
30+
path: .

.rtd-environment.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
name: rtd_fiasco
2+
channels:
3+
- conda-forge
4+
dependencies:
5+
- python=3.12
6+
- pip
7+
- graphviz!=2.42.*,!=2.43.*

conftest.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import pytest
66

77
import pydrad.configure
8+
89
from pydrad.configure.util import get_clean_hydrad
910

1011

@@ -112,7 +113,7 @@ def get_configuration_dict():
112113
}
113114

114115

115-
@pytest.fixture(scope='function')
116+
@pytest.fixture
116117
def configuration():
117118
return pydrad.configure.Configure(get_configuration_dict(), freeze_date=True)
118119

docs/Makefile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,17 @@ help:
1414

1515
.PHONY: help Makefile
1616

17+
html-noplot:
18+
@$(SPHINXBUILD) -D plot_gallery=0 -b html $(ALLSPHINXOPTS) $(SOURCEDIR) $(BUILDDIR)/html
19+
@echo
20+
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
21+
1722
# Catch-all target: route all unknown targets to Sphinx using the new
1823
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
1924
%: Makefile
2025
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
26+
27+
clean:
28+
rm -rf $(BUILDDIR)
29+
rm -rf ./generated
30+
rm -rf ./api

docs/citation.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
.. _pydrad-citation:
2+
13
Citing pydrad
24
===============
35

docs/code_ref/configure.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,10 @@ pydrad configure
44
.. automodapi:: pydrad.configure
55
:no-heading:
66
:no-inheritance-diagram:
7+
8+
.. automodapi:: pydrad.configure.util
9+
:no-heading:
10+
:no-inheritance-diagram:
11+
:no-main-docstr:
12+
:skip: MissingParameter
13+
:skip: HYDRADError

0 commit comments

Comments
 (0)