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
2 changes: 1 addition & 1 deletion process/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -1532,7 +1532,7 @@ def plasma_outboard_edge_toroidal_ripple(
i_tf_sup: int,
dx_tf_wp_insulation: float,
dx_tf_wp_insertion_gap: float,
) -> float:
) -> tuple[float, float, int]:
"""
Plasma outboard toroidal field (TF) ripple calculation.

Expand Down
9 changes: 9 additions & 0 deletions process/io/mfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import json
import logging
from collections import OrderedDict
from typing import Any

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -208,6 +209,14 @@ def __init__(self, filename="MFILE.DAT"):
self.open_mfile()
self.parse_mfile()

def get_variables(self, *variables: str, scan: int = -1) -> list[Any]:
"""Get a number of variables from a single scan"""
return [self.get(v, scan=scan) for v in variables]

def get(self, variable: str, *, scan: int = -1) -> Any:
"""Get variable data from a given scan"""
return self.data[variable].get_scan(scan)

def open_mfile(self):
"""Function to open MFILE.DAT"""
with open(self.filename, encoding="utf-8") as mfile:
Expand Down
Loading