Skip to content

Add __all__ to Firedrake __init__.py #4736

@connorjward

Description

@connorjward

Since we do not define __all__ in the __init__.py, running from firedrake import * pulls in over 550 objects. This includes some questionable entries such as log, mpi and - most confusingly - mesh (which is a Firedrake module). We really ought to control this.

This was discussed in this meeting. One idea that was floated was that we could encourage:

import firedrake as fd
from firedrake.dsl import *

which would further restrict the amount of things brought into the global namespace to only those that form a part of the Firedrake 'language' (e.g. dx, grad, etc). This would not break the existing from firedrake import * approach.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions