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

Try cleaning up some expected_groups logic #175

Merged
merged 3 commits into from
Nov 27, 2022
Merged

Conversation

dcherian
Copy link
Collaborator

No description provided.

@dcherian dcherian force-pushed the cleanup-expected-groups branch from bf3d942 to 6d8f209 Compare November 27, 2022 03:23
@dcherian dcherian merged commit 27a4e9a into main Nov 27, 2022
@dcherian dcherian deleted the cleanup-expected-groups branch November 27, 2022 03:39
group_chunks: tuple[tuple[Union[int, float], ...]] = (
(len(expected_groups),) if expected_groups is not None else (np.nan,),
)
group_chunks: tuple[tuple[Union[int, float], ...]]
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@Illviljan the only float value that is valid here is np.nan. Is there a way to narrow this to just np.nan? A simple Literal[np.nan] does not work.

Copy link
Contributor

Choose a reason for hiding this comment

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

yeah, I am sad about that as well. :(

Thought a little about this in dask/dask#9255 but came to the conclusion that adding float with a reminder comment was the most practical solution. Here's a relevant typing thread: python/typing#1160

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ah too bad. Thanks!

dcherian added a commit to Illviljan/flox that referenced this pull request Nov 27, 2022
* main:
  Try cleaning up some expected_groups logic (xarray-contrib#175)
  Update visualizations & docs (xarray-contrib#189)
  Avoid broadcasting by variables against each other (xarray-contrib#186)
  Some typing (xarray-contrib#190)
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.

2 participants