Skip to content

Commit 6e9bd32

Browse files
authored
Drop Python 3.9 support and update packages (#121)
* Update packages * Run ruff * Pre-commit * Repair use of "floating" as type modifier * Update poetry lock file * Ignore problematic link * Bump version to 7.1.0
1 parent ebb1e9f commit 6e9bd32

File tree

34 files changed

+1618
-1642
lines changed

34 files changed

+1618
-1642
lines changed

.github/workflows/workflow_actions.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ on:
1919
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
2020
jobs:
2121
radas:
22-
runs-on: ubuntu-22.04
22+
runs-on: ubuntu-24.04
2323
steps:
2424
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
2525
- uses: actions/checkout@v4
@@ -56,11 +56,11 @@ jobs:
5656
build:
5757
needs: radas
5858
# The type of runner that the job will run on
59-
runs-on: ubuntu-22.04
59+
runs-on: ubuntu-24.04
6060
strategy:
6161
fail-fast: false
6262
matrix:
63-
python-version: ['3.9', '3.10', '3.11', '3.12'] # should test the versions we allow for in pyproject.toml
63+
python-version: ['3.10', '3.11', '3.12'] # should test the versions we allow for in pyproject.toml
6464

6565
# Steps represent a sequence of tasks that will be executed as part of the job
6666
steps:
@@ -132,7 +132,7 @@ jobs:
132132
build_release:
133133
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
134134
needs: build
135-
runs-on: ubuntu-22.04
135+
runs-on: ubuntu-24.04
136136

137137
steps:
138138
- uses: actions/checkout@v4
@@ -151,7 +151,7 @@ jobs:
151151
publish:
152152
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
153153
needs: build_release
154-
runs-on: ubuntu-22.04
154+
runs-on: ubuntu-24.04
155155
environment:
156156
name: pypi-publish
157157
url: https://pypi.org/project/cfspopcon/

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# per default we only run over the files in the python package
22
repos:
33
- repo: https://github.com/pre-commit/pre-commit-hooks
4-
rev: v4.3.0
4+
rev: v5.0.0
55
hooks:
66
- id: check-added-large-files
77
# but no large files anywhere ;)

cfspopcon/__init__.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,18 @@
1919

2020
# export main classes users should need as well as the option enums
2121
__all__ = [
22+
"Algorithm",
23+
"AtomicData",
24+
"CompositeAlgorithm",
25+
"convert_to_default_units",
26+
"convert_units",
27+
"file_io",
2228
"formulas",
23-
"named_options",
2429
"magnitude_in_default_units",
25-
"convert_to_default_units",
30+
"named_options",
2631
"process_input_dictionary",
27-
"set_default_units",
28-
"convert_units",
2932
"read_case",
3033
"read_plot_style",
31-
"Algorithm",
32-
"CompositeAlgorithm",
33-
"file_io",
34-
"AtomicData",
34+
"set_default_units",
3535
"shaping_and_selection",
3636
]

cfspopcon/algorithm_class.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import inspect
66
from collections.abc import Callable, Sequence
77
from functools import wraps
8-
from pathlib import Path # noqa: TCH003
8+
from pathlib import Path # noqa: TC003
99
from typing import Any, ClassVar, Optional, Union
1010
from warnings import warn
1111

@@ -164,7 +164,7 @@ def wrapped_function(**kwargs: Any) -> dict:
164164
def register_algorithm(
165165
cls, return_keys: list[str], name: Optional[str] = None, skip_unit_conversion: bool = False
166166
) -> GenericFunctionType:
167-
"""Decorate a function and turn it into an Algorithm. Usage: @Algorithm.register_algorithm(return_keys=["..."]).""" # noqa: D402
167+
"""Decorate a function and turn it into an Algorithm. Usage: @Algorithm.register_algorithm(return_keys=["..."])."""
168168

169169
def function_wrapper(func: GenericFunctionType) -> GenericFunctionType:
170170
Algorithm.from_single_function(

cfspopcon/formulas/__init__.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,17 @@
1717
)
1818

1919
__all__ = [
20-
"geometry",
20+
"atomic_data",
21+
"auxiliary_power",
2122
"energy_confinement",
2223
"fusion_power",
24+
"geometry",
25+
"impurities",
2326
"metrics",
2427
"plasma_current",
28+
"plasma_pressure",
2529
"plasma_profiles",
2630
"radiated_power",
2731
"scrape_off_layer",
28-
"plasma_pressure",
29-
"auxiliary_power",
3032
"separatrix_conditions",
31-
"impurities",
32-
"atomic_data",
3333
]

cfspopcon/formulas/energy_confinement/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
)
1010

