Skip to content

Commit

Permalink
Merge pull request #165 from hsorby/pep8-fixes
Browse files Browse the repository at this point in the history
Optimise imports and perform some PEP8 fixes.
  • Loading branch information
hsorby authored Nov 4, 2021
2 parents 13d22c0 + 3586432 commit 0842203
Show file tree
Hide file tree
Showing 73 changed files with 793 additions and 643 deletions.
11 changes: 5 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
from setuptools import setup, find_packages
from setuptools.command.install import install
import os
import io
import os

from setuptools import setup, find_packages

SETUP_DIR = os.path.dirname(os.path.abspath(__file__))

# List all of your Python package dependencies in the
# requirements.txt file

def readfile(filename, split=False):
with io.open(filename, encoding="utf-8") as stream:
if split:
return stream.read().split("\n")
return stream.read()


readme = readfile("README.rst", split=True)[3:] # skip title
# For requirements not hosted on PyPi place listings
# into the 'requirements.txt' file.
Expand Down Expand Up @@ -46,4 +45,4 @@ def readfile(filename, split=False):
include_package_data=True,
zip_safe=False,
install_requires=requires,
)
)
2 changes: 0 additions & 2 deletions src/scaffoldmaker/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +0,0 @@
__import__('pkg_resources').declare_namespace(__name__)

3 changes: 2 additions & 1 deletion src/scaffoldmaker/annotation/annotationgroup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@
Describes subdomains of a scaffold with attached names and terms.
"""

from opencmiss.utils.zinc.general import ChangeManager
from opencmiss.zinc.field import Field, FieldGroup
from opencmiss.zinc.result import RESULT_OK
from opencmiss.utils.zinc.general import ChangeManager
from scaffoldmaker.utils.zinc_utils import group_get_highest_dimension, \
identifier_ranges_from_string, identifier_ranges_to_string, \
mesh_group_add_identifier_ranges, mesh_group_to_identifier_ranges, \
nodeset_group_add_identifier_ranges, nodeset_group_to_identifier_ranges


class AnnotationGroup(object):
'''
Describes subdomains of a scaffold with attached names and terms.
Expand Down
5 changes: 3 additions & 2 deletions src/scaffoldmaker/meshtypes/meshtype_1d_bifurcationtree1.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
"""

from __future__ import division
from math import cos, radians, sin, sqrt
from math import cos, radians, sin

from opencmiss.maths.vectorops import add, cross, magnitude, mult, normalize, sub
from opencmiss.utils.zinc.field import findOrCreateFieldCoordinates, findOrCreateFieldFiniteElement
from opencmiss.zinc.element import Element, Elementbasis
from opencmiss.utils.zinc.general import ChangeManager
from opencmiss.zinc.element import Element, Elementbasis
from opencmiss.zinc.field import Field
from opencmiss.zinc.node import Node
from scaffoldmaker.meshtypes.scaffold_base import Scaffold_base
Expand Down
5 changes: 2 additions & 3 deletions src/scaffoldmaker/meshtypes/meshtype_1d_path1.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,15 @@
"""

from __future__ import division
import math

from opencmiss.utils.zinc.field import findOrCreateFieldCoordinates, findOrCreateFieldGroup
from opencmiss.utils.zinc.general import ChangeManager
from opencmiss.zinc.element import Element, Elementbasis
from opencmiss.zinc.field import Field
from opencmiss.zinc.node import Node
from scaffoldmaker.meshtypes.scaffold_base import Scaffold_base
from scaffoldmaker.utils.interpolation import DerivativeScalingMode, smoothCubicHermiteDerivativesLine, smoothCubicHermiteCrossDerivativesLine
from scaffoldmaker.utils import vector
from opencmiss.zinc.result import RESULT_OK
from scaffoldmaker.utils.interpolation import smoothCubicHermiteCrossDerivativesLine


class MeshType_1d_path1(Scaffold_base):
Expand Down
3 changes: 2 additions & 1 deletion src/scaffoldmaker/meshtypes/meshtype_2d_plate1.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@
"""

