Skip to content

Commit

Permalink
fix: adding type hints
Browse files Browse the repository at this point in the history
  • Loading branch information
lachlangrose committed Feb 9, 2023
1 parent 75890ca commit 916972c
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions LoopStructural/interpolators/supports/_3d_base_structured.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ def check_position(self, pos):
return False
return pos

def _global_indicies(self, indexes, nsteps):
def _global_indicies(self, indexes: np.ndarray, nsteps: np.ndarray) -> np.ndarray:
"""
Convert from cell indexes to global cell index
Expand Down Expand Up @@ -285,7 +285,9 @@ def position_to_cell_corners(self, pos):
inside = self.inside(pos)
ix, iy, iz = self.position_to_cell_index(pos)
cornersx, cornersy, cornersz = self.cell_corner_indexes(ix, iy, iz)
globalidx = self.global_indicies(np.dstack([cornersx, cornersy, cornersz]).T)
globalidx = self.global_node_indicies(
np.dstack([cornersx, cornersy, cornersz]).T
)
# if global index is not inside the support set to -1
globalidx[~inside] = -1
return globalidx, inside
Expand Down Expand Up @@ -360,7 +362,7 @@ def global_index_to_node_index(self, global_index):
z_index = global_index // self.nsteps[0, None] // self.nsteps[1, None]
return x_index, y_index, z_index

def global_node_indicies(self, indexes):
def global_node_indicies(self, indexes) -> np.ndarray:
"""
Convert from node indexes to global node index
Expand All @@ -374,7 +376,7 @@ def global_node_indicies(self, indexes):
"""
return self._global_indicies(indexes, self.nsteps)

def global_cell_indicies(self, indexes):
def global_cell_indicies(self, indexes) -> np.ndarray:
"""
Convert from cell indexes to global cell index
Expand Down

0 comments on commit 916972c

Please sign in to comment.