Skip to content

Conversation

@jl-wynen
Copy link
Member

@jl-wynen jl-wynen commented Jul 9, 2024

This PR contains some miscellaneous errors but focusses on low level modules.

@jl-wynen jl-wynen mentioned this pull request Jul 10, 2024
@jl-wynen jl-wynen changed the base branch from main to remove-stubgen July 11, 2024 13:54
@jl-wynen
Copy link
Member Author

This PR now targets #3497

I fixed the remaining issues in the stub.

bind_binary<Dataset>(dataset);
bind_binary<DataArray>(dataset);
bind_binary<Variable>(dataset);
bind_binary_scalars(dataset);
Copy link
Member Author

Choose a reason for hiding this comment

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

This showed up because Dataset.__add__ and Dataset.__iadd__ were inconsistent. Only the latter supported floats on the RHS.

There are still inconsistencies in Variable and DataArray because they allow binary ops with Dataset but not in-place ops. This makes sense. But I think the clean solution would be, e.g., to not implement Variable.__add__(Dataset) but instead Dataset.__radd__(Variable). I can do that but I don't know how much of a refactor that would be. So I didn't.

Base automatically changed from remove-stubgen to main July 12, 2024 08:34
@jl-wynen jl-wynen merged commit 70b9b04 into main Jul 12, 2024
@jl-wynen jl-wynen deleted the appease-mypy branch July 12, 2024 08:34
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