Move plotting to a separate file and plotting object
Move the plotting functions to a separate file. I think for the time being we can have them a single functions, or in a single MAPIESPlotting object. Then in the future we can think of maybe how to incorporate Guillaume's suggestion of an xarray style plotting functionality.
# In the "plotting" module:
from types import SimpleNamespace
def plot_timeseries(mapies_obj, *args, **kwargs):
raise NotImplementedError
def plot_monthly_map(mapies_obj, *args, **kwargs):
raise NotImplementedError
# In the main module:
from functools import partial
class MyClass:
def __init__(self):
pass
@property
def plot(self):
return SimpleNamespace(
timeseries = partial(plot_timeseries, mapies_obj=self),
monthly_map = partial(plot_monthly_map, mapies_obj=self)
)
Then to make a plot of your mapies object you would use my_mapies_object.plot.timeseries(x=..., y=...) (edited)
FYI: @cgile