from __future__ import division
import math

from opencmiss.utils.zinc.field import findOrCreateFieldCoordinates
from opencmiss.zinc.element import Element, Elementbasis
from opencmiss.zinc.field import Field
from opencmiss.zinc.node import Node
from scaffoldmaker.meshtypes.scaffold_base import Scaffold_base


class MeshType_2d_plate1(Scaffold_base):
'''
classdocs
Expand Down
3 changes: 3 additions & 0 deletions src/scaffoldmaker/meshtypes/meshtype_2d_platehole1.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,17 @@
"""

from __future__ import division

import math

from opencmiss.utils.zinc.field import findOrCreateFieldCoordinates
from opencmiss.zinc.element import Element, Elementbasis, Elementfieldtemplate
from opencmiss.zinc.field import Field
from opencmiss.zinc.node import Node
from scaffoldmaker.meshtypes.scaffold_base import Scaffold_base
from scaffoldmaker.utils.interpolation import interpolateCubicHermite, interpolateCubicHermiteDerivative


class MeshType_2d_platehole1(Scaffold_base):
'''
classdocs
Expand Down
3 changes: 3 additions & 0 deletions src/scaffoldmaker/meshtypes/meshtype_2d_sphere1.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,16 @@
"""

from __future__ import division

import math

from opencmiss.utils.zinc.field import findOrCreateFieldCoordinates
from opencmiss.zinc.element import Element, Elementbasis, Elementfieldtemplate
from opencmiss.zinc.field import Field
from opencmiss.zinc.node import Node
from scaffoldmaker.meshtypes.scaffold_base import Scaffold_base


class MeshType_2d_sphere1(Scaffold_base):
'''
classdocs
Expand Down
3 changes: 3 additions & 0 deletions src/scaffoldmaker/meshtypes/meshtype_2d_tube1.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,16 @@
"""

from __future__ import division

import math

from opencmiss.utils.zinc.field import findOrCreateFieldCoordinates
from opencmiss.zinc.element import Element, Elementbasis
from opencmiss.zinc.field import Field
from opencmiss.zinc.node import Node
from scaffoldmaker.meshtypes.scaffold_base import Scaffold_base


