Skip to content

More support of non-string dimension names#2373

Merged
fujiisoup merged 3 commits into
pydata:masterfrom
fujiisoup:more_nonstring_dims
Aug 20, 2018
Merged

More support of non-string dimension names#2373
fujiisoup merged 3 commits into
pydata:masterfrom
fujiisoup:more_nonstring_dims

Conversation

@fujiisoup

Copy link
Copy Markdown
Member
  • Tests passed (for all non-documentation changes)

Following to #2174

In some methods, consistency of the dictionary arguments and keyword arguments are checked twice in Dataset and Variable.
Can we change the API of Variable so that it does not take kwargs-type argument for dimension names?

@max-sixty max-sixty left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks a lot @fujiisoup !

Comment thread xarray/core/common.py Outdated
----------
dim: dict, optional
Mapping from the dimension name to create the rolling iterator
along (e.g. `time`) to its moging window size.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

small typo!

Comment thread xarray/core/common.py
results[k] = v
return results

def assign_coords(self, **kwargs):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I would actually keep this one as before. It’s designed to mirror ‘assign‘, which also only accepts ‘**kwargs‘.

Comment thread xarray/core/common.py Outdated

.. [1] http://pandas.pydata.org/pandas-docs/stable/timeseries.html#offset-aliases
"""
# TODO support non-string indexer after deprecating the old API.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Deprecating -> removing

@shoyer

shoyer commented Aug 18, 2018

Copy link
Copy Markdown
Member

Can we change the API of Variable so that it does not take kwargs-type argument for dimension names?

I am also tempted to do this, but it’s probably safer not to.

@fujiisoup fujiisoup merged commit 725bd57 into pydata:master Aug 20, 2018
@fujiisoup

Copy link
Copy Markdown
Member Author

Thanks @max-sixty and @shoyer for your kind review.

@fujiisoup fujiisoup deleted the more_nonstring_dims branch August 20, 2018 01:13
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.

3 participants