Subject: [UFL-dev] [HG UFL] Reverted from future absolute_import to

From: [email-masked] (UFL)
Date: Sun, 16 Nov 2008 14:26:33 +0100 (CET)

One or more new changesets pushed to the primary ufl repository.
A short summary of the last three changesets is included below.

changeset:   412:4288af82148d16e15445f852479379f8da89acc2
tag:         tip
user:        "Martin Sandve Alnæs <[email-masked]>"
date:        Sun Nov 16 14:26:35 2008 +0100
files:       ufl/__init__.py ufl/algebra.py ufl/algorithms/__init__.py ufl/algorithms/ad.py ufl/algorithms/analysis.py ufl/algorithms/checks.py ufl/algorithms/dependencies.py ufl/algorithms/formdata.py ufl/algorithms/formfiles.py ufl/algorithms/formtransformations.py ufl/algorithms/indexalgorithms.py ufl/algorithms/predicates.py ufl/algorithms/printing.py ufl/algorithms/transformations.py ufl/algorithms/traversal.py ufl/algorithms/ufl2latex.py ufl/algorithms/variables.py ufl/base.py ufl/baseoperators.py ufl/basisfunction.py ufl/classes.py ufl/conditional.py ufl/differentiation.py ufl/elements.py ufl/finiteelement.py ufl/form.py ufl/formoperators.py ufl/function.py ufl/geometry.py ufl/indexing.py ufl/integral.py ufl/mathfunctions.py ufl/objects.py ufl/operators.py ufl/restriction.py ufl/scalar.py ufl/split.py ufl/tensoralgebra.py ufl/tensors.py ufl/variable.py ufl/zero.py
description:
Reverted from future absolute_import to
normal import (using python script with regexp).

Fixed a bunch of bugs and minor stuff
reported by pylint via pydev in eclipse.
(This works fairly well, but pylint reports
lots of false negatives and annoying details.)

changeset:   411:bfb74f66bf24ee775e0d60a7a7063a962a48a9fe
user:        "Martin Sandve Alnæs <[email-masked]>"
date:        Fri Nov 07 16:54:15 2008 +0100
files:       ROADMAP ufl/algorithms/ad.py ufl/algorithms/dependencies.py ufl/algorithms/ufl2latex.py
description:
Partial implementation of a dependency sorting algorithm
to be used by quadrature code generation.

changeset:   410:0431354dff244a7aa7818c7da6cabc537f035250
user:        "Martin Sandve Alnæs <[email-masked]>"
date:        Fri Nov 07 16:04:25 2008 +0100
files:       ufl/algebra.py ufl/algorithms/ufl2latex.py ufl/variable.py
description:
Bugfixes.

Allowing indexed expressions as variables again (must allow this for easy insertions of new variables many places).

A sort of Latex rendering of ComponentTensor, not entirely satisfied though.

----------------------------------------------------------------------
For more details, visit http://www.fenics.org/hg/ufl

---

From: Johan Hake <[email-masked]>
Date: Sun, 16 Nov 2008 20:24:32 +0100

On Sunday 16 November 2008 14:26:33 UFL wrote:
> files:       ufl/__init__.py ufl/algebra.py ufl/algorithms/__init__.py
> ufl/algorithms/ad.py ufl/algorithms/analysis.py ufl/algorithms/checks.py
> ufl/algorithms/dependencies.py ufl/algorithms/formdata.py
> ufl/algorithms/formfiles.py ufl/algorithms/formtransformations.py
> ufl/algorithms/indexalgorithms.py ufl/algorithms/predicates.py
> ufl/algorithms/printing.py ufl/algorithms/transformations.py
> ufl/algorithms/traversal.py ufl/algorithms/ufl2latex.py
> ufl/algorithms/variables.py ufl/base.py ufl/baseoperators.py
> ufl/basisfunction.py ufl/classes.py ufl/conditional.py
> ufl/differentiation.py ufl/elements.py ufl/finiteelement.py ufl/form.py
> ufl/formoperators.py ufl/function.py ufl/geometry.py ufl/indexing.py
> ufl/integral.py ufl/mathfunctions.py ufl/objects.py ufl/operators.py
> ufl/restriction.py ufl/scalar.py ufl/split.py ufl/tensoralgebra.py
> ufl/tensors.py ufl/variable.py ufl/zero.py description:

Why did you do this?  (just curious)

I see that you rely on system wide imports now, a la 

  from ufl.algebra import something

instead of from 

  from .algebra import something

so there wont be any ambiguities w.r.t. to which packages is imported. Is it 
because you now can write

  from ufl.algebra import *

which you couldn't do with absolute import?

Johan
> files:       ROADMAP ufl/algorithms/ad.py ufl/algorithms/dependencies.py
> ufl/algorithms/ufl2latex.py description:
> Allowing indexed expressions as variables again (must allow this for easy
> insertions of new variables many places).
>

---

From: "Martin Sandve Alnæs" <[email-masked]>
Date: Sun, 16 Nov 2008 20:38:28 +0100

> which you couldn't do with absolute import?

No, I don't want to use * inside ufl anyway, so it was a "good thing"
to be forced not to.

One of the reasons is that absolute_import is partially broken in 2.5, the files
using it cannot be executed (so you can't make small tests in a
__main__ clause).

But the main reason was that various tools haven't caught up with this yet.
For example pychecker and pylint (which are annoyingly slow to update it seems).
I've found static code analysis to be very useful for python, for finding bugs.
(Even better would be full code coverage in the unit tests though).

--
Martin

---

From: Johan Hake <[email-masked]>
Date: Sun, 16 Nov 2008 20:38:56 +0100

On Sunday 16 November 2008 20:24:32 Johan Hake wrote:
> so there wont be any ambiguities w.r.t. to which packages is imported. Is
> it because you now can write
>

... that should of course be 'relative import'

Johan
> _______________________________________________
> UFL-dev mailing list
> [email-masked]
> http://fenics.org/mailman/listinfo/ufl-dev

---

From: Johan Hake <[email-masked]>
Date: Sun, 16 Nov 2008 20:42:36 +0100

On Sunday 16 November 2008 20:38:28 Martin Sandve Alnæs wrote:
> One of the reasons is that absolute_import is partially broken in 2.5, the
> files using it cannot be executed (so you can't make small tests in a
> __main__ clause).

Ok! Strange...

> For example pychecker and pylint (which are annoyingly slow to update it

Ok.

> I've found static code analysis to be very useful for python, for 

Maybee that's why I havn't had any luck with pychecker?

> (Even better would be full code coverage in the unit tests though).

He, he, and free beer on every friday ;)

Johan