Skip to content

Commit

Permalink
Clean up import style
Browse files Browse the repository at this point in the history
  • Loading branch information
klarh committed Feb 23, 2020
1 parent db9c4df commit 50597ae
Show file tree
Hide file tree
Showing 74 changed files with 155 additions and 42 deletions.
3 changes: 2 additions & 1 deletion plato/draw/Arrows2D.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import numpy as np
from .Polygons import Polygons

from .internal import ShapeDecorator
from .Polygons import Polygons

@ShapeDecorator
class Arrows2D(Polygons):
Expand Down
2 changes: 2 additions & 0 deletions plato/draw/Box.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import functools
import itertools

import numpy as np

from .. import math
from .internal import ShapeDecorator, ShapeAttribute
from .Lines import Lines
Expand Down
2 changes: 2 additions & 0 deletions plato/draw/ConvexPolyhedra.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import itertools

import numpy as np

from .internal import Shape, ShapeDecorator, ShapeAttribute

@ShapeDecorator
Expand Down
2 changes: 2 additions & 0 deletions plato/draw/ConvexSpheropolyhedra.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import itertools

import numpy as np

from .internal import Shape, ShapeDecorator, ShapeAttribute

@ShapeDecorator
Expand Down
2 changes: 2 additions & 0 deletions plato/draw/DiskUnions.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import itertools

import numpy as np

from .internal import Shape, ShapeDecorator, ShapeAttribute

@ShapeDecorator
Expand Down
2 changes: 2 additions & 0 deletions plato/draw/Disks.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import itertools

import numpy as np

from .internal import Shape, ShapeDecorator, ShapeAttribute

@ShapeDecorator
Expand Down
2 changes: 2 additions & 0 deletions plato/draw/Ellipsoids.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import itertools

import numpy as np

from .internal import Shape, ShapeDecorator, ShapeAttribute

@ShapeDecorator
Expand Down
2 changes: 2 additions & 0 deletions plato/draw/Lines.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import itertools

import numpy as np

from .internal import Shape, ShapeDecorator, ShapeAttribute

@ShapeDecorator
Expand Down
2 changes: 2 additions & 0 deletions plato/draw/Mesh.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import itertools

import numpy as np

from .internal import Shape, ShapeDecorator, ShapeAttribute
from .. import mesh

Expand Down
2 changes: 2 additions & 0 deletions plato/draw/Polygons.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import itertools

import numpy as np

from .internal import Shape, ShapeDecorator, ShapeAttribute

@ShapeDecorator
Expand Down
2 changes: 2 additions & 0 deletions plato/draw/Scene.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import logging

import numpy as np

from .internal import Shape

DEFAULT_DIRECTIONAL_LIGHTS = (
Expand Down
2 changes: 2 additions & 0 deletions plato/draw/SpherePoints.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import itertools

import numpy as np

from .internal import Shape, ShapeDecorator, ShapeAttribute

@ShapeDecorator
Expand Down
2 changes: 2 additions & 0 deletions plato/draw/SphereUnions.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import itertools

import numpy as np

from .internal import Shape, ShapeDecorator, ShapeAttribute

@ShapeDecorator
Expand Down
2 changes: 2 additions & 0 deletions plato/draw/Spheres.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import itertools

import numpy as np

from .internal import Shape, ShapeDecorator, ShapeAttribute

@ShapeDecorator
Expand Down
2 changes: 2 additions & 0 deletions plato/draw/Spheropolygons.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import itertools

import numpy as np

from .internal import Shape, ShapeDecorator, ShapeAttribute

@ShapeDecorator
Expand Down
2 changes: 2 additions & 0 deletions plato/draw/Voronoi.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import itertools

import numpy as np

from .internal import Shape, ShapeDecorator, ShapeAttribute

@ShapeDecorator
Expand Down
1 change: 0 additions & 1 deletion plato/draw/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from .Scene import Scene


from .Arrows2D import Arrows2D
from .Box import Box
from .Disks import Disks
Expand Down
6 changes: 4 additions & 2 deletions plato/draw/blender/ConvexPolyhedra.py
Original file line number Diff line number Diff line change
@@ -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),
Expand Down
5 changes: 3 additions & 2 deletions plato/draw/blender/Scene.py
Original file line number Diff line number Diff line change
@@ -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__
Expand Down
6 changes: 4 additions & 2 deletions plato/draw/blender/Spheres.py
Original file line number Diff line number Diff line change
@@ -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),
Expand Down
4 changes: 3 additions & 1 deletion plato/draw/fresnel/ConvexPolyhedra.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 1 addition & 0 deletions plato/draw/fresnel/Disks.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import fresnel

from ... import draw
from .FresnelPrimitive import FresnelPrimitiveSolid

Expand Down
4 changes: 3 additions & 1 deletion plato/draw/fresnel/Ellipsoids.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 3 additions & 1 deletion plato/draw/fresnel/Lines.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
3 changes: 2 additions & 1 deletion plato/draw/fresnel/Polygons.py
Original file line number Diff line number Diff line change
@@ -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__
Expand Down
2 changes: 1 addition & 1 deletion plato/draw/fresnel/Scene.py
Original file line number Diff line number Diff line change
@@ -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 '') + """
Expand Down
3 changes: 2 additions & 1 deletion plato/draw/fresnel/SphereUnions.py
Original file line number Diff line number Diff line change
@@ -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__
Expand Down
1 change: 1 addition & 0 deletions plato/draw/fresnel/Spheres.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import fresnel

from ... import draw
from .FresnelPrimitive import FresnelPrimitive

Expand Down
3 changes: 2 additions & 1 deletion plato/draw/fresnel/Spheropolygons.py
Original file line number Diff line number Diff line change
@@ -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__
Expand Down
3 changes: 2 additions & 1 deletion plato/draw/internal.py
Original file line number Diff line number Diff line change
@@ -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:'
Expand Down
5 changes: 3 additions & 2 deletions plato/draw/matplotlib/ConvexPolyhedra.py
Original file line number Diff line number Diff line change
@@ -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__
Expand Down
5 changes: 3 additions & 2 deletions plato/draw/matplotlib/DiskUnions.py
Original file line number Diff line number Diff line change
@@ -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__
Expand Down
3 changes: 2 additions & 1 deletion plato/draw/matplotlib/Disks.py
Original file line number Diff line number Diff line change
@@ -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__
Expand Down
7 changes: 4 additions & 3 deletions plato/draw/matplotlib/Polygons.py
Original file line number Diff line number Diff line change
@@ -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__
Expand Down
2 changes: 2 additions & 0 deletions plato/draw/matplotlib/Scene.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 1 addition & 0 deletions plato/draw/matplotlib/SpherePoints.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import numpy as np

from ... import draw
from ... import math

Expand Down
4 changes: 3 additions & 1 deletion plato/draw/matplotlib/Spheres.py
Original file line number Diff line number Diff line change
@@ -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):
Expand Down
7 changes: 4 additions & 3 deletions plato/draw/matplotlib/Spheropolygons.py
Original file line number Diff line number Diff line change
@@ -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__
Expand Down
2 changes: 2 additions & 0 deletions plato/draw/povray/ConvexPolyhedra.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import itertools

import numpy as np

from ... import draw
from ... import mesh as pmesh
from ... import geometry
Expand Down
1 change: 1 addition & 0 deletions plato/draw/povray/ConvexSpheropolyhedra.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import numpy as np

from ... import draw
from ... import mesh as pmesh
from ... import geometry
Expand Down
1 change: 1 addition & 0 deletions plato/draw/povray/Ellipsoids.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import numpy as np
import rowan

from ... import draw, mesh

class Ellipsoids(draw.Ellipsoids):
Expand Down
2 changes: 2 additions & 0 deletions plato/draw/povray/Lines.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import itertools

import numpy as np

from ... import draw
from ..internal import ShapeDecorator, ShapeAttribute
from ... import math as pmath
Expand Down
1 change: 1 addition & 0 deletions plato/draw/povray/Mesh.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import numpy as np

from ... import draw
from ... import math as pmath
from ... import mesh
Expand Down
Loading

0 comments on commit 50597ae

Please sign in to comment.