alfonso-ferrone / ERUO

Enhancement and Reconstruction of the spectrUm for the MRR-PRRO
GNU General Public License v3.0
9 stars 2 forks source link

Matplotlib usage depricated #1

Open swnesbitt opened 8 months ago

swnesbitt commented 8 months ago

Following #https://github.com/librosa/librosa/issues/1266, ERUO as currently implemented requires matplotlib <=3.3


1/9: /Users/snesbitt/data/mrr_neiu/202401/20240112/1705050198740271804-20240112_080000.nc
Traceback (most recent call last):
  File "/Users/snesbitt/python/ERUO/ERUO/01_preprocess_dataset.py", line 285, in <module>
    main()
  File "/Users/snesbitt/python/ERUO/ERUO/01_preprocess_dataset.py", line 208, in main
    alternative_interf_mask = preprocessing.interference_mask_and_border_correction(\
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/snesbitt/python/ERUO/ERUO/algo/preprocessing.py", line 341, in interference_mask_and_border_correction
    ax2.set_yscale('symlog', linthreshy=0.1)
  File "/Users/snesbitt/mambaforge/envs/py3/lib/python3.11/site-packages/matplotlib/axes/_base.py", line 74, in wrapper
    return get_method(self)(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/snesbitt/mambaforge/envs/py3/lib/python3.11/site-packages/matplotlib/axis.py", line 810, in _set_axes_scale
    ax._axis_map[name]._set_scale(value, **kwargs)
  File "/Users/snesbitt/mambaforge/envs/py3/lib/python3.11/site-packages/matplotlib/axis.py", line 767, in _set_scale
    self._scale = mscale.scale_factory(value, self, **kwargs)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/snesbitt/mambaforge/envs/py3/lib/python3.11/site-packages/matplotlib/scale.py", line 714, in scale_factory
    return scale_cls(axis, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: SymmetricalLogScale.__init__() got an unexpected keyword argument 'linthreshy'
alfonso-ferrone commented 8 months ago

Thank you for noticing the issue with the plots in the "01_preprocess_dataset.py" file. I have replaced the keyword "linthreshy" with "linthresh", which is the one used in matplotlib 3.8 (https://matplotlib.org/stable/api/scale_api.html#matplotlib.scale.SymmetricalLogScale).

I have tested it on the example files and it seems to run correctly, and the corrected version should be now available in the repository.

In case the issue persists, don't hesitate to write again and I will look into it more carefully.