pik-copan / pyunicorn

Unified Complex Network and Recurrence Analysis Toolbox
http://pik-potsdam.de/~donges/pyunicorn/
Other
195 stars 86 forks source link

MAINT: drop `climate.MapPlots` in favour of `climate.CartopyPlots` #203

Closed fkuehlein closed 5 months ago

fkuehlein commented 8 months ago

Look into deprecation/dropping of climate.MapPlots, as discussed in #196:

fkuehlein commented 6 months ago

Looking into this a bit I found that CartopyPlots does not feature a couple of things that MapPlots did. However, I find this legitimate for the sake of simplicity, only that I would then find it consequent to make it even simpler. Here's an idea:

MapPlots features plotting multiple datasets to a single pdf file or to multiple pdf files, or just displaying them in a window. CartopyPlots simply plots every dataset to a separate png-file. I feel like this basic plotting feature is totally sufficient, but then why even bother storing datasets in self.map_data? (note that self.map_mult_data is unused there) Why not just shortcut add_dataset() and generate_plots() and have something like:

class MapPlot:
  def __init__(self, grid, title):
    # initialise cartopy plot based on given Grid object

  def plot(self, title, data, file_name, title_on=True, labels_on=True):
    # plot given dataset on the Grid, then show and/or save to specified file

This would also resolve the question of intermediately storing datasets in lists or, for large datasets, npy-files, which was another extra feature of MapPlots. Beyond that, it might be nice to add the option to display the plot that is saved (sth like if keyword: plt.show()), and specify the file type (keeping png as default). Could also have separate plot() and savefig() methods, as in matplotlib ..

@ntfrgl, @jdonges, what do you think? @zugnachpankow, would you be up to implement such a thing?? Then we could finally substitute the apparently stale MapPlots class!

fkuehlein commented 6 months ago

update: @zugnachpankow and I plan to meet up in January to look into this together!