Subject: [Ufl] Strange import error

From: Anders Logg <[email-masked]>
Date: Mon, 2 May 2011 09:29:06 +0200

I'm experimenting with the element extraction/auto-select in FFC. When
I do

  from ufl.algorithms import extract_sub_elements

inside ffc.analysis, I get

cannot import name extract_sub_elements
Traceback (most recent call last):
  File "test.py", line 4, in <module>
    from dolfin import *
  File
  "/home/logg/scratch/src/dolfin/local/lib/python2.6/site-packages/dolfin/__init__.py",
  line 28, in <module>
    from dolfin.common import *
  File
  "/home/logg/scratch/src/dolfin/local/lib/python2.6/site-packages/dolfin/common/__init__.py",
  line 2, in <module>
    from dolfin.common.globalparameters import *
  File
  "/home/logg/scratch/src/dolfin/local/lib/python2.6/site-packages/dolfin/common/globalparameters.py",
  line 24, in <module>
    raise RuntimeError, "Could not import %s form compiler." %
    form_compiler_name
RuntimeError: Could not import ffc form compiler.

It works fine to import extract_elements. It also works fine if I do

  from ufl.algorithm.analysis import extract_sub_elements

Strange? Could it have anything to do with analysis.py existing in
both FFC and UFL?

--
Anders

---

From: Martin Sandve Alnæs <[email-masked]>
Date: Tue, 3 May 2011 15:01:49 +0200

extract_sub_elements is simply not imported in ufl/algorithms/__init__.py.

Martin

On 2 May 2011 09:29, Anders Logg <[email-masked]> wrote:
> _______________________________________________
> Mailing list: https://launchpad.net/~ufl
> Post to     : [email-masked]
> Unsubscribe : https://launchpad.net/~ufl
> More help   : https://help.launchpad.net/ListHelp
>

---

From: Anders Logg <[email-masked]>
Date: Tue, 3 May 2011 18:12:06 +0200

Aha! I thought it was some strange recursive import.

--
Anders