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

README example fails, and other issues are present in astropy when compiling project with -O3 #112

Open
doronbehar opened this issue Sep 15, 2023 · 8 comments

Comments

@doronbehar
Copy link

doronbehar commented Sep 15, 2023

I'm trying to update this package at NixOS (2.0.0.1 -> 2.0.0.3), and I want to enable testing during build. Here's a full log of the failures I experience:

https://gist.github.com/doronbehar/a321da0ce4d254ff5de34d0e9c3af609

I will also mention that I had from some reason to remove the erfa directory before beginning the tests, as I encountered issues as explained in #92.

@mhvk
Copy link
Contributor

mhvk commented Sep 15, 2023

Removing the erfa directory is in principle weird, since that contains the actual code, and I think that explains why in your test log only README.rst is tested. Have you tried to run the example that fails in a separate session? It works for me:

In [1]: import erfa

In [2]: erfa.jd2cal(2460000., [0, 1, 2, 3])
Out[2]: 
(array([2023, 2023, 2023, 2023], dtype=int32),
 array([2, 2, 2, 2], dtype=int32),
 array([24, 25, 26, 27], dtype=int32),
 array([0.5, 0.5, 0.5, 0.5]))

@doronbehar
Copy link
Author

@mhvk I'm experiencing the same ValueError when I run what you said manually:

  File "/nix/store/29qpy4ln613m35gazmscg2drm8cxd4xz-python3.10-pyerfa-2.0.0.3/lib/python3.10/site-packages/erfa/core.py", line 592, in jd2cal
    iy, im, id, fd, c_retval = ufunc.jd2cal(dj1, dj2)
ValueError: Invalid data-type for array

I also tried to apply 4866342, but it did not help.

@doronbehar
Copy link
Author

doronbehar commented Sep 15, 2023

Oh now I see that with -O2, that code runs :) I guess 4866342 didn't do all the job :).

@doronbehar doronbehar changed the title Doctests fail Doctests fail with -O3 Sep 15, 2023
@doronbehar
Copy link
Author

Unfortunately, now when I try to completely enable again the tests, I get the circular import errors as before... It is very peculiar, but not necessarily your responsibility. We investigate this apparently somewhat common issue in our repository at NixOS/nixpkgs#255262 .

@doronbehar
Copy link
Author

For reference, here's the full log with the circular import failures https://gist.github.com/doronbehar/9eefd3fdb24031e3879621114a6da76b .

@mhvk
Copy link
Contributor

mhvk commented Sep 15, 2023

Interesting! I noticed that there indeed was a compiler warning in your log, which may be related (and which maybe we could fix). Could you do me a favour and raise a new issue just noticing that the actual example from README.rst fails if compiled with -O3? I don't think I'll have time today to look at it, but want to be sure we don't forget!

@doronbehar
Copy link
Author

Could you do me a favour and raise a new issue just noticing that the actual example from README.rst fails if compiled with -O3?

This is sort of covered in the title of this issue no? "Doctests fail with -O3"

@mhvk
Copy link
Contributor

mhvk commented Sep 16, 2023

That title tells the doctests fail - it asks the reader to find out what the doctests actually are (I at least wrote them, but I really didn't remember). Specific issues are super important to help maintenance!

@doronbehar doronbehar changed the title Doctests fail with -O3 README example fails, and other issues are present in astropy when compiling project with -O3 Sep 16, 2023
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

No branches or pull requests

2 participants