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

support for absolute parameters and absparmax(N) #378

Open
hansonmcoombs opened this issue Oct 17, 2022 · 2 comments
Open

support for absolute parameters and absparmax(N) #378

hansonmcoombs opened this issue Oct 17, 2022 · 2 comments
Labels

Comments

@hansonmcoombs
Copy link

From what I can see there is no explict support for setting parameter PARCHGLIM to 'absolute(N)'.

You can manually set the PARCHGLIM field in the parameter data as follows:

pst.parameter_data.loc[idx1, 'parchglim'] = 'absolute(1)'
pst.parameter_data.loc[idx2, 'parchglim'] = 'absolute(2)'

But it does not look like there is a way to set the absparmax(N) values in the control data or write them on line 6 of the pest control file. (e.g. absparmax(1)=0.1 absparmax(2)=0.2)

If I am mistaken, please correct me and maybe add a note somewhere in the documentation.

If I am not mistaken I would suggest implementing:

  1. an absparmax variable in control data with a default value of an implmented as an empty list [] in the dataframe (N by index +1 ) e.g. [N=1, N=2]
  2. alternativley it could be implmented as an empty dictionary and should users need to pass absolute paramter limits they simply call control_data.absparmax[1]=0.1, but this would break the pd.Dataframe object structure
  3. a sanity check that if absparmax is not empty or 'absolute' is in the parameter data, check that the right number of absparmax exist
  4. a modification to the control data.write and write_keyword methods so that the appropriate formatting is written to line 6 of the pst control file (assuming len(control_data.absparmax)!=0)

I'm happy to take a stab at implementing this, but I thought I would check that you all don't have some plan in the works already or that I missed something.

I'm not super familar with the pest control file version 2 style, so a reference to that would help me not mess up :)

@jtwhite79
Copy link
Collaborator

I'm happy for you to have a go at this! Let us know if you get stuck and we can try to help (i don't use these options so might not be very helpful....)

@hansonmcoombs
Copy link
Author

Sounds good I'll put it on my todo list... it may be a min

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