Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 value setter for simple logged quantities. #69
Add value setter for simple logged quantities. #69
Changes from 7 commits
567147f
28d67ea
afd9274
82facd4
1c01d3e
8895f00
5b97314
493958a
136c637
601238b
2161715
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Naming? I think
set_value
would suffice.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.
Would it make sense to move this to a place where it's importable?
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.
Sorry, somehow this fell off my radar. I am not accustomed to having logpyle PRs that I'm watching.
Yes, we could definitely move this and make it "a thing" offered by logpyle - but before we commit to doing that, I just want to point out that this is just an example of how to use the capability added by this change set - which was just the part that allows a setter function to be passed into, and then invoked from inside logging.
It would be my preference to add a class similar to this to the
logging_quantities.py
of MIRGE-Com, instead of a canned one offered by logpyle, but I defer to @inducer and @matthiasdiener about whether to offer this or similar as a logpyle construct.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.
My vote would be to offer it here... the duplication between the two examples is already a bit much for me to bear. OTOH, if you'd like to demonstrate how (not very) hard it is to make your own
LogQuantity
, then maybe I could be convinced.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 see the value in offering a base one. How about we offer a base one, and demonstrate how to make one's own one?
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.
👍
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.
(There could be a comment on the demo one that this specific thing already exists and can just be imported.)
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.
Just access it and handle the
KeyError
.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 should probably be an error.
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.
Make this a function instead.