Grid2op / grid2op

Grid2Op a testbed platform to model sequential decision making in power systems.
https://grid2op.readthedocs.io/
Mozilla Public License 2.0
294 stars 117 forks source link

BasePlot - Text formatting #81

Closed roksikonja closed 4 years ago

roksikonja commented 4 years ago

Running a dummy example outputs a grid visualization with poor text formatting. After investigating the matter, I figured that the method BasePlot._get_text_unit is not formatting the float values, since the condition isinstance(number, float) or isinstance(number, np.float) is always False. This happens since my machine uses np.float32 as a default data type for floats. Thus the issue can be fixed by adding an additional clause to the condition: isinstance(number, float) or isinstance(number, np.float) or isinstance(number, np.float32). This efficiently solves the problem.

Best, RŠ

Tezirg commented 4 years ago

Hello, thank you for reporting this issue.

Starting v0.7.1 grid2op is using np.float32 for all float types. See v0.7.1 Changelog

We also have been working on improving plotting capabilities, as described in the following notebook: getting_started/7_PlottingCapabilities

We recommend you use the new module grid2op.PlotGrid.

We missed the generated documentation in the update process, that is now fixed in 0.8.2 thanks to this issue.

Please let us know if you still encounter issues, Best,