coneoproject / COFFEE

COFFEE - A COmpiler For Fast Expression Evaluation
Other
9 stars 6 forks source link

Modules have cyclic dependencies #86

Closed miklos1 closed 8 years ago

miklos1 commented 8 years ago

Consider the py3-compat branch that removes relative imports. This change seems to expose dependency cycles between COFFEE modules. For example, firedrake-clean fails:

Traceback (most recent call last):
  File "/home/mh1714/firedrake/bin/firedrake-clean", line 6, in <module>
    exec(compile(open(__file__).read(), __file__, 'exec'))
  File "/home/mh1714/firedrake/src/firedrake/scripts/firedrake-clean", line 3, in <module>
    from firedrake.tsfc_interface import clear_cache, TSFCKernel
  File "/home/mh1714/firedrake/src/firedrake/firedrake/__init__.py", line 26, in <module>
    from pyop2 import op2                                           # noqa
  File "/home/mh1714/firedrake/src/PyOP2/pyop2/__init__.py", line 9, in <module>
    from op2 import *  # noqa
  File "/home/mh1714/firedrake/src/PyOP2/pyop2/op2.py", line 48, in <module>
    from coffee.system import coffee_init, O0
  File "/home/mh1714/firedrake/src/COFFEE/coffee/system.py", line 41, in <module>
    from .vectorizer import VectStrategy
  File "/home/mh1714/firedrake/src/COFFEE/coffee/vectorizer.py", line 42, in <module>
    from . import system
ImportError: cannot import name system
miklos1 commented 8 years ago

Digging into this, it seems that reference cycles can be simply broken by splitting coffee.system.