Skip to content
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

Visualizers: axes passed on startup #2728

Merged

Conversation

codingS3b
Copy link
Contributor

This PR makes the API of the visualizers a bit clearer by passing the matplotlib axes on creation instead of only passing it in the visualize(ax,...) call.

So far this API kind of suggested that it is possible to switch the figures between multiple visualization calls which in fact does not happen since the self.plt_obj is still tied to the previous axes.
Now there should be no ambiguity anymore.

Please merge this before #2691 since this still makes use of the API that is currently used.

@ax3l ax3l added the component: tools scripts, python libs and CMake label Oct 15, 2018
@ax3l ax3l self-requested a review October 15, 2018 15:19
@ax3l ax3l self-assigned this Oct 15, 2018
@@ -37,6 +41,10 @@ def __init__(self, run_directory):
self.data_reader = self._create_data_reader(run_directory)
self.data = None

if ax is None:
print("Warning: No axes was given, using plt.gca() instead!")
Copy link
Member

@ax3l ax3l Oct 15, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you want to use

import warnings

warnings.warn(
    "Warning: No axes was given, using plt.gca() instead!",
    RuntimeWarning)

here?

Copy link
Member

@ax3l ax3l left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok so far, can be added in follow-up.

@ax3l ax3l merged commit 749435b into ComputationalRadiationPhysics:dev Oct 15, 2018
@ax3l ax3l added this to the 0.5.0 / 1.0.0: Next Stable milestone Oct 15, 2018
@ax3l ax3l mentioned this pull request Oct 16, 2018
21 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: tools scripts, python libs and CMake
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants