Skip to content

New styling of imports #573

Open
Open
@hakonanes

Description

@hakonanes

I suggest a new "styling" of imports in the documentation (and test suite). Instead of importing functions and classes, we import modules.

Current:

from orix.quaternion import Rotation

Rotation.random()

New:

import orix.quaternion as oqu

oqu.Rotation.random()

If we're good at marking files as private (orix/quaternion/_misorientation.py etc.), users can look up of which functions and classes a module provides by tabbing with the cursor at oqu. etc.

Each module will then be importing accordingly:

import orix.data as oda
import orix.crystal_map as ocm
import orix.io as oio
import orix.measure as ome
import orix.plot as opl
import orix.projections as opr
import orix.quaternion as oqu
import orix.sampling as osa
import orix.vector as ove

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationRelates to the documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions