Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
566 commits
Select commit Hold shift + click to select a range
18bb22b
rough out a merge_voltage_clusters() helper func
rocco8773 Jun 10, 2025
626dedb
too much to explain
rocco8773 Jun 12, 2025
1c5271a
rename _nan_stuff_regular_grid -> _force_regular_spacing
rocco8773 Jun 14, 2025
03309ac
add docstring to _force_regular_spacing
rocco8773 Jun 14, 2025
71b46b5
_force_regular_spacing: only nan stuff the current array
rocco8773 Jun 14, 2025
3feaa67
appease grumpy ruff
rocco8773 Jun 14, 2025
ae1e72e
fix invalid ruff rule in noqa
rocco8773 Jun 14, 2025
7d1a207
appease ruff formatter
rocco8773 Jun 14, 2025
f289684
Update requirements with 'nox -s requirements' (#3038)
plasmapy-requirements-bot[bot] Jun 16, 2025
fce4214
move grid regularity checking into separate func _is_voltage_regularl…
rocco8773 Jun 16, 2025
0ab23b9
rough out docstring for merge_voltage_clusters()
rocco8773 Jun 16, 2025
f6e0852
_force_regular_spacing() only NaN stuff if steps of multiples (>1) of…
rocco8773 Jun 16, 2025
66e1af4
merge_voltage_clusters(): return quickly if already regularly spaced
rocco8773 Jun 16, 2025
f587843
add docstring to _is_voltage_regularly_spaced()
rocco8773 Jun 17, 2025
d9ad848
create _interpolate_sweep()
rocco8773 Jun 17, 2025
b05d76a
create _merge_zero_diff_voltage_clusters()
rocco8773 Jun 17, 2025
1be80d8
add return annotations to _interpolate_sweep()
rocco8773 Jun 17, 2025
06e2fc3
appease grumpy ruff
rocco8773 Jun 17, 2025
295d5b8
appease grumpy ruff formatter
rocco8773 Jun 17, 2025
ccea90d
add else case so new_voltage and new_current are always defined
rocco8773 Jun 17, 2025
5484347
create _merge_voltage_clusters()
rocco8773 Jun 17, 2025
d978467
remove noqa from merge_voltage_clusters()
rocco8773 Jun 17, 2025
66518b9
put back noqa C901 and PLR0912
rocco8773 Jun 17, 2025
e7c075e
fix typo
rocco8773 Jun 18, 2025
701128f
Reduce CPR test time (#3039)
pheuer Jun 19, 2025
84ab13e
Merge branch 'main_from_pp' into sla_merge_voltage_clusters
rocco8773 Jun 23, 2025
2663ab5
_force_regular_spacing: fix docstring wording
rocco8773 Jun 23, 2025
19b83de
_is_voltage_regularly_spaced: fix docstring wording
rocco8773 Jun 23, 2025
45bc39e
_interpolate_sweep: fix docstring wording
rocco8773 Jun 23, 2025
09d807b
_merge_zero_diff_voltage_clusters: fix docstring wording
rocco8773 Jun 23, 2025
e9e77b2
_merge_voltage_clusters: fix docstring wording
rocco8773 Jun 23, 2025
0d1a63a
rename _merge_voltage_clusters -> _merge_voltage_clusters__within_dv
rocco8773 Jun 23, 2025
2b997ec
rename _merge_zero_diff_voltage_clusters -> _merge_voltage_clusters__…
rocco8773 Jun 23, 2025
a0b4af7
rename _interpolate_sweep -> _merge_voltage_clusters__interpolate_sweep
rocco8773 Jun 23, 2025
ccbc7cf
Update requirements with 'nox -s requirements' (#3040)
plasmapy-requirements-bot[bot] Jun 23, 2025
a2382aa
avoid possible infinite loop when voltage_step_size = 0
rocco8773 Jun 23, 2025
31d6969
expand merge_voltage_clusters docstring
rocco8773 Jun 23, 2025
e4a6c78
start test_merge_voltage_clusters()
rocco8773 Jun 23, 2025
a0c545d
add cases to the tests
rocco8773 Jun 24, 2025
16fbee2
Update time to update lockfiles (#3041)
namurphy Jun 24, 2025
c87c163
Remove `sphinx-hoverxref` as an extension to the documentation build …
namurphy Jun 24, 2025
0d70ea2
use np.arange to generate reg_voltage instead of np.linspace
rocco8773 Jun 24, 2025
5febd10
replace UserWarning with PlasmaPyWarning
rocco8773 Jun 24, 2025
dab2bfa
add more test scenarios
rocco8773 Jun 24, 2025
96a78d7
add another scenario for the PlasmaPyWarning
rocco8773 Jun 24, 2025
440beaa
Merge branch 'refs/heads/main_from_pp' into sla_merge_voltage_clusters
rocco8773 Jun 24, 2025
b1359c3
disable untyped mypy error for tests
rocco8773 Jun 24, 2025
115835f
update docstring
rocco8773 Jun 24, 2025
a4144d4
removed unnecessary mock
rocco8773 Jun 25, 2025
1638c5e
rework _merge_voltage_clusters__within_dv so clusters are identified …
rocco8773 Jun 25, 2025
6e1838b
remove force_regular_spacing
rocco8773 Jun 25, 2025
50e7364
update warning messages
rocco8773 Jun 25, 2025
30daae3
remove _force_regular_spacing()
rocco8773 Jun 25, 2025
a1df942
if voltage cluster spans a distance larger than voltage_step_size the…
rocco8773 Jun 26, 2025
51071e8
improve docstring
rocco8773 Jun 26, 2025
641126a
update docstring
rocco8773 Jun 26, 2025
786dcfc
update test for removal of kwarg force_regular_spacing
rocco8773 Jun 26, 2025
5d9fda3
use newshape kwarg
rocco8773 Jun 26, 2025
337b7da
fix variable start_current was supposed to be stop_voltage
rocco8773 Jun 26, 2025
ab59694
add newshape to _typos.toml
rocco8773 Jun 26, 2025
fd7b674
add test cases
rocco8773 Jun 26, 2025
2e88fca
remove nan mask test (not needed after removing force_regular_spacing)
rocco8773 Jun 26, 2025
c995db8
add clarifying comments about test scenarios
rocco8773 Jun 26, 2025
8d12c14
remove _merge_voltage_clusters__interpolate_sweep()
rocco8773 Jun 26, 2025
963d63b
Added functions to laser formulary for Gaussian beams (#3036)
Getahun-yw-Mahl Jun 26, 2025
35c5442
use np.isclose to identify voltage steps near voltage_step_size
rocco8773 Jun 26, 2025
ebd1046
if voltage_steps_size is None default to 95% of average step size
rocco8773 Jun 26, 2025
cf8e7c6
modify cluster binning to accounts for clusters sizes that are close …
rocco8773 Jun 26, 2025
adaea82
only consider voltage regularly spaced if the largest step is less th…
rocco8773 Jun 26, 2025
49ffb54
add test cases
rocco8773 Jun 26, 2025
6a4eb39
enforce the voltage array needs to be monotonically ascending
rocco8773 Jun 26, 2025
02e5b79
add texttt and nbins to _typos.toml
rocco8773 Jun 26, 2025
d14ada6
appease grumpy ruff
rocco8773 Jun 26, 2025
b2dbec4
simplify conditional
rocco8773 Jun 26, 2025
15c386b
add noqa
rocco8773 Jun 26, 2025
e7091f9
add changelog entry
rocco8773 Jun 26, 2025
b4fcb7f
remove unused import
rocco8773 Jun 27, 2025
278c273
appease grump ruff format
rocco8773 Jun 27, 2025
c2b0d76
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jun 27, 2025
91b6543
Update requirements with 'nox -s requirements' (#3043)
plasmapy-requirements-bot[bot] Jun 27, 2025
8e3b5d0
Update pinned requirements 📍 (#3049)
plasmapy-requirements-bot[bot] Jul 5, 2025
8bae949
Merge branch 'main' into sla_merge_voltage_clusters
Jul 9, 2025
c36d1cd
Merge branch 'sla_merge_voltage_clusters' into sla_vp
Jul 9, 2025
8ca2dfd
initial rough out of find_plasma_potential_via_didv_peak
Jul 9, 2025
acf0d59
Update requirements with 'nox -s requirements' (#3051)
plasmapy-requirements-bot[bot] Jul 10, 2025
6c2766e
expose find_plasma_potential to the swept_langmuir namespace
rocco8773 Jul 10, 2025
b314f62
add alias find_vp_
rocco8773 Jul 10, 2025
3a935a2
create namedtuple VpExtras
rocco8773 Jul 10, 2025
a3eff39
incorporate VpExtras into find_plasma_potential
rocco8773 Jul 10, 2025
7b94e1d
calc vp when imax is not singular
rocco8773 Jul 10, 2025
2e9d321
up smooth_fractions count
rocco8773 Jul 10, 2025
1a399ae
force int and float types
rocco8773 Jul 10, 2025
9d13882
[SLA] Add helper function `sort_sweep_arrays` (#3034)
rocco8773 Jul 10, 2025
f598fda
Merge branch 'main_from_pp' into sla_merge_voltage_clusters
rocco8773 Jul 10, 2025
06094a4
Merge branch 'sla_merge_voltage_clusters' into sla_vp
rocco8773 Jul 10, 2025
34d64c7
Update requirements with 'nox -s requirements' (#3052)
plasmapy-requirements-bot[bot] Jul 15, 2025
e174a05
[pre-commit.ci] pre-commit autoupdate (#3050)
pre-commit-ci[bot] Jul 16, 2025
92af72f
Add a security policy and mechanisms to report security vulnerabiliti…
namurphy Jul 16, 2025
821cd59
Update requirements with 'nox -s requirements' (#3053)
plasmapy-requirements-bot[bot] Jul 17, 2025
9b3014e
Update requirements with 'nox -s requirements' (#3054)
plasmapy-requirements-bot[bot] Jul 24, 2025
bdd996e
Fix hyperlinks in documentation (#3056)
namurphy Jul 29, 2025
0f5c795
Let `Particle` accept NumPy integers in the same ways as regular `int…
namurphy Jul 29, 2025
e881bfe
Update usage of `uv` by Nox (#2998)
namurphy Jul 29, 2025
836cafd
[SLA] Add helper function `merge_voltage_clusters` (#3037)
rocco8773 Jul 29, 2025
4318df5
Merge branch 'main' into sla_vp
Jul 29, 2025
445e199
Update pinned requirements for `plasmapy_sphinx>=2025.5.1` (#3058)
plasmapy-requirements-bot[bot] Jul 30, 2025
dcea729
remove alias find_vp_
Jul 30, 2025
e4cdf87
rename find_plasma_potential_via_didv_peak -> find_didv_peak
Jul 30, 2025
64766ab
have E402 lint exception be applied to all files in swept_langmuir
Jul 30, 2025
3d3ed5d
put all dunders at the top of the file
Jul 30, 2025
446bf9a
remove namedtuple filed mehtod
Jul 30, 2025
80acae6
rename namedtuple fields vp_std -> std and computed_plasma_potentials…
Jul 30, 2025
0d6cb8f
rename VpExtras -> dIdVExtras
Jul 30, 2025
1412afc
add noqa's
Jul 30, 2025
5b00125
appease grumpy ruff
Jul 30, 2025
7b87e1f
replace kwarg floating_potential with voltage_window
Jul 30, 2025
2f89e21
rough out docstring for find_didv_peak
Jul 30, 2025
c242dd4
move voltage_window conditioning into dedicated func _condition_volta…
Jul 30, 2025
dd89acd
add docstring for _condition_voltage_window
Jul 30, 2025
d41dfc6
a little minor restructuring
Jul 30, 2025
684343e
fix the return annotation for find_didv_peak
Jul 30, 2025
6f4621d
fix misspelling
Jul 30, 2025
f725d84
create and implement helper function _condition_smooth_fractions
Jul 30, 2025
7f4a337
force data_size to be at least 3 elements
Jul 30, 2025
4a2ab10
add smooth_fractions to docstring, and update annotations
Jul 30, 2025
15653ba
add breadcrumb note
Jul 30, 2025
75fab19
use numpy instead np
Jul 30, 2025
82f73aa
Apply suggestion from @namurphy
rocco8773 Jul 30, 2025
15eceef
Apply suggestion from @namurphy
rocco8773 Jul 30, 2025
3a3946d
Apply suggestion from @namurphy
rocco8773 Jul 30, 2025
0abf9ea
fix line length for docstring
Jul 30, 2025
6ac2a09
reword docstring for clarity
Jul 30, 2025
9be5e55
fix calculation of data_size
Jul 30, 2025
199191c
rename find_didv_peak -> find_didv_peak_location
Jul 30, 2025
28385ef
sort voltage_window, not voltage
Jul 30, 2025
e6b5378
initial rough notebook for find_didv_peak_location()
Jul 30, 2025
08dd09b
add stub file for plasma_potential.py
Jul 30, 2025
593e76e
expose dIdVExtras to the swept_langmuir namespace
Jul 30, 2025
7e9c000
add bias text to the plot
Jul 30, 2025
1a0d175
Update requirements with 'nox -s requirements' (#3062)
plasmapy-requirements-bot[bot] Jul 31, 2025
ea9ebd2
Extract plasma formulary calculator into a standalone package (#3060)
namurphy Jul 31, 2025
78430b0
Update changelog entries prior to release (#3064)
namurphy Jul 31, 2025
d3a9e00
Make `plasmapy_sphinx` solely a `docs` dependency (#3066)
namurphy Jul 31, 2025
ee669cc
Expand the docstring of `Hall_parameter` (#2938)
wnguyen1312 Jul 31, 2025
d41cb81
Use `typing.Self` in type hint annotations for `particle_class.py` (#…
namurphy Jul 31, 2025
0e7e5cc
Update `validators.py` (#2919)
Physics-is-awesome Jul 31, 2025
74d9779
Update the code of conduct to the Contributor Covenant v3.0 (#3069)
namurphy Jul 31, 2025
091a5f7
Update installation instructions for uv (#2999)
namurphy Jul 31, 2025
9a03f12
Merge branch 'main' into sla_vp
Aug 1, 2025
a1fffc7
_condition_voltage_window() add conversion of ndarray to list
Aug 1, 2025
a8d3deb
refactor _condition_voltage_window to handle unsorted voltage_window …
Aug 1, 2025
7db70b7
Summarize dependency support policy and link to security policy in th…
namurphy Aug 1, 2025
66647b2
Update contributor guide pages on contribution workflow and pre-commi…
namurphy Aug 1, 2025
5473909
move _condition_voltage_window() from plasma_potential.py to helpers.py
Aug 1, 2025
339a3ea
add docstring to dIdVExtras
Aug 1, 2025
5fa7b86
fix spelling mistakes
Aug 1, 2025
7dedac5
appease grumpy ruff
Aug 1, 2025
caef8f3
Make miscellaneous updates prior to release (#3070)
namurphy Aug 1, 2025
bc1c751
Build documentation with Python 3.13 (#2943)
namurphy Aug 2, 2025
e98b8b2
Set upper limit on Sphinx version (#3073)
namurphy Aug 2, 2025
feb3a58
Remove upper limits on versions of Astropy and xarray (#3065)
namurphy Aug 5, 2025
4031b63
Enable new rules for `ruff check` (#3077)
namurphy Aug 5, 2025
c152b87
Alphabetize CITATION.cff (#3078)
namurphy Aug 5, 2025
0c73f80
Update requirements with 'nox -s requirements' (#3079)
plasmapy-requirements-bot[bot] Aug 5, 2025
2a7bef4
Use `GITHUB_TOKEN` in workflow to mint a release (#3080)
namurphy Aug 5, 2025
3a591c7
Restructure the workflow to mint a release (#3081)
namurphy Aug 6, 2025
eef69c2
Fix typo in workflow (#3083)
namurphy Aug 6, 2025
359cc64
Fix regular expression (#3084)
namurphy Aug 6, 2025
c678e89
Fix changelog and pre-commit steps (#3085)
namurphy Aug 7, 2025
4c1bc22
Fix regular expression in workflow (#3086)
namurphy Aug 7, 2025
5fa4c0a
Update release workflow to mint a release (#3087)
namurphy Aug 7, 2025
b48a6d0
Build changelog and update package metadata prior to a release (#3088)
plasmapy-requirements-bot[bot] Aug 7, 2025
e4bda5d
Update labeler (#3092)
namurphy Aug 11, 2025
e0ecab5
Bump actions/checkout from 4 to 5 in /.github/workflows (#3093)
dependabot[bot] Aug 12, 2025
6899c30
Update requirements with 'nox -s requirements' (#3095)
plasmapy-requirements-bot[bot] Aug 15, 2025
5bcd92c
Update pinned requirements 📍 (#3097)
plasmapy-requirements-bot[bot] Sep 2, 2025
538e0da
DEP: drop unused runtime dependency on setuptools (#3098)
neutrinoceros Sep 2, 2025
3b03d7f
Update requirements with 'nox -s requirements' (#3102)
plasmapy-requirements-bot[bot] Sep 4, 2025
dacd57b
Bump pypa/gh-action-pypi-publish in /.github/workflows (#3101)
dependabot[bot] Sep 4, 2025
5080f0d
Bump actions/github-script from 7 to 8 in /.github/workflows (#3103)
dependabot[bot] Sep 5, 2025
8f482cc
Bump actions/setup-python from 5 to 6 in /.github/workflows (#3106)
dependabot[bot] Sep 5, 2025
d9d77a2
Bump actions/labeler from 5 to 6 in /.github/workflows (#3105)
dependabot[bot] Sep 9, 2025
5ae7d5f
Bump actions/stale from 9 to 10 in /.github/workflows (#3104)
dependabot[bot] Sep 9, 2025
3268b6f
Update requirements with 'nox -s requirements' (#3108)
plasmapy-requirements-bot[bot] Sep 11, 2025
ad41816
Merge branch 'refs/heads/main' into sla_vp
rocco8773 Sep 11, 2025
f2ca356
add tests for namedtuple dIdVExtras
rocco8773 Sep 12, 2025
5d8bd89
expand docstring for _condition_voltage_window
rocco8773 Sep 15, 2025
bbb5760
_condition_voltage_window: handle case where voltage_window is a string
rocco8773 Sep 15, 2025
66fb53f
_condition_voltage_window: if first_index is 0 set to None
rocco8773 Sep 15, 2025
bd25c14
_condition_voltage_window: for last_index handle the +1 for the slice…
rocco8773 Sep 15, 2025
201f597
add tests for _condition_voltage_window
rocco8773 Sep 15, 2025
4efb1b9
remove unused imports
rocco8773 Sep 15, 2025
2921590
appease grumpy ruff format
rocco8773 Sep 15, 2025
405528a
add noqa to _condition_voltage_window
rocco8773 Sep 15, 2025
755cb56
replace dict() with {}
rocco8773 Sep 15, 2025
f363aa6
Update pinned requirements 📍 (#3109)
plasmapy-requirements-bot[bot] Sep 22, 2025
87e8660
rename test test_plasma_potential_didv.py -> test_plasma_potential__f…
rocco8773 Sep 24, 2025
d454f67
Merge branch 'refs/heads/main' into sla_vp
rocco8773 Sep 24, 2025
65255af
create test_plasma_potential__condition_smooth_fractions.py and initi…
rocco8773 Sep 24, 2025
66f8936
fix mask inequalities for finding smooth_fractions out of range
rocco8773 Sep 24, 2025
88b1dcd
pass if-clause if smooth_fractions already numpy array and handle if …
rocco8773 Sep 24, 2025
f8a1b39
convert sequence to numpy array in else
rocco8773 Sep 24, 2025
f4a709a
add conditioning for data_size
rocco8773 Sep 24, 2025
75e12df
add conditioning for data_size
rocco8773 Sep 24, 2025
bc0bb3c
fix logic for identifying out of range smooth_fractions elements
rocco8773 Sep 24, 2025
dbc5db9
add cases to TestConditionsSmoothFractions.test_raises()
rocco8773 Sep 25, 2025
c770f9d
write TestConditionsSmoothFractions.test_expected()
rocco8773 Sep 25, 2025
0d8612e
initialized TestFinddIdVPeakLocation
rocco8773 Sep 25, 2025
019233c
add merge_voltage_clusters to TestFinddIdVPeakLocation.test_helper_ca…
rocco8773 Sep 25, 2025
5b7413a
add TestFinddIdVPeakLocation.test_call_of_condition_smooth_fractions()
rocco8773 Sep 25, 2025
b432c73
create and implement pytest fixtures simple_voltage and simple_current
rocco8773 Sep 25, 2025
b445c75
Update requirements with 'nox -s requirements' (#3111)
plasmapy-requirements-bot[bot] Sep 25, 2025
7f8f4a4
Update Nox session and configuration for running mypy (#3094)
namurphy Sep 25, 2025
0f2422d
Remove `pre-commit-search-and-replace` hook for `pre-commit` (#3113)
namurphy Sep 30, 2025
a24b0a2
Update requirements with 'nox -s requirements' (#3115)
plasmapy-requirements-bot[bot] Oct 2, 2025
1d071d3
create and implement pytest fixtures class SLAFixtures
rocco8773 Oct 2, 2025
553493a
move fixtures to a conftest.py
rocco8773 Oct 2, 2025
7f59cad
increase size of simple_voltage, make simple_current just be a compy …
rocco8773 Oct 3, 2025
0f259e2
create func arch_current
rocco8773 Oct 3, 2025
a81adfc
create pytext fixture simple_current_two_arches
rocco8773 Oct 3, 2025
b8d1552
cleanup imports
rocco8773 Oct 3, 2025
82d3931
add test case TestFinddIdVPeakLocation.test_raises()
rocco8773 Oct 3, 2025
0a2e202
add test case TestFinddIdVPeakLocation.test_designed_didv()
rocco8773 Oct 3, 2025
6d61d31
allow for a smooth_fractions of 0.0 (or no smoothing)
rocco8773 Oct 3, 2025
95042f7
update error message to indicate smooth_fraction allowed of [0,1]
rocco8773 Oct 3, 2025
9497a70
update TestConditionSmoothFractions for change in allowing smooth_fra…
rocco8773 Oct 3, 2025
23485b2
add fixtures pace_voltage and pace_current
rocco8773 Oct 3, 2025
746a2ab
rough out test TestFinddIdVPeakLocation.test_on_pace_data()
rocco8773 Oct 3, 2025
6aa5fb3
Merge branch 'main' into sla_vp
rocco8773 Oct 3, 2025
b7225fb
fill out assertions on extras for TestFinddIdVPeakLocation.test_on_pa…
rocco8773 Oct 3, 2025
9dda549
remove extra, un-needed comma
rocco8773 Oct 3, 2025
90da4c0
add noqa C901 to _condition_smooth_fractions()
rocco8773 Oct 3, 2025
5e64bad
cleanup imports
rocco8773 Oct 3, 2025
f3d96c2
add lint.per-file-ignores."tests/**/conftest.py" = ["D103"]
rocco8773 Oct 3, 2025
9a2fa11
add module docstring
rocco8773 Oct 3, 2025
a605059
appease grumpy ruff
rocco8773 Oct 3, 2025
fbfb3e5
appease grumpy ruff format
rocco8773 Oct 3, 2025
01a156c
appease grumpy ruff format
rocco8773 Oct 3, 2025
aa7ae66
remove noqa D103 since it is now defined in pyproject.toml
rocco8773 Oct 3, 2025
3e1b6b6
appease grumpy ruff format
rocco8773 Oct 3, 2025
b7e8438
Bump astral-sh/setup-uv from 6 to 7 in /.github/workflows (#3117)
dependabot[bot] Oct 8, 2025
036d670
Update requirements with 'nox -s requirements' (#3118)
plasmapy-requirements-bot[bot] Oct 11, 2025
1e6889b
Merge branch 'main' into sla_vp
rocco8773 Oct 14, 2025
aa03ea2
repair TestFinddIdVPeakLocation.test_raises
rocco8773 Oct 14, 2025
7247054
add clarifying comments
rocco8773 Oct 14, 2025
7ab00e4
use np.max and np.isclose to find max indices instead of np.argmax
rocco8773 Oct 14, 2025
0cb3547
raise RuntimeError if no plasma potential values calculated
rocco8773 Oct 14, 2025
e305f2a
update TestFinddIdVPeakLocation.test_raise to cover the RuntimeError …
rocco8773 Oct 14, 2025
6389da3
add test TestFinddIdVPeakLocation.test_peak_index_identification
rocco8773 Oct 14, 2025
8603cb2
appease grumpy ruff format
rocco8773 Oct 14, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions .github/SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# PlasmaPy Security Policy

<!-- This sets up the security policy on GitHub. Changes to security practices may need to be made in the GitHub settings for the project. -->

## Supported versions

Security updates will only be provided for the most recent release of PlasmaPy.

| Version | Supported |
| ------- | --------- |
| latest | ✅ |
| older | ❌ |

## Reporting security vulnerabilities

Please use this link to [privately report a security vulnerability].

## Finding security vulnerabilities via continuous integration

PlasmaPy has an extensive suite of continuous integration checks,
including several that identify and flag common security vulnerabilities.

- [`zizmor`] finds security vulnerabilities in the GitHub workflows.
- [`ruff`] has several [rule sets] that find security vulnerabilities,
including the [`flake8-bandit` rule set].

The checks are usually either run as [`pre-commit`] hooks
(defined in [`.pre-commit-config.yaml`])
or as [Nox] sessions (defined in [`noxfile.py`])
invoked during GitHub workflows (located in [`.github/workflows/`]).
The configurations for most of these tools are located in [`pyproject.toml`],
but some have a dedicated configuration file
(for `zizmor`, this would be at [`.github/zizmor.yml`])

[nox]: https://nox.thea.codes
[privately report a security vulnerability]: https://github.com/plasmapy/plasmapy/security/advisories/new
[rule sets]: https://docs.astral.sh/ruff/rules
[`.github/workflows/`]: https://github.com/PlasmaPy/PlasmaPy/tree/main/.github/workflows
[`.github/zizmor.yml`]: https://github.com/PlasmaPy/PlasmaPy/blob/main/.github/zizmor.yml
[`.pre-commit-config.yaml`]: https://github.com/PlasmaPy/PlasmaPy/blob/main/.pre-commit-config.yaml
[`flake8-bandit` rule set]: https://docs.astral.sh/ruff/rules/#flake8-bandit-s
[`noxfile.py`]: https://github.com/PlasmaPy/PlasmaPy/blob/main/noxfile.py
[`pre-commit`]: https://pre-commit.com/
[`pyproject.toml`]: https://github.com/PlasmaPy/PlasmaPy/blob/main/pyproject.toml
[`ruff`]: https://docs.astral.sh/ruff
[`zizmor`]: https://github.com/woodruffw/zizmor
10 changes: 8 additions & 2 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,14 @@ maintenance:
'licenses/**',
]

security:
- changed-files:
- any-glob-to-any-file: [
'**/*security*',
'**/*SECURITY*',
'**/*zizmor*',
]

notebooks:
- changed-files:
- any-glob-to-any-file: [
Expand Down Expand Up @@ -189,8 +197,6 @@ release:
- changed-files:
- any-glob-to-any-file: [
'.github/workflows/*weekly*.yml',
'docs/conf.py',
'noxfile.py',
]

'static type checking':
Expand Down
5 changes: 5 additions & 0 deletions .github/scripts/citation_updater.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# /// script
# requires-python = ">=3.13"
# dependencies = [ "ruamel.yaml" ]
# ///

"""Functionality to update citation information prior to making a release."""

import argparse
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
steps:

- name: Add no changelog label
uses: actions/github-script@v7
uses: actions/github-script@v8
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/check-author-included.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ jobs:
steps:

- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
persist-credentials: false

- name: Install uv
uses: astral-sh/setup-uv@v6
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
cache-suffix: author-cff
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ jobs:
python: '3.11'
nox_session: tests-3.11(lowest-direct-skipslow)

- name: Documentation, Python 3.12, Ubuntu
- name: Documentation, Python 3.13, Ubuntu
os: ubuntu-latest
python: '3.12'
python: '3.13'
nox_session: docs

- name: Static type checking with mypy, Python 3.13, Ubuntu
Expand Down Expand Up @@ -82,7 +82,7 @@ jobs:
steps:

- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
persist-credentials: false

Expand All @@ -98,14 +98,14 @@ jobs:
sudo apt-get install -y pandoc

- name: Install uv
uses: astral-sh/setup-uv@v6
uses: astral-sh/setup-uv@v7
with:
python-version: ${{ matrix.python }}
enable-cache: true
enable-cache: true # zizmor: ignore[cache-poisoning]
cache-suffix: ${{ matrix.nox_session }}-${{ matrix.python }}-${{ runner.os }}

- name: Run the check
run: uv run --with nox --frozen nox -s '${{ matrix.nox_session }}'
run: uvx nox -s '${{ matrix.nox_session }}'

- name: Upload coverage reports to Codecov
if: ${{ contains(matrix.nox_session, 'cov') }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/comment-on-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:

steps:

- uses: actions/github-script@v7
- uses: actions/github-script@v8
with:
script: |
github.rest.issues.createComment({
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/create-release-issue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
persist-credentials: false

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ jobs:
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@v5
- uses: actions/labeler@v6
with:
configuration-path: .github/labeler.yml
8 changes: 4 additions & 4 deletions .github/workflows/linkcheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
steps:

- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
persist-credentials: false

Expand All @@ -41,12 +41,12 @@ jobs:
sudo apt-get install -y pandoc

- name: Install uv
uses: astral-sh/setup-uv@v6
uses: astral-sh/setup-uv@v7
with:
python: 3.12
python-version: 3.12

- name: Install graphviz & pandoc
run: sudo apt-get install graphviz pandoc

- name: Check hyperlinks
run: uv run --with nox --frozen nox -s linkcheck
run: uvx nox -s linkcheck
70 changes: 0 additions & 70 deletions .github/workflows/mint-release.yml

This file was deleted.

83 changes: 83 additions & 0 deletions .github/workflows/prepare-release-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: Prepare a release

on:
workflow_dispatch:
inputs:
version:
description: Version
required: true
default: 2025.8.0
doi:
description: Reserved DOI from Zenodo
required: true
default: 10.5281/zenodo.16747747

jobs:
create-pull-request:
name: Create pull request
runs-on: ubuntu-latest

steps:

- name: Validate version input
run: |
if [[ ! ${VERSION} =~ ^2[0-9]{3}\.[0-9]+\.[0-9]+$ ]]; then
echo "::error ::Provide a calendar version like `2025.8.0`"
exit 1
fi
env:
VERSION: ${{ github.event.inputs.version }}

- name: Validate DOI input
run: |
if [[ ! ${DOI} =~ ^10\.[0-9]{4,9}/.*$ ]]; then
echo "::error ::Provide a valid DOI reserved from Zenodo."
exit 1
fi
env:
DOI: ${{ github.event.inputs.doi }}

- name: Checkout code
uses: actions/checkout@v5
with:
persist-credentials: false

- name: Install uv
uses: astral-sh/setup-uv@v7

- name: Update version and DOI in CITATION.cff and docs/about/citation.rst
run: |
uv run .github/scripts/citation_updater.py CITATION.cff docs/about/citation.rst docs/changelog/index.rst --version=$VERSION --doi=$DOI
env:
VERSION: ${{ github.event.inputs.version }}
DOI: ${{ github.event.inputs.doi }}

- name: Build the changelog with towncrier
run: |
uvx nox -s "changelog(final)" -- $VERSION
env:
VERSION: ${{ github.event.inputs.version }}

# When a PR is created by a GitHub Action, normally the checks will
# not be run. While the simplest workaround would have been to open
# and close the PR, an alternative is to authenticate with GitHub
# App generated tokens (as done below). The instructions for how to
# do this are in the documentation for the create-pull-request
# action.

- name: Generate token
uses: tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a # v2.1.0
id: generate_token
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.APP_PRIVATE_KEY }}

- name: Create pull request
uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e # v7.0.8
with:
title: Build changelog and update package metadata prior to a release
commit-message: Build changelog & update citation info
body: This automated pull request builds the changelog with towncrier and updates package metadata prior to a forthcoming release. Merge this pull request prior to drafting the release.
labels: skip changelog checks
delete-branch: true
token: ${{ steps.generate_token.outputs.token }}
6 changes: 3 additions & 3 deletions .github/workflows/publish-to-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ jobs:
steps:

- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
persist-credentials: false

- name: Set up Python
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: 3.13

Expand All @@ -33,7 +33,7 @@ jobs:
run: python -m build

- name: Upload package to PyPI
uses: pypa/gh-action-pypi-publish@v1.12.4
uses: pypa/gh-action-pypi-publish@v1.13.0
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:

steps:

- uses: actions/stale@v9
- uses: actions/stale@v10
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: This issue will be closed in 90 days due to five years of inactivity unless the stale label or comment is removed.
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/unlabel-pr-after-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
steps:

- name: Remove specific labels
uses: actions/github-script@v7
uses: actions/github-script@v8
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
Expand Down
Loading
Loading