Skip to content

use keyword arguments for plot_points and plot_3d_grid#28

Merged
deeplycloudy merged 6 commits intodeeplycloudy:masterfrom
wx4stg:plotpointskw
Nov 20, 2023
Merged

use keyword arguments for plot_points and plot_3d_grid#28
deeplycloudy merged 6 commits intodeeplycloudy:masterfrom
wx4stg:plotpointskw

Conversation

@wx4stg
Copy link
Copy Markdown
Contributor

@wx4stg wx4stg commented Oct 24, 2023

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
Copy link
Copy Markdown
Owner

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

@deeplycloudy deeplycloudy merged commit 2013d0a into deeplycloudy:master Nov 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants