Skip to content

Issue when import pyssht #206

@ASKabalan

Description

@ASKabalan

Trying to finish up my PR #204
I ran to an issue

  File "<string>", line 1, in <module>
  File "/home/wassim/Projects/CMB/s2fft/s2fft/__init__.py", line 2, in <module>
    from .transforms import wigner
  File "/home/wassim/Projects/CMB/s2fft/s2fft/transforms/__init__.py", line 1, in <module>
    from . import spherical
  File "/home/wassim/Projects/CMB/s2fft/s2fft/transforms/spherical.py", line 16, in <module>
    from s2fft.transforms import c_backend_spherical as c_sph
  File "/home/wassim/Projects/CMB/s2fft/s2fft/transforms/c_backend_spherical.py", line 8, in <module>
    import pyssht
  File "/home/wassim/micromamba/envs/jax/lib/python3.10/site-packages/pyssht/__init__.py", line 11, in <module>
    from pyssht.cpyssht import *
  File "cpyssht.pyx", line 1, in init pyssht.cpyssht
ImportError: numpy.core.multiarray failed to import (auto-generated because you didn't call 'numpy.import_array()' after cimporting numpy; use '<void>numpy._import_array' to disabl
e if you are certain you don't need it).

I think that there is an issue with pyssht and it prevents is from even importing s2fft

I commented it in three places

And I set c_sph to None

Just to be able to test my PR

I will look into it if you want, but the wise thing to do here is to wrap the import with a try catch et dynamically deactivate pyssht if it not working

Metadata

Metadata

Assignees

No one assigned

    Labels

    blockerBlocking other or upcoming tasks

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions