mesa icon indicating copy to clipboard operation
mesa copied to clipboard

Adding Pyplot visualization

Open vineetvermait opened this issue 2 years ago • 14 comments

This visualization allows the developer to add any pyplot visualization. removes all dependencies on the js components

vineetvermait avatar Jan 21 '22 05:01 vineetvermait

This looks awsome! Could you add a few example screenshots?

EwoutH avatar Jan 22 '22 09:01 EwoutH

Updated the code, Added Documentation

vineetvermait avatar Jan 24 '22 03:01 vineetvermait

Codecov Report

Merging #1139 (c9e2694) into main (4a79705) will increase coverage by 0.18%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1139      +/-   ##
==========================================
+ Coverage   89.30%   89.48%   +0.18%     
==========================================
  Files          19       20       +1     
  Lines        1253     1294      +41     
  Branches      256      255       -1     
==========================================
+ Hits         1119     1158      +39     
- Misses         98      100       +2     
  Partials       36       36              
Impacted Files Coverage Δ
mesa/visualization/modules/PyPlotVisualization.py 100.00% <100.00%> (ø)
mesa/visualization/modules/__init__.py 100.00% <100.00%> (ø)
mesa/space.py 94.91% <0.00%> (-1.00%) :arrow_down:
mesa/batchrunner.py 92.28% <0.00%> (+0.72%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 4a79705...c9e2694. Read the comment docs.

codecov[bot] avatar Jan 24 '22 13:01 codecov[bot]

Fixed

vineetvermait avatar Jan 27 '22 06:01 vineetvermait

The CI fails because matplotlib is not installed. TODO:

  • inside PyPlotVisualization.py, do a try import matplotlib. If this fail raises an error and say that the optional dependency matplotlib is missing
  • in setup.py, in extras_require, in dev, add matplotlib.

rht avatar Jan 28 '22 00:01 rht

If the 3 TODOs are addressed, then this LGTM.

rht avatar Jan 28 '22 01:01 rht

The CI fails because matplotlib is not installed. TODO:

  • inside PyPlotVisualization.py, do a try import matplotlib. If this fail raises an error and say that the optional dependency matplotlib is missing
  • in setup.py, in extras_require, in dev, add matplotlib.

Not yet addressed.

rht avatar Jan 30 '22 07:01 rht

Resolved issues

vineetvermait avatar Jan 30 '22 14:01 vineetvermait

inside PyPlotVisualization.py, do a try import matplotlib. If this fail raises an error and say that the optional dependency matplotlib is missing

Not yet addressed.

Also the new const comments not yet addressed.

rht avatar Jan 30 '22 16:01 rht

Anything pending??

vineetvermait avatar Feb 01 '22 09:02 vineetvermait

  • There is one issue with the import matplotlib still not yet resolved
  • You need to squash your commits into 1 commit

rht avatar Feb 01 '22 14:02 rht

Here is an example UX in Pandas. I was trying to use the string[pyarrow] feature, which depends on an optional dependency of PyArrow. I got this error message:

ImportError: pyarrow>=1.0.0 is required for PyArrow backed StringArray.

We could use this concise error message instead of the long one I suggested.

rht avatar Feb 05 '22 07:02 rht

@vineetvermait are you still availabe for the remaining small points? If not would you mind me finishing the PR for you so we can get this merged?

Corvince avatar May 14 '22 19:05 Corvince

It has been 2 days. @Corvince you should just go for it.

rht avatar May 17 '22 06:05 rht

Bump.

rht avatar Oct 13 '22 11:10 rht

Thanks for the bump, I totally forgot about this!

Corvince avatar Oct 13 '22 18:10 Corvince

Closing, because I think the next-gent frontend for Mesa should be based on Streamlit/Panel/ipywidgets. This would result in simpler code (plus for maintainability), and that it is easier to be customized by the user. Followup discussion on https://github.com/projectmesa/mesa/discussions/1622.

rht avatar May 11 '23 06:05 rht