def __init__(self, path, nfields_max=<NUM_LIT:50>):
runpath = pathlib.Path(path)<EOL>if runpath.is_file():<EOL><INDENT>parname = runpath.name<EOL>runpath = runpath.parent<EOL><DEDENT>else:<EOL><INDENT>parname = '<STR_LIT>'<EOL><DEDENT>self._rundir = {'<STR_LIT:path>': runpath,<EOL>'<STR_LIT>': parname,<EOL>'<STR_LIT>': UNDETERMINED,<EOL>'<STR_LIT>': UNDETERMINED}<EOL>self._stagdat = {'<STR_LIT>': parfile.readpar(self.parpath, self.path),<EOL>'<STR_LIT>': UNDETERMINED,<EOL>'<STR_LIT>': UNDETERMINED}<EOL>self.scales = _Scales(self)<EOL>self.steps = _Steps(self)<EOL>self.snaps = _Snaps(self)<EOL>self.nfields_max = nfields_max<EOL>self.collected_fields = []<EOL>
Initialization of instances:

        Args:
            path (pathlike): path of the StagYY run. It can either be the path
                of the directory containing the par file, or the path of the
                par file. If the path given is a directory, the path of the par
                file is assumed to be path/par.
            nfields_max (int): the maximum number of scalar fields that should
                be kept in memory. Set to a value smaller than 6 if you want no
                limit.

        Attributes:
            steps (:class:`_Steps`): collection of time steps.
            snaps (:class:`_Snaps`): collection of snapshots.
            scales (:class:`_Scales`): dimensionful scaling factors.
            nfields_max (int): the maximum number of scalar fields that should
                be kept in memory. Set to a value smaller than 6 if you want no
                limit.
            collected_fields (list of (int, str)): list of fields currently in
                memory, described by istep and field name.