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

Dask type checking #643

Merged
merged 2 commits into from
Aug 26, 2024
Merged

Dask type checking #643

merged 2 commits into from
Aug 26, 2024

Conversation

tennlee
Copy link
Collaborator

@tennlee tennlee commented Aug 25, 2024

With the most recent updates to numpy, the computed dask objects have a different numpy type. I have made the type checking in the automated tests more generic to allow for a range of numpy types in the computed object. This should be compatible across a wide range of Python and numpy versions while still being a correct test.

…data types to a numpy generic (e.g. a scalar, such as int or float) rather than to an array of such things.

This change modifies the test to incorporate a union type of array and generic in assert statements for dask operations
@tennlee
Copy link
Collaborator Author

tennlee commented Aug 26, 2024

This PR still needs review, but is a safe change and is needed to restore test compliance so that others can test their changes. I will re-open the issue and ensure a review occurs before the next release.

@tennlee tennlee merged commit 22f0ca3 into nci:develop Aug 26, 2024
11 checks passed
@nicholasloveday
Copy link
Collaborator

Thanks @tennlee, this seems reasonable. Can you explain why these changes are only needed for some of the dask tests, but not all?

@tennlee
Copy link
Collaborator Author

tennlee commented Aug 29, 2024

Great, thanks for checking through it. I only fixed test cases which were failing. I imagine the only tests that were affected are the ones which are calculating a single number, whereas many of the tests are creating arrays which are then still array types.

@nicholasloveday
Copy link
Collaborator

Okay that makes sense. I can see that the ones that didn't need changing preserve a dim in the calculation

@tennlee tennlee deleted the dask_type_checking branch August 30, 2024 05:24
tennlee added a commit to tennlee/scores that referenced this pull request Sep 4, 2024
tennlee added a commit that referenced this pull request Sep 4, 2024
* Allow use of slightly earlier pandas versions

* Merge pull request #643 from tennlee/dask_type_checking

Dask type checking
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