question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Refactor plotting to use backends and a consistent notebook experience

See original GitHub issue

🐞 Problem

The experience with 2D and 3D plots in the notebook is inconsistent, due to the inconsistencies in the rendering between matplotlib and plotly. The transition from Jupyter notebook to JupyterLab is making things more difficult, as the documentation is scattered and now the users need to install JavaScript extensions as well.

Also, OrbitPlotter and OrbitPlotter3D do not share a common parent class and API, which is also a problem since most of the functionality is shared.

Related: #315 and #316.

🎯 Goal

  1. Refactor the plotting module so it allows the user to configure a “backend”, via an environment variable or an IPython magic
  2. Unify the OrbitPlotter and OrbitPlotter3D classes, putting common functionality in a parent superclass
  3. Use Plotly for the notebook, both in 2D and 3D, and leave a matplotlib backend for those that want static, publication-quality 2D

💡 Possible solutions

📋 Steps to solve the problem

  • Comment below about what you’ve started working on.
  • Add, commit, push your changes
  • Submit a pull request and add this in comments - Addresses #<put issue number here>
  • Ask for a review in comments section of pull request
  • Celebrate your contribution to this project 🎉

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:19 (19 by maintainers)

github_iconTop GitHub Comments

1reaction
astrojuanlucommented, May 15, 2018

for the moment yes, although BaseOrbitPlotter should perhaps be private (so _BaseOrbitPlotter) and we might think of just having one class and switching the behavior using a flag, or something like that

1reaction
astrojuanlucommented, May 12, 2018

Now that OrbitPlotter2D shows nice plots, it’s time to start unifying OrbitPlotter2D and OrbitPlotter3D finding common code and putting it in a base class. I think we can take care of OrbitPlotter separately.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Adapt to Plotly 3.0 · Issue #397 · poliastro/poliastro · GitHub
Anyhow we should focus on the Figure class (we're implicitly using it in the ... Refactor plotting to use backends and a consistent...
Read more >
Refactoring some code and maybe working on a project
Going to try and refactor some code live if possible and work on any side projects------------ Patreon ...
Read more >
How should we be using matplotlib? - Data Management
We wrap any selection of a backend into a utility function that hides the matplotlib specifics from user code; We adopt the matplotlib.pyplot ......
Read more >
How to Refactor a Codebase? - Better Programming
Name patterns, design patterns, and code formatting should be consistent. At least from yourself, stick to one style. For the team, you will...
Read more >
Muhammad Hanif Mohamad Musa on LinkedIn: Refactoring a ...
Refactoring a Jupyter notebook into a maintainable pipeline: A ... the data is consistent across all the nodes, and thus all clients see...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found