-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Add methods to get and set late-bound constants. #12664
Conversation
Thanks @rkimball, this overall looks like a solid change. The one thing I'd like to see is the addition of some tests to make sure this works as expected. |
Thank you Josh. I added some tests. Much of this new code is already tested as it is an integral part of the normal save/load. I added tests for the new API functions. |
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.
Thanks for adding the tests, this all LGTM!
This is now merged, thanks @rkimball! |
* Add methods to read and restore late-bound constants on Executable. * Add bindings for new functions * Cleanup * Fix function name * Add tests for python API to access new load/save functions * Add another tests for python API to access new load/save functions where there are no constants
This PR adds methods to both get and set late-bound constants.
The current approach for saving and restoring a model's late-bound constants is via the either
MoveLateBoundConstantsToFile
and then this file can be reloaded to the Executable by callingLoadLateBoundConstantsFromFile
. These methods save the constants to a fileconsts
.I have a need to save and restore the constants in a pre-existing format. In order to write these I added
GetLateBoundConstants
which returns a Map of all late-bound contants. To restore the constants back to the ExecutableLoadLateBoundConstantsFromMap
was added.The PR arranges the code so that both
GetLateBoundConstants
andLoadLateBoundConstantsFromMap
are used in the existing methods to write and read late-bound constants. This means there is minimal code change, functions were mostly just rearranged to expose the two new entry points.