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
Allows 'append' on non-existing plot for option re-use #391
Conversation
Do we really need this? Afaict it is currently perfectly well possible to write only a single call for both plot creation and updating?
I'm not against adding the feature, but am generally a bit wary of bloat when things like this are being added. |
You can't currently pass in From elif update is not None:
assert win is not None |
Right. So perhaps the "right" change to make here would be to allow folks to append to empty plots rather than adding a separate |
Sounds fine by me. I suppose database APIs usually make a strong distinction between updating and upserting so users are immediately alerted to logic errors in their code if they try to update a non-existing record, but in the context of visdom the increase in API complexity of the distinction might not be warranted. |
Will make the change to append creating by default |
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.
@JackUrb is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
Closes #100.
People want a blankboard so that they can use the same command in every call of an evaluation loop to plot rather than needing to instantiate the graph before they can update. Existing workarounds are doing a regular plot call on the first iteration and appends for all others, or initializing the plot with a garbage value (like 0,0 on a line) and then appending from that point. Having an option that can create or append solves the issue.
This leverages
win_exists
to determine whether a particular call should be a create or append when passed the'createappend'
option. It then does the correct action. Tested for both line and scatter, and existing behavior is maintained.