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

Clean up modification of dynamic recordables map in models #1007

Merged
merged 1 commit into from Aug 17, 2018

Conversation

Projects
None yet
4 participants
@hakonsbm
Contributor

hakonsbm commented Aug 16, 2018

Do changes directly to recordablesMap_, not to a temporary variable. Also reinstate constant in DynamicRecordablesMap. Fixes #996.

@clinssen

@hakonsbm : why do we not need a temporary copy for the DynamicRecordablesMap but do for the State and Parameters objects? Errors in the latter two are recoverable?

@hakonsbm

This comment has been minimized.

Show comment
Hide comment
@hakonsbm

hakonsbm Aug 16, 2018

Contributor

@clinssen Yes, if any properties in the dictionary d are wrong, it throws BadProperty without actually changing anything. Parameters and State aren't changed before we know that all properties are correct. However, it is not possible to recover from errors arising from changing the DynamicRecordablesMap.

Contributor

hakonsbm commented Aug 16, 2018

@clinssen Yes, if any properties in the dictionary d are wrong, it throws BadProperty without actually changing anything. Parameters and State aren't changed before we know that all properties are correct. However, it is not possible to recover from errors arising from changing the DynamicRecordablesMap.

@heplesser

This comment has been minimized.

Show comment
Hide comment
@heplesser

heplesser Aug 16, 2018

Contributor

To clarify: inserting into the recordables map can only fail if we run out of memory, and then preserving an old state makes no sense. Setting parameters or state, in contrast, will quite frequently raise exceptions when a user provides an illegal parameter value.

Contributor

heplesser commented Aug 16, 2018

To clarify: inserting into the recordables map can only fail if we run out of memory, and then preserving an old state makes no sense. Setting parameters or state, in contrast, will quite frequently raise exceptions when a user provides an illegal parameter value.

@clinssen

OK, makes sense!

@heplesser heplesser merged commit 67d05dc into nest:master Aug 17, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@hakonsbm hakonsbm deleted the hakonsbm:cleanup_dynamic_recordables_map_mod branch Aug 17, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment