yancc 0.0.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- yancc-0.0.1/CITATION.cff +40 -0
- yancc-0.0.1/LICENSE +21 -0
- yancc-0.0.1/MANIFEST.in +14 -0
- yancc-0.0.1/PKG-INFO +158 -0
- yancc-0.0.1/README.rst +107 -0
- yancc-0.0.1/pyproject.toml +161 -0
- yancc-0.0.1/setup.cfg +4 -0
- yancc-0.0.1/setup.py +22 -0
- yancc-0.0.1/tests/test_collisions.py +625 -0
- yancc-0.0.1/tests/test_convergence.py +1580 -0
- yancc-0.0.1/tests/test_field.py +143 -0
- yancc-0.0.1/tests/test_finite_diff.py +114 -0
- yancc-0.0.1/tests/test_krylov.py +810 -0
- yancc-0.0.1/tests/test_linalg.py +478 -0
- yancc-0.0.1/tests/test_misc.py +37 -0
- yancc-0.0.1/tests/test_multigrid.py +206 -0
- yancc-0.0.1/tests/test_potentials.py +517 -0
- yancc-0.0.1/tests/test_preconditioner.py +62 -0
- yancc-0.0.1/tests/test_smoothers.py +676 -0
- yancc-0.0.1/tests/test_solution.py +124 -0
- yancc-0.0.1/tests/test_solve.py +793 -0
- yancc-0.0.1/tests/test_species.py +551 -0
- yancc-0.0.1/tests/test_trajectories.py +1072 -0
- yancc-0.0.1/tests/test_velocity_grids.py +118 -0
- yancc-0.0.1/versioneer.py +2333 -0
- yancc-0.0.1/yancc/__init__.py +24 -0
- yancc-0.0.1/yancc/_version.py +21 -0
- yancc-0.0.1/yancc/collisions.py +2616 -0
- yancc-0.0.1/yancc/convergence.py +2218 -0
- yancc-0.0.1/yancc/field.py +793 -0
- yancc-0.0.1/yancc/finite_diff.py +220 -0
- yancc-0.0.1/yancc/krylov.py +1272 -0
- yancc-0.0.1/yancc/linalg.py +1579 -0
- yancc-0.0.1/yancc/misc.py +298 -0
- yancc-0.0.1/yancc/multigrid.py +1395 -0
- yancc-0.0.1/yancc/preconditioner.py +579 -0
- yancc-0.0.1/yancc/smoothers.py +1055 -0
- yancc-0.0.1/yancc/solution.py +655 -0
- yancc-0.0.1/yancc/solve.py +553 -0
- yancc-0.0.1/yancc/species.py +476 -0
- yancc-0.0.1/yancc/trajectories.py +2343 -0
- yancc-0.0.1/yancc/trajectories_scipy.py +273 -0
- yancc-0.0.1/yancc/utils.py +255 -0
- yancc-0.0.1/yancc/velocity_grids.py +350 -0
- yancc-0.0.1/yancc.egg-info/PKG-INFO +158 -0
- yancc-0.0.1/yancc.egg-info/SOURCES.txt +47 -0
- yancc-0.0.1/yancc.egg-info/dependency_links.txt +1 -0
- yancc-0.0.1/yancc.egg-info/requires.txt +26 -0
- yancc-0.0.1/yancc.egg-info/top_level.txt +3 -0
yancc-0.0.1/CITATION.cff
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
cff-version: 1.2.0
|
|
2
|
+
message: "If you use yancc in published work, please cite it as below."
|
|
3
|
+
title: "yancc: Yet Another NeoClassical Code"
|
|
4
|
+
abstract: >-
|
|
5
|
+
yancc is a pure-Python, JAX-based code for solving the drift kinetic equation
|
|
6
|
+
to compute neoclassical flows and transport fluxes in toroidal magnetic
|
|
7
|
+
confinement geometries, including both tokamaks and stellarators. It solves
|
|
8
|
+
the full (multi-species, energy-dependent) drift kinetic equation as well as
|
|
9
|
+
the monoenergetic approximation, using a matrix-free Krylov solver with a
|
|
10
|
+
geometric multigrid preconditioner. Being written in JAX, it is
|
|
11
|
+
differentiable and runs on both CPUs and GPUs.
|
|
12
|
+
type: software
|
|
13
|
+
authors:
|
|
14
|
+
- given-names: Rory
|
|
15
|
+
family-names: Conlin
|
|
16
|
+
email: mail@fouriest.net
|
|
17
|
+
affiliation: >-
|
|
18
|
+
Institute for Research in Electronics and Applied Physics,
|
|
19
|
+
University of Maryland, College Park
|
|
20
|
+
orcid: 'https://orcid.org/0000-0001-8366-2111'
|
|
21
|
+
- given-names: Matt
|
|
22
|
+
family-names: Landreman
|
|
23
|
+
affiliation: >-
|
|
24
|
+
Institute for Research in Electronics and Applied Physics,
|
|
25
|
+
University of Maryland, College Park
|
|
26
|
+
orcid: 'https://orcid.org/0000-0002-7233-577X'
|
|
27
|
+
keywords:
|
|
28
|
+
- neoclassical transport
|
|
29
|
+
- drift kinetic equation
|
|
30
|
+
- stellarator
|
|
31
|
+
- tokamak
|
|
32
|
+
- plasma physics
|
|
33
|
+
- magnetic confinement fusion
|
|
34
|
+
- automatic differentiation
|
|
35
|
+
- JAX
|
|
36
|
+
- GPU
|
|
37
|
+
url: "https://yancc.readthedocs.io/"
|
|
38
|
+
repository-code: "https://github.com/f0uriest/yancc"
|
|
39
|
+
repository-artifact: "https://pypi.org/project/yancc/"
|
|
40
|
+
license: MIT
|
yancc-0.0.1/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Rory Conlin
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
yancc-0.0.1/MANIFEST.in
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
include LICENSE
|
|
2
|
+
include README.rst
|
|
3
|
+
include CITATION.cff
|
|
4
|
+
include versioneer.py
|
|
5
|
+
include yancc/_version.py
|
|
6
|
+
exclude .pymon
|
|
7
|
+
recursive-exclude * __pycache__
|
|
8
|
+
recursive-exclude * *.py[co]
|
|
9
|
+
recursive-exclude * .pymon
|
|
10
|
+
prune docs
|
|
11
|
+
prune local
|
|
12
|
+
prune benchmarks
|
|
13
|
+
prune publications
|
|
14
|
+
prune htmlcov
|
yancc-0.0.1/PKG-INFO
ADDED
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: yancc
|
|
3
|
+
Version: 0.0.1
|
|
4
|
+
Summary: Yet Another NeoClassical Code
|
|
5
|
+
Author-email: Rory Conlin <mail@fouriest.net>
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/f0uriest/yancc
|
|
8
|
+
Project-URL: Documentation, https://yancc.readthedocs.io/
|
|
9
|
+
Project-URL: Source Code, https://github.com/f0uriest/yancc/
|
|
10
|
+
Project-URL: Issues Tracker, https://github.com/f0uriest/yancc/issues
|
|
11
|
+
Keywords: neoclassical,transport,stellarator,tokamak,plasma
|
|
12
|
+
Classifier: Development Status :: 3 - Alpha
|
|
13
|
+
Classifier: Intended Audience :: Science/Research
|
|
14
|
+
Classifier: Natural Language :: English
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
20
|
+
Classifier: Topic :: Scientific/Engineering
|
|
21
|
+
Classifier: Topic :: Scientific/Engineering :: Mathematics
|
|
22
|
+
Requires-Python: >=3.10
|
|
23
|
+
Description-Content-Type: text/x-rst
|
|
24
|
+
License-File: LICENSE
|
|
25
|
+
Requires-Dist: equinox<0.14,>=0.11.0
|
|
26
|
+
Requires-Dist: interpax<0.4,>=0.3.3
|
|
27
|
+
Requires-Dist: jax<0.11,>=0.4.30
|
|
28
|
+
Requires-Dist: jaxtyping<0.4,>=0.2.24
|
|
29
|
+
Requires-Dist: lineax<0.2,>=0.0.6
|
|
30
|
+
Requires-Dist: netcdf4<1.8,>=1.5.4
|
|
31
|
+
Requires-Dist: numpy<2.5,>=1.20.0
|
|
32
|
+
Requires-Dist: orthax<0.3
|
|
33
|
+
Requires-Dist: quadax<0.3,>=0.2.2
|
|
34
|
+
Requires-Dist: scipy<1.18,>=1.7.0
|
|
35
|
+
Provides-Extra: dev
|
|
36
|
+
Requires-Dist: sympy; extra == "dev"
|
|
37
|
+
Requires-Dist: desc-opt<=0.17.1; extra == "dev"
|
|
38
|
+
Requires-Dist: mpmath; extra == "dev"
|
|
39
|
+
Requires-Dist: sphinx<=9.1,>=3.0.0; extra == "dev"
|
|
40
|
+
Requires-Dist: sphinx_copybutton<=0.5.2; extra == "dev"
|
|
41
|
+
Requires-Dist: sphinx-rtd-theme<=3.1,>=1.0; extra == "dev"
|
|
42
|
+
Requires-Dist: sphinx-github-style<=1.2.2,>=1.0; extra == "dev"
|
|
43
|
+
Requires-Dist: ruff==0.15.14; extra == "dev"
|
|
44
|
+
Requires-Dist: pre-commit<=4.5.1; extra == "dev"
|
|
45
|
+
Requires-Dist: pyright<1.2; extra == "dev"
|
|
46
|
+
Requires-Dist: pytest<=9.0.3,>=5.0.0; extra == "dev"
|
|
47
|
+
Requires-Dist: pytest-cov<=7.1.0,>=2.6; extra == "dev"
|
|
48
|
+
Requires-Dist: pytest-split<=0.11,>=0.8.2; extra == "dev"
|
|
49
|
+
Requires-Dist: build; extra == "dev"
|
|
50
|
+
Dynamic: license-file
|
|
51
|
+
|
|
52
|
+
.. image:: https://raw.githubusercontent.com/f0uriest/yancc/master/docs/_static/images/logo.png
|
|
53
|
+
:width: 400
|
|
54
|
+
:align: center
|
|
55
|
+
:alt: yancc
|
|
56
|
+
|
|
57
|
+
Yet Another NeoClassical Code.
|
|
58
|
+
==============================
|
|
59
|
+
|License|
|
|
60
|
+
|
|
61
|
+
|Docs| |UnitTests| |Codecov|
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
``yancc`` solves the drift kinetic equation to compute neoclassical flows and transport
|
|
65
|
+
fluxes in toroidal geometry (both tokamaks and stellarators).
|
|
66
|
+
|
|
67
|
+
Installation
|
|
68
|
+
------------
|
|
69
|
+
|
|
70
|
+
``yancc`` is a pure-Python package built on `JAX <https://github.com/google/jax>`_
|
|
71
|
+
and requires Python 3.10 or newer.
|
|
72
|
+
|
|
73
|
+
From PyPI::
|
|
74
|
+
|
|
75
|
+
pip install yancc
|
|
76
|
+
|
|
77
|
+
From source (for development)::
|
|
78
|
+
|
|
79
|
+
git clone https://github.com/f0uriest/yancc.git
|
|
80
|
+
cd yancc
|
|
81
|
+
pip install -e ".[dev]"
|
|
82
|
+
|
|
83
|
+
JAX provides separate wheels for CPU and GPU backends; see the
|
|
84
|
+
`JAX install guide <https://docs.jax.dev/en/latest/installation.html>`_ to pick
|
|
85
|
+
the appropriate one for your hardware.
|
|
86
|
+
|
|
87
|
+
Example: Solving the Drift Kinetic Equation
|
|
88
|
+
-------------------------------------------
|
|
89
|
+
|
|
90
|
+
A minimal end-to-end DKE solve for a single hydrogen species:
|
|
91
|
+
|
|
92
|
+
.. code-block:: python
|
|
93
|
+
|
|
94
|
+
from yancc.field import Field
|
|
95
|
+
from yancc.solve import solve_dke
|
|
96
|
+
from yancc.species import Hydrogen, LocalMaxwellian
|
|
97
|
+
from yancc.velocity_grids import MaxwellSpeedGrid, UniformPitchAngleGrid
|
|
98
|
+
|
|
99
|
+
# Field and grids.
|
|
100
|
+
rho = 0.5
|
|
101
|
+
nt, nz, na, nx = 15, 31, 61, 6
|
|
102
|
+
field = Field.from_vmec("wout_NCSX.nc", rho, nt, nz)
|
|
103
|
+
pitchgrid = UniformPitchAngleGrid(na)
|
|
104
|
+
speedgrid = MaxwellSpeedGrid(nx)
|
|
105
|
+
|
|
106
|
+
# Single hydrogen species. Density and temperature gradients are with
|
|
107
|
+
# respect to rho = sqrt(normalized toroidal flux), so multiply physical
|
|
108
|
+
# gradients by the minor radius.
|
|
109
|
+
species = [
|
|
110
|
+
LocalMaxwellian(
|
|
111
|
+
Hydrogen,
|
|
112
|
+
temperature=0.8e3, # eV
|
|
113
|
+
density=1.5e20, # 1/m^3
|
|
114
|
+
dTdrho=-2.0e3 * field.a_minor,
|
|
115
|
+
dndrho=-0.4e20 * field.a_minor,
|
|
116
|
+
)
|
|
117
|
+
]
|
|
118
|
+
|
|
119
|
+
# Radial electric field, in Volts. Erho = -dPhi/drho.
|
|
120
|
+
Er_kV_per_m = 0.5
|
|
121
|
+
Erho = Er_kV_per_m * field.a_minor * 1000
|
|
122
|
+
|
|
123
|
+
sol, info = solve_dke(
|
|
124
|
+
field,
|
|
125
|
+
pitchgrid,
|
|
126
|
+
speedgrid,
|
|
127
|
+
species,
|
|
128
|
+
Erho=Erho,
|
|
129
|
+
verbose=2,
|
|
130
|
+
rtol=1e-5,
|
|
131
|
+
)
|
|
132
|
+
|
|
133
|
+
print("<Gamma> =", sol.get("<particle_flux>")) # particles/(m^2 s)
|
|
134
|
+
print("<Q> =", sol.get("<heat_flux>")) # J/(m^2 s)
|
|
135
|
+
print("<V||B> =", sol.get("<V||B>")) # T*m/s
|
|
136
|
+
print("<J||B> =", sol.get("<J||B>")) # T*A/m^2
|
|
137
|
+
|
|
138
|
+
See the `documentation <https://yancc.readthedocs.io/>`_ for the monoenergetic
|
|
139
|
+
solver, multi-species runs, the full list of output variables, and the API
|
|
140
|
+
reference.
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
.. |License| image:: https://img.shields.io/github/license/f0uriest/yancc?color=blue&logo=open-source-initiative&logoColor=white
|
|
144
|
+
:target: https://github.com/f0uriest/yancc/blob/master/LICENSE
|
|
145
|
+
:alt: License
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
.. |Docs| image:: https://img.shields.io/readthedocs/yancc?logo=Read-the-Docs
|
|
149
|
+
:target: https://yancc.readthedocs.io/en/latest/?badge=latest
|
|
150
|
+
:alt: Documentation
|
|
151
|
+
|
|
152
|
+
.. |UnitTests| image:: https://github.com/f0uriest/yancc/actions/workflows/unittest.yml/badge.svg
|
|
153
|
+
:target: https://github.com/f0uriest/yancc/actions/workflows/unittest.yml
|
|
154
|
+
:alt: UnitTests
|
|
155
|
+
|
|
156
|
+
.. |Codecov| image:: https://codecov.io/gh/f0uriest/yancc/branch/master/graph/badge.svg?token=4WTFZ0ZLLB
|
|
157
|
+
:target: https://codecov.io/gh/f0uriest/yancc
|
|
158
|
+
:alt: Coverage
|
yancc-0.0.1/README.rst
ADDED
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
.. image:: https://raw.githubusercontent.com/f0uriest/yancc/master/docs/_static/images/logo.png
|
|
2
|
+
:width: 400
|
|
3
|
+
:align: center
|
|
4
|
+
:alt: yancc
|
|
5
|
+
|
|
6
|
+
Yet Another NeoClassical Code.
|
|
7
|
+
==============================
|
|
8
|
+
|License|
|
|
9
|
+
|
|
10
|
+
|Docs| |UnitTests| |Codecov|
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
``yancc`` solves the drift kinetic equation to compute neoclassical flows and transport
|
|
14
|
+
fluxes in toroidal geometry (both tokamaks and stellarators).
|
|
15
|
+
|
|
16
|
+
Installation
|
|
17
|
+
------------
|
|
18
|
+
|
|
19
|
+
``yancc`` is a pure-Python package built on `JAX <https://github.com/google/jax>`_
|
|
20
|
+
and requires Python 3.10 or newer.
|
|
21
|
+
|
|
22
|
+
From PyPI::
|
|
23
|
+
|
|
24
|
+
pip install yancc
|
|
25
|
+
|
|
26
|
+
From source (for development)::
|
|
27
|
+
|
|
28
|
+
git clone https://github.com/f0uriest/yancc.git
|
|
29
|
+
cd yancc
|
|
30
|
+
pip install -e ".[dev]"
|
|
31
|
+
|
|
32
|
+
JAX provides separate wheels for CPU and GPU backends; see the
|
|
33
|
+
`JAX install guide <https://docs.jax.dev/en/latest/installation.html>`_ to pick
|
|
34
|
+
the appropriate one for your hardware.
|
|
35
|
+
|
|
36
|
+
Example: Solving the Drift Kinetic Equation
|
|
37
|
+
-------------------------------------------
|
|
38
|
+
|
|
39
|
+
A minimal end-to-end DKE solve for a single hydrogen species:
|
|
40
|
+
|
|
41
|
+
.. code-block:: python
|
|
42
|
+
|
|
43
|
+
from yancc.field import Field
|
|
44
|
+
from yancc.solve import solve_dke
|
|
45
|
+
from yancc.species import Hydrogen, LocalMaxwellian
|
|
46
|
+
from yancc.velocity_grids import MaxwellSpeedGrid, UniformPitchAngleGrid
|
|
47
|
+
|
|
48
|
+
# Field and grids.
|
|
49
|
+
rho = 0.5
|
|
50
|
+
nt, nz, na, nx = 15, 31, 61, 6
|
|
51
|
+
field = Field.from_vmec("wout_NCSX.nc", rho, nt, nz)
|
|
52
|
+
pitchgrid = UniformPitchAngleGrid(na)
|
|
53
|
+
speedgrid = MaxwellSpeedGrid(nx)
|
|
54
|
+
|
|
55
|
+
# Single hydrogen species. Density and temperature gradients are with
|
|
56
|
+
# respect to rho = sqrt(normalized toroidal flux), so multiply physical
|
|
57
|
+
# gradients by the minor radius.
|
|
58
|
+
species = [
|
|
59
|
+
LocalMaxwellian(
|
|
60
|
+
Hydrogen,
|
|
61
|
+
temperature=0.8e3, # eV
|
|
62
|
+
density=1.5e20, # 1/m^3
|
|
63
|
+
dTdrho=-2.0e3 * field.a_minor,
|
|
64
|
+
dndrho=-0.4e20 * field.a_minor,
|
|
65
|
+
)
|
|
66
|
+
]
|
|
67
|
+
|
|
68
|
+
# Radial electric field, in Volts. Erho = -dPhi/drho.
|
|
69
|
+
Er_kV_per_m = 0.5
|
|
70
|
+
Erho = Er_kV_per_m * field.a_minor * 1000
|
|
71
|
+
|
|
72
|
+
sol, info = solve_dke(
|
|
73
|
+
field,
|
|
74
|
+
pitchgrid,
|
|
75
|
+
speedgrid,
|
|
76
|
+
species,
|
|
77
|
+
Erho=Erho,
|
|
78
|
+
verbose=2,
|
|
79
|
+
rtol=1e-5,
|
|
80
|
+
)
|
|
81
|
+
|
|
82
|
+
print("<Gamma> =", sol.get("<particle_flux>")) # particles/(m^2 s)
|
|
83
|
+
print("<Q> =", sol.get("<heat_flux>")) # J/(m^2 s)
|
|
84
|
+
print("<V||B> =", sol.get("<V||B>")) # T*m/s
|
|
85
|
+
print("<J||B> =", sol.get("<J||B>")) # T*A/m^2
|
|
86
|
+
|
|
87
|
+
See the `documentation <https://yancc.readthedocs.io/>`_ for the monoenergetic
|
|
88
|
+
solver, multi-species runs, the full list of output variables, and the API
|
|
89
|
+
reference.
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
.. |License| image:: https://img.shields.io/github/license/f0uriest/yancc?color=blue&logo=open-source-initiative&logoColor=white
|
|
93
|
+
:target: https://github.com/f0uriest/yancc/blob/master/LICENSE
|
|
94
|
+
:alt: License
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
.. |Docs| image:: https://img.shields.io/readthedocs/yancc?logo=Read-the-Docs
|
|
98
|
+
:target: https://yancc.readthedocs.io/en/latest/?badge=latest
|
|
99
|
+
:alt: Documentation
|
|
100
|
+
|
|
101
|
+
.. |UnitTests| image:: https://github.com/f0uriest/yancc/actions/workflows/unittest.yml/badge.svg
|
|
102
|
+
:target: https://github.com/f0uriest/yancc/actions/workflows/unittest.yml
|
|
103
|
+
:alt: UnitTests
|
|
104
|
+
|
|
105
|
+
.. |Codecov| image:: https://codecov.io/gh/f0uriest/yancc/branch/master/graph/badge.svg?token=4WTFZ0ZLLB
|
|
106
|
+
:target: https://codecov.io/gh/f0uriest/yancc
|
|
107
|
+
:alt: Coverage
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = [
|
|
3
|
+
"setuptools>=77",
|
|
4
|
+
# versioneer itself is vendored as ./versioneer.py; tomli lets it read its
|
|
5
|
+
# [tool.versioneer] config from this file on Python < 3.11
|
|
6
|
+
"tomli>=1.2.0; python_version < '3.11'",
|
|
7
|
+
]
|
|
8
|
+
build-backend = "setuptools.build_meta"
|
|
9
|
+
|
|
10
|
+
[project]
|
|
11
|
+
name = "yancc"
|
|
12
|
+
description = "Yet Another NeoClassical Code"
|
|
13
|
+
readme = "README.rst"
|
|
14
|
+
requires-python = ">=3.10"
|
|
15
|
+
license = "MIT"
|
|
16
|
+
license-files = ["LICENSE"]
|
|
17
|
+
authors = [ { name = "Rory Conlin", email = "mail@fouriest.net" } ]
|
|
18
|
+
keywords = [
|
|
19
|
+
"neoclassical",
|
|
20
|
+
"transport",
|
|
21
|
+
"stellarator",
|
|
22
|
+
"tokamak",
|
|
23
|
+
"plasma",
|
|
24
|
+
]
|
|
25
|
+
classifiers = [
|
|
26
|
+
"Development Status :: 3 - Alpha",
|
|
27
|
+
"Intended Audience :: Science/Research",
|
|
28
|
+
"Natural Language :: English",
|
|
29
|
+
"Programming Language :: Python :: 3",
|
|
30
|
+
"Programming Language :: Python :: 3.10",
|
|
31
|
+
"Programming Language :: Python :: 3.11",
|
|
32
|
+
"Programming Language :: Python :: 3.12",
|
|
33
|
+
"Programming Language :: Python :: 3.13",
|
|
34
|
+
"Topic :: Scientific/Engineering",
|
|
35
|
+
"Topic :: Scientific/Engineering :: Mathematics",
|
|
36
|
+
]
|
|
37
|
+
dependencies = [
|
|
38
|
+
"equinox >= 0.11.0, < 0.14",
|
|
39
|
+
"interpax >= 0.3.3, < 0.4",
|
|
40
|
+
"jax >= 0.4.30, < 0.11",
|
|
41
|
+
"jaxtyping >= 0.2.24, < 0.4",
|
|
42
|
+
"lineax >= 0.0.6, < 0.2",
|
|
43
|
+
"netcdf4 >= 1.5.4, < 1.8",
|
|
44
|
+
"numpy >= 1.20.0, < 2.5",
|
|
45
|
+
"orthax < 0.3",
|
|
46
|
+
"quadax >= 0.2.2, < 0.3",
|
|
47
|
+
"scipy >= 1.7.0, < 1.18",
|
|
48
|
+
]
|
|
49
|
+
# version is computed from git by versioneer
|
|
50
|
+
dynamic = [ "version" ]
|
|
51
|
+
|
|
52
|
+
[project.optional-dependencies]
|
|
53
|
+
dev = [
|
|
54
|
+
# benchmarks and analytic test oracles
|
|
55
|
+
"sympy",
|
|
56
|
+
"desc-opt <= 0.17.1",
|
|
57
|
+
"mpmath",
|
|
58
|
+
# building the docs
|
|
59
|
+
"sphinx >= 3.0.0, <= 9.1",
|
|
60
|
+
"sphinx_copybutton <= 0.5.2",
|
|
61
|
+
"sphinx-rtd-theme >= 1.0, <= 3.1",
|
|
62
|
+
"sphinx-github-style >= 1.0, <= 1.2.2",
|
|
63
|
+
# linting
|
|
64
|
+
"ruff == 0.15.14",
|
|
65
|
+
"pre-commit <= 4.5.1",
|
|
66
|
+
"pyright < 1.2",
|
|
67
|
+
# testing and benchmarking
|
|
68
|
+
"pytest >= 5.0.0, <= 9.0.3",
|
|
69
|
+
"pytest-cov >= 2.6, <= 7.1.0",
|
|
70
|
+
"pytest-split >= 0.8.2, <= 0.11",
|
|
71
|
+
# building
|
|
72
|
+
"build",
|
|
73
|
+
]
|
|
74
|
+
|
|
75
|
+
[project.urls]
|
|
76
|
+
Homepage = "https://github.com/f0uriest/yancc"
|
|
77
|
+
Documentation = "https://yancc.readthedocs.io/"
|
|
78
|
+
"Source Code" = "https://github.com/f0uriest/yancc/"
|
|
79
|
+
"Issues Tracker" = "https://github.com/f0uriest/yancc/issues"
|
|
80
|
+
|
|
81
|
+
[tool.setuptools.packages.find]
|
|
82
|
+
exclude = [ "docs*", "tests*", "local*", "benchmarks*", "publications*" ]
|
|
83
|
+
|
|
84
|
+
[tool.versioneer]
|
|
85
|
+
VCS = "git"
|
|
86
|
+
style = "pep440"
|
|
87
|
+
versionfile_source = "yancc/_version.py"
|
|
88
|
+
versionfile_build = "yancc/_version.py"
|
|
89
|
+
tag_prefix = "v"
|
|
90
|
+
parentdir_prefix = "yancc-"
|
|
91
|
+
|
|
92
|
+
[tool.pyright]
|
|
93
|
+
include = [ "yancc/*.py", "tests/*.py" ]
|
|
94
|
+
exclude = [
|
|
95
|
+
"yancc/_version.py",
|
|
96
|
+
"versioneer.py",
|
|
97
|
+
"docs/conf.py",
|
|
98
|
+
"local/*",
|
|
99
|
+
"*/.ipynb_checkpoints/*"
|
|
100
|
+
]
|
|
101
|
+
|
|
102
|
+
[tool.ruff]
|
|
103
|
+
line-length = 88
|
|
104
|
+
target-version = "py310"
|
|
105
|
+
extend-exclude = ["docs", "build", "local", "versioneer.py", "yancc/_version.py"]
|
|
106
|
+
|
|
107
|
+
[tool.ruff.lint]
|
|
108
|
+
select = ["E", "W", "F", "I", "D", "ERA", "UP", "C901"]
|
|
109
|
+
ignore = [
|
|
110
|
+
"E731", # lambda expressions are useful
|
|
111
|
+
"E741", # variable names like "l" are common for mode numbers
|
|
112
|
+
"D401", # don't want to always use "imperative mood" in docstrings
|
|
113
|
+
"D105", # don't care about docstrings in __dunder__ methods
|
|
114
|
+
"D205", # rst titles in modules
|
|
115
|
+
"D400", # rst titles in modules
|
|
116
|
+
"F722", # to play nice with jaxtyping
|
|
117
|
+
"W505", # doc line length handled elsewhere
|
|
118
|
+
]
|
|
119
|
+
|
|
120
|
+
[tool.ruff.lint.per-file-ignores]
|
|
121
|
+
# need to import things to top level even if they aren't used there
|
|
122
|
+
"yancc/__init__.py" = ["F401"]
|
|
123
|
+
"tests/*" = ["D101", "D102", "D103"]
|
|
124
|
+
|
|
125
|
+
[tool.ruff.lint.pydocstyle]
|
|
126
|
+
convention = "numpy"
|
|
127
|
+
|
|
128
|
+
[tool.ruff.lint.mccabe]
|
|
129
|
+
max-complexity = 15
|
|
130
|
+
|
|
131
|
+
[tool.pytest.ini_options]
|
|
132
|
+
markers = [
|
|
133
|
+
"unit: marks small unit tests",
|
|
134
|
+
"regression: marks end to end regression tests",
|
|
135
|
+
"slow: marks tests as slow (deselect with 'pytest -m \"not slow\"').",
|
|
136
|
+
"fast: mark tests as fast.",
|
|
137
|
+
]
|
|
138
|
+
filterwarnings = [
|
|
139
|
+
"error",
|
|
140
|
+
"ignore::pytest.PytestUnraisableExceptionWarning",
|
|
141
|
+
# ignore benign Cython warnings on ndarray size
|
|
142
|
+
"ignore:numpy.ndarray size changed:RuntimeWarning",
|
|
143
|
+
# ignore benign ml_dtypes DeprecationWarning
|
|
144
|
+
"ignore::DeprecationWarning:ml_dtypes.*",
|
|
145
|
+
]
|
|
146
|
+
|
|
147
|
+
[tool.coverage.run]
|
|
148
|
+
# we only care about the coverage of the source itself
|
|
149
|
+
# otherwise it measures coverage of the tests themselves as well
|
|
150
|
+
source = [ "yancc/" ]
|
|
151
|
+
# _version.py is generated code, no need to count it
|
|
152
|
+
omit = [ "yancc/_version.py" ]
|
|
153
|
+
|
|
154
|
+
[tool.coverage.report]
|
|
155
|
+
# Regexes for lines to exclude from consideration
|
|
156
|
+
exclude_lines = [
|
|
157
|
+
# Have to re-enable the standard pragma
|
|
158
|
+
"pragma: no cover",
|
|
159
|
+
"if __name__ == .__main__.:",
|
|
160
|
+
]
|
|
161
|
+
ignore_errors = true
|
yancc-0.0.1/setup.cfg
ADDED
yancc-0.0.1/setup.py
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"""Setup/build/install script for yancc.
|
|
2
|
+
|
|
3
|
+
Package metadata lives in ``pyproject.toml``. This file exists only because
|
|
4
|
+
versioneer needs to inject the version and its custom build commands, which
|
|
5
|
+
cannot be expressed declaratively.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
import os
|
|
9
|
+
import sys
|
|
10
|
+
|
|
11
|
+
from setuptools import setup
|
|
12
|
+
|
|
13
|
+
# PEP 517 backends do not put the source root on sys.path, so the vendored
|
|
14
|
+
# versioneer.py next to this file would not otherwise be importable.
|
|
15
|
+
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
|
|
16
|
+
|
|
17
|
+
import versioneer # noqa: E402
|
|
18
|
+
|
|
19
|
+
setup(
|
|
20
|
+
version=versioneer.get_version(),
|
|
21
|
+
cmdclass=versioneer.get_cmdclass(),
|
|
22
|
+
)
|