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

Refactor plot_polarisation_vectors into a Class. #74

Open
9 tasks
PinkShnack opened this issue Apr 10, 2022 · 0 comments
Open
9 tasks

Refactor plot_polarisation_vectors into a Class. #74

PinkShnack opened this issue Apr 10, 2022 · 0 comments

Comments

@PinkShnack
Copy link
Owner

Overview

The plot_polarisation_vectors function is quite useful for plotting data, but users are limited by the fact that it is a single function and has limited parameters right now. **kwargs can help with this, but it would just make each called function more confusing. It is not well designed and not extensible!

After #70 and some other examples, this has become even more apparent. Users want to be able to manipulate the plots. Some of the issue lies with matplotlib's plotting system, but most of the problems are due to the plot_polarisation_vectors design.

Solution

I will likely try to refactor plot_polarisation_vectors into a class that is more flexible and extensible, and not limited to parameters.

  • For example, it can simply have a norm attribute so that the user can set any matplotlib.colors.colors.Normalize class, which will then be used for any plotting. This is much more user friendly, as one can then play with the underlying functionality freely, rather than relying on someone having the time to add parameters to a function.
  • Most of the underlying functionality can be done this way, with clearly stated defaults.
  • It also makes things easily to test, as each attribute can be individually called and checked.

To do:

  • Deprecation warnings for plot_polarisation_vectors.
  • A new class, perhaps named PolarisationPlotter, which includes setters for setting the underlying functionality of the plotting parameters. See the norm example above.
  • Docstrings for each method
  • Tests for all methods
  • Docs examples showing extensive usecases
  • New description in README.

Acceptance Criteria

  • Python class that replaces and improves all functionality of plot_polarisation_vectors.
  • All class methods tested
  • Docs examples for users
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant