-
Notifications
You must be signed in to change notification settings - Fork 536
Pyomo.DoE bugfixes #3574
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
base: main
Are you sure you want to change the base?
Pyomo.DoE bugfixes #3574
Conversation
Ensured square solve (e.g., fix the experiment inputs) when solving each scenario block. Added self.tee to sequential computing FIM solves.
Bug we saw this morning that was fixed but not pushed. |
@djlaky Is this ready for review by the Pyomo team? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me.
# Fix experiment inputs before solve (enforce square solve) | ||
for comp in b.experiment_inputs: | ||
comp.fix() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any model checking before this that ensures fixing b.experiment_inputs
will result in a square model?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, is there any chance that a user will have already fixed some of these inputs in which case we shouldn't unfix them?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there is not a chance of this. The understanding of Pyomo.DoE is be that all the experiment inputs (as labeled) should be fixed during initialization and free during the optimization call. If they should be fixed, the user should not include them in that suffix.
@adowling2, can you check to make sure what I said is correct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any model checking before this that ensures fixing
b.experiment_inputs
will result in a square model?
There is not.
Since the blocks are built on cloning the model from 'get_labeled_model()', the model output from this call needs to be square.
Also, is there a way to tell if the model is square using the 'res' object in line 1127? That would be the best case, then the user can get an error if their model is not square and I can write a test in the suite.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the idea of this failing gracefully if the user tries running it with a non-square model. I have less of an opinion on if the check happens here or somewhere else.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we have a custom function that inspects the build model and summarize the number of measurements, equations, parameters, inputs, etc. and estimates the degrees of freedom. I am thinking "If someone contacted me asking for help with ParmEst or Pyomo.DoE, what would I am to know about the model? I'm s there a way we can make the first debugging step to run "model_diagnostics" or similar and report the output.
Fixes # .
self.tee
to sequential compute FIM methodSummary/Motivation:
Fixing some bugs found in Pyomo.DoE over the past month.
Changes proposed in this PR:
tee
value in the compute FIM methodsLegal Acknowledgement
By contributing to this software project, I have read the contribution guide and agree to the following terms and conditions for my contribution: