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

Remove np.asarray in formatting.py #8100

Merged
merged 8 commits into from
Oct 18, 2023
Merged

Conversation

dcherian
Copy link
Contributor

@dcherian dcherian commented Aug 22, 2023

No description provided.

@@ -101,3 +101,37 @@ def is_chunked_array(x) -> bool:

def is_0d_dask_array(x):
return is_duck_dask_array(x) and is_scalar(x)


def to_numpy(data):
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
def to_numpy(data):
def to_numpy(data) -> np.ndarray:

Not sure what data should be... maybe simply Any?

return data


def to_duck_array(data):
Copy link
Collaborator

Choose a reason for hiding this comment

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

Some typing would be nice, but again no idea what the return type is. Do we have a duck array protocol?

I think for internal use a protocol is nice, for external return types we should simply return Any.

* 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)
  ...
@dcherian dcherian marked this pull request as ready for review October 14, 2023 04:02
@dcherian
Copy link
Contributor Author

This module has no typing so I'd like to get this in and sort that out later.

@headtr1ck
Copy link
Collaborator

This module has no typing so I'd like to get this in and sort that out later.

Fine by me :)

@dcherian dcherian added plan to merge Final call for comments and removed needs review labels Oct 17, 2023
@andersy005 andersy005 merged commit e611c97 into pydata:main Oct 18, 2023
34 checks passed
@dcherian dcherian deleted the kvikio-2 branch October 18, 2023 13:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
plan to merge Final call for comments
Projects
Development

Successfully merging this pull request may close these issues.

3 participants