-
Notifications
You must be signed in to change notification settings - Fork 24
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
Update plotting capabilities and dataset restructure #178
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #178 +/- ##
===========================================
+ Coverage 94.29% 95.13% +0.83%
===========================================
Files 33 36 +3
Lines 1753 1994 +241
===========================================
+ Hits 1653 1897 +244
+ Misses 100 97 -3 ☔ View full report in Codecov by Sentry. |
Hi Nicola, Thanks for the addition! Unfortunately I'm a bit stuck as I'm not sure how to proceed with the current state of the diffs. I don't think we'll be able to catch differences in the base vs. head due to the full file deltas. I'm not keen on manually diffing them, maybe we can remove the filename changes and add them after the PR is approved. Could you also include details of the codebase changes in the top PR comment? It would both help me and give us a bread trail for changes to these files. |
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.
Excellent – thanks @NicolaCourtier! Glad to get this one finished, I've added a few suggestions for you to consider. Happy for this to be merged once you are happy.
As discussed, it would be good to have a normal merge on this to distiguish between the three PR's for debugging in the future.
|
||
|
||
def plot2d( | ||
cost_or_optim, gradient=False, bounds=None, steps=10, show=True, **layout_kwargs |
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.
Something like this could be a bit more clear. Could be helpful with generality in the future as well.
cost_or_optim, gradient=False, bounds=None, steps=10, show=True, **layout_kwargs | |
plot_object, gradient=False, bounds=None, steps=10, show=True, **layout_kwargs |
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.
Let's update this when we allow for more general inputs in the future.
|
||
Parameters | ||
---------- | ||
cost_or_optim : a callable cost function, pybop Cost or Optimisation object |
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.
cost_or_optim : a callable cost function, pybop Cost or Optimisation object | |
plot_object : a callable object that returns a scalar value. Example: pybop.cost or pybop.optimisation |
""" | ||
|
||
# Assign input as a cost or optimisation object | ||
if isinstance(cost_or_optim, pybop.Optimisation): |
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.
if isinstance(cost_or_optim, pybop.Optimisation): | |
if isinstance(plot_object, pybop.Optimisation): |
|
||
# Assign input as a cost or optimisation object | ||
if isinstance(cost_or_optim, pybop.Optimisation): | ||
optim = cost_or_optim |
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.
optim = cost_or_optim | |
optim = plot_object |
plot_optim = True | ||
cost = optim.cost | ||
else: | ||
cost = cost_or_optim |
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.
cost = cost_or_optim | |
cost = plot_object |
Co-authored-by: Brady Planden <55357039+BradyPlanden@users.noreply.github.com>
xaxis_title