Skip to content

Commit

Permalink
use np.float64 instead of np.float_
Browse files Browse the repository at this point in the history
  • Loading branch information
mcflugen committed Oct 18, 2024
1 parent ad7ed5c commit 4cbc5e9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
14 changes: 7 additions & 7 deletions heat/bmi_heat.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,15 +301,15 @@ def get_grid_shape(self, grid_id: int, shape: NDArray[np.int_]) -> NDArray[np.in
return shape

def get_grid_spacing(
self, grid_id: int, spacing: NDArray[np.float_]
) -> NDArray[np.float_]:
self, grid_id: int, spacing: NDArray[np.float64]
) -> NDArray[np.float64]:
"""Spacing of rows and columns of uniform rectilinear grid."""
spacing[:] = self._model.spacing
return spacing

def get_grid_origin(
self, grid_id: int, origin: NDArray[np.float_]
) -> NDArray[np.float_]:
self, grid_id: int, origin: NDArray[np.float64]
) -> NDArray[np.float64]:
"""Origin of uniform rectilinear grid."""
origin[:] = self._model.origin
return origin
Expand Down Expand Up @@ -370,11 +370,11 @@ def get_grid_nodes_per_face(
def get_grid_face_edges(self, grid: int, face_edges: NDArray[np.int_]) -> None:
raise NotImplementedError("get_grid_face_edges")

def get_grid_x(self, grid: int, x: NDArray[np.float_]) -> None:
def get_grid_x(self, grid: int, x: NDArray[np.float64]) -> None:
raise NotImplementedError("get_grid_x")

def get_grid_y(self, grid: int, y: NDArray[np.float_]) -> None:
def get_grid_y(self, grid: int, y: NDArray[np.float64]) -> None:
raise NotImplementedError("get_grid_y")

def get_grid_z(self, grid: int, z: NDArray[np.float_]) -> None:
def get_grid_z(self, grid: int, z: NDArray[np.float64]) -> None:
raise NotImplementedError("get_grid_z")
8 changes: 4 additions & 4 deletions heat/heat.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@


def solve_2d(
temp: NDArray[np.float_],
temp: NDArray[np.float64],
spacing: tuple[float, ...],
out: NDArray[np.float_] | None = None,
out: NDArray[np.float64] | None = None,
alpha: float = 1.0,
time_step: float = 1.0,
) -> NDArray[np.float_]:
) -> NDArray[np.float64]:
"""Solve the 2D Heat Equation on a uniform mesh.
Parameters
Expand Down Expand Up @@ -127,7 +127,7 @@ def time(self) -> float:
return self._time

@property
def temperature(self) -> NDArray[np.float_]:
def temperature(self) -> NDArray[np.float64]:
"""Temperature of the plate."""
return self._temperature

Expand Down

0 comments on commit 4cbc5e9

Please sign in to comment.