Uh oh!
There was an error while loading. Please reload this page.
Type check sentinel values - #3472
Conversation
Uh oh!
There was an error while loading. Please reload this page.
crusaderky
commented
Oct 31, 2019
@max-sixty have a look at my changes and then feel free to merge |
| if dims is not None: | ||
| self._dims = dims | ||
| if attrs is not self.__default: | ||
| if not isinstance(attrs, Default): |
There was a problem hiding this comment.
I feel like there's some Chesterton's fence here: is there some reason we had self. here?
There was a problem hiding this comment.
I don't think so. self.__default is misleading - it was a class attribute to begin with (you could rewrite it as Dataset.__default).
max-sixty
commented
Oct 31, 2019
Great, thanks @crusaderky I followed the Enum pattern because that was suggested in python docs. But I agree your suggestion is a bit simpler. Maybe have a quick glance at those docs and unless you change your mind, hit the green button? |
crusaderky
commented
Oct 31, 2019
Ah now I understand what you meant with mypy master |
* upstream/master: __dask_tokenize__ (pydata#3446) Type check sentinel values (pydata#3472) Fix typo in docstring (pydata#3474) fix test suite warnings re `drop` (pydata#3460) Fix integrate docs (pydata#3469) Fix leap year condition in monthly means example (pydata#3464) Hypothesis tests for roundtrip to & from pandas (pydata#3285) unpin cftime (pydata#3463) Cleanup whatsnew (pydata#3462) enable xr.ALL_DIMS in xr.dot (pydata#3424) Merge stable into master (pydata#3457) upgrade black verison to 19.10b0 (pydata#3456) Remove outdated code related to compatibility with netcdftime (pydata#3450) Remove deprecated behavior from dataset.drop docstring (pydata#3451) jupyterlab dark theme (pydata#3443) Drop groups associated with nans in group variable (pydata#3406) Allow ellipsis (...) in transpose (pydata#3421) Another groupby.reduce bugfix. (pydata#3403) add icomoon license (pydata#3448)
* upstream/master: (27 commits) drop_vars; deprecate drop for variables (pydata#3475) uamiv test using only raw uamiv variables (pydata#3485) Optimize dask array equality checks. (pydata#3453) Propagate indexes in DataArray binary operations. (pydata#3481) python 3.8 tests (pydata#3477) __dask_tokenize__ (pydata#3446) Type check sentinel values (pydata#3472) Fix typo in docstring (pydata#3474) fix test suite warnings re `drop` (pydata#3460) Fix integrate docs (pydata#3469) Fix leap year condition in monthly means example (pydata#3464) Hypothesis tests for roundtrip to & from pandas (pydata#3285) unpin cftime (pydata#3463) Cleanup whatsnew (pydata#3462) enable xr.ALL_DIMS in xr.dot (pydata#3424) Merge stable into master (pydata#3457) upgrade black verison to 19.10b0 (pydata#3456) Remove outdated code related to compatibility with netcdftime (pydata#3450) Remove deprecated behavior from dataset.drop docstring (pydata#3451) jupyterlab dark theme (pydata#3443) ...
black . && mypy . && flake8whats-new.rstfor all changes andapi.rstfor new APII did this before I realized it only works on mypy master! But posting so no one else does it. We can wait to merge until the next version of mypy is out