Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions process/core/io/in_dat/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,14 +228,13 @@ def get_constraint_equations(data):
Parameters
----------
dict:
data: Data dictionary for the IN.DAT information
data :
data:
Data dictionary for the IN.DAT information
Returns
-------
dict
:
dict of the constraint numbers and their comments
"""
constraints = {}
Expand Down
20 changes: 12 additions & 8 deletions process/core/io/mfile/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,8 @@ def to_toml(
Parameters
----------
filename:
file name
keys_to_write :
keys to select
scan :
Expand All @@ -419,12 +421,14 @@ def to_csv(
Parameters
----------
args : string, list of tuples
input filename, variable data
csv_outfile :
output_data :
(Default value = None)
filename:
file name
keys_to_write :
keys to select
scan :
scan to select
verbose :
verbosity of output
"""
columns = (
("Description", "Varname", "Value") if verbose else ("Varname", "Value")
Expand Down Expand Up @@ -555,8 +559,8 @@ def search_des(dictionary, description):
----------
dictionary :
dictionary to search in
variable :
variable name to search for
description :
variable description to search for
Returns
-------
Expand Down
12 changes: 10 additions & 2 deletions process/core/io/mfile/comparison.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,8 +290,16 @@ def compare_mfiles(
Parameters
----------
arg :
List of arguments
files:
file paths
comparison:
comparison type
acc:
percentage tolerance
save:
save flag
verbose:
verbosity flag
"""
print_counter = 0
n = 2
Expand Down
7 changes: 1 addition & 6 deletions process/core/io/plot/summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -4423,11 +4423,10 @@ def read_imprad_data(_skiprows, data_path):

Parameters
----------
skiprows :
_skiprows :
number of rows to skip when reading impurity data files
data_path :
path to impurity data
_skiprows :

"""
label = [
Expand Down Expand Up @@ -9902,8 +9901,6 @@ def plot_cs_coil_structure(
MFILE
scan :
scan number to use
demo_ranges :
whether to use demo ranges for the plot
colour_scheme :
colour scheme to use for the plot (Default value = 1)

Expand Down Expand Up @@ -15309,8 +15306,6 @@ def main_plot(

Parameters
----------
figs :
figure object to add plot to
m_file :
MFILE
scan :
Expand Down
14 changes: 10 additions & 4 deletions process/core/io/vary_run/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,24 @@
A selection of functions for using the PROCESS code
"""

from __future__ import annotations

import logging
import re
import sys
from pathlib import Path
from typing import TYPE_CHECKING

from process.core.input import INPUT_VARIABLES
from process.core.io.data_structure_dicts import get_dicts
from process.core.io.in_dat import InDat
from process.core.io.mfile import MFile
from process.core.model import DataStructure
from process.core.solver.iteration_variables import ITERATION_VARIABLES

if TYPE_CHECKING:
from process.core.io.vary_run import RunProcessConfig
from process.core.model import DataStructure

logger = logging.getLogger(__name__)


Expand Down Expand Up @@ -253,7 +259,7 @@ def no_unfeasible_mfile(wdir=".", mfile="MFILE.DAT"):
return 100000


def vary_iteration_variables(itervars, lbs, ubs, config):
def vary_iteration_variables(itervars, lbs, ubs, config: RunProcessConfig):
"""Routine to change the iteration variables in the initial IN.DAT
within given bounds.
Expand All @@ -265,8 +271,8 @@ def vary_iteration_variables(itervars, lbs, ubs, config):
float list of lower bounds for variables
ubs :
float list of upper bounds for variables
generator :
Generator numpy generator to create random numbers
config :
vary run configuration
"""
in_dat = InDat(config.initial_infile)

Expand Down
2 changes: 1 addition & 1 deletion process/core/solver/objectives.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def objective_function(minmax: int, data: DataStructure) -> float:
Parameters
----------
minimax : int
minmax : int
the ID and sign of the figure of merit to evaluate.
A negative value indicates maximisation.
A positive value indicates minimisation.
Expand Down
4 changes: 2 additions & 2 deletions process/models/blankets/blanket_library.py
Original file line number Diff line number Diff line change
Expand Up @@ -2851,7 +2851,7 @@ def total_pressure_drop(
Whether to write output to file.
icoolpump : int
Switch for coolant type (1=primary He/H2O, 2=secondary PbLi/Li).
flow_velocity : float
vel_coolant : float
Coolant flow velocity (m/s).
len_pipe : float
Total flow length along pipe (m).
Expand Down Expand Up @@ -3379,7 +3379,7 @@ def coolant_pumping_power(
Pump outlet temperature (K).
temp_coolant_pump_inlet : float
Pump inlet temperature (K).
pressure : float
pres_coolant_pump_inlet : float
Outlet (pump inlet) coolant pressure (Pa).
dpres_coolant : float
Coolant pressure drop (Pa).
Expand Down
2 changes: 1 addition & 1 deletion process/models/geometry/shield.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ def shield_geometry_double_null(
Parameters
----------
cumulative_lowe:
cumulative_lower:
cumulative vertical thicknesses of components below the midplane
radx_far:
outboard radius of outer surface of shield
Expand Down
58 changes: 12 additions & 46 deletions process/models/tfcoil/superconducting.py
Original file line number Diff line number Diff line change
Expand Up @@ -4399,65 +4399,31 @@ def tf_croco_averaged_turn_geometry(
Parameters
----------
j_tf_wp : float
j_tf_wp:
Current density in the TF winding pack (in A/m²).
dx_tf_turn_steel : float
dx_tf_turn_steel:
Thickness of the steel layer in the TF turn (in meters).
dx_tf_turn_insulation : float
dx_tf_turn_insulation:
Thickness of the insulation layer in the TF turn (in meters).
i_tf_sc_mat : int
Identifier for the superconducting material type.
dx_tf_turn_general : float
dx_tf_turn_general :
General dimension of the TF turn (in meters).
c_tf_turn : float
c_tf_turn:
Current per turn in the TF coil (in Amperes).
i_dx_tf_turn_general_input : bool
i_dx_tf_turn_general_input:
Flag indicating if the general turn dimension is provided as input.
i_dx_tf_turn_cable_space_general_input : bool
i_dx_tf_turn_cable_space_general_input:
Flag indicating if the cable space dimension is provided as input.
dx_tf_turn_cable_space_general : float
dx_tf_turn_cable_space_general:
General dimension of the cable space in the TF turn (in meters).
layer_ins : float
layer_ins:
Thickness of the insulation layer in the TF turn (in meters).
a_tf_wp_no_insulation : float
a_tf_wp_no_insulation:
Area of the TF winding pack without insulation (in square meters).
dia_tf_turn_coolant_channel : float
Diameter of the coolant channel in the TF turn (in meters).
f_a_tf_turn_cable_space_extra_void : float
Fraction of extra void space in the cable space of the TF turn.
Returns
-------
CROCOAveragedTurnGeometry
A dataclass containing the calculated geometry of the TF turn, including:
- a_tf_turn: Area of the TF turn (in square meters).
- dx_tf_turn: Dimension of the TF turn (in meters).
- dr_tf_turn: Dimension of the TF turn (in meters).
- t_conductor: Thickness of the conductor in the TF turn (in meters).
- n_tf_coil_turns: Number of turns in the TF coil (not necessarily
an integer).
- a_tf_turn_insulation: Area of the insulation in the TF turn
(in square meters).
- a_tf_turn_cable_space_no_void: Area of the cable space in the TF turn
without voids (in square meters).
- a_tf_turn_steel: Area of the steel in the TF turn (in square meters).
- a_tf_turn_cable_space_effective: Effective area of the cable space in the
TF turn after accounting for cooling channels and voids (in square meters).
- f_a_tf_turn_cable_space_cooling: Fraction of the cable space used for
cooling.
:
A dataclass containing the calculated geometry of the TF turn
"""
# Turn dimension is a an input
if i_dx_tf_turn_general_input:
Expand Down
3 changes: 1 addition & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ dependencies = ["pre-commit", "ruff", "ty"]

[tool.hatch.envs.lint.scripts]
fmt = ["pre-commit run --all-files --hook-stage manual {args:}"]
fmt_extra = ["ruff check --select=E501,C901,PLR0904,PLR0911,PLR0912,PLR0913,PLR0914,PLR0915,PLR0916,PLR0917,PLR1702,D100,D101,D102,D103,DOC501,D404,DOC102,D104,D105,PLC1901,S307 {args:.}"]
fmt_extra = ["ruff check --select=E501,C901,PLR0904,PLR0911,PLR0912,PLR0913,PLR0914,PLR0915,PLR0916,PLR0917,PLR1702,D100,D101,D102,D103,DOC501,D404,D104,D105,PLC1901,S307 {args:.}"]

[tool.coverage.report]
exclude_lines = ["no cov", "if __name__ == .__main__.:", "if TYPE_CHECKING:"]
Expand Down Expand Up @@ -254,7 +254,6 @@ ignore = [
"D103",
"DOC501", # docstring-missing-exception
"D404", # docstring-starts-with-this
"DOC102", # docstring-extraneous-parameter
"D104", # undocumented-public-package
"D105", # undocumented-magic-method
"PLC1901", # compare-to-empty-string
Expand Down
Loading