Skip to content

Conversation

@dcherian
Copy link
Contributor

@dcherian dcherian commented Jun 19, 2020

This adds _plot_decorator that is used to set default kwargs when appropriate CF attributes are set.

Right now it only looks for positive="down" and sets xincrease, yincrease appropriately.

This only works when x and y are explicitly specified. To work when x=None or y=None we'll have to do our own autoguessing. This could be useful the y-axis is Z or Y (priority order) and xaxis is T, X (priority order). Will leave that for later.

dcherian added 2 commits June 19, 2020 14:20
This allows us to set default plotting kwargs.
1. xincrease, yincrease deepending on .attrs["positive"]
def wrapper(*args, **kwargs):
arguments = accessor._process_signature(func, args, kwargs, key_mappers)
result = func(**arguments)
final_func = extra_decorator(func) if extra_decorator else func
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the only design I could think of but it seems a little complicated.

@dcherian dcherian mentioned this pull request Jun 19, 2020
5 tasks
@dcherian dcherian merged commit 34384de into xarray-contrib:master Jun 19, 2020
@dcherian dcherian deleted the default-plot branch June 20, 2020 02:56
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.

1 participant