Closed gewitterblitz closed 1 year ago
This change in matplotlib api creates backward incompatibility in lmatools. For example, here is the error message I get:
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
/tmp/ipykernel_24811/1303470875.py in <module>
6 import matplotlib.pyplot as plt
7
----> 8 from lmatools.grid.grid_collection import LMAgridFileCollection
9 from lmatools.flash_stats import plot_energy_from_area_histogram, get_energy_spectrum_bins, bin_center, plot_energies
10
~/lmatools/lmatools/grid/grid_collection.py in <module>
12 from scipy.io.netcdf import NetCDFFile
13
---> 14 from lmatools.vis.multiples_nc import centers_to_edges
15
16 class LMAgridFileCollection(object):
~/lmatools/lmatools/vis/multiples_nc.py in <module>
20 from matplotlib.cm import get_cmap
21 from matplotlib.ticker import FuncFormatter
---> 22 from matplotlib.dates import mx2num, date2num, DateFormatter #mx2num, date2num, DateFormatter
23 from matplotlib.backends.backend_agg import FigureCanvasAgg
24
ImportError: cannot import name 'mx2num' from 'matplotlib.dates' (/home/sharm261/.conda/envs/cent7/2020.02-py37/vortexse_analysis/lib/python3.8/site-packages/matplotlib/dates.py)
this is fixed in #37
Thanks @wx4stg , and sorry for my slow reply @gewitterblitz. Yes, we should update it; in fact, it seems that mx2num isn't even used by the script, so it's an easy fix. Once #37 goes through we can close this.
Closing now that #37 is merged.
lmatools/lmatools/vis/multiples_nc.py
imports the mx2num function from matplotlib.datesThis function was deprecated for some time and has been removed since matplotlib release v3.4.2
Should we make the required changes in
multiples_nc.py
script?