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
bugfix to rebuild_platypus_population #276
Conversation
decision variables are now properly encoded using the underlying platypus datatypes
Looks good. Two remarks:
|
|
I rechecked the code. There is no need for a check because problem.types and problem.parameter_names will always match. the bigger issue might be a mismatch between problem.parameter_names and what is in the row. This would entail a try-catch around the |
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.
Looks good, I added two suggestions to make the error messages more informative.
Co-authored-by: Ewout ter Hoeven <E.M.terHoeven@student.tudelft.nl>
Co-authored-by: Ewout ter Hoeven <E.M.terHoeven@student.tudelft.nl>
for more information, see https://pre-commit.ci
* bugfix to rebuild_platypus_population decision variables are now properly encoded using the underlying platypus datatypes * some additional exceptions are now raised * Update ema_workbench/em_framework/optimization.py Co-authored-by: Ewout ter Hoeven <E.M.terHoeven@student.tudelft.nl> * Update ema_workbench/em_framework/optimization.py Co-authored-by: Ewout ter Hoeven <E.M.terHoeven@student.tudelft.nl> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: Ewout ter Hoeven <E.M.terHoeven@student.tudelft.nl> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
The current implementation of
rebuild_platypus_population
did not properly encode the decision variables. This means that a roundtrip via to_dataframe, rebuild_platypus_population, to_dataframe does not work for non-real parameters. This fixes that by properly encoding all decision variables.