Skip to content

Commit 122b277

Browse files
committed
path argument of StagyyData is now optional
It defauts to conf.core.path.
1 parent b88fb60 commit 122b277

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

stagpy/stagyydata.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -519,22 +519,28 @@ class StagyyData:
519519

520520
"""Generic lazy interface to StagYY output data."""
521521

522-
def __init__(self, path):
522+
def __init__(self, path=None):
523523
"""Initialization of instances:
524524
525525
Args:
526526
path (pathlike): path of the StagYY run. It can either be the path
527527
of the directory containing the par file, or the path of the
528528
par file. If the path given is a directory, the path of the par
529-
file is assumed to be path/par.
529+
file is assumed to be path/par. If no path is given (or None)
530+
it is set to ``conf.core.path``.
530531
531532
Attributes:
532533
steps (:class:`_Steps`): collection of time steps.
533534
snaps (:class:`_Snaps`): collection of snapshots.
534535
scales (:class:`_Scales`): dimensionful scaling factors.
535536
collected_fields (list of (int, str)): list of fields currently in
536537
memory, described by istep and field name.
538+
539+
Other Parameters:
540+
conf.core.path: the default path.
537541
"""
542+
if path is None:
543+
path = conf.core.path
538544
runpath = pathlib.Path(path)
539545
if runpath.is_file():
540546
parname = runpath.name

0 commit comments

Comments
 (0)