Uh oh!
There was an error while loading. Please reload this page.
copy the dtypes module to the namedarray package. - #8250
Conversation
Uh oh!
There was an error while loading. Please reload this page.
dtypes module to be located in the namedarray package.dtypes module to be located in the namedarray package.| return result | ||
| class ReprObject: |
There was a problem hiding this comment.
This one is not considered np.typing.ArrayLike, therefore I don't like it. Is it possible to avoid it?
Example error from #8211:
xarray/core/dataarray.py: note: In member "__init__" of class "DataArray":
xarray/core/dataarray.py:414: error: Incompatible default for argument "data" (default has type "ReprObject", argument has type "T_DuckArray | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes]") [assignment]
There was a problem hiding this comment.
I don't see why the constructor has a default value of "NA"
dtypes module to be located in the namedarray package.dtypes module to the namedarray package.Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Illviljan <14371165+Illviljan@users.noreply.github.com>
Illviljan
left a comment
There was a problem hiding this comment.
Add typing. mypy might fail after some suggestions
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Illviljan <14371165+Illviljan@users.noreply.github.com>
for more information, see https://pre-commit.ci
andersy005
commented
Oct 2, 2023
@Illviljan / @dcherian, I'm leaning towards merging this PR unless there are any objections and/or edits |
Illviljan
commented
Oct 3, 2023
I was hoping to get #8241 merged before to see the remaining type issues. |
dcherian
commented
Oct 4, 2023
Let's merge with some type ignores. There are many more major issues to be handled, and time is running out... |
* upstream/main: (46 commits) xfail flaky test (pydata#8299) Most of mypy 1.6.0 passing (pydata#8296) Rename `reset_encoding` to `drop_encoding` (pydata#8287) Enable `.rolling_exp` to work on dask arrays (pydata#8284) Fix `GroupBy` import (pydata#8286) Ask bug reporters to confirm they're using a recent version of xarray (pydata#8283) Add pyright type checker (pydata#8279) Improved typing of align & broadcast (pydata#8234) Update ci-additional.yaml (pydata#8280) Fix time encoding regression (pydata#8272) Allow a function in `.sortby` method (pydata#8273) make more args kw only (except 'dim') (pydata#6403) Use duck array ops in more places (pydata#8267) Don't raise rename warning if it is a no operation (pydata#8266) Mandate kwargs on `to_zarr` (pydata#8257) copy the `dtypes` module to the `namedarray` package. (pydata#8250) Add xarray-regrid to ecosystem.rst (pydata#8270) Use strict type hinting for namedarray (pydata#8241) Update type annotation for center argument of dataaray_plot methods (pydata#8261) [pre-commit.ci] pre-commit autoupdate (pydata#8262) ...
this PR copies the
dtypesmodule from thexarray.corepackage to thexarray.namedarraypackage. It also recreates theReprObjectclass from theutilsmodule within thexarray.namedarraypackageThese changes are part of the ongoing work in:
whats-new.rstapi.rst