Skip to content

Commit 71c71ba

Browse files
committed
fix root of StagyyPar when a default par is used
If the default par file was not in the same directory as the "main" par file, the produced StagyyPar instance would inherit the root of that default par file. This commit fixes this, keeping the root of the "main" par file.
1 parent 1470f70 commit 71c71ba

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

stagpy/parfile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def from_main_par(parfile: Path) -> StagyyPar:
6464
)
6565
par_dflt = StagyyPar._from_file(par_main.root / dfltfile)
6666
par_dflt._update(par_main)
67-
par_main = par_dflt
67+
par_main = StagyyPar(nml=par_dflt.nml, root=par_main.root)
6868

6969
outfile = par_main.legacy_output("_parameters.dat")
7070
if outfile.is_file():

0 commit comments

Comments
 (0)