Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

var_names not needed when DataArrays are passed #16

Open
max-sixty opened this issue Feb 2, 2023 · 2 comments
Open

var_names not needed when DataArrays are passed #16

max-sixty opened this issue Feb 2, 2023 · 2 comments

Comments

@max-sixty
Copy link

max-sixty commented Feb 2, 2023

@dcherian pointed me towards this library in pydata/xarray#7498, it looks awesome!

Very small point — when I have something like the linked example, but add a cast to a DataArray in the func:

def generate_timeseries(x, y):
    return xr.DataArray(np.random.normal(loc=x, scale=y, size=100))

...then var_names doesn't seem to do anything; I get back a DataArray anyway (which is great!). But it still requires passing something, so I'm just passing Runner(gen, var_names=["foo"]) atm.

Could we avoid having to pass anything there? Or is there a different construction I should be choosing?

@jcmgray
Copy link
Owner

jcmgray commented Feb 3, 2023

It should work with var_names=None which is buried in the docstrings here. By default var_names is required rather than being a default simply because handling DataSet / DataArray was functionality added later. But would happily think about making it the default - the only problem is its hard to check / helpfully error until the function is actually run etc.

@max-sixty
Copy link
Author

OK cool — feel free to close, passing var_names=None is the smallest of small issues...

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

No branches or pull requests

2 participants