deeplycloudy / xlma-python

A future, Python-based version of xlma?
MIT License
6 stars 6 forks source link

use keyword arguments for plot_points and plot_3d_grid #28

Closed wx4stg closed 7 months ago

wx4stg commented 8 months ago

old keywords and kwargs.pop are still in the function call signature to preserve backwards compatibility.

compatibility tested by specifying the arguments as positional args, like so:

from pyxlma.plot.xlma_plot_feature import plot_points, color_by_time
from pyxlma.plot.xlma_base_plot import BlankPlot
import xarray as xr

lightning = xr.open_dataset('path/to/gridded/lma/data.nc')

lmaPlot = BlankPlot(initTime_dt, xlim=[lon_west, lon_east], ylim=[lat_south, lat_north], zlim=[alt_bottom, alt_top/1000], tlim=[initTime_dt, endOfBin_dt], title='test figure', bkgmap=True)

plot_points(lmaPlot, lightning.event_longitude.data, lightning.event_latitude.data, lightning.event_altitude.data/1000, lightning.event_time.data, 'rainbow', 3, vmin, vmax, colors, 'black', 0.15)

as well as by specifying arguments by keywords:

plot_points(lmaPlot, lightning.event_longitude.data, lightning.event_latitude.data, lightning.event_altitude.data/1000, lightning.event_time.data, plot_cmap='rainbow', plot_s=3, plot_vmin=vmin, plot_vmax=vmax, plot_c=colors, edge_color='black', edge_width=0.15)
deeplycloudy commented 7 months ago

Recommend adding a few docs to indicate the defaults where assumed, but otherwise lgtm