Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modify control data in pst from create from PstFrom object #401

Open
RyanConway91 opened this issue Jan 21, 2023 · 2 comments
Open

Modify control data in pst from create from PstFrom object #401

RyanConway91 opened this issue Jan 21, 2023 · 2 comments
Labels

Comments

@RyanConway91
Copy link

I want to add stuff to my control_data section. However, when I try the code below:

pst = pf.build_pst()
#add stuff to pass pestchek
d = {pst.control_data.numcom:1}
for k,v in d.items():
    k = v
pst.write(pst_dir+"\\freyberg_mf6_cln.pst")

The new pst file does not have the added "numcom" parameter

@jtwhite79
Copy link
Collaborator

the ControlData class overrides the setters and getters to 0) keep us from having to set all those gory little options as attributes and ii) so that we can type check when someone tries to change one (so you cant pass an str for noptmax, etc). What this means is that you have to assign the values for the control data options by name directly (you cant get a reference to them like in your code because the ControlData instance doesnt have an explicit numcom attribute):

pst.control_data.numcom = 2

@RyanConway91
Copy link
Author

pst.control_data.numcom = 1 does not make it through to the printed .pst. Seems like this might be the same as issue 379?
#379
Manually adding a few things got the .pst past pestchek, so all good! Thanks

@briochh briochh added the pst label Aug 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants