From 50597ae007a6a30ca5269b2cfe5e194f39afc70d Mon Sep 17 00:00:00 2001 From: Matthew Spellings Date: Sun, 23 Feb 2020 07:49:11 -0500 Subject: [PATCH] Clean up import style --- plato/draw/Arrows2D.py | 3 ++- plato/draw/Box.py | 2 ++ plato/draw/ConvexPolyhedra.py | 2 ++ plato/draw/ConvexSpheropolyhedra.py | 2 ++ plato/draw/DiskUnions.py | 2 ++ plato/draw/Disks.py | 2 ++ plato/draw/Ellipsoids.py | 2 ++ plato/draw/Lines.py | 2 ++ plato/draw/Mesh.py | 2 ++ plato/draw/Polygons.py | 2 ++ plato/draw/Scene.py | 2 ++ plato/draw/SpherePoints.py | 2 ++ plato/draw/SphereUnions.py | 2 ++ plato/draw/Spheres.py | 2 ++ plato/draw/Spheropolygons.py | 2 ++ plato/draw/Voronoi.py | 2 ++ plato/draw/__init__.py | 1 - plato/draw/blender/ConvexPolyhedra.py | 6 ++++-- plato/draw/blender/Scene.py | 5 +++-- plato/draw/blender/Spheres.py | 6 ++++-- plato/draw/fresnel/ConvexPolyhedra.py | 4 +++- plato/draw/fresnel/Disks.py | 1 + plato/draw/fresnel/Ellipsoids.py | 4 +++- plato/draw/fresnel/Lines.py | 4 +++- plato/draw/fresnel/Polygons.py | 3 ++- plato/draw/fresnel/Scene.py | 2 +- plato/draw/fresnel/SphereUnions.py | 3 ++- plato/draw/fresnel/Spheres.py | 1 + plato/draw/fresnel/Spheropolygons.py | 3 ++- plato/draw/internal.py | 3 ++- plato/draw/matplotlib/ConvexPolyhedra.py | 5 +++-- plato/draw/matplotlib/DiskUnions.py | 5 +++-- plato/draw/matplotlib/Disks.py | 3 ++- plato/draw/matplotlib/Polygons.py | 7 ++++--- plato/draw/matplotlib/Scene.py | 2 ++ plato/draw/matplotlib/SpherePoints.py | 1 + plato/draw/matplotlib/Spheres.py | 4 +++- plato/draw/matplotlib/Spheropolygons.py | 7 ++++--- plato/draw/povray/ConvexPolyhedra.py | 2 ++ plato/draw/povray/ConvexSpheropolyhedra.py | 1 + plato/draw/povray/Ellipsoids.py | 1 + plato/draw/povray/Lines.py | 2 ++ plato/draw/povray/Mesh.py | 1 + plato/draw/povray/Scene.py | 3 ++- plato/draw/povray/SphereUnions.py | 1 + plato/draw/povray/Spheres.py | 1 + plato/draw/pythreejs/ConvexPolyhedra.py | 3 ++- plato/draw/pythreejs/ConvexSpheropolyhedra.py | 3 ++- plato/draw/pythreejs/Ellipsoids.py | 4 +++- plato/draw/pythreejs/Lines.py | 5 +++-- plato/draw/pythreejs/Mesh.py | 3 ++- plato/draw/pythreejs/Scene.py | 5 +++-- plato/draw/pythreejs/Spheres.py | 4 +++- plato/draw/pythreejs/internal.py | 3 ++- plato/draw/vispy/ConvexPolyhedra.py | 2 ++ plato/draw/vispy/ConvexSpheropolyhedra.py | 2 ++ plato/draw/vispy/DiskUnions.py | 2 ++ plato/draw/vispy/Disks.py | 2 ++ plato/draw/vispy/Ellipsoids.py | 2 ++ plato/draw/vispy/Lines.py | 2 ++ plato/draw/vispy/Mesh.py | 2 ++ plato/draw/vispy/Polygons.py | 2 ++ plato/draw/vispy/Scene.py | 4 +++- plato/draw/vispy/SpherePoints.py | 2 ++ plato/draw/vispy/SphereUnions.py | 2 ++ plato/draw/vispy/Spheres.py | 2 ++ plato/draw/vispy/Spheropolygons.py | 2 ++ plato/draw/vispy/Voronoi.py | 2 ++ plato/draw/vispy/internal.py | 2 ++ plato/draw/zdog/Scene.py | 3 ++- plato/draw/zdog/Spheres.py | 2 ++ plato/draw/zdog/internal.py | 1 + plato/imp.py | 3 ++- plato/mesh.py | 1 + 74 files changed, 155 insertions(+), 42 deletions(-) diff --git a/plato/draw/Arrows2D.py b/plato/draw/Arrows2D.py index 7c29e25..7055aad 100644 --- a/plato/draw/Arrows2D.py +++ b/plato/draw/Arrows2D.py @@ -1,6 +1,7 @@ import numpy as np -from .Polygons import Polygons + from .internal import ShapeDecorator +from .Polygons import Polygons @ShapeDecorator class Arrows2D(Polygons): diff --git a/plato/draw/Box.py b/plato/draw/Box.py index 1592e2d..7e15035 100644 --- a/plato/draw/Box.py +++ b/plato/draw/Box.py @@ -1,6 +1,8 @@ import functools import itertools + import numpy as np + from .. import math from .internal import ShapeDecorator, ShapeAttribute from .Lines import Lines diff --git a/plato/draw/ConvexPolyhedra.py b/plato/draw/ConvexPolyhedra.py index 1dc70fb..4104c07 100644 --- a/plato/draw/ConvexPolyhedra.py +++ b/plato/draw/ConvexPolyhedra.py @@ -1,5 +1,7 @@ import itertools + import numpy as np + from .internal import Shape, ShapeDecorator, ShapeAttribute @ShapeDecorator diff --git a/plato/draw/ConvexSpheropolyhedra.py b/plato/draw/ConvexSpheropolyhedra.py index 85bfe7e..66e179d 100644 --- a/plato/draw/ConvexSpheropolyhedra.py +++ b/plato/draw/ConvexSpheropolyhedra.py @@ -1,5 +1,7 @@ import itertools + import numpy as np + from .internal import Shape, ShapeDecorator, ShapeAttribute @ShapeDecorator diff --git a/plato/draw/DiskUnions.py b/plato/draw/DiskUnions.py index 095b769..ab54533 100644 --- a/plato/draw/DiskUnions.py +++ b/plato/draw/DiskUnions.py @@ -1,5 +1,7 @@ import itertools + import numpy as np + from .internal import Shape, ShapeDecorator, ShapeAttribute @ShapeDecorator diff --git a/plato/draw/Disks.py b/plato/draw/Disks.py index 328f8ed..4977bdd 100644 --- a/plato/draw/Disks.py +++ b/plato/draw/Disks.py @@ -1,5 +1,7 @@ import itertools + import numpy as np + from .internal import Shape, ShapeDecorator, ShapeAttribute @ShapeDecorator diff --git a/plato/draw/Ellipsoids.py b/plato/draw/Ellipsoids.py index 4ef7823..a2f32e9 100644 --- a/plato/draw/Ellipsoids.py +++ b/plato/draw/Ellipsoids.py @@ -1,5 +1,7 @@ import itertools + import numpy as np + from .internal import Shape, ShapeDecorator, ShapeAttribute @ShapeDecorator diff --git a/plato/draw/Lines.py b/plato/draw/Lines.py index abe4e47..3f9f7b5 100644 --- a/plato/draw/Lines.py +++ b/plato/draw/Lines.py @@ -1,5 +1,7 @@ import itertools + import numpy as np + from .internal import Shape, ShapeDecorator, ShapeAttribute @ShapeDecorator diff --git a/plato/draw/Mesh.py b/plato/draw/Mesh.py index d9ab021..c3b2bbb 100644 --- a/plato/draw/Mesh.py +++ b/plato/draw/Mesh.py @@ -1,5 +1,7 @@ import itertools + import numpy as np + from .internal import Shape, ShapeDecorator, ShapeAttribute from .. import mesh diff --git a/plato/draw/Polygons.py b/plato/draw/Polygons.py index b99c87b..ec65189 100644 --- a/plato/draw/Polygons.py +++ b/plato/draw/Polygons.py @@ -1,5 +1,7 @@ import itertools + import numpy as np + from .internal import Shape, ShapeDecorator, ShapeAttribute @ShapeDecorator diff --git a/plato/draw/Scene.py b/plato/draw/Scene.py index 0d26e15..7ee78ba 100644 --- a/plato/draw/Scene.py +++ b/plato/draw/Scene.py @@ -1,5 +1,7 @@ import logging + import numpy as np + from .internal import Shape DEFAULT_DIRECTIONAL_LIGHTS = ( diff --git a/plato/draw/SpherePoints.py b/plato/draw/SpherePoints.py index d1beb58..71478b4 100644 --- a/plato/draw/SpherePoints.py +++ b/plato/draw/SpherePoints.py @@ -1,5 +1,7 @@ import itertools + import numpy as np + from .internal import Shape, ShapeDecorator, ShapeAttribute @ShapeDecorator diff --git a/plato/draw/SphereUnions.py b/plato/draw/SphereUnions.py index 9247e2b..32e68ba 100644 --- a/plato/draw/SphereUnions.py +++ b/plato/draw/SphereUnions.py @@ -1,5 +1,7 @@ import itertools + import numpy as np + from .internal import Shape, ShapeDecorator, ShapeAttribute @ShapeDecorator diff --git a/plato/draw/Spheres.py b/plato/draw/Spheres.py index 17fd80f..a14e657 100644 --- a/plato/draw/Spheres.py +++ b/plato/draw/Spheres.py @@ -1,5 +1,7 @@ import itertools + import numpy as np + from .internal import Shape, ShapeDecorator, ShapeAttribute @ShapeDecorator diff --git a/plato/draw/Spheropolygons.py b/plato/draw/Spheropolygons.py index cbce399..e37ae76 100644 --- a/plato/draw/Spheropolygons.py +++ b/plato/draw/Spheropolygons.py @@ -1,5 +1,7 @@ import itertools + import numpy as np + from .internal import Shape, ShapeDecorator, ShapeAttribute @ShapeDecorator diff --git a/plato/draw/Voronoi.py b/plato/draw/Voronoi.py index 9dc293e..ef7df65 100644 --- a/plato/draw/Voronoi.py +++ b/plato/draw/Voronoi.py @@ -1,5 +1,7 @@ import itertools + import numpy as np + from .internal import Shape, ShapeDecorator, ShapeAttribute @ShapeDecorator diff --git a/plato/draw/__init__.py b/plato/draw/__init__.py index 161f868..05bdbe7 100644 --- a/plato/draw/__init__.py +++ b/plato/draw/__init__.py @@ -1,6 +1,5 @@ from .Scene import Scene - from .Arrows2D import Arrows2D from .Box import Box from .Disks import Disks diff --git a/plato/draw/blender/ConvexPolyhedra.py b/plato/draw/blender/ConvexPolyhedra.py index 9f18f95..d640167 100644 --- a/plato/draw/blender/ConvexPolyhedra.py +++ b/plato/draw/blender/ConvexPolyhedra.py @@ -1,8 +1,10 @@ -import bpy import itertools -from ... import draw, geometry, math, mesh + +import bpy import numpy as np +from ... import draw, geometry, math, mesh + class ConvexPolyhedra(draw.ConvexPolyhedra): def render(self, scene, suffix='', translation=(0, 0, 0), diff --git a/plato/draw/blender/Scene.py b/plato/draw/blender/Scene.py index 7923b4c..c774e7d 100644 --- a/plato/draw/blender/Scene.py +++ b/plato/draw/blender/Scene.py @@ -1,6 +1,7 @@ -from ... import draw -import numpy as np import bpy +import numpy as np + +from ... import draw class Scene(draw.Scene): __doc__ = draw.Scene.__doc__ diff --git a/plato/draw/blender/Spheres.py b/plato/draw/blender/Spheres.py index 91a1ddd..57817b6 100644 --- a/plato/draw/blender/Spheres.py +++ b/plato/draw/blender/Spheres.py @@ -1,8 +1,10 @@ -import bpy import itertools -from ... import draw, math, mesh + +import bpy import numpy as np +from ... import draw, math, mesh + class Spheres(draw.Spheres): def render(self, scene, suffix='', translation=(0, 0, 0), diff --git a/plato/draw/fresnel/ConvexPolyhedra.py b/plato/draw/fresnel/ConvexPolyhedra.py index 84a7e6b..91019c6 100644 --- a/plato/draw/fresnel/ConvexPolyhedra.py +++ b/plato/draw/fresnel/ConvexPolyhedra.py @@ -1,6 +1,8 @@ -import fresnel import itertools + +import fresnel import numpy as np + from ... import draw from ..internal import ShapeAttribute, ShapeDecorator from .FresnelPrimitive import FresnelPrimitive diff --git a/plato/draw/fresnel/Disks.py b/plato/draw/fresnel/Disks.py index b4a5831..df4168d 100644 --- a/plato/draw/fresnel/Disks.py +++ b/plato/draw/fresnel/Disks.py @@ -1,4 +1,5 @@ import fresnel + from ... import draw from .FresnelPrimitive import FresnelPrimitiveSolid diff --git a/plato/draw/fresnel/Ellipsoids.py b/plato/draw/fresnel/Ellipsoids.py index 12e65da..41a18a8 100644 --- a/plato/draw/fresnel/Ellipsoids.py +++ b/plato/draw/fresnel/Ellipsoids.py @@ -1,6 +1,8 @@ -import fresnel import itertools + +import fresnel import numpy as np + from ... import draw from ...geometry import fibonacciPositions from ..internal import ShapeAttribute, ShapeDecorator diff --git a/plato/draw/fresnel/Lines.py b/plato/draw/fresnel/Lines.py index 1fdb7e2..05ddd34 100644 --- a/plato/draw/fresnel/Lines.py +++ b/plato/draw/fresnel/Lines.py @@ -1,6 +1,8 @@ -import fresnel import itertools + +import fresnel import numpy as np + from ... import draw from ..internal import ShapeAttribute, ShapeDecorator from .FresnelPrimitive import FresnelPrimitiveSolid diff --git a/plato/draw/fresnel/Polygons.py b/plato/draw/fresnel/Polygons.py index 61691c8..95daaf9 100644 --- a/plato/draw/fresnel/Polygons.py +++ b/plato/draw/fresnel/Polygons.py @@ -1,7 +1,8 @@ import fresnel +import rowan + from ... import draw from .FresnelPrimitive import FresnelPrimitiveSolid -import rowan class Polygons(FresnelPrimitiveSolid, draw.Polygons): __doc__ = draw.Polygons.__doc__ diff --git a/plato/draw/fresnel/Scene.py b/plato/draw/fresnel/Scene.py index 039c847..f0ea3e7 100644 --- a/plato/draw/fresnel/Scene.py +++ b/plato/draw/fresnel/Scene.py @@ -1,8 +1,8 @@ import fresnel import numpy as np import rowan -from ... import draw +from ... import draw class Scene(draw.Scene): __doc__ = (draw.Scene.__doc__ or '') + """ diff --git a/plato/draw/fresnel/SphereUnions.py b/plato/draw/fresnel/SphereUnions.py index 68d286c..a0fe885 100644 --- a/plato/draw/fresnel/SphereUnions.py +++ b/plato/draw/fresnel/SphereUnions.py @@ -1,8 +1,9 @@ import fresnel +import numpy as np + from ... import draw from ... import math from .FresnelPrimitive import FresnelPrimitive -import numpy as np class SphereUnions(FresnelPrimitive, draw.SphereUnions): __doc__ = draw.SphereUnions.__doc__ diff --git a/plato/draw/fresnel/Spheres.py b/plato/draw/fresnel/Spheres.py index 8e25e9d..a551722 100644 --- a/plato/draw/fresnel/Spheres.py +++ b/plato/draw/fresnel/Spheres.py @@ -1,4 +1,5 @@ import fresnel + from ... import draw from .FresnelPrimitive import FresnelPrimitive diff --git a/plato/draw/fresnel/Spheropolygons.py b/plato/draw/fresnel/Spheropolygons.py index 70294c9..beb53e8 100644 --- a/plato/draw/fresnel/Spheropolygons.py +++ b/plato/draw/fresnel/Spheropolygons.py @@ -1,7 +1,8 @@ import fresnel +import rowan + from ... import draw from .FresnelPrimitive import FresnelPrimitiveSolid -import rowan class Spheropolygons(FresnelPrimitiveSolid, draw.Spheropolygons): __doc__ = draw.Spheropolygons.__doc__ diff --git a/plato/draw/internal.py b/plato/draw/internal.py index 396ea14..6689cb4 100644 --- a/plato/draw/internal.py +++ b/plato/draw/internal.py @@ -1,6 +1,7 @@ +from collections import namedtuple import functools import inspect -from collections import namedtuple + import numpy as np ATTRIBUTE_DOCSTRING_HEADER = '\n\nThis primitive has the following attributes:' diff --git a/plato/draw/matplotlib/ConvexPolyhedra.py b/plato/draw/matplotlib/ConvexPolyhedra.py index c0d3f13..fa11ff0 100644 --- a/plato/draw/matplotlib/ConvexPolyhedra.py +++ b/plato/draw/matplotlib/ConvexPolyhedra.py @@ -1,10 +1,11 @@ import numpy as np +from matplotlib.path import Path +from matplotlib.patches import PathPatch, Polygon + from ... import math from ... import geometry from ... import draw from .internal import PatchUser -from matplotlib.path import Path -from matplotlib.patches import PathPatch, Polygon class ConvexPolyhedra(draw.ConvexPolyhedra, PatchUser): __doc__ = draw.ConvexPolyhedra.__doc__ diff --git a/plato/draw/matplotlib/DiskUnions.py b/plato/draw/matplotlib/DiskUnions.py index 08f519e..27077f6 100644 --- a/plato/draw/matplotlib/DiskUnions.py +++ b/plato/draw/matplotlib/DiskUnions.py @@ -1,8 +1,9 @@ +from matplotlib.patches import Circle, Wedge +from matplotlib.transforms import Affine2D import numpy as np + from ... import draw from .internal import PatchUser -from matplotlib.patches import Circle, Wedge -from matplotlib.transforms import Affine2D class DiskUnions(draw.DiskUnions, PatchUser): __doc__ = draw.DiskUnions.__doc__ diff --git a/plato/draw/matplotlib/Disks.py b/plato/draw/matplotlib/Disks.py index 26a8de8..9b2f3d6 100644 --- a/plato/draw/matplotlib/Disks.py +++ b/plato/draw/matplotlib/Disks.py @@ -1,7 +1,8 @@ +from matplotlib.patches import Circle, Wedge import numpy as np + from ... import draw from .internal import PatchUser -from matplotlib.patches import Circle, Wedge class Disks(draw.Disks, PatchUser): __doc__ = draw.Disks.__doc__ diff --git a/plato/draw/matplotlib/Polygons.py b/plato/draw/matplotlib/Polygons.py index fd8d32d..28436b3 100644 --- a/plato/draw/matplotlib/Polygons.py +++ b/plato/draw/matplotlib/Polygons.py @@ -1,10 +1,11 @@ +from matplotlib.path import Path +from matplotlib.patches import PathPatch, Polygon +from matplotlib.transforms import Affine2D import numpy as np + from ... import geometry from ... import draw from .internal import PatchUser -from matplotlib.path import Path -from matplotlib.patches import PathPatch, Polygon -from matplotlib.transforms import Affine2D class Polygons(draw.Polygons, PatchUser): __doc__ = draw.Polygons.__doc__ diff --git a/plato/draw/matplotlib/Scene.py b/plato/draw/matplotlib/Scene.py index 451c422..27ba7b5 100644 --- a/plato/draw/matplotlib/Scene.py +++ b/plato/draw/matplotlib/Scene.py @@ -1,7 +1,9 @@ import contextlib + import matplotlib.pyplot as pp from matplotlib.collections import PatchCollection import numpy as np + from ... import draw @contextlib.contextmanager diff --git a/plato/draw/matplotlib/SpherePoints.py b/plato/draw/matplotlib/SpherePoints.py index 5bb1c0b..d09832d 100644 --- a/plato/draw/matplotlib/SpherePoints.py +++ b/plato/draw/matplotlib/SpherePoints.py @@ -1,4 +1,5 @@ import numpy as np + from ... import draw from ... import math diff --git a/plato/draw/matplotlib/Spheres.py b/plato/draw/matplotlib/Spheres.py index 68afa43..f0f6228 100644 --- a/plato/draw/matplotlib/Spheres.py +++ b/plato/draw/matplotlib/Spheres.py @@ -1,10 +1,12 @@ import itertools + +from matplotlib.patches import Circle import numpy as np + from ... import math from ... import draw from ...draw import internal from .internal import PatchUser -from matplotlib.patches import Circle @internal.ShapeDecorator class Spheres(draw.Spheres, PatchUser): diff --git a/plato/draw/matplotlib/Spheropolygons.py b/plato/draw/matplotlib/Spheropolygons.py index f6bc01d..2f63d93 100644 --- a/plato/draw/matplotlib/Spheropolygons.py +++ b/plato/draw/matplotlib/Spheropolygons.py @@ -1,9 +1,10 @@ -import numpy as np -from ... import draw -from .internal import PatchUser from matplotlib.path import Path from matplotlib.patches import PathPatch from matplotlib.transforms import Affine2D +import numpy as np + +from ... import draw +from .internal import PatchUser class Spheropolygons(draw.Spheropolygons, PatchUser): __doc__ = draw.Spheropolygons.__doc__ diff --git a/plato/draw/povray/ConvexPolyhedra.py b/plato/draw/povray/ConvexPolyhedra.py index 6b7c13b..14d52f8 100644 --- a/plato/draw/povray/ConvexPolyhedra.py +++ b/plato/draw/povray/ConvexPolyhedra.py @@ -1,5 +1,7 @@ import itertools + import numpy as np + from ... import draw from ... import mesh as pmesh from ... import geometry diff --git a/plato/draw/povray/ConvexSpheropolyhedra.py b/plato/draw/povray/ConvexSpheropolyhedra.py index 111d90d..3f34881 100644 --- a/plato/draw/povray/ConvexSpheropolyhedra.py +++ b/plato/draw/povray/ConvexSpheropolyhedra.py @@ -1,4 +1,5 @@ import numpy as np + from ... import draw from ... import mesh as pmesh from ... import geometry diff --git a/plato/draw/povray/Ellipsoids.py b/plato/draw/povray/Ellipsoids.py index 22f26cf..e5eca6f 100644 --- a/plato/draw/povray/Ellipsoids.py +++ b/plato/draw/povray/Ellipsoids.py @@ -1,5 +1,6 @@ import numpy as np import rowan + from ... import draw, mesh class Ellipsoids(draw.Ellipsoids): diff --git a/plato/draw/povray/Lines.py b/plato/draw/povray/Lines.py index 1b78ebc..d052e91 100644 --- a/plato/draw/povray/Lines.py +++ b/plato/draw/povray/Lines.py @@ -1,5 +1,7 @@ import itertools + import numpy as np + from ... import draw from ..internal import ShapeDecorator, ShapeAttribute from ... import math as pmath diff --git a/plato/draw/povray/Mesh.py b/plato/draw/povray/Mesh.py index c8d9323..061654a 100644 --- a/plato/draw/povray/Mesh.py +++ b/plato/draw/povray/Mesh.py @@ -1,4 +1,5 @@ import numpy as np + from ... import draw from ... import math as pmath from ... import mesh diff --git a/plato/draw/povray/Scene.py b/plato/draw/povray/Scene.py index 98194e4..9c16215 100644 --- a/plato/draw/povray/Scene.py +++ b/plato/draw/povray/Scene.py @@ -3,10 +3,11 @@ import subprocess import tempfile +import numpy as np + from ... import draw from ... import math from ... import __version__ -import numpy as np class Scene(draw.Scene): __doc__ = (draw.Scene.__doc__ or '') + """ diff --git a/plato/draw/povray/SphereUnions.py b/plato/draw/povray/SphereUnions.py index ae2c277..f763147 100644 --- a/plato/draw/povray/SphereUnions.py +++ b/plato/draw/povray/SphereUnions.py @@ -1,4 +1,5 @@ import numpy as np + from ... import draw from ... import math from ... import mesh diff --git a/plato/draw/povray/Spheres.py b/plato/draw/povray/Spheres.py index c662e61..c14ff8c 100644 --- a/plato/draw/povray/Spheres.py +++ b/plato/draw/povray/Spheres.py @@ -1,4 +1,5 @@ import numpy as np + from ... import draw from ... import math from ... import mesh diff --git a/plato/draw/pythreejs/ConvexPolyhedra.py b/plato/draw/pythreejs/ConvexPolyhedra.py index 8d33d59..c6415ff 100644 --- a/plato/draw/pythreejs/ConvexPolyhedra.py +++ b/plato/draw/pythreejs/ConvexPolyhedra.py @@ -1,7 +1,8 @@ +import numpy as np + from ... import draw from ... import mesh from .internal import ThreeJSPrimitive -import numpy as np class ConvexPolyhedra(draw.ConvexPolyhedra, ThreeJSPrimitive): __doc__ = draw.ConvexPolyhedra.__doc__ diff --git a/plato/draw/pythreejs/ConvexSpheropolyhedra.py b/plato/draw/pythreejs/ConvexSpheropolyhedra.py index b46c0f9..7e1aeb1 100644 --- a/plato/draw/pythreejs/ConvexSpheropolyhedra.py +++ b/plato/draw/pythreejs/ConvexSpheropolyhedra.py @@ -1,7 +1,8 @@ +import numpy as np + from ... import draw from ... import mesh from .internal import ThreeJSPrimitive -import numpy as np class ConvexSpheropolyhedra(draw.ConvexSpheropolyhedra, ThreeJSPrimitive): __doc__ = draw.ConvexSpheropolyhedra.__doc__ diff --git a/plato/draw/pythreejs/Ellipsoids.py b/plato/draw/pythreejs/Ellipsoids.py index 6ee296c..a7d7897 100644 --- a/plato/draw/pythreejs/Ellipsoids.py +++ b/plato/draw/pythreejs/Ellipsoids.py @@ -1,10 +1,12 @@ import itertools + +import numpy as np + from ... import draw from ...geometry import fibonacciPositions from ... import mesh from .internal import ThreeJSPrimitive from ..internal import ShapeAttribute, ShapeDecorator -import numpy as np @ShapeDecorator class Ellipsoids(draw.Ellipsoids, ThreeJSPrimitive): diff --git a/plato/draw/pythreejs/Lines.py b/plato/draw/pythreejs/Lines.py index 67cf69b..c93a213 100644 --- a/plato/draw/pythreejs/Lines.py +++ b/plato/draw/pythreejs/Lines.py @@ -1,8 +1,9 @@ +import numpy as np +import rowan + from ... import draw from ... import geometry from .internal import ThreeJSPrimitive -import numpy as np -import rowan class Lines(draw.Lines, ThreeJSPrimitive): __doc__ = draw.Lines.__doc__ diff --git a/plato/draw/pythreejs/Mesh.py b/plato/draw/pythreejs/Mesh.py index 9eef312..3738661 100644 --- a/plato/draw/pythreejs/Mesh.py +++ b/plato/draw/pythreejs/Mesh.py @@ -1,7 +1,8 @@ +import numpy as np + from ... import draw from ... import mesh from .internal import ThreeJSPrimitive -import numpy as np class Mesh(draw.Mesh, ThreeJSPrimitive): __doc__ = draw.Mesh.__doc__ diff --git a/plato/draw/pythreejs/Scene.py b/plato/draw/pythreejs/Scene.py index 9678b56..ae5ace9 100644 --- a/plato/draw/pythreejs/Scene.py +++ b/plato/draw/pythreejs/Scene.py @@ -1,9 +1,10 @@ -from ... import draw -from ..Scene import DEFAULT_DIRECTIONAL_LIGHTS import rowan import numpy as np import pythreejs +from ... import draw +from ..Scene import DEFAULT_DIRECTIONAL_LIGHTS + class Scene(draw.Scene): def __init__(self, *args, **kwargs): self._backend_objects = dict(scene=pythreejs.Scene()) diff --git a/plato/draw/pythreejs/Spheres.py b/plato/draw/pythreejs/Spheres.py index 9d5cf6f..5eda71b 100644 --- a/plato/draw/pythreejs/Spheres.py +++ b/plato/draw/pythreejs/Spheres.py @@ -1,10 +1,12 @@ import itertools + +import numpy as np + from ... import draw from ...geometry import fibonacciPositions from ... import mesh from .internal import ThreeJSPrimitive from ..internal import ShapeAttribute, ShapeDecorator -import numpy as np @ShapeDecorator class Spheres(draw.Spheres, ThreeJSPrimitive): diff --git a/plato/draw/pythreejs/internal.py b/plato/draw/pythreejs/internal.py index 56ef777..180e595 100644 --- a/plato/draw/pythreejs/internal.py +++ b/plato/draw/pythreejs/internal.py @@ -1,7 +1,8 @@ -from ... import math import numpy as np import pythreejs +from ... import math + class ThreeJSPrimitive: @property def threejs_primitive(self): diff --git a/plato/draw/vispy/ConvexPolyhedra.py b/plato/draw/vispy/ConvexPolyhedra.py index 85df61c..0248bb0 100644 --- a/plato/draw/vispy/ConvexPolyhedra.py +++ b/plato/draw/vispy/ConvexPolyhedra.py @@ -1,5 +1,7 @@ import itertools + import numpy as np + from ... import mesh from .internal import GLPrimitive, GLShapeDecorator from ... import draw diff --git a/plato/draw/vispy/ConvexSpheropolyhedra.py b/plato/draw/vispy/ConvexSpheropolyhedra.py index 693ff1e..a6538cb 100644 --- a/plato/draw/vispy/ConvexSpheropolyhedra.py +++ b/plato/draw/vispy/ConvexSpheropolyhedra.py @@ -1,5 +1,7 @@ import itertools + import numpy as np + from ... import mesh from .internal import GLPrimitive, GLShapeDecorator from ... import draw diff --git a/plato/draw/vispy/DiskUnions.py b/plato/draw/vispy/DiskUnions.py index b37e659..3f7484e 100644 --- a/plato/draw/vispy/DiskUnions.py +++ b/plato/draw/vispy/DiskUnions.py @@ -1,5 +1,7 @@ import itertools + import numpy as np + from ... import mesh from .internal import GLPrimitive, GLShapeDecorator from ... import draw diff --git a/plato/draw/vispy/Disks.py b/plato/draw/vispy/Disks.py index 3797b50..925e14f 100644 --- a/plato/draw/vispy/Disks.py +++ b/plato/draw/vispy/Disks.py @@ -1,5 +1,7 @@ import itertools + import numpy as np + from ... import mesh from .internal import GLPrimitive, GLShapeDecorator from ... import draw diff --git a/plato/draw/vispy/Ellipsoids.py b/plato/draw/vispy/Ellipsoids.py index 4352de8..3ddc985 100644 --- a/plato/draw/vispy/Ellipsoids.py +++ b/plato/draw/vispy/Ellipsoids.py @@ -1,5 +1,7 @@ import itertools + import numpy as np + from ... import mesh from .internal import GLPrimitive, GLShapeDecorator from .Spheres import Spheres diff --git a/plato/draw/vispy/Lines.py b/plato/draw/vispy/Lines.py index 21f7c7e..9f5d241 100644 --- a/plato/draw/vispy/Lines.py +++ b/plato/draw/vispy/Lines.py @@ -1,5 +1,7 @@ import itertools + import numpy as np + from ... import mesh from .internal import GLPrimitive, GLShapeDecorator from ... import draw diff --git a/plato/draw/vispy/Mesh.py b/plato/draw/vispy/Mesh.py index 8fe0b03..b9f9054 100644 --- a/plato/draw/vispy/Mesh.py +++ b/plato/draw/vispy/Mesh.py @@ -1,5 +1,7 @@ import itertools + import numpy as np + from ... import mesh from .internal import GLPrimitive, GLShapeDecorator from ... import draw diff --git a/plato/draw/vispy/Polygons.py b/plato/draw/vispy/Polygons.py index 973538d..fa2642b 100644 --- a/plato/draw/vispy/Polygons.py +++ b/plato/draw/vispy/Polygons.py @@ -1,5 +1,7 @@ import itertools + import numpy as np + from ... import geometry from ... import mesh from .internal import GLPrimitive, GLShapeDecorator diff --git a/plato/draw/vispy/Scene.py b/plato/draw/vispy/Scene.py index 39958bc..2bddb29 100644 --- a/plato/draw/vispy/Scene.py +++ b/plato/draw/vispy/Scene.py @@ -1,8 +1,10 @@ import logging + +import numpy as np import vispy.io + from .Canvas import Canvas from ... import draw -import numpy as np from ..Scene import DEFAULT_DIRECTIONAL_LIGHTS logger = logging.getLogger(__name__) diff --git a/plato/draw/vispy/SpherePoints.py b/plato/draw/vispy/SpherePoints.py index f8d57d1..2a624ea 100644 --- a/plato/draw/vispy/SpherePoints.py +++ b/plato/draw/vispy/SpherePoints.py @@ -1,5 +1,7 @@ import itertools + import numpy as np + from .internal import GLPrimitive, GLShapeDecorator from ... import draw from ..internal import ShapeAttribute diff --git a/plato/draw/vispy/SphereUnions.py b/plato/draw/vispy/SphereUnions.py index ce14b0a..3645c52 100644 --- a/plato/draw/vispy/SphereUnions.py +++ b/plato/draw/vispy/SphereUnions.py @@ -1,5 +1,7 @@ import itertools + import numpy as np + from ... import mesh from .internal import GLPrimitive, GLShapeDecorator from ... import draw diff --git a/plato/draw/vispy/Spheres.py b/plato/draw/vispy/Spheres.py index 9bb1103..bad62b4 100644 --- a/plato/draw/vispy/Spheres.py +++ b/plato/draw/vispy/Spheres.py @@ -1,5 +1,7 @@ import itertools + import numpy as np + from ... import mesh from .internal import GLPrimitive, GLShapeDecorator from ... import draw diff --git a/plato/draw/vispy/Spheropolygons.py b/plato/draw/vispy/Spheropolygons.py index c360d5a..3527b40 100644 --- a/plato/draw/vispy/Spheropolygons.py +++ b/plato/draw/vispy/Spheropolygons.py @@ -1,5 +1,7 @@ import itertools + import numpy as np + from ... import mesh from .internal import GLPrimitive, GLShapeDecorator from ... import draw diff --git a/plato/draw/vispy/Voronoi.py b/plato/draw/vispy/Voronoi.py index d3c97e5..300bc0f 100644 --- a/plato/draw/vispy/Voronoi.py +++ b/plato/draw/vispy/Voronoi.py @@ -1,5 +1,7 @@ import itertools + import numpy as np + from ... import mesh from .internal import GLPrimitive, GLShapeDecorator from ... import draw diff --git a/plato/draw/vispy/internal.py b/plato/draw/vispy/internal.py index 41d361a..1f55f35 100644 --- a/plato/draw/vispy/internal.py +++ b/plato/draw/vispy/internal.py @@ -1,8 +1,10 @@ import functools import itertools + import numpy as np import vispy, vispy.app from vispy import gloo + from ... import mesh from ..internal import array_size_checkers, ATTRIBUTE_DOCSTRING_TEMPLATE from ..Scene import DEFAULT_DIRECTIONAL_LIGHTS diff --git a/plato/draw/zdog/Scene.py b/plato/draw/zdog/Scene.py index d6b1359..b758f8a 100644 --- a/plato/draw/zdog/Scene.py +++ b/plato/draw/zdog/Scene.py @@ -1,7 +1,8 @@ -from ... import draw import numpy as np import rowan +from ... import draw + LOCAL_HELPER_SCRIPT = """ let is_in_view = function(elt) { let bounding_rect = elt.getBoundingClientRect(); diff --git a/plato/draw/zdog/Spheres.py b/plato/draw/zdog/Spheres.py index 14460f0..cc963cb 100644 --- a/plato/draw/zdog/Spheres.py +++ b/plato/draw/zdog/Spheres.py @@ -1,6 +1,8 @@ import collections import itertools + import numpy as np + from ... import draw, mesh from ...draw import internal diff --git a/plato/draw/zdog/internal.py b/plato/draw/zdog/internal.py index 850dd6f..62c7b8f 100644 --- a/plato/draw/zdog/internal.py +++ b/plato/draw/zdog/internal.py @@ -1,5 +1,6 @@ import numpy as np import rowan + from ... import geometry, mesh class PolyhedronRenderer: diff --git a/plato/imp.py b/plato/imp.py index 650bf45..f21ff79 100644 --- a/plato/imp.py +++ b/plato/imp.py @@ -24,9 +24,10 @@ """ import functools import importlib -import plato.draw as draw import sys +from . import draw + _pending_primitives = [] _last_scene = None _used_vispy_backend = None diff --git a/plato/mesh.py b/plato/mesh.py index eb0692d..7664791 100644 --- a/plato/mesh.py +++ b/plato/mesh.py @@ -1,6 +1,7 @@ from collections import defaultdict, namedtuple from itertools import repeat + import numpy as np from .geometry import convexHull, insetPolygon, massProperties, Polygon