class MeshType_2d_tube1(Scaffold_base):
'''
classdocs
Expand Down
2 changes: 2 additions & 0 deletions src/scaffoldmaker/meshtypes/meshtype_2d_tubebifurcation1.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
"""

from __future__ import division

import math

from opencmiss.maths.vectorops import cross, mult, normalize, sub
from opencmiss.utils.zinc.field import findOrCreateFieldCoordinates
from opencmiss.zinc.field import Field
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,14 @@

from __future__ import division
import math
from opencmiss.maths.vectorops import cross, mult, normalize, sub

from opencmiss.utils.zinc.field import findOrCreateFieldCoordinates
from opencmiss.zinc.field import Field
from opencmiss.zinc.node import Node
from scaffoldmaker.meshtypes.meshtype_1d_bifurcationtree1 import MeshType_1d_bifurcationtree1
from scaffoldmaker.meshtypes.scaffold_base import Scaffold_base
from scaffoldmaker.scaffoldpackage import ScaffoldPackage
from scaffoldmaker.utils.bifurcation import get_curve_circle_points, \
make_tube_bifurcation_points, make_tube_bifurcation_elements_2d
from scaffoldmaker.utils.geometry import createCirclePoints
from scaffoldmaker.utils.bifurcation import get_curve_circle_points
from scaffoldmaker.utils.interpolation import getCubicHermiteArcLength


Expand Down
8 changes: 5 additions & 3 deletions src/scaffoldmaker/meshtypes/meshtype_3d_bladder1.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
"""

from __future__ import division
import math

import copy
import math

from opencmiss.utils.zinc.field import findOrCreateFieldCoordinates
from opencmiss.zinc.element import Element
from opencmiss.zinc.field import Field
Expand All @@ -14,11 +16,11 @@
from scaffoldmaker.meshtypes.meshtype_3d_ostium1 import MeshType_3d_ostium1, generateOstiumMesh
from scaffoldmaker.meshtypes.scaffold_base import Scaffold_base
from scaffoldmaker.scaffoldpackage import ScaffoldPackage
from scaffoldmaker.utils import interpolation as interp
from scaffoldmaker.utils import vector
from scaffoldmaker.utils.annulusmesh import createAnnulusMesh3d
from scaffoldmaker.utils.eftfactory_bicubichermitelinear import eftfactory_bicubichermitelinear
from scaffoldmaker.utils import interpolation as interp
from scaffoldmaker.utils.interpolation import getCubicHermiteBasis, smoothCubicHermiteDerivativesLine
from scaffoldmaker.utils import vector
from scaffoldmaker.utils.meshrefinement import MeshRefinement
from scaffoldmaker.utils.tracksurface import TrackSurface, TrackSurfacePosition, calculate_surface_axes

Expand Down
9 changes: 5 additions & 4 deletions src/scaffoldmaker/meshtypes/meshtype_3d_bladderurethra1.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@

import copy
import math

from opencmiss.utils.zinc.field import findOrCreateFieldGroup, findOrCreateFieldNodeGroup, findOrCreateFieldStoredMeshLocation, findOrCreateFieldStoredString
from opencmiss.zinc.element import Element
from opencmiss.zinc.field import Field
from opencmiss.zinc.node import Node
from scaffoldmaker.annotation.annotationgroup import AnnotationGroup, findOrCreateAnnotationGroupForTerm, getAnnotationGroupForTerm
from scaffoldmaker.annotation.bladder_terms import get_bladder_term
from scaffoldmaker.meshtypes.meshtype_1d_path1 import MeshType_1d_path1, extractPathParametersFromRegion
Expand All @@ -21,10 +26,6 @@
from scaffoldmaker.utils.interpolation import smoothCubicHermiteDerivativesLine
from scaffoldmaker.utils.tracksurface import TrackSurface, TrackSurfacePosition, calculate_surface_axes
from scaffoldmaker.utils.zinc_utils import exnodeStringFromNodeValues, mesh_destroy_elements_and_nodes_by_identifiers
from opencmiss.utils.zinc.field import findOrCreateFieldGroup, findOrCreateFieldNodeGroup, findOrCreateFieldStoredMeshLocation, findOrCreateFieldStoredString
from opencmiss.zinc.element import Element
from opencmiss.zinc.field import Field
from opencmiss.zinc.node import Node


class MeshType_3d_bladderurethra1(Scaffold_base):
Expand Down
5 changes: 3 additions & 2 deletions src/scaffoldmaker/meshtypes/meshtype_3d_box1.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,16 @@
"""

from __future__ import division
import math

from opencmiss.utils.zinc.field import findOrCreateFieldCoordinates
from opencmiss.zinc.element import Element, Elementbasis
from opencmiss.zinc.element import Element
from opencmiss.zinc.field import Field
from opencmiss.zinc.node import Node
from scaffoldmaker.meshtypes.scaffold_base import Scaffold_base
from scaffoldmaker.utils.eftfactory_tricubichermite import eftfactory_tricubichermite
from scaffoldmaker.utils.meshrefinement import MeshRefinement


class MeshType_3d_box1(Scaffold_base):
'''
classdocs
Expand Down
3 changes: 3 additions & 0 deletions src/scaffoldmaker/meshtypes/meshtype_3d_boxhole1.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
"""

from __future__ import division

import math

from opencmiss.utils.zinc.field import findOrCreateFieldCoordinates
from opencmiss.zinc.element import Element, Elementbasis, Elementfieldtemplate
from opencmiss.zinc.field import Field
Expand All @@ -15,6 +17,7 @@
from scaffoldmaker.utils.eftfactory_tricubichermite import eftfactory_tricubichermite
from scaffoldmaker.utils.interpolation import interpolateCubicHermite, interpolateCubicHermiteDerivative


class MeshType_3d_boxhole1(Scaffold_base):
'''
classdocs
Expand Down
Loading

0 comments on commit 0842203

Please sign in to comment.