Skip to content

Commit

Permalink
fix: 🐛 fixing bugs for flake8
Browse files Browse the repository at this point in the history
  • Loading branch information
Lachlan Grose committed Feb 20, 2022
1 parent 1dcc716 commit 9dce30c
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 3 deletions.
4 changes: 4 additions & 0 deletions LoopStructural/analysis/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
Various tools for analysing loopstructural models, including calculating fault intersections and fault toplogies
"""
from LoopStructural.utils import getLogger

logger = getLogger(__name__)

logger.warning("LoopStructural.analysis is experimental and may not perform as expected")
from ._fault_displacement import displacement_missfit
from ._fault_intersection import calculate_fault_intersections
Expand Down
9 changes: 7 additions & 2 deletions LoopStructural/interpolators/_geological_interpolator.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,13 @@ def __init__(self):
self.valid = False

def __str__(self):

return self.__str
name = f'{self.type} \n'
name += f'{self.n_g} gradient points\n'
name += f'{self.n_i} interface points\n'
name += f'{self.n_n} normal points\n'
name += f'{self.n_t} tangent points\n'
name += f'{self.n_g + self.n_i + self.n_n + self.n_t} total points\n'
return name

def set_region(self, **kwargs):
pass
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@ def __init__(self, elements, vertices, neighbours):
self.edge_relationships = self.edge_relationships[:edge_index, :]

@property
def ncps(self):
"""
Returns the number of nodes for an element in the mesh
"""
return self.elements.shape[1]
@property
def nodes(self):
"""
Gets the nodes of the mesh as a property rather than using a function, accessible as a property! Python magic!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ def get_quadrature_points(self,npts=2):

v1 = self.nodes[self.edges][:, 0, :]
v2 = self.nodes[self.edges][:, 1, :]
cp = np.zeros((v1.shape[0], ncp, 2))
cp = np.zeros((v1.shape[0], self.ncps, 2))
cp[:, 0] = 0.25 * v1 + 0.75 * v2
cp[:, 1] = 0.75 * v1 + 0.25 * v2
return cp
Expand Down

0 comments on commit 9dce30c

Please sign in to comment.