1111
__all__ = [
12+
"ConfinementScaling",
1213
"calc_plasma_stored_energy",
1314
"read_confinement_scalings",
14-
"ConfinementScaling",
1515
"solve_energy_confinement_scaling_for_input_power",
16-
"switch_to_linearised_ohmic_confinement_below_threshold",
1716
"switch_to_L_mode_confinement_below_threshold",
17+
"switch_to_linearised_ohmic_confinement_below_threshold",
1818
]

cfspopcon/formulas/fusion_power/__init__.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,17 @@
1515
from .fusion_rates import calc_fusion_power, calc_neutron_flux_to_walls
1616

1717
__all__ = [
18-
"fusion_data",
19-
"calc_average_ion_mass",
20-
"FusionReaction",
21-
"DTFusionBoschHale",
22-
"DTFusionHively",
2318
"DDFusionBoschHale",
2419
"DDFusionHively",
2520
"DHe3Fusion",
26-
"pB11Fusion",
21+
"DTFusionBoschHale",
22+
"DTFusionHively",
23+
"FusionReaction",
24+
"calc_average_ion_mass",
2725
"calc_fusion_gain",
28-
"calc_triple_product",
2926
"calc_fusion_power",
3027
"calc_neutron_flux_to_walls",
28+
"calc_triple_product",
29+
"fusion_data",
30+
"pB11Fusion",
3131
]

cfspopcon/formulas/geometry/__init__.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@
1515
from .volume_integral import integrate_profile_over_volume
1616

1717
__all__ = [
18+
"calc_areal_elongation_from_elongation_at_psi95",
19+
"calc_elongation_at_psi95_from_areal_elongation",
20+
"calc_inverse_aspect_ratio",
21+
"calc_minor_radius_from_inverse_aspect_ratio",
22+
"calc_plasma_poloidal_circumference",
1823
"calc_plasma_surface_area",
1924
"calc_plasma_volume",
20-
"integrate_profile_over_volume",
2125
"calc_separatrix_elongation_from_areal_elongation",
2226
"calc_separatrix_triangularity_from_triangularity95",
23-
"calc_minor_radius_from_inverse_aspect_ratio",
2427
"calc_vertical_minor_radius_from_elongation_and_minor_radius",
25-
"calc_areal_elongation_from_elongation_at_psi95",
26-
"calc_inverse_aspect_ratio",
27-
"calc_plasma_poloidal_circumference",
28-
"calc_elongation_at_psi95_from_areal_elongation",
28+
"integrate_profile_over_volume",
2929
]

cfspopcon/formulas/impurities/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@
1414
__all__ = [
1515
"calc_P_radiation_from_core_seeded_impurity",
1616
"calc_core_seeded_impurity_concentration",
17-
"calc_min_P_radiation_from_fraction",
18-
"calc_min_P_radiation_from_LH_factor",
1917
"calc_edge_impurity_concentration",
2018
"calc_impurity_charge_state",
19+
"calc_min_P_radiation_from_LH_factor",
20+
"calc_min_P_radiation_from_fraction",
2121
"calc_zeff_and_dilution_due_to_impurities",
2222
"set_up_impurity_concentration_array",
2323
]

cfspopcon/formulas/metrics/__init__.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@
2121
)
2222

2323
__all__ = [
24-
"calc_coulomb_logarithm",
25-
"calc_normalised_collisionality",
26-
"calc_greenwald_density_limit",
27-
"calc_greenwald_fraction",
2824
"calc_PB_over_R",
2925
"calc_PBpRnSq",
30-
"calc_rho_star",
31-
"calc_larmor_radius",
3226
"calc_alpha_t",
33-
"calc_edge_collisionality",
3427
"calc_average_electron_density_from_greenwald_fraction",
28+
"calc_coulomb_logarithm",
29+
"calc_edge_collisionality",
30+
"calc_greenwald_density_limit",
31+
"calc_greenwald_fraction",
32+
"calc_larmor_radius",
33+
"calc_normalised_collisionality",
34+
"calc_rho_star",
3535
]

0 commit comments

Comments
 (0)