Skip to content

Commit

Permalink
allow kwargs in from_input_file
Browse files Browse the repository at this point in the history
  • Loading branch information
dpanici committed Aug 27, 2024
1 parent f9469d2 commit 71eeefd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion desc/geometry/curve.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,13 +203,16 @@ def Z_n(self, new):
)

@classmethod
def from_input_file(cls, path):
def from_input_file(cls, path, **kwargs):
"""Create a axis curve from Fourier coefficients in a DESC or VMEC input file.
Parameters
----------
path : Path-like or str
Path to DESC or VMEC input file.
**kwargs : dict, optional
keyword arguments to pass to the constructor of the
FourierRZCurve being created.
Returns
-------
Expand All @@ -227,6 +230,7 @@ def from_input_file(cls, path):
inputs["axis"][:, 0].astype(int),
inputs["NFP"],
inputs["sym"],
**kwargs,
)
return curve

Expand Down
6 changes: 5 additions & 1 deletion desc/geometry/surface.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,13 +298,16 @@ def set_coeffs(self, m, n=0, R=None, Z=None):
self.Z_lmn = put(self.Z_lmn, idxZ, ZZ)

@classmethod
def from_input_file(cls, path):
def from_input_file(cls, path, **kwargs):
"""Create a surface from Fourier coefficients in a DESC or VMEC input file.
Parameters
----------
path : Path-like or str
Path to DESC or VMEC input file.
**kwargs : dict, optional
keyword arguments to pass to the constructor of the
FourierRZToroidalSurface being created.
Returns
-------
Expand All @@ -328,6 +331,7 @@ def from_input_file(cls, path):
inputs["surface"][:, 1:3].astype(int),
inputs["NFP"],
inputs["sym"],
**kwargs,
)
return surf

Expand Down

0 comments on commit 71eeefd

Please sign in to comment.