Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5ec4bde

Browse files
committed
Added option to noot write pst at build_pst(), pass version=None
1 parent 7e1cf72 commit 5ec4bde

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

pyemu/utils/pst_from.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -599,7 +599,10 @@ def build_pst(self, filename=None, update=False, version=1):
599599
rewrite. If string {'pars', 'obs'} just update respective
600600
components of Pst. Default is False - build from PstFrom
601601
components.
602-
version (`int`): control file version to write, Default is 1
602+
version (`int`): control file version to write, Default is 1.
603+
If None, option to not write pst to file at pst_build() call --
604+
handy when control file is huge pst object will be modified
605+
again before running.
603606
Note:
604607
This builds a pest control file from scratch, overwriting anything already
605608
in self.pst object and anything already writen to `filename`
@@ -817,8 +820,8 @@ def build_pst(self, filename=None, update=False, version=1):
817820

818821
pst.control_data.noptmax = 0
819822
self.pst = pst
820-
821-
self.pst.write(filename, version=version)
823+
if version is not None:
824+
self.pst.write(filename, version=version)
822825
self.write_forward_run()
823826
pst.try_parse_name_metadata()
824827
return pst

0 commit comments

Comments
 (0)