diff --git a/process/data_structure/blanket_variables.py b/process/data_structure/blanket_variables.py index 0eb0f89713..05d2b9c7cf 100644 --- a/process/data_structure/blanket_variables.py +++ b/process/data_structure/blanket_variables.py @@ -17,9 +17,10 @@ """ from dataclasses import dataclass -from enum import IntEnum +from enum import IntEnum, unique +@unique class BlktModelTypes(IntEnum): """Enum for blanket model types. `i_blanket_type`""" diff --git a/process/data_structure/buildings_variables.py b/process/data_structure/buildings_variables.py index f1e99bdbdd..d123d242f2 100644 --- a/process/data_structure/buildings_variables.py +++ b/process/data_structure/buildings_variables.py @@ -1,9 +1,10 @@ """Module containing variables for the buildings models""" from dataclasses import dataclass -from enum import IntEnum +from enum import IntEnum, unique +@unique class BuildingsModel(IntEnum): """Enum for building size estimation models, controlled by `i_bldgs_size` in `BuildingsData`. diff --git a/process/data_structure/cost_variables.py b/process/data_structure/cost_variables.py index 8b140e5c0b..bc2ad7d233 100644 --- a/process/data_structure/cost_variables.py +++ b/process/data_structure/cost_variables.py @@ -1,9 +1,10 @@ """Module containing variables for the costs models""" from dataclasses import dataclass, field -from enum import IntEnum +from enum import IntEnum, unique +@unique class CostModels(IntEnum): """Enum for cost model selection""" diff --git a/process/data_structure/divertor_variables.py b/process/data_structure/divertor_variables.py index 29934185b4..443af4fb2e 100644 --- a/process/data_structure/divertor_variables.py +++ b/process/data_structure/divertor_variables.py @@ -1,9 +1,10 @@ """Module containing variables for the divertor models""" from dataclasses import dataclass -from enum import IntEnum +from enum import IntEnum, unique +@unique class DivertorHeatLoadModel(IntEnum): """Divertor heat load model enumeration, controlled' by `i_div_heat_load`""" diff --git a/process/data_structure/numerics.py b/process/data_structure/numerics.py index c45415f95b..43b0b78314 100644 --- a/process/data_structure/numerics.py +++ b/process/data_structure/numerics.py @@ -1,7 +1,7 @@ """Module containing variables for the numerics""" from dataclasses import dataclass, field -from enum import IntEnum +from enum import IntEnum, unique from types import DynamicClassAttribute import numpy as np @@ -9,6 +9,7 @@ from process.core.solver.iteration_variables import ITERATION_VARIABLES +@unique class SolverOutputCondition(IntEnum): """Enum for the possible conditions that can be returned by the solvers. This is for the `ifail` condition. @@ -40,6 +41,7 @@ class SolverOutputCondition(IntEnum): """No feasible solution or bad approximation of Hessian (in VMCON only).""" +@unique class PROCESSRunMode(IntEnum): """Enumeration of the available PROCESS run modes, which determine the behaviour of the code in various places. This is controlled by the `i_process_run_mode` variable @@ -85,6 +87,7 @@ def description(self): return self._description_ +@unique class FiguresOfMerit(IntEnum): """Enumeration of the available figures of merit (FoM) that can be used as objective functions for optimisation in PROCESS. diff --git a/process/data_structure/pfcoil_variables.py b/process/data_structure/pfcoil_variables.py index 2942b13c69..efad8f5193 100644 --- a/process/data_structure/pfcoil_variables.py +++ b/process/data_structure/pfcoil_variables.py @@ -1,11 +1,12 @@ """Module containing variables for the PF coil models""" from dataclasses import dataclass, field -from enum import IntEnum +from enum import IntEnum, unique import numpy as np +@unique class PFConductorModel(IntEnum): """Enumeration for PF conductor models. Controlled via `i_pf_conductor` diff --git a/process/data_structure/physics_variables.py b/process/data_structure/physics_variables.py index 561ebb502a..046015ac4a 100644 --- a/process/data_structure/physics_variables.py +++ b/process/data_structure/physics_variables.py @@ -6,6 +6,7 @@ import numpy as np +@unique class OutbordSOLPowerDecayLengthModel(IntEnum): """Enum for outboard scrape off layer power decay length models with descriptions.""" @@ -35,6 +36,7 @@ def __new__(cls, value: int, description: str): return obj +@unique class CurrentProfileIndexModel(IntEnum): """Enum for current profile index models.""" @@ -42,6 +44,7 @@ class CurrentProfileIndexModel(IntEnum): WESSON = 1 +@unique class PlasmaIgnitionModel(IntEnum): """Enum for plasma ignition models.""" @@ -49,6 +52,7 @@ class PlasmaIgnitionModel(IntEnum): IGNITED = 1 +@unique class DivertorNumberModels(IntEnum): """Enum for divertor number models. `i_single_null` is the index for this enum.""" @@ -56,6 +60,7 @@ class DivertorNumberModels(IntEnum): SINGLE_NULL = 1 +@unique class ConfinementMode(IntEnum): """Enum for plasma confinement mode""" @@ -377,6 +382,7 @@ def __new__(cls, value: int, full_name: str, mode: ConfinementMode = None): return obj +@unique class ConfinementRadiationLossModel(IntEnum): """Confinement radiation loss model types""" diff --git a/process/data_structure/superconducting_tf_coil_variables.py b/process/data_structure/superconducting_tf_coil_variables.py index eb551e5425..34faf78cf8 100644 --- a/process/data_structure/superconducting_tf_coil_variables.py +++ b/process/data_structure/superconducting_tf_coil_variables.py @@ -1,9 +1,10 @@ """Module containing variables for the superconducting TF coil models""" from dataclasses import dataclass -from enum import IntEnum +from enum import IntEnum, unique +@unique class TFWPIntegerTurnType(IntEnum): """TF winding pack integer turn type, controlled via the `i_tf_turns_integer` variable. diff --git a/process/data_structure/vacuum_variables.py b/process/data_structure/vacuum_variables.py index 5c5829b852..2d836987a0 100644 --- a/process/data_structure/vacuum_variables.py +++ b/process/data_structure/vacuum_variables.py @@ -1,9 +1,10 @@ """Module containing variables for the vacuum vessel models""" from dataclasses import dataclass -from enum import IntEnum +from enum import IntEnum, unique +@unique class VacuumPumpType(IntEnum): """Enum for vacuum pump types. Controlled via `i_vacuum_pump_type` in `VacuumData`.""" diff --git a/process/models/availability.py b/process/models/availability.py index a6f804476e..31ba5ec91b 100644 --- a/process/models/availability.py +++ b/process/models/availability.py @@ -2,7 +2,7 @@ import logging import math -from enum import IntEnum +from enum import IntEnum, unique from types import DynamicClassAttribute from scipy.special import comb as combinations @@ -16,6 +16,7 @@ logger = logging.getLogger(__name__) +@unique class AvailabilityModel(IntEnum): """Enum for availability models""" diff --git a/process/models/blankets/blanket_library.py b/process/models/blankets/blanket_library.py index b381985142..ec293bed12 100644 --- a/process/models/blankets/blanket_library.py +++ b/process/models/blankets/blanket_library.py @@ -1,7 +1,7 @@ """Library containing routines that can be shared by the blanket modules.""" import logging -from enum import IntEnum +from enum import IntEnum, unique import numpy as np @@ -44,6 +44,7 @@ # FCI Flow Channel Insert +@unique class FWBlktCoolantLoopTypes(IntEnum): """Enumeration for first wall and blanket coolant loop types. `i_fw_blkt_shared_coolant`. diff --git a/process/models/build.py b/process/models/build.py index d0f86fa049..d929c04f11 100644 --- a/process/models/build.py +++ b/process/models/build.py @@ -1,7 +1,7 @@ """Module containing routines for build calculations""" import logging -from enum import IntEnum +from enum import IntEnum, unique import numpy as np @@ -23,6 +23,7 @@ logger = logging.getLogger(__name__) +@unique class FwBlktVVShape(IntEnum): """Enum for first wall, blanket, and vacuum vessel shape options.""" diff --git a/process/models/engineering/pumping.py b/process/models/engineering/pumping.py index ae7f2f6131..7ee6e0e29f 100644 --- a/process/models/engineering/pumping.py +++ b/process/models/engineering/pumping.py @@ -1,12 +1,13 @@ """Engineering models for pumping system analysis.""" import logging -from enum import IntEnum +from enum import IntEnum, unique from types import DynamicClassAttribute import numpy as np +@unique class CoolantType(IntEnum): """Enum for coolant types.""" diff --git a/process/models/pfcoil.py b/process/models/pfcoil.py index 2343d3fde3..af0441a29a 100644 --- a/process/models/pfcoil.py +++ b/process/models/pfcoil.py @@ -3,7 +3,7 @@ import logging import math from dataclasses import dataclass -from enum import IntEnum +from enum import IntEnum, unique import numba import numpy as np @@ -42,6 +42,7 @@ N_CS_STRESS_PROFILE_POINTS = 20 +@unique class PFLocationTypes(IntEnum): """Enum for PF coil location types.""" diff --git a/process/models/physics/bootstrap_current.py b/process/models/physics/bootstrap_current.py index d77bcbedb0..03d1887a52 100644 --- a/process/models/physics/bootstrap_current.py +++ b/process/models/physics/bootstrap_current.py @@ -3,7 +3,7 @@ from __future__ import annotations import logging -from enum import IntEnum +from enum import IntEnum, unique from types import DynamicClassAttribute from typing import TYPE_CHECKING @@ -23,6 +23,7 @@ logger = logging.getLogger(__name__) +@unique class BootstrapCurrentFractionModel(IntEnum): """Bootstrap plasma current fraction (f_BS) model types""" diff --git a/process/models/physics/current_drive.py b/process/models/physics/current_drive.py index ca9c086e67..61c1df7ff7 100644 --- a/process/models/physics/current_drive.py +++ b/process/models/physics/current_drive.py @@ -1,7 +1,7 @@ """Module for current drive physics models and heating method types.""" import logging -from enum import IntEnum +from enum import IntEnum, unique from types import DynamicClassAttribute import numpy as np @@ -18,6 +18,7 @@ logger = logging.getLogger(__name__) +@unique class CurrentDriveMethodType(IntEnum): """Enum for heating and current drive method types""" @@ -41,6 +42,7 @@ def abbreviation(self): return self._abbreviation_ +@unique class CurrentDriveModel(IntEnum): """Heating and current drive models for use in current drive calculations""" diff --git a/process/models/physics/density_limit.py b/process/models/physics/density_limit.py index 28b330534c..3ea8c31bc0 100644 --- a/process/models/physics/density_limit.py +++ b/process/models/physics/density_limit.py @@ -6,7 +6,7 @@ """ import logging -from enum import IntEnum +from enum import IntEnum, unique from types import DynamicClassAttribute import numpy as np @@ -19,6 +19,7 @@ logger = logging.getLogger(__name__) +@unique class DensityLimitModel(IntEnum): """Electron density model types""" diff --git a/process/models/physics/l_h_transition.py b/process/models/physics/l_h_transition.py index 70c12584a8..dac95c23d3 100644 --- a/process/models/physics/l_h_transition.py +++ b/process/models/physics/l_h_transition.py @@ -1,7 +1,7 @@ """Module for plasma L-H and L-I transition power threshold calculations.""" import logging -from enum import IntEnum +from enum import IntEnum, unique from process.core import constants from process.core import process_output as po @@ -10,6 +10,7 @@ logger = logging.getLogger(__name__) +@unique class PlasmaConfinementTransitionModel(IntEnum): """Enum for plasma L -> H and L -> I transition power threshold models.""" diff --git a/process/models/physics/physics.py b/process/models/physics/physics.py index 95b6d126a8..926e0eee8f 100644 --- a/process/models/physics/physics.py +++ b/process/models/physics/physics.py @@ -4,7 +4,7 @@ import logging import math -from enum import IntEnum +from enum import IntEnum, unique from types import DynamicClassAttribute from typing import TYPE_CHECKING @@ -3665,6 +3665,7 @@ def reinke_tsep(b_plasma_toroidal_on_axis, flh, qstar, rmajor, eps, fgw, kappa, ) +@unique class BetaNormMaxModel(IntEnum): """Beta norm max (β_N_max) model types""" @@ -3688,6 +3689,7 @@ def full_name(self): return self._full_name_ +@unique class BetaComponentLimits(IntEnum): """Beta component to apply limit types""" @@ -4679,6 +4681,7 @@ def output_beta_information(self): po.oblnkl(self.outfile) +@unique class IndInternalNormModel(IntEnum): """Normalised internal inductance (lᵢ) model types""" diff --git a/process/models/physics/plasma_current.py b/process/models/physics/plasma_current.py index cc1c12da37..e7d3e5910f 100644 --- a/process/models/physics/plasma_current.py +++ b/process/models/physics/plasma_current.py @@ -6,7 +6,7 @@ """ import logging -from enum import IntEnum +from enum import IntEnum, unique from types import DynamicClassAttribute import numba as nb @@ -21,6 +21,7 @@ logger = logging.getLogger(__name__) +@unique class PlasmaCurrentModel(IntEnum): """Enumeration of plasma current scaling models available for calculations. @@ -1016,6 +1017,7 @@ def calculate_current_coefficient_fiesta( return 0.538 * (1.0 + 2.440 * eps**2.736) * kappa**2.154 * triang**0.060 +@unique class PlasmaDiamagneticCurrentModel(IntEnum): """Enum for plasma diamagnetic current method types""" diff --git a/process/models/physics/plasma_geometry.py b/process/models/physics/plasma_geometry.py index e91029c4a4..99ba1bd7d8 100644 --- a/process/models/physics/plasma_geometry.py +++ b/process/models/physics/plasma_geometry.py @@ -1,7 +1,7 @@ """Plasma geometry models and shape definitions for PROCESS.""" import logging -from enum import IntEnum +from enum import IntEnum, unique from types import DynamicClassAttribute import numpy as np @@ -14,6 +14,7 @@ logger = logging.getLogger(__name__) +@unique class PlasmaShapeModelType(IntEnum): """Enum for plasma shape model types.""" @@ -33,6 +34,7 @@ def full_name(self): return self._full_name_ +@unique class PlasmaGeometryModels(IntEnum): """Enum for plasma geometry model types.""" @@ -60,6 +62,7 @@ def description(self): return self._description_ +@unique class PlasmaGeometryModelType(IntEnum): """Enum for i_plasma_geometry plasma geometry model types.""" diff --git a/process/models/physics/profiles.py b/process/models/physics/profiles.py index 2a655789b2..53342d9abc 100644 --- a/process/models/physics/profiles.py +++ b/process/models/physics/profiles.py @@ -6,7 +6,7 @@ import logging from abc import ABC, abstractmethod -from enum import IntEnum +from enum import IntEnum, unique from types import DynamicClassAttribute import numpy as np @@ -19,6 +19,7 @@ logger = logging.getLogger(__name__) +@unique class PlasmaProfileShapeType(IntEnum): """Enum for i_plasma_pedestal method types""" @@ -112,6 +113,7 @@ def integrate_profile_y(self): ) +@unique class DensityProfilePedestalType(IntEnum): """Enum for i_nd_plasma_pedestal_separatrix types""" diff --git a/process/models/power.py b/process/models/power.py index 144b6961aa..99a3f4d296 100644 --- a/process/models/power.py +++ b/process/models/power.py @@ -2,7 +2,7 @@ import logging import math -from enum import IntEnum +from enum import IntEnum, unique import numpy as np import scipy as sp @@ -16,6 +16,7 @@ from process.models.pulse import PulseTimings +@unique class PumpingPowerModelTypes(IntEnum): """Pumping power model types for `i_p_coolant_pumping` in `fwbs_variables`""" @@ -28,6 +29,7 @@ class PumpingPowerModelTypes(IntEnum): logger = logging.getLogger(__name__) +@unique class ElectricConversionModelTypes(IntEnum): """Enum for thermal to electric power conversion model types.""" diff --git a/process/models/superconductors.py b/process/models/superconductors.py index 2590fd9b4c..da470ed75a 100644 --- a/process/models/superconductors.py +++ b/process/models/superconductors.py @@ -2,7 +2,7 @@ import logging from dataclasses import dataclass -from enum import IntEnum +from enum import IntEnum, unique from types import DynamicClassAttribute import numpy as np @@ -15,6 +15,7 @@ N_CROCO_STRANDS_TURN = 6 +@unique class SuperconductorShape(IntEnum): """Enumeration of superconductor shapes.""" @@ -24,6 +25,7 @@ class SuperconductorShape(IntEnum): "The superconductor is in the form of a flat tape with a rectangular cross-section" +@unique class SuperconductorType(IntEnum): """Enumeration of superconductor types.""" @@ -43,6 +45,7 @@ def abbreviation(self): return self._abbreviation_ +@unique class SuperconductorMaterial(IntEnum): """Enumeration of superconductor materials.""" @@ -70,6 +73,7 @@ def material_name(self): return self._material_name_ +@unique class SuperconductorModel(IntEnum): """Enumeration of superconductor models.""" diff --git a/process/models/tfcoil/base.py b/process/models/tfcoil/base.py index c253aac5b4..ce106eee3b 100644 --- a/process/models/tfcoil/base.py +++ b/process/models/tfcoil/base.py @@ -6,7 +6,7 @@ import json import logging from dataclasses import dataclass -from enum import IntEnum +from enum import IntEnum, unique from types import DynamicClassAttribute import numba @@ -28,6 +28,7 @@ logger = logging.getLogger(__name__) +@unique class TFCoilShapeModel(IntEnum): """Enumeration for TF coil shape models. 0: Auto-select @@ -41,6 +42,7 @@ class TFCoilShapeModel(IntEnum): PICTURE_FRAME = 2 +@unique class TFConductorModel(IntEnum): """Enumeration for TF conductor models. @@ -55,6 +57,7 @@ class TFConductorModel(IntEnum): HELIUM_COOLED_ALUMINIUM = 2 +@unique class TFPlasmaCaseType(IntEnum): """Enumeration for TF plasma-facing case types (i_tf_case_geom). diff --git a/process/models/tfcoil/superconducting.py b/process/models/tfcoil/superconducting.py index 56162e2469..2e0a346a55 100644 --- a/process/models/tfcoil/superconducting.py +++ b/process/models/tfcoil/superconducting.py @@ -2,7 +2,7 @@ import logging from dataclasses import dataclass -from enum import IntEnum +from enum import IntEnum, unique from types import DynamicClassAttribute import numpy as np @@ -27,6 +27,7 @@ logger = logging.getLogger(__name__) +@unique class SuperconductingTFTurnType(IntEnum): """Enum for the type of TF coil turn, which determines the superconductor properties and stress calculations. @@ -74,6 +75,7 @@ def _missing_(cls, value): ) from None +@unique class SuperconductingTFWPShapeType(IntEnum): """Enum for the type of TF coil WP shape, which determines the geometry of the winding pack and ground insulation.