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

Fix cylic import artifical data. #2101

Conversation

ericpre
Copy link
Member

@ericpre ericpre commented Dec 1, 2018

As noticed in conda-forge/hyperspy-feedstock@951ad46, there is a cyclic import in hyperspy.datasets.artificial_data which breaks the import of hyperspy._lazy_signals.

Traceback (most recent call last):

  File "<ipython-input-1-f66322193b6e>", line 1, in <module>
    import hyperspy._lazy_signals

  File "/home/eric/Dev/hyperspy/hyperspy/_lazy_signals.py", line 6, in <module>
    from hyperspy._signals.eds_sem import LazyEDSSEMSpectrum

  File "/home/eric/Dev/hyperspy/hyperspy/_signals/eds_sem.py", line 23, in <module>
    from hyperspy._signals.eds import (EDSSpectrum, LazyEDSSpectrum)

  File "/home/eric/Dev/hyperspy/hyperspy/_signals/eds.py", line 27, in <module>
    from hyperspy import utils

  File "/home/eric/Dev/hyperspy/hyperspy/utils/__init__.py", line 24, in <module>
    import hyperspy.datasets.example_signals

  File "/home/eric/Dev/hyperspy/hyperspy/datasets/__init__.py", line 21, in <module>
    from hyperspy.datasets import artificial_data

  File "/home/eric/Dev/hyperspy/hyperspy/datasets/artificial_data.py", line 9, in <module>
    from hyperspy.signals import EELSSpectrum, Signal2D

  File "/home/eric/Dev/hyperspy/hyperspy/signals.py", line 46, in <module>
    from hyperspy._signals.eds_sem import EDSSEMSpectrum

ImportError: cannot import name 'EDSSEMSpectrum' from 'hyperspy._signals.eds_sem' (/home/eric/Dev/hyperspy/hyperspy/_signals/eds_sem.py)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants