From 587032f271c6f1803012f0f4d1dd05a3e17764c1 Mon Sep 17 00:00:00 2001 From: shimwell Date: Sat, 28 Sep 2024 23:09:06 +0100 Subject: [PATCH 1/8] using enum instead of string --- docs/usage.rst | 512 +++++++++--------- .../spherical_tokamak_from_plasma_minimal.py | 18 +- ...rical_tokamak_from_plasma_with_divertor.py | 22 +- ...cal_tokamak_from_plasma_with_pf_magnets.py | 18 +- ...om_plasma_with_pf_magnets_and_divertors.py | 20 +- ...cal_tokamak_from_plasma_with_tf_magnets.py | 18 +- examples/spherical_tokamak_minimal.py | 36 +- examples/tokamak_from_plasma_minimal.py | 24 +- examples/tokamak_from_plasma_with_divertor.py | 26 +- examples/tokamak_minimal.py | 42 +- examples/tokamak_with_pf_magnets.py | 42 +- src/paramak/__init__.py | 2 +- src/paramak/assemblies/spherical_tokamak.py | 11 +- src/paramak/assemblies/tokamak.py | 20 +- src/paramak/utils.py | 78 +-- .../test_assemblies/test_spherical_tokamak.py | 40 +- tests/test_utils.py | 461 ++++++++-------- 17 files changed, 701 insertions(+), 689 deletions(-) diff --git a/docs/usage.rst b/docs/usage.rst index ad085696..d0b7cd91 100644 --- a/docs/usage.rst +++ b/docs/usage.rst @@ -55,18 +55,18 @@ Tokamak from plasma import paramak result = paramak.tokamak_from_plasma( radial_builds=[ - ("gap", 10), - ("layer", 30), - ("layer", 50), - ("layer", 10), - ("layer", 120), - ("layer", 20), - ("gap", 60), - ("plasma", 300), - ("gap", 60), - ("layer", 20), - ("layer", 120), - ("layer", 10), + (paramak.LayerType.GAP, 10), + (LayerType.SOLID, 30), + (LayerType.SOLID, 50), + (LayerType.SOLID, 10), + (LayerType.SOLID, 120), + (LayerType.SOLID, 20), + (paramak.LayerType.GAP, 60), + (paramak.LayerType.PLASMA, 300), + (paramak.LayerType.GAP, 60), + (LayerType.SOLID, 20), + (LayerType.SOLID, 120), + (LayerType.SOLID, 10), ], elongation=2, triangularity=0.55, @@ -79,18 +79,18 @@ Tokamak from plasma import paramak result = paramak.tokamak_from_plasma( radial_builds=[ - ("gap", 10), - ("layer", 30), - ("layer", 50), - ("layer", 10), - ("layer", 120), - ("layer", 20), - ("gap", 60), - ("plasma", 300), - ("gap", 60), - ("layer", 20), - ("layer", 120), - ("layer", 10), + (paramak.LayerType.GAP, 10), + (LayerType.SOLID, 30), + (LayerType.SOLID, 50), + (LayerType.SOLID, 10), + (LayerType.SOLID, 120), + (LayerType.SOLID, 20), + (paramak.LayerType.GAP, 60), + (paramak.LayerType.PLASMA, 300), + (paramak.LayerType.GAP, 60), + (LayerType.SOLID, 20), + (LayerType.SOLID, 120), + (LayerType.SOLID, 10), ], elongation=2, triangularity=0.55, @@ -116,15 +116,15 @@ Spherical tokamak from plasma import paramak result = paramak.spherical_tokamak_from_plasma( radial_builds=[ - ("gap", 10), - ("layer", 60), - ("layer", 20), - ("gap", 60), - ("plasma", 300), - ("gap", 60), - ("layer", 20), - ("layer", 120), - ("layer", 10), + (paramak.LayerType.GAP, 10), + (LayerType.SOLID, 60), + (LayerType.SOLID, 20), + (paramak.LayerType.GAP, 60), + (paramak.LayerType.PLASMA, 300), + (paramak.LayerType.GAP, 60), + (LayerType.SOLID, 20), + (LayerType.SOLID, 120), + (LayerType.SOLID, 10), ], elongation=2, triangularity=0.55, @@ -137,15 +137,15 @@ Spherical tokamak from plasma import paramak result = paramak.spherical_tokamak_from_plasma( radial_builds=[ - ("gap", 10), - ("layer", 60), - ("layer", 20), - ("gap", 60), - ("plasma", 300), - ("gap", 60), - ("layer", 20), - ("layer", 120), - ("layer", 10), + (paramak.LayerType.GAP, 10), + (LayerType.SOLID, 60), + (LayerType.SOLID, 20), + (paramak.LayerType.GAP, 60), + (paramak.LayerType.PLASMA, 300), + (paramak.LayerType.GAP, 60), + (LayerType.SOLID, 20), + (LayerType.SOLID, 120), + (LayerType.SOLID, 10), ], elongation=2, triangularity=0.55, @@ -173,29 +173,29 @@ Tokamak result = paramak.tokamak( radial_builds=[ - ("gap", 10), - ("layer", 30), - ("layer", 50), - ("layer", 10), - ("layer", 120), - ("layer", 20), - ("gap", 60), - ("plasma", 300), - ("gap", 60), - ("layer", 20), - ("layer", 120), - ("layer", 10), + (paramak.LayerType.GAP, 10), + (LayerType.SOLID, 30), + (LayerType.SOLID, 50), + (LayerType.SOLID, 10), + (LayerType.SOLID, 120), + (LayerType.SOLID, 20), + (paramak.LayerType.GAP, 60), + (paramak.LayerType.PLASMA, 300), + (paramak.LayerType.GAP, 60), + (LayerType.SOLID, 20), + (LayerType.SOLID, 120), + (LayerType.SOLID, 10), ], vertical_build=[ - ("layer", 15), - ("layer", 80), - ("layer", 10), - ("gap", 50), - ("plasma", 700), - ("gap", 60), - ("layer", 10), - ("layer", 40), - ("layer", 15), + (LayerType.SOLID, 15), + (LayerType.SOLID, 80), + (LayerType.SOLID, 10), + (paramak.LayerType.GAP, 50), + (paramak.LayerType.PLASMA, 700), + (paramak.LayerType.GAP, 60), + (LayerType.SOLID, 10), + (LayerType.SOLID, 40), + (LayerType.SOLID, 15), ], triangularity=0.55, rotation_angle=180, @@ -207,29 +207,29 @@ Tokamak result = paramak.tokamak( radial_builds=[ - ("gap", 10), - ("layer", 30), - ("layer", 50), - ("layer", 10), - ("layer", 120), - ("layer", 20), - ("gap", 60), - ("plasma", 300), - ("gap", 60), - ("layer", 20), - ("layer", 120), - ("layer", 10), + (paramak.LayerType.GAP, 10), + (LayerType.SOLID, 30), + (LayerType.SOLID, 50), + (LayerType.SOLID, 10), + (LayerType.SOLID, 120), + (LayerType.SOLID, 20), + (paramak.LayerType.GAP, 60), + (paramak.LayerType.PLASMA, 300), + (paramak.LayerType.GAP, 60), + (LayerType.SOLID, 20), + (LayerType.SOLID, 120), + (LayerType.SOLID, 10), ], vertical_build=[ - ("layer", 15), - ("layer", 80), - ("layer", 10), - ("gap", 50), - ("plasma", 700), - ("gap", 60), - ("layer", 10), - ("layer", 40), - ("layer", 15), + (LayerType.SOLID, 15), + (LayerType.SOLID, 80), + (LayerType.SOLID, 10), + (paramak.LayerType.GAP, 50), + (paramak.LayerType.PLASMA, 700), + (paramak.LayerType.GAP, 60), + (LayerType.SOLID, 10), + (LayerType.SOLID, 40), + (LayerType.SOLID, 15), ], triangularity=0.55, rotation_angle=180, @@ -258,27 +258,27 @@ Spherical tokamak result = paramak.spherical_tokamak( radial_builds=[ [ - ("gap", 10), - ("layer", 50), - ("layer", 10), - ("gap", 50), - ("plasma", 300), - ("gap", 60), - ("layer", 10), - ("layer", 60), - ("layer", 10), + (paramak.LayerType.GAP, 10), + (LayerType.SOLID, 50), + (LayerType.SOLID, 10), + (paramak.LayerType.GAP, 50), + (paramak.LayerType.PLASMA, 300), + (paramak.LayerType.GAP, 60), + (LayerType.SOLID, 10), + (LayerType.SOLID, 60), + (LayerType.SOLID, 10), ] ], vertical_build=[ - ("layer", 15), - ("layer", 120), - ("layer", 10), - ("gap", 50), - ("plasma", 700), - ("gap", 60), - ("layer", 10), - ("layer", 30), - ("layer", 15), + (LayerType.SOLID, 15), + (LayerType.SOLID, 120), + (LayerType.SOLID, 10), + (paramak.LayerType.GAP, 50), + (paramak.LayerType.PLASMA, 700), + (paramak.LayerType.GAP, 60), + (LayerType.SOLID, 10), + (LayerType.SOLID, 30), + (LayerType.SOLID, 15), ], rotation_angle=180, triangularity=0.55, @@ -291,27 +291,27 @@ Spherical tokamak result = paramak.spherical_tokamak( radial_builds=[ [ - ("gap", 10), - ("layer", 50), - ("layer", 10), - ("gap", 50), - ("plasma", 300), - ("gap", 60), - ("layer", 10), - ("layer", 60), - ("layer", 10), + (paramak.LayerType.GAP, 10), + (LayerType.SOLID, 50), + (LayerType.SOLID, 10), + (paramak.LayerType.GAP, 50), + (paramak.LayerType.PLASMA, 300), + (paramak.LayerType.GAP, 60), + (LayerType.SOLID, 10), + (LayerType.SOLID, 60), + (LayerType.SOLID, 10), ] ], vertical_build=[ - ("layer", 15), - ("layer", 120), - ("layer", 10), - ("gap", 50), - ("plasma", 700), - ("gap", 60), - ("layer", 10), - ("layer", 30), - ("layer", 15), + (LayerType.SOLID, 15), + (LayerType.SOLID, 120), + (LayerType.SOLID, 10), + (paramak.LayerType.GAP, 50), + (paramak.LayerType.PLASMA, 700), + (paramak.LayerType.GAP, 60), + (LayerType.SOLID, 10), + (LayerType.SOLID, 30), + (LayerType.SOLID, 15), ], rotation_angle=180, triangularity=0.55, @@ -335,18 +335,18 @@ Reactor with divertor(s) result = paramak.spherical_tokamak_from_plasma( radial_builds=[ [ - ("gap", 10), - ("layer", 50), - ("layer", 15), - ("gap", 50), - ("plasma", 300), - ("gap", 60), - ("layer", 15), - ("layer", 60), - ("layer", 10), + (paramak.LayerType.GAP, 10), + (LayerType.SOLID, 50), + (LayerType.SOLID, 15), + (paramak.LayerType.GAP, 50), + (paramak.LayerType.PLASMA, 300), + (paramak.LayerType.GAP, 60), + (LayerType.SOLID, 15), + (LayerType.SOLID, 60), + (LayerType.SOLID, 10), ], - [("gap", 75), ("lower_divertor", 100)], # this divertor connects to the center column - [("gap", 120), ("upper_divertor", 100)], # this divertor has some blanket between the center colum and itself + [(paramak.LayerType.GAP, 75), ("lower_divertor", 100)], # this divertor connects to the center column + [(paramak.LayerType.GAP, 120), ("upper_divertor", 100)], # this divertor has some blanket between the center colum and itself ], elongation=2, triangularity=0.55, @@ -359,18 +359,18 @@ Reactor with divertor(s) result = paramak.spherical_tokamak_from_plasma( radial_builds=[ [ - ("gap", 10), - ("layer", 50), - ("layer", 15), - ("gap", 50), - ("plasma", 300), - ("gap", 60), - ("layer", 15), - ("layer", 60), - ("layer", 10), + (paramak.LayerType.GAP, 10), + (LayerType.SOLID, 50), + (LayerType.SOLID, 15), + (paramak.LayerType.GAP, 50), + (paramak.LayerType.PLASMA, 300), + (paramak.LayerType.GAP, 60), + (LayerType.SOLID, 15), + (LayerType.SOLID, 60), + (LayerType.SOLID, 10), ], - [("gap", 75), ("lower_divertor", 100)], # this divertor connects to the center column - [("gap", 120), ("upper_divertor", 140)], # this divertor has some blanket between the center colum and itself + [(paramak.LayerType.GAP, 75), ("lower_divertor", 100)], # this divertor connects to the center column + [(paramak.LayerType.GAP, 120), ("upper_divertor", 140)], # this divertor has some blanket between the center colum and itself ], elongation=2, triangularity=0.55, @@ -416,15 +416,15 @@ Reactor with poloidal field coils result = paramak.spherical_tokamak_from_plasma( radial_builds=[ - ("gap", 10), - ("layer", 50), - ("layer", 15), - ("gap", 50), - ("plasma", 300), - ("gap", 60), - ("layer", 15), - ("layer", 60), - ("layer", 10), + (paramak.LayerType.GAP, 10), + (LayerType.SOLID, 50), + (LayerType.SOLID, 15), + (paramak.LayerType.GAP, 50), + (paramak.LayerType.PLASMA, 300), + (paramak.LayerType.GAP, 60), + (LayerType.SOLID, 15), + (LayerType.SOLID, 60), + (LayerType.SOLID, 10), ], elongation=2, triangularity=0.55, @@ -459,15 +459,15 @@ Reactor with poloidal field coils result = paramak.spherical_tokamak_from_plasma( radial_builds=[ - ("gap", 10), - ("layer", 50), - ("layer", 15), - ("gap", 50), - ("plasma", 300), - ("gap", 60), - ("layer", 15), - ("layer", 60), - ("layer", 10), + (paramak.LayerType.GAP, 10), + (LayerType.SOLID, 50), + (LayerType.SOLID, 15), + (paramak.LayerType.GAP, 50), + (paramak.LayerType.PLASMA, 300), + (paramak.LayerType.GAP, 60), + (LayerType.SOLID, 15), + (LayerType.SOLID, 60), + (LayerType.SOLID, 10), ], elongation=2, triangularity=0.55, @@ -507,15 +507,15 @@ Reactor with toroidal field coils result = paramak.spherical_tokamak_from_plasma( radial_builds=[ - ("gap", 70), - ("layer", 10), - ("layer", 10), - ("gap", 50), - ("plasma", 300), - ("gap", 60), - ("layer", 10), - ("layer", 60), - ("layer", 10), + (paramak.LayerType.GAP, 70), + (LayerType.SOLID, 10), + (LayerType.SOLID, 10), + (paramak.LayerType.GAP, 50), + (paramak.LayerType.PLASMA, 300), + (paramak.LayerType.GAP, 60), + (LayerType.SOLID, 10), + (LayerType.SOLID, 60), + (LayerType.SOLID, 10), ], elongation=2.5, rotation_angle=180, @@ -538,15 +538,15 @@ Reactor with toroidal field coils result = paramak.spherical_tokamak_from_plasma( radial_builds=[ - ("gap", 70), - ("layer", 10), - ("layer", 10), - ("gap", 50), - ("plasma", 300), - ("gap", 60), - ("layer", 10), - ("layer", 60), - ("layer", 10), + (paramak.LayerType.GAP, 70), + (LayerType.SOLID, 10), + (LayerType.SOLID, 10), + (paramak.LayerType.GAP, 50), + (paramak.LayerType.PLASMA, 300), + (paramak.LayerType.GAP, 60), + (LayerType.SOLID, 10), + (LayerType.SOLID, 60), + (LayerType.SOLID, 10), ], elongation=2.5, rotation_angle=180, @@ -574,29 +574,29 @@ Tokamak with negative triangularity result = paramak.tokamak( radial_builds=[ - ("gap", 10), - ("layer", 30), - ("layer", 50), - ("layer", 10), - ("layer", 120), - ("layer", 20), - ("gap", 60), - ("plasma", 300), - ("gap", 60), - ("layer", 20), - ("layer", 120), - ("layer", 10), + (paramak.LayerType.GAP, 10), + (LayerType.SOLID, 30), + (LayerType.SOLID, 50), + (LayerType.SOLID, 10), + (LayerType.SOLID, 120), + (LayerType.SOLID, 20), + (paramak.LayerType.GAP, 60), + (paramak.LayerType.PLASMA, 300), + (paramak.LayerType.GAP, 60), + (LayerType.SOLID, 20), + (LayerType.SOLID, 120), + (LayerType.SOLID, 10), ], vertical_build=[ - ("layer", 15), - ("layer", 80), - ("layer", 10), - ("gap", 50), - ("plasma", 700), - ("gap", 60), - ("layer", 10), - ("layer", 40), - ("layer", 15), + (LayerType.SOLID, 15), + (LayerType.SOLID, 80), + (LayerType.SOLID, 10), + (paramak.LayerType.GAP, 50), + (paramak.LayerType.PLASMA, 700), + (paramak.LayerType.GAP, 60), + (LayerType.SOLID, 10), + (LayerType.SOLID, 40), + (LayerType.SOLID, 15), ], triangularity=-0.55, rotation_angle=180, @@ -608,29 +608,29 @@ Tokamak with negative triangularity result = paramak.tokamak( radial_builds=[ - ("gap", 10), - ("layer", 30), - ("layer", 50), - ("layer", 10), - ("layer", 120), - ("layer", 20), - ("gap", 60), - ("plasma", 300), - ("gap", 60), - ("layer", 20), - ("layer", 120), - ("layer", 10), + (paramak.LayerType.GAP, 10), + (LayerType.SOLID, 30), + (LayerType.SOLID, 50), + (LayerType.SOLID, 10), + (LayerType.SOLID, 120), + (LayerType.SOLID, 20), + (paramak.LayerType.GAP, 60), + (paramak.LayerType.PLASMA, 300), + (paramak.LayerType.GAP, 60), + (LayerType.SOLID, 20), + (LayerType.SOLID, 120), + (LayerType.SOLID, 10), ], vertical_build=[ - ("layer", 15), - ("layer", 80), - ("layer", 10), - ("gap", 50), - ("plasma", 700), - ("gap", 60), - ("layer", 10), - ("layer", 40), - ("layer", 15), + (LayerType.SOLID, 15), + (LayerType.SOLID, 80), + (LayerType.SOLID, 10), + (paramak.LayerType.GAP, 50), + (paramak.LayerType.PLASMA, 700), + (paramak.LayerType.GAP, 60), + (LayerType.SOLID, 10), + (LayerType.SOLID, 40), + (LayerType.SOLID, 15), ], triangularity=-0.55, rotation_angle=180, @@ -658,27 +658,27 @@ Spherical tokamak with negative triangularity result = paramak.spherical_tokamak( radial_builds=[ [ - ("gap", 10), - ("layer", 50), - ("layer", 15), - ("gap", 50), - ("plasma", 300), - ("gap", 60), - ("layer", 40), - ("layer", 60), - ("layer", 10), + (paramak.LayerType.GAP, 10), + (LayerType.SOLID, 50), + (LayerType.SOLID, 15), + (paramak.LayerType.GAP, 50), + (paramak.LayerType.PLASMA, 300), + (paramak.LayerType.GAP, 60), + (LayerType.SOLID, 40), + (LayerType.SOLID, 60), + (LayerType.SOLID, 10), ] ], vertical_build=[ - ("layer", 15), - ("layer", 80), - ("layer", 10), - ("gap", 50), - ("plasma", 700), - ("gap", 60), - ("layer", 10), - ("layer", 40), - ("layer", 15), + (LayerType.SOLID, 15), + (LayerType.SOLID, 80), + (LayerType.SOLID, 10), + (paramak.LayerType.GAP, 50), + (paramak.LayerType.PLASMA, 700), + (paramak.LayerType.GAP, 60), + (LayerType.SOLID, 10), + (LayerType.SOLID, 40), + (LayerType.SOLID, 15), ], rotation_angle=180, triangularity=-0.55, @@ -691,27 +691,27 @@ Spherical tokamak with negative triangularity result = paramak.spherical_tokamak( radial_builds=[ [ - ("gap", 10), - ("layer", 50), - ("layer", 15), - ("gap", 50), - ("plasma", 300), - ("gap", 60), - ("layer", 10), - ("layer", 60), - ("layer", 10), + (paramak.LayerType.GAP, 10), + (LayerType.SOLID, 50), + (LayerType.SOLID, 15), + (paramak.LayerType.GAP, 50), + (paramak.LayerType.PLASMA, 300), + (paramak.LayerType.GAP, 60), + (LayerType.SOLID, 10), + (LayerType.SOLID, 60), + (LayerType.SOLID, 10), ] ], vertical_build=[ - ("layer", 15), - ("layer", 80), - ("layer", 10), - ("gap", 50), - ("plasma", 700), - ("gap", 60), - ("layer", 10), - ("layer", 40), - ("layer", 15), + (LayerType.SOLID, 15), + (LayerType.SOLID, 80), + (LayerType.SOLID, 10), + (paramak.LayerType.GAP, 50), + (paramak.LayerType.PLASMA, 700), + (paramak.LayerType.GAP, 60), + (LayerType.SOLID, 10), + (LayerType.SOLID, 40), + (LayerType.SOLID, 15), ], rotation_angle=180, triangularity=-0.55, diff --git a/examples/spherical_tokamak_from_plasma_minimal.py b/examples/spherical_tokamak_from_plasma_minimal.py index 37592d59..f5b281b7 100644 --- a/examples/spherical_tokamak_from_plasma_minimal.py +++ b/examples/spherical_tokamak_from_plasma_minimal.py @@ -8,15 +8,15 @@ my_reactor = paramak.spherical_tokamak_from_plasma( radial_builds=[ [ - ("gap", 10), - ("layer", 50), - ("layer", 15), - ("gap", 50), - ("plasma", 300), - ("gap", 60), - ("layer", 15), - ("layer", 60), - ("layer", 10), + (paramak.LayerType.GAP, 10), + (LayerType.SOLID, 50), + (LayerType.SOLID, 15), + (paramak.LayerType.GAP, 50), + (paramak.LayerType.PLASMA, 300), + (paramak.LayerType.GAP, 60), + (LayerType.SOLID, 15), + (LayerType.SOLID, 60), + (LayerType.SOLID, 10), ] ], elongation=2, diff --git a/examples/spherical_tokamak_from_plasma_with_divertor.py b/examples/spherical_tokamak_from_plasma_with_divertor.py index 62858134..ce402568 100644 --- a/examples/spherical_tokamak_from_plasma_with_divertor.py +++ b/examples/spherical_tokamak_from_plasma_with_divertor.py @@ -8,18 +8,18 @@ my_reactor = paramak.spherical_tokamak_from_plasma( radial_builds=[ [ - ("gap", 10), - ("layer", 50), - ("layer", 15), - ("gap", 50), - ("plasma", 300), - ("gap", 60), - ("layer", 15), - ("layer", 60), - ("layer", 10), + (paramak.LayerType.GAP, 10), + (LayerType.SOLID, 50), + (LayerType.SOLID, 15), + (paramak.LayerType.GAP, 50), + (paramak.LayerType.PLASMA, 300), + (paramak.LayerType.GAP, 60), + (LayerType.SOLID, 15), + (LayerType.SOLID, 60), + (LayerType.SOLID, 10), ], - [("gap", 75), ("lower_divertor", 100)], # this divertor connects to the center column - [("gap", 120), ("upper_divertor", 140)], # this divertor has some blanket between the center colum and itself + [(paramak.LayerType.GAP, 75), ("lower_divertor", 100)], # this divertor connects to the center column + [(paramak.LayerType.GAP, 120), ("upper_divertor", 140)], # this divertor has some blanket between the center colum and itself ], elongation=2, triangularity=0.55, diff --git a/examples/spherical_tokamak_from_plasma_with_pf_magnets.py b/examples/spherical_tokamak_from_plasma_with_pf_magnets.py index df88df43..ce137a0a 100644 --- a/examples/spherical_tokamak_from_plasma_with_pf_magnets.py +++ b/examples/spherical_tokamak_from_plasma_with_pf_magnets.py @@ -26,15 +26,15 @@ my_reactor = paramak.spherical_tokamak_from_plasma( radial_builds=[ - ("gap", 10), - ("layer", 50), - ("layer", 15), - ("gap", 50), - ("plasma", 300), - ("gap", 60), - ("layer", 15), - ("layer", 60), - ("layer", 10), + (paramak.LayerType.GAP, 10), + (LayerType.SOLID, 50), + (LayerType.SOLID, 15), + (paramak.LayerType.GAP, 50), + (paramak.LayerType.PLASMA, 300), + (paramak.LayerType.GAP, 60), + (LayerType.SOLID, 15), + (LayerType.SOLID, 60), + (LayerType.SOLID, 10), ], elongation=2, triangularity=0.55, diff --git a/examples/spherical_tokamak_from_plasma_with_pf_magnets_and_divertors.py b/examples/spherical_tokamak_from_plasma_with_pf_magnets_and_divertors.py index 77c91b31..5ae3fc76 100644 --- a/examples/spherical_tokamak_from_plasma_with_pf_magnets_and_divertors.py +++ b/examples/spherical_tokamak_from_plasma_with_pf_magnets_and_divertors.py @@ -29,17 +29,17 @@ my_reactor = paramak.spherical_tokamak_from_plasma( radial_builds=[ [ - ("gap", 10), - ("layer", 50), - ("layer", 15), - ("gap", 50), - ("plasma", 300), - ("gap", 60), - ("layer", 15), - ("layer", 60), - ("layer", 10), + (paramak.LayerType.GAP, 10), + (LayerType.SOLID, 50), + (LayerType.SOLID, 15), + (paramak.LayerType.GAP, 50), + (paramak.LayerType.PLASMA, 300), + (paramak.LayerType.GAP, 60), + (LayerType.SOLID, 15), + (LayerType.SOLID, 60), + (LayerType.SOLID, 10), ], - [("gap", 75), ("lower_divertor", 100)], + [(paramak.LayerType.GAP, 75), ("lower_divertor", 100)], ], elongation=2, triangularity=0.55, diff --git a/examples/spherical_tokamak_from_plasma_with_tf_magnets.py b/examples/spherical_tokamak_from_plasma_with_tf_magnets.py index 851d640a..c716a06d 100644 --- a/examples/spherical_tokamak_from_plasma_with_tf_magnets.py +++ b/examples/spherical_tokamak_from_plasma_with_tf_magnets.py @@ -16,15 +16,15 @@ result = paramak.spherical_tokamak_from_plasma( radial_builds=[ - ("gap", 70), - ("layer", 10), - ("layer", 10), - ("gap", 50), - ("plasma", 300), - ("gap", 60), - ("layer", 10), - ("layer", 60), - ("layer", 10), + (paramak.LayerType.GAP, 70), + (LayerType.SOLID, 10), + (LayerType.SOLID, 10), + (paramak.LayerType.GAP, 50), + (paramak.LayerType.PLASMA, 300), + (paramak.LayerType.GAP, 60), + (LayerType.SOLID, 10), + (LayerType.SOLID, 60), + (LayerType.SOLID, 10), ], elongation=2.5, rotation_angle=180, diff --git a/examples/spherical_tokamak_minimal.py b/examples/spherical_tokamak_minimal.py index 393628b8..6f8136f8 100644 --- a/examples/spherical_tokamak_minimal.py +++ b/examples/spherical_tokamak_minimal.py @@ -8,27 +8,27 @@ my_reactor = paramak.spherical_tokamak( radial_builds=[ [ - ("gap", 10), - ("layer", 50), - ("layer", 15), - ("gap", 50), - ("plasma", 300), - ("gap", 60), - ("layer", 40), - ("layer", 60), - ("layer", 10), + (paramak.LayerType.GAP, 10), + (LayerType.SOLID, 50), + (LayerType.SOLID, 15), + (paramak.LayerType.GAP, 50), + (paramak.LayerType.PLASMA, 300), + (paramak.LayerType.GAP, 60), + (LayerType.SOLID, 40), + (LayerType.SOLID, 60), + (LayerType.SOLID, 10), ] ], vertical_build=[ - ("layer", 15), - ("layer", 80), - ("layer", 10), - ("gap", 50), - ("plasma", 700), - ("gap", 60), - ("layer", 10), - ("layer", 40), - ("layer", 15), + (LayerType.SOLID, 15), + (LayerType.SOLID, 80), + (LayerType.SOLID, 10), + (paramak.LayerType.GAP, 50), + (paramak.LayerType.PLASMA, 700), + (paramak.LayerType.GAP, 60), + (LayerType.SOLID, 10), + (LayerType.SOLID, 40), + (LayerType.SOLID, 15), ], rotation_angle=180, triangularity=-0.55, diff --git a/examples/tokamak_from_plasma_minimal.py b/examples/tokamak_from_plasma_minimal.py index 1ecb19e4..c1b0f03b 100644 --- a/examples/tokamak_from_plasma_minimal.py +++ b/examples/tokamak_from_plasma_minimal.py @@ -5,18 +5,18 @@ my_reactor = paramak.tokamak_from_plasma( radial_builds=[ - ("gap", 10), - ("layer", 30), - ("layer", 50), - ("layer", 10), - ("layer", 120), - ("layer", 20), - ("gap", 60), - ("plasma", 300), - ("gap", 60), - ("layer", 20), - ("layer", 120), - ("layer", 10), + (paramak.LayerType.GAP, 10), + (LayerType.SOLID, 30), + (LayerType.SOLID, 50), + (LayerType.SOLID, 10), + (LayerType.SOLID, 120), + (LayerType.SOLID, 20), + (paramak.LayerType.GAP, 60), + (paramak.LayerType.PLASMA, 300), + (paramak.LayerType.GAP, 60), + (LayerType.SOLID, 20), + (LayerType.SOLID, 120), + (LayerType.SOLID, 10), ], elongation=2, triangularity=0.55, diff --git a/examples/tokamak_from_plasma_with_divertor.py b/examples/tokamak_from_plasma_with_divertor.py index 6ec86e8c..1c902047 100644 --- a/examples/tokamak_from_plasma_with_divertor.py +++ b/examples/tokamak_from_plasma_with_divertor.py @@ -6,20 +6,20 @@ my_reactor = paramak.tokamak( radial_builds=[ [ - ("gap", 10), - ("layer", 30), - ("layer", 50), - ("layer", 10), - ("layer", 120), - ("layer", 20), - ("gap", 60), - ("plasma", 300), - ("gap", 60), - ("layer", 20), - ("layer", 120), - ("layer", 10), + (paramak.LayerType.GAP, 10), + (LayerType.SOLID, 30), + (LayerType.SOLID, 50), + (LayerType.SOLID, 10), + (LayerType.SOLID, 120), + (LayerType.SOLID, 20), + (paramak.LayerType.GAP, 60), + (paramak.LayerType.PLASMA, 300), + (paramak.LayerType.GAP, 60), + (LayerType.SOLID, 20), + (LayerType.SOLID, 120), + (LayerType.SOLID, 10), ], - [("gap", 300), ("lower_divertor", 150)], + [(paramak.LayerType.GAP, 300), ("lower_divertor", 150)], ], elongation=2, triangularity=0.55, diff --git a/examples/tokamak_minimal.py b/examples/tokamak_minimal.py index 93758e61..2b216a25 100644 --- a/examples/tokamak_minimal.py +++ b/examples/tokamak_minimal.py @@ -5,29 +5,29 @@ my_reactor = paramak.tokamak( radial_builds=[ - ("gap", 10), - ("layer", 30), - ("layer", 50), - ("layer", 10), - ("layer", 120), - ("layer", 20), - ("gap", 60), - ("plasma", 300), - ("gap", 60), - ("layer", 20), - ("layer", 120), - ("layer", 10), + (paramak.LayerType.GAP, 10), + (LayerType.SOLID, 30), + (LayerType.SOLID, 50), + (LayerType.SOLID, 10), + (LayerType.SOLID, 120), + (LayerType.SOLID, 20), + (paramak.LayerType.GAP, 60), + (paramak.LayerType.PLASMA, 300), + (paramak.LayerType.GAP, 60), + (LayerType.SOLID, 20), + (LayerType.SOLID, 120), + (LayerType.SOLID, 10), ], vertical_build=[ - ("layer", 15), - ("layer", 80), - ("layer", 10), - ("gap", 50), - ("plasma", 700), - ("gap", 60), - ("layer", 10), - ("layer", 40), - ("layer", 15), + (LayerType.SOLID, 15), + (LayerType.SOLID, 80), + (LayerType.SOLID, 10), + (paramak.LayerType.GAP, 50), + (paramak.LayerType.PLASMA, 700), + (paramak.LayerType.GAP, 60), + (LayerType.SOLID, 10), + (LayerType.SOLID, 40), + (LayerType.SOLID, 15), ], triangularity=0.55, rotation_angle=180, diff --git a/examples/tokamak_with_pf_magnets.py b/examples/tokamak_with_pf_magnets.py index 5dbb199a..da8dbb74 100644 --- a/examples/tokamak_with_pf_magnets.py +++ b/examples/tokamak_with_pf_magnets.py @@ -25,29 +25,29 @@ my_reactor = paramak.tokamak( radial_builds=[ - ("gap", 10), - ("layer", 30), - ("layer", 50), - ("layer", 10), - ("layer", 120), - ("layer", 20), - ("gap", 60), - ("plasma", 300), - ("gap", 60), - ("layer", 20), - ("layer", 120), - ("layer", 10), + (paramak.LayerType.GAP, 10), + (LayerType.SOLID, 30), + (LayerType.SOLID, 50), + (LayerType.SOLID, 10), + (LayerType.SOLID, 120), + (LayerType.SOLID, 20), + (paramak.LayerType.GAP, 60), + (paramak.LayerType.PLASMA, 300), + (paramak.LayerType.GAP, 60), + (LayerType.SOLID, 20), + (LayerType.SOLID, 120), + (LayerType.SOLID, 10), ], vertical_build=[ - ("layer", 15), - ("layer", 80), - ("layer", 10), - ("gap", 50), - ("plasma", 700), - ("gap", 60), - ("layer", 10), - ("layer", 40), - ("layer", 15), + (LayerType.SOLID, 15), + (LayerType.SOLID, 80), + (LayerType.SOLID, 10), + (paramak.LayerType.GAP, 50), + (paramak.LayerType.PLASMA, 700), + (paramak.LayerType.GAP, 60), + (LayerType.SOLID, 10), + (LayerType.SOLID, 40), + (LayerType.SOLID, 15), ], triangularity=0.55, rotation_angle=180, diff --git a/src/paramak/__init__.py b/src/paramak/__init__.py index 59a2cf4e..f793fab8 100644 --- a/src/paramak/__init__.py +++ b/src/paramak/__init__.py @@ -15,7 +15,7 @@ from .workplanes.toroidal_field_coil_rectangle import toroidal_field_coil_rectangle from .workplanes.u_shaped_dome import u_shaped_dome -# from .utils import * +from .utils import LayerType __version__ = version("paramak") diff --git a/src/paramak/assemblies/spherical_tokamak.py b/src/paramak/assemblies/spherical_tokamak.py index d30f871a..f3a5ed0a 100644 --- a/src/paramak/assemblies/spherical_tokamak.py +++ b/src/paramak/assemblies/spherical_tokamak.py @@ -11,6 +11,7 @@ sum_up_to_gap_before_plasma, sum_up_to_plasma, sum_before_after_plasma, + LayerType ) from ..workplanes.blanket_from_plasma import blanket_from_plasma from ..workplanes.center_column_shield_cylinder import center_column_shield_cylinder @@ -33,7 +34,7 @@ def create_blanket_layers_after_plasma( lower_thicknees = vertical_build[plasma_index_vertical - 1 - i][1] radial_thickness = item[1] - if item[0] == "gap": + if item[0] == LayerType.GAP: cumulative_thickness_rb += radial_thickness cumulative_thickness_uvb += upper_thicknees cumulative_thickness_lvb += lower_thicknees @@ -80,11 +81,11 @@ def create_center_column_shield_cylinders(radial_build, vertical_build, rotation center_column_shield_height = sum([item[1] for item in vertical_build]) for index, item in enumerate(radial_build): - if item[0] == "plasma": + if item[0] == LayerType.PLASMA: break - if item[0] == "gap" and radial_build[index + 1][0] == "plasma": + if item[0] == LayerType.GAP and radial_build[index + 1][0] == LayerType.PLASMA: break - if item[0] == "gap": + if item[0] == LayerType.GAP: total_sum += item[1] continue @@ -142,7 +143,7 @@ def spherical_tokamak_from_plasma( plasma_height = 2 * minor_radius * elongation # slice opperation reverses the list and removes the last value to avoid two plasmas - vertical_build = upper_vertical_build[::-1][:-1] + [("plasma", plasma_height)] + upper_vertical_build[1:] + vertical_build = upper_vertical_build[::-1][:-1] + [(LayerType.PLASMA, plasma_height)] + upper_vertical_build[1:] return spherical_tokamak( radial_builds=radial_builds, diff --git a/src/paramak/assemblies/tokamak.py b/src/paramak/assemblies/tokamak.py index 37115eeb..6fd46391 100644 --- a/src/paramak/assemblies/tokamak.py +++ b/src/paramak/assemblies/tokamak.py @@ -2,7 +2,7 @@ import cadquery as cq -from ..utils import build_divertor_modify_blanket, extract_radial_builds, get_plasma_index, sum_after_plasma +from ..utils import build_divertor_modify_blanket, extract_radial_builds, get_plasma_index, sum_after_plasma, LayerType from ..workplanes.blanket_from_plasma import blanket_from_plasma from ..workplanes.center_column_shield_cylinder import center_column_shield_cylinder from ..workplanes.plasma_simplified import plasma_simplified @@ -15,9 +15,9 @@ def count_cylinder_layers(radial_build): found_plasma = False for item in radial_build: - if item[0] == "plasma": + if item[0] == LayerType.PLASMA: found_plasma = True - elif item[0] == "layer": + elif item[0] == LayerType.SOLID: if not found_plasma: before_plasma += 1 else: @@ -34,10 +34,10 @@ def create_center_column_shield_cylinders(radial_build, rotation_angle, center_c number_of_cylinder_layers = count_cylinder_layers(radial_build) for index, item in enumerate(radial_build): - if item[0] == "plasma": + if item[0] == LayerType.PLASMA: break - if item[0] == "gap": + if item[0] == LayerType.GAP: total_sum += item[1] continue @@ -62,7 +62,7 @@ def create_center_column_shield_cylinders(radial_build, rotation_angle, center_c def distance_to_plasma(radial_build, index): distance = 0 for item in radial_build[index + 1 :]: - if item[0] == "plasma": + if item[0] == LayerType.PLASMA: break distance += item[1] return distance @@ -83,14 +83,14 @@ def create_layers_from_plasma( cumulative_thickness_lvb = 0 for index_delta in range(indexes_from_plamsa_to_end): - if radial_build[plasma_index_rb + index_delta][0] == "plasma": + if radial_build[plasma_index_rb + index_delta][0] == LayerType.PLASMA: continue outer_layer_thickness = radial_build[plasma_index_rb + index_delta][1] inner_layer_thickness = radial_build[plasma_index_rb - index_delta][1] upper_layer_thickness = vertical_build[plasma_index_vb - index_delta][1] lower_layer_thickness = vertical_build[plasma_index_vb + index_delta][1] - if radial_build[plasma_index_rb + index_delta][0] == "gap": + if radial_build[plasma_index_rb + index_delta][0] == LayerType.GAP: cumulative_thickness_orb += outer_layer_thickness cumulative_thickness_irb += inner_layer_thickness cumulative_thickness_uvb += upper_layer_thickness @@ -98,7 +98,7 @@ def create_layers_from_plasma( continue # build outer layer - if radial_build[plasma_index_rb + index_delta][0] == "layer": + if radial_build[plasma_index_rb + index_delta][0] == LayerType.SOLID: outer_layer = blanket_from_plasma( minor_radius=minor_radius, major_radius=major_radius, @@ -182,7 +182,7 @@ def tokamak_from_plasma( plasma_height = 2 * minor_radius * elongation # slice opperation reverses the list and removes the last value to avoid two plasmas - vertical_build = upper_vertical_build[::-1][:-1] + [("plasma", plasma_height)] + upper_vertical_build[1:] + vertical_build = upper_vertical_build[::-1][:-1] + [(LayerType.PLASMA, plasma_height)] + upper_vertical_build[1:] return tokamak( radial_builds=radial_builds, diff --git a/src/paramak/utils.py b/src/paramak/utils.py index 7704e9fc..19fc15e9 100644 --- a/src/paramak/utils.py +++ b/src/paramak/utils.py @@ -1,8 +1,14 @@ import typing +from enum import Enum from cadquery import Workplane +class LayerType(Enum): + GAP = 'gap' + SOLID = 'solid' + PLASMA = 'plasma' + def instructions_from_points(points): # obtains the first two values of the points list XZ_points = [(p[0], p[1]) for p in points] @@ -96,9 +102,9 @@ def rotate_solid(angles: typing.Sequence[float], solid: Workplane) -> Workplane: def sum_up_to_gap_before_plasma(radial_build): total_sum = 0 for i, item in enumerate(radial_build): - if item[0] == "plasma": + if item[0] == LayerType.PLASMA: return total_sum - if item[0] == "gap" and i + 1 < len(radial_build) and radial_build[i + 1][0] == "plasma": + if item[0] == LayerType.GAP and i + 1 < len(radial_build) and radial_build[i + 1][0] == LayerType.PLASMA: return total_sum total_sum += item[1] return total_sum @@ -107,7 +113,7 @@ def sum_up_to_gap_before_plasma(radial_build): def sum_up_to_plasma(radial_build): total_sum = 0 for item in radial_build: - if item[0] == "plasma": + if item[0] == LayerType.PLASMA: break total_sum += item[1] return total_sum @@ -119,7 +125,7 @@ def sum_after_plasma(radial_build): for item in radial_build: if plasma_found: total_sum += item[1] - if item[0] == "plasma": + if item[0] == LayerType.PLASMA: plasma_found = True return total_sum @@ -135,7 +141,7 @@ def sum_before_after_plasma(vertical_build): plasma_found = False for item in vertical_build: - if item[0] == "plasma": + if item[0] == LayerType.PLASMA: plasma_value = item[1] / 2 plasma_found = True continue @@ -198,7 +204,9 @@ def build_divertor_modify_blanket(outer_layers, divertor_radial_builds, blanket_ def is_plasma_radial_build(radial_build): for entry in radial_build: - if entry[0] == "plasma": + # if entry == LayerType.PLASMA: + # return True + if entry[0] == LayerType.PLASMA: return True return False @@ -207,14 +215,14 @@ def extract_radial_builds(radial_build): # TODO more rubust method of finding if it is a single list of tupes or multiple lists # only one radial build so it should be a plasma based radial build divertor_radial_builds = [] - if isinstance(radial_build[0][0], str) and ( + if isinstance(radial_build[0][0], LayerType) and ( isinstance(radial_build[0][1], float) or isinstance(radial_build[0][1], int) ): plasma_radial_build = radial_build else: for entry in radial_build: if is_plasma_radial_build(entry): - # TODO this assumes htere is only one radial build, which needs to e checked + # TODO this assumes there is only one radial build, which needs to e checked plasma_radial_build = entry else: divertor_radial_builds.append(entry) @@ -228,12 +236,12 @@ def extract_radial_builds(radial_build): def validate_divertor_radial_build(radial_build): if len(radial_build) != 2: raise ValidationError( - f'The radial build for the divertor should only contain two entries, for example (("gap",10), ("lower_divertor", 10)) not {radial_build}' + f'The radial build for the divertor should only contain two entries, for example ((LayerType.GAP,10), ("lower_divertor", 10)) not {radial_build}' ) if len(radial_build[0]) != 2 or len(radial_build[1]) != 2: raise ValidationError( - 'The radial build for the divertor should only contain tuples of length 2,, for example ("gap",10)' + 'The radial build for the divertor should only contain tuples of length 2,, for example (LayerType.GAP,10)' ) if radial_build[1][0] not in {"lower_divertor", "upper_divertor"}: @@ -241,9 +249,9 @@ def validate_divertor_radial_build(radial_build): f'The second entry in the radial build for the divertor should be either "lower_divertor" or "upper_divertor" not {radial_build[1][0]}' ) - if radial_build[0][0] != "gap": + if radial_build[0][0] != LayerType.GAP: raise ValidationError( - f'The first entry in the radial build for the divertor should be a "gap" not {radial_build[0][0]}' + f'The first entry in the radial build for the divertor should be a LayerType.GAP not {radial_build[0][0]}' ) if not isinstance(radial_build[0][1], (int, float)) or not isinstance(radial_build[1][1], (int, float)): @@ -259,27 +267,29 @@ def validate_divertor_radial_build(radial_build): def validate_plasma_radial_build(radial_build): # TODO should end with layer, not gap - valid_strings = {"gap", "layer", "plasma"} + valid_strings = {LayerType.GAP, LayerType.SOLID, LayerType.PLASMA} plasma_count = 0 plasma_index = -1 for index, item in enumerate(radial_build): - if not (isinstance(item[0], str) and isinstance(item[1], (int, float))): - raise ValidationError(f"Invalid tuple structure at index {index}: {item}") + if not isinstance(item[0], LayerType): + raise ValidationError(f"First entry in each radial build Tuple should be a paramak.LayerType") + if not isinstance(item[1], (int, float)): + raise ValidationError(f"Second entry in each radial build Tuple should be a Float") if item[0] not in valid_strings: - raise ValidationError(f"Invalid string '{item[0]}' at index {index}") + raise ValidationError(f"Invalid entry '{item[0]}' at index {index}") if item[1] <= 0: raise ValidationError(f"Non-positive value '{item[1]}' at index {index}") - if item[0] == "plasma": + if item[0] == LayerType.PLASMA: plasma_count += 1 plasma_index = index if plasma_count > 1: - raise ValidationError("Multiple 'plasma' entries found") + raise ValidationError("Multiple LayerType.PLASMA entries found") if plasma_count != 1: - raise ValidationError("'plasma' entry not found or found multiple times") + raise ValidationError("LayerType.PLASMA entry not found or found multiple times") if plasma_index == 0 or plasma_index == len(radial_build) - 1: - raise ValidationError("'plasma' entry must have at least one entry before and after it") - if radial_build[plasma_index - 1][0] != "gap" or radial_build[plasma_index + 1][0] != "gap": - raise ValidationError("'plasma' entry must be preceded and followed by a 'gap'") + raise ValidationError("LayerType.PLASMA entry must have at least one entry before and after it") + if radial_build[plasma_index - 1][0] != LayerType.GAP or radial_build[plasma_index + 1][0] != LayerType.GAP: + raise ValidationError("LayerType.PLASMA entry must be preceded and followed by a LayerType.GAP") def is_lower_or_upper_divertor(radial_build): @@ -293,26 +303,26 @@ def is_lower_or_upper_divertor(radial_build): def get_plasma_value(radial_build): for item in radial_build: - if item[0] == "plasma": + if item[0] == LayerType.PLASMA: return item[1] - raise ValueError("'plasma' entry not found") + raise ValueError("LayerType.PLASMA entry not found") def get_plasma_index(radial_build): for i, item in enumerate(radial_build): - if item[0] == "plasma": + if item[0] == LayerType.PLASMA: return i - raise ValueError("'plasma' entry not found") + raise ValueError("LayerType.PLASMA entry not found") def get_gap_after_plasma(radial_build): for index, item in enumerate(radial_build): - if item[0] == "plasma": - if index + 1 < len(radial_build) and radial_build[index + 1][0] == "gap": + if item[0] == LayerType.PLASMA: + if index + 1 < len(radial_build) and radial_build[index + 1][0] == LayerType.GAP: return radial_build[index + 1][1] else: - raise ValueError("'plasma' entry is not followed by a 'gap'") - raise ValueError("'plasma' entry not found") + raise ValueError("LayerType.PLASMA entry is not followed by a 'gap'") + raise ValueError("LayerType.PLASMA entry not found") def sum_after_gap_following_plasma(radial_build): @@ -323,14 +333,14 @@ def sum_after_gap_following_plasma(radial_build): for item in radial_build: if found_gap_after_plasma: total_sum += item[1] - elif found_plasma and item[0] == "gap": + elif found_plasma and item[0] == LayerType.GAP: found_gap_after_plasma = True - elif item[0] == "plasma": + elif item[0] == LayerType.PLASMA: found_plasma = True if not found_plasma: - raise ValueError("'plasma' entry not found") + raise ValueError("LayerType.PLASMA entry not found") if not found_gap_after_plasma: - raise ValueError("'plasma' entry is not followed by a 'gap'") + raise ValueError("LayerType.PLASMA entry is not followed by a 'gap'") return total_sum diff --git a/tests/test_assemblies/test_spherical_tokamak.py b/tests/test_assemblies/test_spherical_tokamak.py index bf926ff1..53c692c5 100644 --- a/tests/test_assemblies/test_spherical_tokamak.py +++ b/tests/test_assemblies/test_spherical_tokamak.py @@ -34,16 +34,16 @@ def test_transport_with_magnets(rotation_angle): my_reactor = paramak.spherical_tokamak_from_plasma( radial_builds=[ - ("gap", 10), - ("layer", 50), - ("layer", 15), - ("gap", 50), - ("plasma", 300), - ("gap", 60), - ("layer", 15), - ("layer", 60), - ("layer", 10), - ("gap", 10), + (paramak.LayerType.GAP, 10), + (paramak.LayerType.SOLID, 50), + (paramak.LayerType.SOLID, 15), + (paramak.LayerType.GAP, 50), + (paramak.LayerType.PLASMA, 300), + (paramak.LayerType.GAP, 60), + (paramak.LayerType.SOLID, 15), + (paramak.LayerType.SOLID, 60), + (paramak.LayerType.SOLID, 10), + (paramak.LayerType.GAP, 10), ], elongation=2, triangularity=0.55, @@ -71,16 +71,16 @@ def test_transport_with_magnets(rotation_angle): def test_transport_without_magnets(): reactor = paramak.spherical_tokamak_from_plasma( radial_builds=[ - ("gap", 10), - ("layer", 50), - ("layer", 15), - ("gap", 50), - ("plasma", 300), - ("gap", 60), - ("layer", 15), - ("layer", 60), - ("layer", 10), - ("gap", 10), + (paramak.LayerType.GAP, 10), + (paramak.LayerType.SOLID, 50), + (paramak.LayerType.SOLID, 15), + (paramak.LayerType.GAP, 50), + (paramak.LayerType.PLASMA, 300), + (paramak.LayerType.GAP, 60), + (paramak.LayerType.SOLID, 15), + (paramak.LayerType.SOLID, 60), + (paramak.LayerType.SOLID, 10), + (paramak.LayerType.GAP, 10), ], elongation=2, triangularity=0.55, diff --git a/tests/test_utils.py b/tests/test_utils.py index 29ecfa20..9a74cf37 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -8,46 +8,47 @@ sum_up_to_plasma, validate_divertor_radial_build, validate_plasma_radial_build, + LayerType ) def test_validate_divertor_radial_build_valid(): - radial_build = [("gap", 10), ("lower_divertor", 20)] + radial_build = [(LayerType.GAP, 10), ("lower_divertor", 20)] assert validate_divertor_radial_build(radial_build) is None def test_validate_divertor_radial_build_invalid_length(): - radial_build = [("gap", 10)] + radial_build = [(LayerType.GAP, 10)] with pytest.raises(ValidationError, match="should only contain two entries"): validate_divertor_radial_build(radial_build) def test_validate_divertor_radial_build_invalid_tuple_length(): - radial_build = [("gap", 10, 5), ("lower_divertor", 20)] + radial_build = [(LayerType.GAP, 10, 5), ("lower_divertor", 20)] with pytest.raises(ValidationError, match="should only contain tuples of length 2"): validate_divertor_radial_build(radial_build) def test_validate_divertor_radial_build_invalid_second_entry(): - radial_build = [("gap", 10), ("divertor", 20)] + radial_build = [(LayerType.GAP, 10), ("divertor", 20)] with pytest.raises(ValidationError, match='should be either "lower_divertor" or "upper_divertor"'): validate_divertor_radial_build(radial_build) def test_validate_divertor_radial_build_invalid_first_entry(): - radial_build = [("layer", 10), ("lower_divertor", 20)] - with pytest.raises(ValidationError, match='should be a "gap"'): + radial_build = [(LayerType.SOLID, 10), ("lower_divertor", 20)] + with pytest.raises(ValidationError, match='should be a LayerType.GAP'): validate_divertor_radial_build(radial_build) def test_validate_divertor_radial_build_non_positive_thickness(): - radial_build = [("gap", -10), ("lower_divertor", 20)] + radial_build = [(LayerType.GAP, -10), ("lower_divertor", 20)] with pytest.raises(ValidationError, match="should both be positive values"): validate_divertor_radial_build(radial_build) def test_validate_divertor_radial_build_invalid_thickness_type(): - radial_build = [("gap", "10"), ("lower_divertor", 20)] + radial_build = [(LayerType.GAP, "10"), ("lower_divertor", 20)] with pytest.raises(ValidationError, match="should both be integers or floats"): validate_divertor_radial_build(radial_build) @@ -55,43 +56,43 @@ def test_validate_divertor_radial_build_invalid_thickness_type(): def test_get_plasma_value(): radial_build = [ ( - "gap", + LayerType.GAP, 10, ), ( - "layer", + LayerType.SOLID, 50, ), ( - "layer", + LayerType.SOLID, 5, ), ( - "gap", + LayerType.GAP, 50, ), ( - "plasma", + LayerType.PLASMA, 50, ), ( - "gap", + LayerType.GAP, 60, ), ( - "layer", + LayerType.SOLID, 2, ), ( - "layer", + LayerType.SOLID, 2, ), ( - "layer", + LayerType.SOLID, 2, ), ( - "gap", + LayerType.GAP, 10, ), ] @@ -101,86 +102,86 @@ def test_get_plasma_value(): def test_get_plasma_value_not_found(): radial_build = [ ( - "gap", + LayerType.GAP, 10, ), ( - "layer", + LayerType.SOLID, 50, ), ( - "layer", + LayerType.SOLID, 5, ), ( - "gap", + LayerType.GAP, 50, ), ( - "gap", + LayerType.GAP, 60, ), ( - "layer", + LayerType.SOLID, 2, ), ( - "layer", + LayerType.SOLID, 2, ), ( - "layer", + LayerType.SOLID, 2, ), ( - "gap", + LayerType.GAP, 10, ), ] - with pytest.raises(ValueError, match="'plasma' entry not found"): + with pytest.raises(ValueError, match="LayerType.PLASMA entry not found"): get_plasma_value(radial_build) def test_valid_case(): radial_build = [ ( - "gap", + LayerType.GAP, 10, ), ( - "layer", + LayerType.SOLID, 50, ), ( - "layer", + LayerType.SOLID, 5, ), ( - "gap", + LayerType.GAP, 50, ), ( - "plasma", + LayerType.PLASMA, 50, ), ( - "gap", + LayerType.GAP, 60, ), ( - "layer", + LayerType.SOLID, 2, ), ( - "layer", + LayerType.SOLID, 2, ), ( - "layer", + LayerType.SOLID, 2, ), ( - "gap", + LayerType.GAP, 10, ), ] @@ -190,176 +191,176 @@ def test_valid_case(): def test_plasma_not_preceded_by_gap(): radial_build = [ ( - "gap", + LayerType.GAP, 10, ), ( - "layer", + LayerType.SOLID, 50, ), ( - "layer", + LayerType.SOLID, 5, ), ( - "plasma", + LayerType.PLASMA, 50, ), ( - "gap", + LayerType.GAP, 60, ), ( - "layer", + LayerType.SOLID, 2, ), ( - "layer", + LayerType.SOLID, 2, ), ( - "layer", + LayerType.SOLID, 2, ), ( - "gap", + LayerType.GAP, 10, ), ] - with pytest.raises(ValidationError, match="'plasma' entry must be preceded and followed by a 'gap'"): + with pytest.raises(ValidationError, match="LayerType.PLASMA entry must be preceded and followed by a LayerType.GAP"): validate_plasma_radial_build(radial_build) def test_plasma_not_followed_by_gap(): radial_build = [ ( - "gap", + LayerType.GAP, 10, ), ( - "layer", + LayerType.SOLID, 50, ), ( - "gap", + LayerType.GAP, 5, ), ( - "plasma", + LayerType.PLASMA, 50, ), ( - "layer", + LayerType.SOLID, 60, ), ( - "layer", + LayerType.SOLID, 2, ), ( - "layer", + LayerType.SOLID, 2, ), ( - "layer", + LayerType.SOLID, 2, ), ( - "gap", + LayerType.GAP, 10, ), ] - with pytest.raises(ValidationError, match="'plasma' entry must be preceded and followed by a 'gap'"): + with pytest.raises(ValidationError, match="LayerType.PLASMA entry must be preceded and followed by a LayerType.GAP"): validate_plasma_radial_build(radial_build) def test_missing_plasma(): radial_build = [ ( - "gap", + LayerType.GAP, 10, ), ( - "layer", + LayerType.SOLID, 50, ), ( - "layer", + LayerType.SOLID, 5, ), ( - "gap", + LayerType.GAP, 50, ), ( - "gap", + LayerType.GAP, 60, ), ( - "layer", + LayerType.SOLID, 2, ), ( - "layer", + LayerType.SOLID, 2, ), ( - "layer", + LayerType.SOLID, 2, ), ( - "gap", + LayerType.GAP, 10, ), ] - with pytest.raises(ValidationError, match="'plasma' entry not found or found multiple times"): + with pytest.raises(ValidationError, match="LayerType.PLASMA entry not found or found multiple times"): validate_plasma_radial_build(radial_build) def test_multiple_plasma(): radial_build = [ ( - "gap", + LayerType.GAP, 10, ), ( - "layer", + LayerType.SOLID, 50, ), ( - "plasma", + LayerType.PLASMA, 50, ), ( - "gap", + LayerType.GAP, 50, ), ( - "plasma", + LayerType.PLASMA, 50, ), ( - "gap", + LayerType.GAP, 60, ), ( - "layer", + LayerType.SOLID, 2, ), ( - "layer", + LayerType.SOLID, 2, ), ( - "layer", + LayerType.SOLID, 2, ), ( - "gap", + LayerType.GAP, 10, ), ] - with pytest.raises(ValidationError, match="Multiple 'plasma' entries found"): + with pytest.raises(ValidationError, match="Multiple LayerType.PLASMA entries found"): validate_plasma_radial_build(radial_build) @@ -370,101 +371,101 @@ def test_first_entry_not_string(): 10, ), ( - "layer", + LayerType.SOLID, 50, ), ( - "layer", + LayerType.SOLID, 5, ), ( - "gap", + LayerType.GAP, 50, ), ( - "plasma", + LayerType.PLASMA, 50, ), ( - "gap", + LayerType.GAP, 60, ), ( - "layer", + LayerType.SOLID, 2, ), ( - "layer", + LayerType.SOLID, 2, ), ( - "layer", + LayerType.SOLID, 2, ), ( - "gap", + LayerType.GAP, 10, ), ] - with pytest.raises(ValidationError, match="Invalid tuple structure at index 0"): + with pytest.raises(ValidationError, match="First entry in each radial build Tuple should be a paramak.LayerType"): validate_plasma_radial_build(radial_build) def test_second_entry_not_number(): radial_build = [ ( - "gap", + LayerType.GAP, 10, ), ( - "layer", + LayerType.SOLID, "50", ), ( - "layer", + LayerType.SOLID, 5, ), ( - "gap", + LayerType.GAP, 50, ), ( - "plasma", + LayerType.PLASMA, 50, ), ( - "gap", + LayerType.GAP, 60, ), ( - "layer", + LayerType.SOLID, 2, ), ( - "layer", + LayerType.SOLID, 2, ), ( - "layer", + LayerType.SOLID, 2, ), ( - "gap", + LayerType.GAP, 10, ), ] - with pytest.raises(ValidationError, match="Invalid tuple structure at index 1"): + with pytest.raises(ValidationError, match="Second entry in each radial build Tuple should be a Float"): validate_plasma_radial_build(radial_build) def test_invalid_string(): radial_build = [ ( - "gap", + LayerType.GAP, 10, ), ( - "layer", + LayerType.SOLID, 50, ), ( @@ -472,172 +473,172 @@ def test_invalid_string(): 5, ), # Invalid string ( - "gap", + LayerType.GAP, 50, ), ( - "plasma", + LayerType.PLASMA, 50, ), ( - "gap", + LayerType.GAP, 60, ), ( - "layer", + LayerType.SOLID, 2, ), ( - "layer", + LayerType.SOLID, 2, ), ( - "layer", + LayerType.SOLID, 2, ), ( - "gap", + LayerType.GAP, 10, ), ] - with pytest.raises(ValidationError, match="Invalid string 'invalid' at index 2"): + with pytest.raises(ValidationError, match="First entry in each radial build Tuple should be a paramak.LayerType"): validate_plasma_radial_build(radial_build) def test_plasma_first_entry(): radial_build = [ ( - "plasma", + LayerType.PLASMA, 50, ), ( - "gap", + LayerType.GAP, 10, ), ( - "layer", + LayerType.SOLID, 50, ), ( - "layer", + LayerType.SOLID, 5, ), ( - "gap", + LayerType.GAP, 50, ), ( - "gap", + LayerType.GAP, 60, ), ( - "layer", + LayerType.SOLID, 2, ), ( - "layer", + LayerType.SOLID, 2, ), ( - "layer", + LayerType.SOLID, 2, ), ( - "gap", + LayerType.GAP, 10, ), ] - with pytest.raises(ValidationError, match="'plasma' entry must have at least one entry before and after it"): + with pytest.raises(ValidationError, match="LayerType.PLASMA entry must have at least one entry before and after it"): validate_plasma_radial_build(radial_build) def test_plasma_last_entry(): radial_build = [ ( - "gap", + LayerType.GAP, 10, ), ( - "layer", + LayerType.SOLID, 50, ), ( - "layer", + LayerType.SOLID, 5, ), ( - "gap", + LayerType.GAP, 50, ), ( - "gap", + LayerType.GAP, 60, ), ( - "layer", + LayerType.SOLID, 2, ), ( - "layer", + LayerType.SOLID, 2, ), ( - "layer", + LayerType.SOLID, 2, ), ( - "gap", + LayerType.GAP, 10, ), ( - "plasma", + LayerType.PLASMA, 50, ), ] - with pytest.raises(ValidationError, match="'plasma' entry must have at least one entry before and after it"): + with pytest.raises(ValidationError, match="LayerType.PLASMA entry must have at least one entry before and after it"): validate_plasma_radial_build(radial_build) def test_non_positive_values(): radial_build = [ ( - "gap", + LayerType.GAP, 10, ), ( - "layer", + LayerType.SOLID, 50, ), ( - "layer", + LayerType.SOLID, 0, ), # Non-positive value ( - "gap", + LayerType.GAP, 50, ), ( - "plasma", + LayerType.PLASMA, 50, ), ( - "gap", + LayerType.GAP, 60, ), ( - "layer", + LayerType.SOLID, 2, ), ( - "layer", + LayerType.SOLID, 2, ), ( - "layer", + LayerType.SOLID, 2, ), ( - "gap", + LayerType.GAP, 10, ), ] @@ -648,43 +649,43 @@ def test_non_positive_values(): def test_sum_up_to_plasma_middle(): radial_build = [ ( - "gap", + LayerType.GAP, 10, ), ( - "layer", + LayerType.SOLID, 50, ), ( - "layer", + LayerType.SOLID, 5, ), ( - "gap", + LayerType.GAP, 50, ), ( - "plasma", + LayerType.PLASMA, 50, ), ( - "gap", + LayerType.GAP, 60, ), ( - "layer", + LayerType.SOLID, 2, ), ( - "layer", + LayerType.SOLID, 2, ), ( - "layer", + LayerType.SOLID, 2, ), ( - "gap", + LayerType.GAP, 10, ), ] @@ -694,43 +695,43 @@ def test_sum_up_to_plasma_middle(): def test_sum_up_to_plasma_first(): radial_build = [ ( - "plasma", + LayerType.PLASMA, 50, ), ( - "gap", + LayerType.GAP, 10, ), ( - "layer", + LayerType.SOLID, 50, ), ( - "layer", + LayerType.SOLID, 5, ), ( - "gap", + LayerType.GAP, 50, ), ( - "gap", + LayerType.GAP, 60, ), ( - "layer", + LayerType.SOLID, 2, ), ( - "layer", + LayerType.SOLID, 2, ), ( - "layer", + LayerType.SOLID, 2, ), ( - "gap", + LayerType.GAP, 10, ), ] @@ -740,43 +741,43 @@ def test_sum_up_to_plasma_first(): def test_sum_up_to_plasma_last(): radial_build = [ ( - "gap", + LayerType.GAP, 10, ), ( - "layer", + LayerType.SOLID, 50, ), ( - "layer", + LayerType.SOLID, 5, ), ( - "gap", + LayerType.GAP, 50, ), ( - "gap", + LayerType.GAP, 60, ), ( - "layer", + LayerType.SOLID, 2, ), ( - "layer", + LayerType.SOLID, 2, ), ( - "layer", + LayerType.SOLID, 2, ), ( - "gap", + LayerType.GAP, 10, ), ( - "plasma", + LayerType.PLASMA, 50, ), ] @@ -786,39 +787,39 @@ def test_sum_up_to_plasma_last(): def test_sum_up_to_plasma_not_present(): radial_build = [ ( - "gap", + LayerType.GAP, 10, ), ( - "layer", + LayerType.SOLID, 50, ), ( - "layer", + LayerType.SOLID, 5, ), ( - "gap", + LayerType.GAP, 50, ), ( - "gap", + LayerType.GAP, 60, ), ( - "layer", + LayerType.SOLID, 2, ), ( - "layer", + LayerType.SOLID, 2, ), ( - "layer", + LayerType.SOLID, 2, ), ( - "gap", + LayerType.GAP, 10, ), ] @@ -833,43 +834,43 @@ def test_sum_up_to_plasma_empty(): def test_sum_up_to_plasma_multiple_entries(): radial_build = [ ( - "gap", + LayerType.GAP, 10, ), ( - "layer", + LayerType.SOLID, 20, ), ( - "layer", + LayerType.SOLID, 30, ), ( - "gap", + LayerType.GAP, 40, ), ( - "plasma", + LayerType.PLASMA, 50, ), ( - "gap", + LayerType.GAP, 60, ), ( - "layer", + LayerType.SOLID, 2, ), ( - "layer", + LayerType.SOLID, 2, ), ( - "layer", + LayerType.SOLID, 2, ), ( - "gap", + LayerType.GAP, 10, ), ] @@ -879,125 +880,125 @@ def test_sum_up_to_plasma_multiple_entries(): def test_get_gap_after_plasma_not_followed_by_gap(): radial_build = [ ( - "gap", + LayerType.GAP, 10, ), ( - "layer", + LayerType.SOLID, 50, ), ( - "gap", + LayerType.GAP, 5, ), ( - "plasma", + LayerType.PLASMA, 50, ), ( - "layer", + LayerType.SOLID, 60, ), ( - "layer", + LayerType.SOLID, 2, ), ( - "layer", + LayerType.SOLID, 2, ), ( - "layer", + LayerType.SOLID, 2, ), ( - "gap", + LayerType.GAP, 10, ), ] - with pytest.raises(ValueError, match="'plasma' entry is not followed by a 'gap'"): + with pytest.raises(ValueError, match="LayerType.PLASMA entry is not followed by a 'gap'"): get_gap_after_plasma(radial_build) def test_get_gap_after_plasma_not_found(): radial_build = [ ( - "gap", + LayerType.GAP, 10, ), ( - "layer", + LayerType.SOLID, 50, ), ( - "gap", + LayerType.GAP, 5, ), ( - "layer", + LayerType.SOLID, 50, ), ( - "gap", + LayerType.GAP, 60, ), ( - "layer", + LayerType.SOLID, 2, ), ( - "layer", + LayerType.SOLID, 2, ), ( - "layer", + LayerType.SOLID, 2, ), ( - "gap", + LayerType.GAP, 10, ), ] - with pytest.raises(ValueError, match="'plasma' entry not found"): + with pytest.raises(ValueError, match="LayerType.PLASMA entry not found"): get_gap_after_plasma(radial_build) def test_sum_after_gap_following_plasma(): radial_build = [ ( - "gap", + LayerType.GAP, 10, ), ( - "layer", + LayerType.SOLID, 50, ), ( - "gap", + LayerType.GAP, 5, ), ( - "plasma", + LayerType.PLASMA, 50, ), ( - "gap", + LayerType.GAP, 60, ), ( - "layer", + LayerType.SOLID, 2, ), ( - "layer", + LayerType.SOLID, 2, ), ( - "layer", + LayerType.SOLID, 2, ), ( - "gap", + LayerType.GAP, 10, ), ] @@ -1007,41 +1008,41 @@ def test_sum_after_gap_following_plasma(): def test_sum_after_gap_following_plasma_not_found(): radial_build = [ ( - "gap", + LayerType.GAP, 10, ), ( - "layer", + LayerType.SOLID, 50, ), ( - "gap", + LayerType.GAP, 5, ), ( - "layer", + LayerType.SOLID, 50, ), ( - "gap", + LayerType.GAP, 60, ), ( - "layer", + LayerType.SOLID, 2, ), ( - "layer", + LayerType.SOLID, 2, ), ( - "layer", + LayerType.SOLID, 2, ), ( - "gap", + LayerType.GAP, 10, ), ] - with pytest.raises(ValueError, match="'plasma' entry not found"): + with pytest.raises(ValueError, match="LayerType.PLASMA entry not found"): sum_after_gap_following_plasma(radial_build) From 5e65f8313aa8d863398903cc0dc8ca1dc00ba7ef Mon Sep 17 00:00:00 2001 From: shimwell Date: Sat, 28 Sep 2024 23:14:09 +0100 Subject: [PATCH 2/8] enums --- docs/usage.rst | 316 +++++++++--------- src/paramak/workplanes/blanket_from_plasma.py | 1 - 2 files changed, 158 insertions(+), 159 deletions(-) diff --git a/docs/usage.rst b/docs/usage.rst index d0b7cd91..5575efcc 100644 --- a/docs/usage.rst +++ b/docs/usage.rst @@ -3,8 +3,8 @@ Usage There are two main reactors to choose from, Tokamak and Spherical Tokamak. These can be built with: - - A radial and vertical build - - A radial build and plasma elongation. +- A radial and vertical build +- A radial build and plasma elongation. The former gives the user more control of the size of components allowing reactor blankets to vary both radially and vertically. The later allows reactors to be built with a minimal number of parameters. @@ -56,17 +56,17 @@ Tokamak from plasma result = paramak.tokamak_from_plasma( radial_builds=[ (paramak.LayerType.GAP, 10), - (LayerType.SOLID, 30), - (LayerType.SOLID, 50), - (LayerType.SOLID, 10), - (LayerType.SOLID, 120), - (LayerType.SOLID, 20), + (paramak.LayerType.SOLID, 30), + (paramak.LayerType.SOLID, 50), + (paramak.LayerType.SOLID, 10), + (paramak.LayerType.SOLID, 120), + (paramak.LayerType.SOLID, 20), (paramak.LayerType.GAP, 60), (paramak.LayerType.PLASMA, 300), (paramak.LayerType.GAP, 60), - (LayerType.SOLID, 20), - (LayerType.SOLID, 120), - (LayerType.SOLID, 10), + (paramak.LayerType.SOLID, 20), + (paramak.LayerType.SOLID, 120), + (paramak.LayerType.SOLID, 10), ], elongation=2, triangularity=0.55, @@ -80,17 +80,17 @@ Tokamak from plasma result = paramak.tokamak_from_plasma( radial_builds=[ (paramak.LayerType.GAP, 10), - (LayerType.SOLID, 30), - (LayerType.SOLID, 50), - (LayerType.SOLID, 10), - (LayerType.SOLID, 120), - (LayerType.SOLID, 20), + (paramak.LayerType.SOLID, 30), + (paramak.LayerType.SOLID, 50), + (paramak.LayerType.SOLID, 10), + (paramak.LayerType.SOLID, 120), + (paramak.LayerType.SOLID, 20), (paramak.LayerType.GAP, 60), (paramak.LayerType.PLASMA, 300), (paramak.LayerType.GAP, 60), - (LayerType.SOLID, 20), - (LayerType.SOLID, 120), - (LayerType.SOLID, 10), + (paramak.LayerType.SOLID, 20), + (paramak.LayerType.SOLID, 120), + (paramak.LayerType.SOLID, 10), ], elongation=2, triangularity=0.55, @@ -117,14 +117,14 @@ Spherical tokamak from plasma result = paramak.spherical_tokamak_from_plasma( radial_builds=[ (paramak.LayerType.GAP, 10), - (LayerType.SOLID, 60), - (LayerType.SOLID, 20), + (paramak.LayerType.SOLID, 60), + (paramak.LayerType.SOLID, 20), (paramak.LayerType.GAP, 60), (paramak.LayerType.PLASMA, 300), (paramak.LayerType.GAP, 60), - (LayerType.SOLID, 20), - (LayerType.SOLID, 120), - (LayerType.SOLID, 10), + (paramak.LayerType.SOLID, 20), + (paramak.LayerType.SOLID, 120), + (paramak.LayerType.SOLID, 10), ], elongation=2, triangularity=0.55, @@ -138,14 +138,14 @@ Spherical tokamak from plasma result = paramak.spherical_tokamak_from_plasma( radial_builds=[ (paramak.LayerType.GAP, 10), - (LayerType.SOLID, 60), - (LayerType.SOLID, 20), + (paramak.LayerType.SOLID, 60), + (paramak.LayerType.SOLID, 20), (paramak.LayerType.GAP, 60), (paramak.LayerType.PLASMA, 300), (paramak.LayerType.GAP, 60), - (LayerType.SOLID, 20), - (LayerType.SOLID, 120), - (LayerType.SOLID, 10), + (paramak.LayerType.SOLID, 20), + (paramak.LayerType.SOLID, 120), + (paramak.LayerType.SOLID, 10), ], elongation=2, triangularity=0.55, @@ -174,28 +174,28 @@ Tokamak result = paramak.tokamak( radial_builds=[ (paramak.LayerType.GAP, 10), - (LayerType.SOLID, 30), - (LayerType.SOLID, 50), - (LayerType.SOLID, 10), - (LayerType.SOLID, 120), - (LayerType.SOLID, 20), + (paramak.LayerType.SOLID, 30), + (paramak.LayerType.SOLID, 50), + (paramak.LayerType.SOLID, 10), + (paramak.LayerType.SOLID, 120), + (paramak.LayerType.SOLID, 20), (paramak.LayerType.GAP, 60), (paramak.LayerType.PLASMA, 300), (paramak.LayerType.GAP, 60), - (LayerType.SOLID, 20), - (LayerType.SOLID, 120), - (LayerType.SOLID, 10), + (paramak.LayerType.SOLID, 20), + (paramak.LayerType.SOLID, 120), + (paramak.LayerType.SOLID, 10), ], vertical_build=[ - (LayerType.SOLID, 15), - (LayerType.SOLID, 80), - (LayerType.SOLID, 10), + (paramak.LayerType.SOLID, 15), + (paramak.LayerType.SOLID, 80), + (paramak.LayerType.SOLID, 10), (paramak.LayerType.GAP, 50), (paramak.LayerType.PLASMA, 700), (paramak.LayerType.GAP, 60), - (LayerType.SOLID, 10), - (LayerType.SOLID, 40), - (LayerType.SOLID, 15), + (paramak.LayerType.SOLID, 10), + (paramak.LayerType.SOLID, 40), + (paramak.LayerType.SOLID, 15), ], triangularity=0.55, rotation_angle=180, @@ -208,28 +208,28 @@ Tokamak result = paramak.tokamak( radial_builds=[ (paramak.LayerType.GAP, 10), - (LayerType.SOLID, 30), - (LayerType.SOLID, 50), - (LayerType.SOLID, 10), - (LayerType.SOLID, 120), - (LayerType.SOLID, 20), + (paramak.LayerType.SOLID, 30), + (paramak.LayerType.SOLID, 50), + (paramak.LayerType.SOLID, 10), + (paramak.LayerType.SOLID, 120), + (paramak.LayerType.SOLID, 20), (paramak.LayerType.GAP, 60), (paramak.LayerType.PLASMA, 300), (paramak.LayerType.GAP, 60), - (LayerType.SOLID, 20), - (LayerType.SOLID, 120), - (LayerType.SOLID, 10), + (paramak.LayerType.SOLID, 20), + (paramak.LayerType.SOLID, 120), + (paramak.LayerType.SOLID, 10), ], vertical_build=[ - (LayerType.SOLID, 15), - (LayerType.SOLID, 80), - (LayerType.SOLID, 10), + (paramak.LayerType.SOLID, 15), + (paramak.LayerType.SOLID, 80), + (paramak.LayerType.SOLID, 10), (paramak.LayerType.GAP, 50), (paramak.LayerType.PLASMA, 700), (paramak.LayerType.GAP, 60), - (LayerType.SOLID, 10), - (LayerType.SOLID, 40), - (LayerType.SOLID, 15), + (paramak.LayerType.SOLID, 10), + (paramak.LayerType.SOLID, 40), + (paramak.LayerType.SOLID, 15), ], triangularity=0.55, rotation_angle=180, @@ -259,26 +259,26 @@ Spherical tokamak radial_builds=[ [ (paramak.LayerType.GAP, 10), - (LayerType.SOLID, 50), - (LayerType.SOLID, 10), + (paramak.LayerType.SOLID, 50), + (paramak.LayerType.SOLID, 10), (paramak.LayerType.GAP, 50), (paramak.LayerType.PLASMA, 300), (paramak.LayerType.GAP, 60), - (LayerType.SOLID, 10), - (LayerType.SOLID, 60), - (LayerType.SOLID, 10), + (paramak.LayerType.SOLID, 10), + (paramak.LayerType.SOLID, 60), + (paramak.LayerType.SOLID, 10), ] ], vertical_build=[ - (LayerType.SOLID, 15), - (LayerType.SOLID, 120), - (LayerType.SOLID, 10), + (paramak.LayerType.SOLID, 15), + (paramak.LayerType.SOLID, 120), + (paramak.LayerType.SOLID, 10), (paramak.LayerType.GAP, 50), (paramak.LayerType.PLASMA, 700), (paramak.LayerType.GAP, 60), - (LayerType.SOLID, 10), - (LayerType.SOLID, 30), - (LayerType.SOLID, 15), + (paramak.LayerType.SOLID, 10), + (paramak.LayerType.SOLID, 30), + (paramak.LayerType.SOLID, 15), ], rotation_angle=180, triangularity=0.55, @@ -292,26 +292,26 @@ Spherical tokamak radial_builds=[ [ (paramak.LayerType.GAP, 10), - (LayerType.SOLID, 50), - (LayerType.SOLID, 10), + (paramak.LayerType.SOLID, 50), + (paramak.LayerType.SOLID, 10), (paramak.LayerType.GAP, 50), (paramak.LayerType.PLASMA, 300), (paramak.LayerType.GAP, 60), - (LayerType.SOLID, 10), - (LayerType.SOLID, 60), - (LayerType.SOLID, 10), + (paramak.LayerType.SOLID, 10), + (paramak.LayerType.SOLID, 60), + (paramak.LayerType.SOLID, 10), ] ], vertical_build=[ - (LayerType.SOLID, 15), - (LayerType.SOLID, 120), - (LayerType.SOLID, 10), + (paramak.LayerType.SOLID, 15), + (paramak.LayerType.SOLID, 120), + (paramak.LayerType.SOLID, 10), (paramak.LayerType.GAP, 50), (paramak.LayerType.PLASMA, 700), (paramak.LayerType.GAP, 60), - (LayerType.SOLID, 10), - (LayerType.SOLID, 30), - (LayerType.SOLID, 15), + (paramak.LayerType.SOLID, 10), + (paramak.LayerType.SOLID, 30), + (paramak.LayerType.SOLID, 15), ], rotation_angle=180, triangularity=0.55, @@ -336,14 +336,14 @@ Reactor with divertor(s) radial_builds=[ [ (paramak.LayerType.GAP, 10), - (LayerType.SOLID, 50), - (LayerType.SOLID, 15), + (paramak.LayerType.SOLID, 50), + (paramak.LayerType.SOLID, 15), (paramak.LayerType.GAP, 50), (paramak.LayerType.PLASMA, 300), (paramak.LayerType.GAP, 60), - (LayerType.SOLID, 15), - (LayerType.SOLID, 60), - (LayerType.SOLID, 10), + (paramak.LayerType.SOLID, 15), + (paramak.LayerType.SOLID, 60), + (paramak.LayerType.SOLID, 10), ], [(paramak.LayerType.GAP, 75), ("lower_divertor", 100)], # this divertor connects to the center column [(paramak.LayerType.GAP, 120), ("upper_divertor", 100)], # this divertor has some blanket between the center colum and itself @@ -360,14 +360,14 @@ Reactor with divertor(s) radial_builds=[ [ (paramak.LayerType.GAP, 10), - (LayerType.SOLID, 50), - (LayerType.SOLID, 15), + (paramak.LayerType.SOLID, 50), + (paramak.LayerType.SOLID, 15), (paramak.LayerType.GAP, 50), (paramak.LayerType.PLASMA, 300), (paramak.LayerType.GAP, 60), - (LayerType.SOLID, 15), - (LayerType.SOLID, 60), - (LayerType.SOLID, 10), + (paramak.LayerType.SOLID, 15), + (paramak.LayerType.SOLID, 60), + (paramak.LayerType.SOLID, 10), ], [(paramak.LayerType.GAP, 75), ("lower_divertor", 100)], # this divertor connects to the center column [(paramak.LayerType.GAP, 120), ("upper_divertor", 140)], # this divertor has some blanket between the center colum and itself @@ -417,14 +417,14 @@ Reactor with poloidal field coils result = paramak.spherical_tokamak_from_plasma( radial_builds=[ (paramak.LayerType.GAP, 10), - (LayerType.SOLID, 50), - (LayerType.SOLID, 15), + (paramak.LayerType.SOLID, 50), + (paramak.LayerType.SOLID, 15), (paramak.LayerType.GAP, 50), (paramak.LayerType.PLASMA, 300), (paramak.LayerType.GAP, 60), - (LayerType.SOLID, 15), - (LayerType.SOLID, 60), - (LayerType.SOLID, 10), + (paramak.LayerType.SOLID, 15), + (paramak.LayerType.SOLID, 60), + (paramak.LayerType.SOLID, 10), ], elongation=2, triangularity=0.55, @@ -460,14 +460,14 @@ Reactor with poloidal field coils result = paramak.spherical_tokamak_from_plasma( radial_builds=[ (paramak.LayerType.GAP, 10), - (LayerType.SOLID, 50), - (LayerType.SOLID, 15), + (paramak.LayerType.SOLID, 50), + (paramak.LayerType.SOLID, 15), (paramak.LayerType.GAP, 50), (paramak.LayerType.PLASMA, 300), (paramak.LayerType.GAP, 60), - (LayerType.SOLID, 15), - (LayerType.SOLID, 60), - (LayerType.SOLID, 10), + (paramak.LayerType.SOLID, 15), + (paramak.LayerType.SOLID, 60), + (paramak.LayerType.SOLID, 10), ], elongation=2, triangularity=0.55, @@ -508,14 +508,14 @@ Reactor with toroidal field coils result = paramak.spherical_tokamak_from_plasma( radial_builds=[ (paramak.LayerType.GAP, 70), - (LayerType.SOLID, 10), - (LayerType.SOLID, 10), + (paramak.LayerType.SOLID, 10), + (paramak.LayerType.SOLID, 10), (paramak.LayerType.GAP, 50), (paramak.LayerType.PLASMA, 300), (paramak.LayerType.GAP, 60), - (LayerType.SOLID, 10), - (LayerType.SOLID, 60), - (LayerType.SOLID, 10), + (paramak.LayerType.SOLID, 10), + (paramak.LayerType.SOLID, 60), + (paramak.LayerType.SOLID, 10), ], elongation=2.5, rotation_angle=180, @@ -539,14 +539,14 @@ Reactor with toroidal field coils result = paramak.spherical_tokamak_from_plasma( radial_builds=[ (paramak.LayerType.GAP, 70), - (LayerType.SOLID, 10), - (LayerType.SOLID, 10), + (paramak.LayerType.SOLID, 10), + (paramak.LayerType.SOLID, 10), (paramak.LayerType.GAP, 50), (paramak.LayerType.PLASMA, 300), (paramak.LayerType.GAP, 60), - (LayerType.SOLID, 10), - (LayerType.SOLID, 60), - (LayerType.SOLID, 10), + (paramak.LayerType.SOLID, 10), + (paramak.LayerType.SOLID, 60), + (paramak.LayerType.SOLID, 10), ], elongation=2.5, rotation_angle=180, @@ -575,28 +575,28 @@ Tokamak with negative triangularity result = paramak.tokamak( radial_builds=[ (paramak.LayerType.GAP, 10), - (LayerType.SOLID, 30), - (LayerType.SOLID, 50), - (LayerType.SOLID, 10), - (LayerType.SOLID, 120), - (LayerType.SOLID, 20), + (paramak.LayerType.SOLID, 30), + (paramak.LayerType.SOLID, 50), + (paramak.LayerType.SOLID, 10), + (paramak.LayerType.SOLID, 120), + (paramak.LayerType.SOLID, 20), (paramak.LayerType.GAP, 60), (paramak.LayerType.PLASMA, 300), (paramak.LayerType.GAP, 60), - (LayerType.SOLID, 20), - (LayerType.SOLID, 120), - (LayerType.SOLID, 10), + (paramak.LayerType.SOLID, 20), + (paramak.LayerType.SOLID, 120), + (paramak.LayerType.SOLID, 10), ], vertical_build=[ - (LayerType.SOLID, 15), - (LayerType.SOLID, 80), - (LayerType.SOLID, 10), + (paramak.LayerType.SOLID, 15), + (paramak.LayerType.SOLID, 80), + (paramak.LayerType.SOLID, 10), (paramak.LayerType.GAP, 50), (paramak.LayerType.PLASMA, 700), (paramak.LayerType.GAP, 60), - (LayerType.SOLID, 10), - (LayerType.SOLID, 40), - (LayerType.SOLID, 15), + (paramak.LayerType.SOLID, 10), + (paramak.LayerType.SOLID, 40), + (paramak.LayerType.SOLID, 15), ], triangularity=-0.55, rotation_angle=180, @@ -609,28 +609,28 @@ Tokamak with negative triangularity result = paramak.tokamak( radial_builds=[ (paramak.LayerType.GAP, 10), - (LayerType.SOLID, 30), - (LayerType.SOLID, 50), - (LayerType.SOLID, 10), - (LayerType.SOLID, 120), - (LayerType.SOLID, 20), + (paramak.LayerType.SOLID, 30), + (paramak.LayerType.SOLID, 50), + (paramak.LayerType.SOLID, 10), + (paramak.LayerType.SOLID, 120), + (paramak.LayerType.SOLID, 20), (paramak.LayerType.GAP, 60), (paramak.LayerType.PLASMA, 300), (paramak.LayerType.GAP, 60), - (LayerType.SOLID, 20), - (LayerType.SOLID, 120), - (LayerType.SOLID, 10), + (paramak.LayerType.SOLID, 20), + (paramak.LayerType.SOLID, 120), + (paramak.LayerType.SOLID, 10), ], vertical_build=[ - (LayerType.SOLID, 15), - (LayerType.SOLID, 80), - (LayerType.SOLID, 10), + (paramak.LayerType.SOLID, 15), + (paramak.LayerType.SOLID, 80), + (paramak.LayerType.SOLID, 10), (paramak.LayerType.GAP, 50), (paramak.LayerType.PLASMA, 700), (paramak.LayerType.GAP, 60), - (LayerType.SOLID, 10), - (LayerType.SOLID, 40), - (LayerType.SOLID, 15), + (paramak.LayerType.SOLID, 10), + (paramak.LayerType.SOLID, 40), + (paramak.LayerType.SOLID, 15), ], triangularity=-0.55, rotation_angle=180, @@ -659,26 +659,26 @@ Spherical tokamak with negative triangularity radial_builds=[ [ (paramak.LayerType.GAP, 10), - (LayerType.SOLID, 50), - (LayerType.SOLID, 15), + (paramak.LayerType.SOLID, 50), + (paramak.LayerType.SOLID, 15), (paramak.LayerType.GAP, 50), (paramak.LayerType.PLASMA, 300), (paramak.LayerType.GAP, 60), - (LayerType.SOLID, 40), - (LayerType.SOLID, 60), - (LayerType.SOLID, 10), + (paramak.LayerType.SOLID, 40), + (paramak.LayerType.SOLID, 60), + (paramak.LayerType.SOLID, 10), ] ], vertical_build=[ - (LayerType.SOLID, 15), - (LayerType.SOLID, 80), - (LayerType.SOLID, 10), + (paramak.LayerType.SOLID, 15), + (paramak.LayerType.SOLID, 80), + (paramak.LayerType.SOLID, 10), (paramak.LayerType.GAP, 50), (paramak.LayerType.PLASMA, 700), (paramak.LayerType.GAP, 60), - (LayerType.SOLID, 10), - (LayerType.SOLID, 40), - (LayerType.SOLID, 15), + (paramak.LayerType.SOLID, 10), + (paramak.LayerType.SOLID, 40), + (paramak.LayerType.SOLID, 15), ], rotation_angle=180, triangularity=-0.55, @@ -692,26 +692,26 @@ Spherical tokamak with negative triangularity radial_builds=[ [ (paramak.LayerType.GAP, 10), - (LayerType.SOLID, 50), - (LayerType.SOLID, 15), + (paramak.LayerType.SOLID, 50), + (paramak.LayerType.SOLID, 15), (paramak.LayerType.GAP, 50), (paramak.LayerType.PLASMA, 300), (paramak.LayerType.GAP, 60), - (LayerType.SOLID, 10), - (LayerType.SOLID, 60), - (LayerType.SOLID, 10), + (paramak.LayerType.SOLID, 10), + (paramak.LayerType.SOLID, 60), + (paramak.LayerType.SOLID, 10), ] ], vertical_build=[ - (LayerType.SOLID, 15), - (LayerType.SOLID, 80), - (LayerType.SOLID, 10), + (paramak.LayerType.SOLID, 15), + (paramak.LayerType.SOLID, 80), + (paramak.LayerType.SOLID, 10), (paramak.LayerType.GAP, 50), (paramak.LayerType.PLASMA, 700), (paramak.LayerType.GAP, 60), - (LayerType.SOLID, 10), - (LayerType.SOLID, 40), - (LayerType.SOLID, 15), + (paramak.LayerType.SOLID, 10), + (paramak.LayerType.SOLID, 40), + (paramak.LayerType.SOLID, 15), ], rotation_angle=180, triangularity=-0.55, diff --git a/src/paramak/workplanes/blanket_from_plasma.py b/src/paramak/workplanes/blanket_from_plasma.py index 71049e34..20c72361 100644 --- a/src/paramak/workplanes/blanket_from_plasma.py +++ b/src/paramak/workplanes/blanket_from_plasma.py @@ -106,7 +106,6 @@ def outer_offset(theta): # assemble points = inner_points + outer_points - print(overlapping_shape, allow_overlapping_shape) if overlapping_shape and allow_overlapping_shape is False: msg = "blanket_from_plasma: Some points with negative R coordinate have " "been ignored." warnings.warn(msg, category=UserWarning) From bef56f4266a1fcd6eca7936207fcc1b85a3daf0e Mon Sep 17 00:00:00 2001 From: shimwell Date: Sat, 28 Sep 2024 23:16:17 +0100 Subject: [PATCH 3/8] added mssing xml --- tests/cross_sections.xml | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 tests/cross_sections.xml diff --git a/tests/cross_sections.xml b/tests/cross_sections.xml new file mode 100644 index 00000000..600da014 --- /dev/null +++ b/tests/cross_sections.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file From 83f47cf6e0d0846869bdf95b0e5d576a3e24fa36 Mon Sep 17 00:00:00 2001 From: shimwell Date: Sat, 28 Sep 2024 23:33:34 +0100 Subject: [PATCH 4/8] added mssing h5 --- tests/ENDFB-7.1-NNDC_H1.h5 | Bin 0 -> 71272 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 tests/ENDFB-7.1-NNDC_H1.h5 diff --git a/tests/ENDFB-7.1-NNDC_H1.h5 b/tests/ENDFB-7.1-NNDC_H1.h5 new file mode 100644 index 0000000000000000000000000000000000000000..ff20c6ac8adce0465cc2736bcf41ad3230bb950e GIT binary patch literal 71272 zcmeEv2|Sfs_x~}E$yA0?=AkIVF{SKvNRe43l|m?zc@9Mp8iX`c8kAfYad@B9AV-~ab}Z^!53d)C^+v-Wz{-p@XJ?Y*94^VxI8@JsVk z7$06<3MWOF`IYr=1b@87voTpLnw9Q~zmTaEN)o1X*~u?#6fO!QO%n5kas9F!B%>Jf z7dV)iQHY$Z`dNsRDY@L_H(nOwC;qK8U~WdUV>H+ax0+?8#n{eR$}ra=zp?DmoR#oT zq6oIv(RM9JF(CR1!(#a;yu{y1?=_wwkpZ5p%ZL#I2r|=2j)z-_n~R@kXh@L1AA=)E zF~{Y3iSLq>FwdZ1Zz4&UFmTewfmx7^jcf_4nJmQJhna``$Le9fV*TnX8-?e0`(ZZ^ znMoBZ?9cjPjle&0wO?KM=hy!z4UF!GszK!i{Hlh^SHz<@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nk~vJCFWe`MJg&O=5LxfDYY&nAuYOkw zQW<yRotwgFHJvfM#DFvxMo*s`H34Obsx1ZF5!VPhV=pF;7sqQ2DMa!I6 z>bz<(h)|dQzBbW_XnvmbxG1uJZhR0)9WNJ&5{UNE-n|#45FN*>Z4UxMj#}&YQ29QN zKvPYL5?Dr%dKh^p9HpPUW9D8QiYliPBihptM10LD;4TECt{l(Stja)A9{O8%q4rlV z+4Gj{L@{c_fFvJ)grMSnp29C^d)hR$cx``b9CPwU;^(H40l&S#>gPxnISjvmrMvOCaXjV+&s&+|kE{ZjYNU$q@A-r)Eq zz Date: Sat, 28 Sep 2024 23:39:00 +0100 Subject: [PATCH 5/8] added missing import --- examples/spherical_tokamak_from_plasma_minimal.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/spherical_tokamak_from_plasma_minimal.py b/examples/spherical_tokamak_from_plasma_minimal.py index f5b281b7..a821a25e 100644 --- a/examples/spherical_tokamak_from_plasma_minimal.py +++ b/examples/spherical_tokamak_from_plasma_minimal.py @@ -9,14 +9,14 @@ radial_builds=[ [ (paramak.LayerType.GAP, 10), - (LayerType.SOLID, 50), - (LayerType.SOLID, 15), + (paramak.LayerType.SOLID, 50), + (paramak.LayerType.SOLID, 15), (paramak.LayerType.GAP, 50), (paramak.LayerType.PLASMA, 300), (paramak.LayerType.GAP, 60), - (LayerType.SOLID, 15), - (LayerType.SOLID, 60), - (LayerType.SOLID, 10), + (paramak.LayerType.SOLID, 15), + (paramak.LayerType.SOLID, 60), + (paramak.LayerType.SOLID, 10), ] ], elongation=2, From 40d537f811840547557ff721ef3cca92ce2e59aa Mon Sep 17 00:00:00 2001 From: shimwell Date: Sat, 28 Sep 2024 23:46:38 +0100 Subject: [PATCH 6/8] added missing import --- ...rical_tokamak_from_plasma_with_divertor.py | 10 +++---- ...cal_tokamak_from_plasma_with_pf_magnets.py | 10 +++---- ...om_plasma_with_pf_magnets_and_divertors.py | 10 +++---- ...cal_tokamak_from_plasma_with_tf_magnets.py | 10 +++---- examples/spherical_tokamak_minimal.py | 22 +++++++-------- examples/tokamak_from_plasma_minimal.py | 16 +++++------ examples/tokamak_from_plasma_with_divertor.py | 16 +++++------ examples/tokamak_minimal.py | 28 +++++++++---------- examples/tokamak_with_pf_magnets.py | 28 +++++++++---------- 9 files changed, 75 insertions(+), 75 deletions(-) diff --git a/examples/spherical_tokamak_from_plasma_with_divertor.py b/examples/spherical_tokamak_from_plasma_with_divertor.py index ce402568..94e7eb07 100644 --- a/examples/spherical_tokamak_from_plasma_with_divertor.py +++ b/examples/spherical_tokamak_from_plasma_with_divertor.py @@ -9,14 +9,14 @@ radial_builds=[ [ (paramak.LayerType.GAP, 10), - (LayerType.SOLID, 50), - (LayerType.SOLID, 15), + (paramak.LayerType.SOLID, 50), + (paramak.LayerType.SOLID, 15), (paramak.LayerType.GAP, 50), (paramak.LayerType.PLASMA, 300), (paramak.LayerType.GAP, 60), - (LayerType.SOLID, 15), - (LayerType.SOLID, 60), - (LayerType.SOLID, 10), + (paramak.LayerType.SOLID, 15), + (paramak.LayerType.SOLID, 60), + (paramak.LayerType.SOLID, 10), ], [(paramak.LayerType.GAP, 75), ("lower_divertor", 100)], # this divertor connects to the center column [(paramak.LayerType.GAP, 120), ("upper_divertor", 140)], # this divertor has some blanket between the center colum and itself diff --git a/examples/spherical_tokamak_from_plasma_with_pf_magnets.py b/examples/spherical_tokamak_from_plasma_with_pf_magnets.py index ce137a0a..f4db3c8f 100644 --- a/examples/spherical_tokamak_from_plasma_with_pf_magnets.py +++ b/examples/spherical_tokamak_from_plasma_with_pf_magnets.py @@ -27,14 +27,14 @@ my_reactor = paramak.spherical_tokamak_from_plasma( radial_builds=[ (paramak.LayerType.GAP, 10), - (LayerType.SOLID, 50), - (LayerType.SOLID, 15), + (paramak.LayerType.SOLID, 50), + (paramak.LayerType.SOLID, 15), (paramak.LayerType.GAP, 50), (paramak.LayerType.PLASMA, 300), (paramak.LayerType.GAP, 60), - (LayerType.SOLID, 15), - (LayerType.SOLID, 60), - (LayerType.SOLID, 10), + (paramak.LayerType.SOLID, 15), + (paramak.LayerType.SOLID, 60), + (paramak.LayerType.SOLID, 10), ], elongation=2, triangularity=0.55, diff --git a/examples/spherical_tokamak_from_plasma_with_pf_magnets_and_divertors.py b/examples/spherical_tokamak_from_plasma_with_pf_magnets_and_divertors.py index 5ae3fc76..4343321a 100644 --- a/examples/spherical_tokamak_from_plasma_with_pf_magnets_and_divertors.py +++ b/examples/spherical_tokamak_from_plasma_with_pf_magnets_and_divertors.py @@ -30,14 +30,14 @@ radial_builds=[ [ (paramak.LayerType.GAP, 10), - (LayerType.SOLID, 50), - (LayerType.SOLID, 15), + (paramak.LayerType.SOLID, 50), + (paramak.LayerType.SOLID, 15), (paramak.LayerType.GAP, 50), (paramak.LayerType.PLASMA, 300), (paramak.LayerType.GAP, 60), - (LayerType.SOLID, 15), - (LayerType.SOLID, 60), - (LayerType.SOLID, 10), + (paramak.LayerType.SOLID, 15), + (paramak.LayerType.SOLID, 60), + (paramak.LayerType.SOLID, 10), ], [(paramak.LayerType.GAP, 75), ("lower_divertor", 100)], ], diff --git a/examples/spherical_tokamak_from_plasma_with_tf_magnets.py b/examples/spherical_tokamak_from_plasma_with_tf_magnets.py index c716a06d..4297e6c6 100644 --- a/examples/spherical_tokamak_from_plasma_with_tf_magnets.py +++ b/examples/spherical_tokamak_from_plasma_with_tf_magnets.py @@ -17,14 +17,14 @@ result = paramak.spherical_tokamak_from_plasma( radial_builds=[ (paramak.LayerType.GAP, 70), - (LayerType.SOLID, 10), - (LayerType.SOLID, 10), + (paramak.LayerType.SOLID, 10), + (paramak.LayerType.SOLID, 10), (paramak.LayerType.GAP, 50), (paramak.LayerType.PLASMA, 300), (paramak.LayerType.GAP, 60), - (LayerType.SOLID, 10), - (LayerType.SOLID, 60), - (LayerType.SOLID, 10), + (paramak.LayerType.SOLID, 10), + (paramak.LayerType.SOLID, 60), + (paramak.LayerType.SOLID, 10), ], elongation=2.5, rotation_angle=180, diff --git a/examples/spherical_tokamak_minimal.py b/examples/spherical_tokamak_minimal.py index 6f8136f8..95ba4b71 100644 --- a/examples/spherical_tokamak_minimal.py +++ b/examples/spherical_tokamak_minimal.py @@ -9,26 +9,26 @@ radial_builds=[ [ (paramak.LayerType.GAP, 10), - (LayerType.SOLID, 50), - (LayerType.SOLID, 15), + (paramak.LayerType.SOLID, 50), + (paramak.LayerType.SOLID, 15), (paramak.LayerType.GAP, 50), (paramak.LayerType.PLASMA, 300), (paramak.LayerType.GAP, 60), - (LayerType.SOLID, 40), - (LayerType.SOLID, 60), - (LayerType.SOLID, 10), + (paramak.LayerType.SOLID, 40), + (paramak.LayerType.SOLID, 60), + (paramak.LayerType.SOLID, 10), ] ], vertical_build=[ - (LayerType.SOLID, 15), - (LayerType.SOLID, 80), - (LayerType.SOLID, 10), + (paramak.LayerType.SOLID, 15), + (paramak.LayerType.SOLID, 80), + (paramak.LayerType.SOLID, 10), (paramak.LayerType.GAP, 50), (paramak.LayerType.PLASMA, 700), (paramak.LayerType.GAP, 60), - (LayerType.SOLID, 10), - (LayerType.SOLID, 40), - (LayerType.SOLID, 15), + (paramak.LayerType.SOLID, 10), + (paramak.LayerType.SOLID, 40), + (paramak.LayerType.SOLID, 15), ], rotation_angle=180, triangularity=-0.55, diff --git a/examples/tokamak_from_plasma_minimal.py b/examples/tokamak_from_plasma_minimal.py index c1b0f03b..4c81c745 100644 --- a/examples/tokamak_from_plasma_minimal.py +++ b/examples/tokamak_from_plasma_minimal.py @@ -6,17 +6,17 @@ my_reactor = paramak.tokamak_from_plasma( radial_builds=[ (paramak.LayerType.GAP, 10), - (LayerType.SOLID, 30), - (LayerType.SOLID, 50), - (LayerType.SOLID, 10), - (LayerType.SOLID, 120), - (LayerType.SOLID, 20), + (paramak.LayerType.SOLID, 30), + (paramak.LayerType.SOLID, 50), + (paramak.LayerType.SOLID, 10), + (paramak.LayerType.SOLID, 120), + (paramak.LayerType.SOLID, 20), (paramak.LayerType.GAP, 60), (paramak.LayerType.PLASMA, 300), (paramak.LayerType.GAP, 60), - (LayerType.SOLID, 20), - (LayerType.SOLID, 120), - (LayerType.SOLID, 10), + (paramak.LayerType.SOLID, 20), + (paramak.LayerType.SOLID, 120), + (paramak.LayerType.SOLID, 10), ], elongation=2, triangularity=0.55, diff --git a/examples/tokamak_from_plasma_with_divertor.py b/examples/tokamak_from_plasma_with_divertor.py index 1c902047..e8ef8a80 100644 --- a/examples/tokamak_from_plasma_with_divertor.py +++ b/examples/tokamak_from_plasma_with_divertor.py @@ -7,17 +7,17 @@ radial_builds=[ [ (paramak.LayerType.GAP, 10), - (LayerType.SOLID, 30), - (LayerType.SOLID, 50), - (LayerType.SOLID, 10), - (LayerType.SOLID, 120), - (LayerType.SOLID, 20), + (paramak.LayerType.SOLID, 30), + (paramak.LayerType.SOLID, 50), + (paramak.LayerType.SOLID, 10), + (paramak.LayerType.SOLID, 120), + (paramak.LayerType.SOLID, 20), (paramak.LayerType.GAP, 60), (paramak.LayerType.PLASMA, 300), (paramak.LayerType.GAP, 60), - (LayerType.SOLID, 20), - (LayerType.SOLID, 120), - (LayerType.SOLID, 10), + (paramak.LayerType.SOLID, 20), + (paramak.LayerType.SOLID, 120), + (paramak.LayerType.SOLID, 10), ], [(paramak.LayerType.GAP, 300), ("lower_divertor", 150)], ], diff --git a/examples/tokamak_minimal.py b/examples/tokamak_minimal.py index 2b216a25..8de149d6 100644 --- a/examples/tokamak_minimal.py +++ b/examples/tokamak_minimal.py @@ -6,28 +6,28 @@ my_reactor = paramak.tokamak( radial_builds=[ (paramak.LayerType.GAP, 10), - (LayerType.SOLID, 30), - (LayerType.SOLID, 50), - (LayerType.SOLID, 10), - (LayerType.SOLID, 120), - (LayerType.SOLID, 20), + (paramak.LayerType.SOLID, 30), + (paramak.LayerType.SOLID, 50), + (paramak.LayerType.SOLID, 10), + (paramak.LayerType.SOLID, 120), + (paramak.LayerType.SOLID, 20), (paramak.LayerType.GAP, 60), (paramak.LayerType.PLASMA, 300), (paramak.LayerType.GAP, 60), - (LayerType.SOLID, 20), - (LayerType.SOLID, 120), - (LayerType.SOLID, 10), + (paramak.LayerType.SOLID, 20), + (paramak.LayerType.SOLID, 120), + (paramak.LayerType.SOLID, 10), ], vertical_build=[ - (LayerType.SOLID, 15), - (LayerType.SOLID, 80), - (LayerType.SOLID, 10), + (paramak.LayerType.SOLID, 15), + (paramak.LayerType.SOLID, 80), + (paramak.LayerType.SOLID, 10), (paramak.LayerType.GAP, 50), (paramak.LayerType.PLASMA, 700), (paramak.LayerType.GAP, 60), - (LayerType.SOLID, 10), - (LayerType.SOLID, 40), - (LayerType.SOLID, 15), + (paramak.LayerType.SOLID, 10), + (paramak.LayerType.SOLID, 40), + (paramak.LayerType.SOLID, 15), ], triangularity=0.55, rotation_angle=180, diff --git a/examples/tokamak_with_pf_magnets.py b/examples/tokamak_with_pf_magnets.py index da8dbb74..0fcb4f69 100644 --- a/examples/tokamak_with_pf_magnets.py +++ b/examples/tokamak_with_pf_magnets.py @@ -26,28 +26,28 @@ my_reactor = paramak.tokamak( radial_builds=[ (paramak.LayerType.GAP, 10), - (LayerType.SOLID, 30), - (LayerType.SOLID, 50), - (LayerType.SOLID, 10), - (LayerType.SOLID, 120), - (LayerType.SOLID, 20), + (paramak.LayerType.SOLID, 30), + (paramak.LayerType.SOLID, 50), + (paramak.LayerType.SOLID, 10), + (paramak.LayerType.SOLID, 120), + (paramak.LayerType.SOLID, 20), (paramak.LayerType.GAP, 60), (paramak.LayerType.PLASMA, 300), (paramak.LayerType.GAP, 60), - (LayerType.SOLID, 20), - (LayerType.SOLID, 120), - (LayerType.SOLID, 10), + (paramak.LayerType.SOLID, 20), + (paramak.LayerType.SOLID, 120), + (paramak.LayerType.SOLID, 10), ], vertical_build=[ - (LayerType.SOLID, 15), - (LayerType.SOLID, 80), - (LayerType.SOLID, 10), + (paramak.LayerType.SOLID, 15), + (paramak.LayerType.SOLID, 80), + (paramak.LayerType.SOLID, 10), (paramak.LayerType.GAP, 50), (paramak.LayerType.PLASMA, 700), (paramak.LayerType.GAP, 60), - (LayerType.SOLID, 10), - (LayerType.SOLID, 40), - (LayerType.SOLID, 15), + (paramak.LayerType.SOLID, 10), + (paramak.LayerType.SOLID, 40), + (paramak.LayerType.SOLID, 15), ], triangularity=0.55, rotation_angle=180, From 02db3c43d0a9b12a2ad08443c04b3b7a2753dea3 Mon Sep 17 00:00:00 2001 From: shimwell Date: Sun, 29 Sep 2024 00:10:20 +0100 Subject: [PATCH 7/8] removed vis --- examples/tokamak_minimal.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/examples/tokamak_minimal.py b/examples/tokamak_minimal.py index 8de149d6..c8c04eb6 100644 --- a/examples/tokamak_minimal.py +++ b/examples/tokamak_minimal.py @@ -33,9 +33,6 @@ rotation_angle=180, ) -from cadquery.vis import show -show(my_reactor) - my_reactor.save(f"tokamak_minimal.step") print(f"Saved as tokamak_minimal.step") From bdb6bdb82796081b12a9dc5a45b11f6bc60874fc Mon Sep 17 00:00:00 2001 From: shimwell Date: Sun, 29 Sep 2024 00:33:06 +0100 Subject: [PATCH 8/8] from plasma --- .github/workflows/ci.yml | 4 ++-- examples/tokamak_from_plasma_with_divertor.py | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8e9a9e96..3ee18f4a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -49,7 +49,7 @@ jobs: python examples/spherical_tokamak_from_plasma_with_pf_magnets.py python examples/spherical_tokamak_from_plasma_with_tf_magnets.py python examples/spherical_tokamak_minimal.py - python examples/tokamak_from_plasma_minimal.py - python examples/tokamak_minimal.py python examples/tokamak_from_plasma_with_divertor.py + python examples/tokamak_minimal.py + python examples/tokamak_from_plasma_minimal.py diff --git a/examples/tokamak_from_plasma_with_divertor.py b/examples/tokamak_from_plasma_with_divertor.py index e8ef8a80..359b2f44 100644 --- a/examples/tokamak_from_plasma_with_divertor.py +++ b/examples/tokamak_from_plasma_with_divertor.py @@ -1,9 +1,9 @@ -from cad_to_dagmc import CadToDagmc + from example_util_functions import transport_particles_on_h5m_geometry import paramak -my_reactor = paramak.tokamak( +my_reactor = paramak.tokamak_from_plasma( radial_builds=[ [ (paramak.LayerType.GAP, 10), @@ -28,6 +28,7 @@ my_reactor.save(f"tokamak_with_divertor.step") print(f"Saved as tokamak_with_divertor.step") +# from cad_to_dagmc import CadToDagmc # my_model = CadToDagmc() # material_tags = ["mat1"] * 6 # as inner and outer layers are one solid there are only 6 solids in model # my_model.add_cadquery_object(cadquery_object=my_reactor, material_tags=material_tags)