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

pin numpy #14

Closed
wants to merge 1 commit into from
Closed

pin numpy #14

wants to merge 1 commit into from

Conversation

BrianWhitneyAI
Copy link
Contributor

@BrianWhitneyAI BrianWhitneyAI commented Jun 17, 2024

Core Issue

The purpose of this PR is to investigate some improper metadata reading for the bioformats reader. As can be seen here . The channels for the Imaris image are being read as ['Red', 'Green', 'Blue'] rather than ['Channel:0:0', 'Channel:0:1','Channel:0:2']. The weird part Is that I cannot replicate this locally. I originally assumed that this was a dependency issue ( This is what led me to pin Numpy, see below). However with the exact dependencies and confirming that the download hash is the same for test files I still have not been able to replicate this locally.

Notes

  1. numpy 2.0.0 moves from np.round_ to np.round. dask.array still uses np.round_ raising AttributeError: np.round_ was removed in the NumPy 2.0 release. Use np.round instead. I have pinned Numpy to look at the deeper issue.
  2. This issue seems to have been seen before here Test Failure - Channel Found Unexectedly #10 however the logs have expired so I cannot tell 100% that it is the same issue.

@evamaxfield
Copy link
Contributor

I would argue that we should do something like:

import numpy as np

def np_round(*args, **kwargs) -> int,
    if np.__version__.split(".")[0] == "1":
        return np.round_(*args, **kwargs)

    return np.round(*args, **kwargs)

Because pinning numpy should be imo a last resort, that might break a lot of things.

@BrianWhitneyAI
Copy link
Contributor Author

BrianWhitneyAI commented Jun 17, 2024

I would argue that we should do something like:

import numpy as np

def np_round(*args, **kwargs) -> int,
    if np.__version__.split(".")[0] == "1":
        return np.round_(*args, **kwargs)

    return np.round(*args, **kwargs)

Because pinning numpy should be imo a last resort, that might break a lot of things.

Still in draft! I agree this would be better. There's still some weird things going on here with tests, the pin is to see the lower error which I cannot see locally.

@BrianWhitneyAI
Copy link
Contributor Author

@evamaxfield @toloudis I wanted to see if either of you had any insight into this. Tests fail only in GH Action and neither Sean or I can replicate.

@toloudis
Copy link
Contributor

toloudis commented Jun 21, 2024

First guess: maybe check version differences between what bioformats is being installed on your local machine vs gh-actions?

Is it possible bioformats fixed something and the new behavior is actually more correct?

It doesn't seem like this could be numpy, as bioformats is a pure java implementation

@BrianWhitneyAI
Copy link
Contributor Author

First guess: maybe check version differences between what bioformats is being installed on your local machine vs gh-actions?

Is it possible bioformats fixed something and the new behavior is actually more correct?

It doesn't seem like this could be numpy, as bioformats is a pure java implementation

It is not numpy. I just pinned numpy to be able to see the error again since I cannot reproduce locally. I have the same versions installed locally as is described in the action. maybe we have a cached version that has a hotfix somewhere that wasnt annotated with a versioning?

@BrianWhitneyAI BrianWhitneyAI deleted the bugfix/numpy-pin branch November 19, 2024 17:39
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