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

Occasional "Units are not convertible" errors #52

Open
JimBiardClimateAI opened this issue Aug 14, 2023 · 1 comment
Open

Occasional "Units are not convertible" errors #52

JimBiardClimateAI opened this issue Aug 14, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@JimBiardClimateAI
Copy link

I am calling Units.conform in a function called through xarray. The processing is running in multi-threaded mode, so the cfunits code is being accessed by multiple threads (potentially) simultaneously. The problem I am seeing shows up when I attempt to do a NULL conversion. That is, the code

    in_units_obj = Units("degrees_C")
    out_units_obj = Units("degrees_C")

    out_a, out_b = Units.conform((in_a, in_b), in_units_obj, out_units_obj)

sometimes (but not always) raises the exception

ValueError: Units are not convertible: <Units: degrees_C>, <Units: degrees_C>
@sadielbartholomew sadielbartholomew added the bug Something isn't working label Aug 15, 2023
@sadielbartholomew
Copy link
Member

Thanks for reporting this, Jim. That looks like a bug, albeit one that our test suite wouldn't pick up on if it is to do with running on multiple threads. Hence it is particularly useful that you reported it.

We'll investigate shortly and report back here on what we find. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants