Skip to content

Commit

Permalink
[#1017] Unifying interface for loading equilibria from EQDSK and MEQ,…
Browse files Browse the repository at this point in the history
… TBF
  • Loading branch information
dvezinet committed Jan 24, 2025
1 parent cbbb139 commit 585c9f8
Show file tree
Hide file tree
Showing 3 changed files with 1,402 additions and 0 deletions.
35 changes: 35 additions & 0 deletions tofu/data/_class01_eqdsk.py
Original file line number Diff line number Diff line change
Expand Up @@ -525,6 +525,41 @@ def check_inputs(
# ########################################################


def get_load_pfe():

# -----------------
# check dependency
# -----------------

try:
from freeqdsk import geqdsk
except Exception as err:
msg = (
"loading an eqdsk file requires an optional dependency:\n"
"\t- file trying to load: {pfe}\n"
"\t- required dependency: freeqdsk"
)
err.args = (msg,)
raise err

# -----------------
# define load_pfe
# -----------------

def func(pfe):

data = geqdsk.read(pfe)
dout = {
{
katt: getattr(data, katt) for katt in dir(data)
if not k0.startswith('__')
}
}
return dout

return func


def _check_shapes(
lpfe=None,
geqdsk=None,
Expand Down
Loading

0 comments on commit 585c9f8

Please sign in to comment.