SINTEF / Geomaker

4 stars 4 forks source link

Exporting causes fatal error #62

Open arildj78 opened 1 year ago

arildj78 commented 1 year ago

With MatPlotLib 3.7.0 installed

Traceback (most recent call last):
  File "C:\Users\arild\geomaker\env\Lib\site-packages\geomaker\__main__.py", line 841, in export_data
    dialog = ExporterDialog(self.poly, project)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\arild\geomaker\env\Lib\site-packages\geomaker\__main__.py", line 122, in __init__
    for category, entries in export.iter_map_categories():
  File "C:\Users\arild\geomaker\env\Lib\site-packages\geomaker\export.py", line 147, in iter_map_categories
    filtered_keys = [key for key, name in category['entries'].items() if name in colormap.cmap_d]
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\arild\geomaker\env\Lib\site-packages\geomaker\export.py", line 147, in <listcomp>
    filtered_keys = [key for key, name in category['entries'].items() if name in colormap.cmap_d]
                                                                                 ^^^^^^^^^^^^^^^
AttributeError: module 'matplotlib.cm' has no attribute 'cmap_d'

cmap_d was removed in version 3.6.0 of MatPlotLib https://matplotlib.org/stable/api/prev_api_changes/api_changes_3.6.0.html

arildj78 commented 1 year ago

These are issues and discussions that seems relevant:

https://github.com/matplotlib/matplotlib/issues/18490 https://github.com/matplotlib/matplotlib/blob/main/doc/api/next_api_changes/deprecations/24846-ES.rst https://github.com/matplotlib/matplotlib/pull/22298