-
Notifications
You must be signed in to change notification settings - Fork 5
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 residual plot overloading the -
operator
#275
Conversation
Sorry for the late reply. This got lost in my feed somehow. I don't think using the This solution optimises completely for modularity but, as you said, it's expensive because of the temporary plots. Would it be acceptable to modify the input plot by adding a line to it? This would give more or less the same performance as a dedicated function as first described in #201 but would also be modular. (In this case, |
This isn't technically modifying the original plot, it makes a new plot and copies the data over from the old plots, which should still be displayable in their original form.
Maybe this isn't so expensive anymore after #290 ? |
True. But it does compute new data which the other operators don't do.
Do you have benchmarks? |
Nothing beyond what I mention in the PR message:
|
main_fig: | ||
The main figure. | ||
reference: | ||
The reference figure. |
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.
Missed this earlier, but wouldn't it make more sense to accept a data array instead of a figure? Why would you require the user to plot the reference data first?
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.
Yes, I'm starting to think that the whole approach using operators is a bad idea. I also ran into problems if, for example, the user made a figure where they changed the line style or the line color. Then I had to make sure that was copied over.
I think we need to go back to some of the suggestions in #201 and use a dedicated function, and drop the operators.
ref_node = next(iter(reference.graph_nodes.values())) | ||
data = ref_node() | ||
if not data.name: | ||
data.name = "reference" |
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 modifies the input, right? Seems like you should make a copy of reference
first.
Note that this was just to try things out.
Decision on whether we should implement it this way has not yet been made.
Fixes #201