|
| 1 | +from __future__ import annotations |
| 2 | + |
| 3 | +from typing import TYPE_CHECKING |
| 4 | +from typing import Any |
| 5 | + |
| 6 | +from bmipy.bmi import Bmi |
| 7 | + |
| 8 | +if TYPE_CHECKING: |
| 9 | + import numpy as np |
| 10 | + from numpy.typing import NDArray |
| 11 | + |
| 12 | + |
| 13 | +class BmiStub(Bmi): |
| 14 | + """Concrete BMI base for partial implementations. |
| 15 | +
|
| 16 | + Unless overridden, all methods raise ``NotImplementedError``. |
| 17 | + """ |
| 18 | + |
| 19 | + def initialize(self, config_file: str) -> None: |
| 20 | + raise NotImplementedError("initialize") |
| 21 | + |
| 22 | + def update(self) -> None: |
| 23 | + raise NotImplementedError("update") |
| 24 | + |
| 25 | + def update_until(self, time: float) -> None: |
| 26 | + raise NotImplementedError("update_until") |
| 27 | + |
| 28 | + def finalize(self) -> None: |
| 29 | + raise NotImplementedError("finalize") |
| 30 | + |
| 31 | + def get_component_name(self) -> str: |
| 32 | + raise NotImplementedError("get_component_name") |
| 33 | + |
| 34 | + def get_input_item_count(self) -> int: |
| 35 | + raise NotImplementedError("get_input_item_count") |
| 36 | + |
| 37 | + def get_input_var_names(self) -> tuple[str, ...]: |
| 38 | + raise NotImplementedError("get_input_var_names") |
| 39 | + |
| 40 | + def get_output_item_count(self) -> int: |
| 41 | + raise NotImplementedError("get_output_item_count") |
| 42 | + |
| 43 | + def get_output_var_names(self) -> tuple[str, ...]: |
| 44 | + raise NotImplementedError("get_output_var_names") |
| 45 | + |
| 46 | + def get_var_grid(self, name: str) -> int: |
| 47 | + raise NotImplementedError("get_var_grid") |
| 48 | + |
| 49 | + def get_var_itemsize(self, name: str) -> int: |
| 50 | + raise NotImplementedError("get_var_itemsize") |
| 51 | + |
| 52 | + def get_var_location(self, name: str) -> str: |
| 53 | + raise NotImplementedError("get_var_location") |
| 54 | + |
| 55 | + def get_var_nbytes(self, name: str) -> int: |
| 56 | + raise NotImplementedError("get_var_nbytes") |
| 57 | + |
| 58 | + def get_var_type(self, name: str) -> str: |
| 59 | + raise NotImplementedError("get_var_type") |
| 60 | + |
| 61 | + def get_var_units(self, name: str) -> str: |
| 62 | + raise NotImplementedError("get_var_units") |
| 63 | + |
| 64 | + def get_current_time(self) -> float: |
| 65 | + raise NotImplementedError("get_current_time") |
| 66 | + |
| 67 | + def get_end_time(self) -> float: |
| 68 | + raise NotImplementedError("get_end_time") |
| 69 | + |
| 70 | + def get_start_time(self) -> float: |
| 71 | + raise NotImplementedError("get_start_time") |
| 72 | + |
| 73 | + def get_time_step(self) -> float: |
| 74 | + raise NotImplementedError("get_time_step") |
| 75 | + |
| 76 | + def get_time_units(self) -> str: |
| 77 | + raise NotImplementedError("get_time_units") |
| 78 | + |
| 79 | + def get_value(self, name: str, dest: NDArray[Any]) -> NDArray[Any]: |
| 80 | + raise NotImplementedError("get_value") |
| 81 | + |
| 82 | + def get_value_at_indices( |
| 83 | + self, name: str, dest: NDArray[Any], inds: NDArray[np.int_] |
| 84 | + ) -> NDArray[Any]: |
| 85 | + raise NotImplementedError("get_value_at_indices") |
| 86 | + |
| 87 | + def get_value_ptr(self, name: str) -> NDArray[Any]: |
| 88 | + raise NotImplementedError("get_value_ptr") |
| 89 | + |
| 90 | + def set_value(self, name: str, src: NDArray[Any]) -> None: |
| 91 | + raise NotImplementedError("set_value") |
| 92 | + |
| 93 | + def set_value_at_indices( |
| 94 | + self, name: str, inds: NDArray[np.int_], src: NDArray[Any] |
| 95 | + ) -> None: |
| 96 | + raise NotImplementedError("set_value_at_indices") |
| 97 | + |
| 98 | + def get_grid_edge_count(self, grid: int) -> int: |
| 99 | + raise NotImplementedError("get_grid_edge_count") |
| 100 | + |
| 101 | + def get_grid_edge_nodes( |
| 102 | + self, grid: int, edge_nodes: NDArray[np.int_] |
| 103 | + ) -> NDArray[np.int_]: |
| 104 | + raise NotImplementedError("get_grid_edge_nodes") |
| 105 | + |
| 106 | + def get_grid_face_count(self, grid: int) -> int: |
| 107 | + raise NotImplementedError("get_grid_face_count") |
| 108 | + |
| 109 | + def get_grid_face_edges( |
| 110 | + self, grid: int, face_edges: NDArray[np.int_] |
| 111 | + ) -> NDArray[np.int_]: |
| 112 | + raise NotImplementedError("get_grid_face_edges") |
| 113 | + |
| 114 | + def get_grid_face_nodes( |
| 115 | + self, grid: int, face_nodes: NDArray[np.int_] |
| 116 | + ) -> NDArray[np.int_]: |
| 117 | + raise NotImplementedError("get_grid_face_nodes") |
| 118 | + |
| 119 | + def get_grid_node_count(self, grid: int) -> int: |
| 120 | + raise NotImplementedError("get_grid_node_count") |
| 121 | + |
| 122 | + def get_grid_nodes_per_face( |
| 123 | + self, grid: int, nodes_per_face: NDArray[np.int_] |
| 124 | + ) -> NDArray[np.int_]: |
| 125 | + raise NotImplementedError("get_grid_nodes_per_face") |
| 126 | + |
| 127 | + def get_grid_origin( |
| 128 | + self, grid: int, origin: NDArray[np.float64] |
| 129 | + ) -> NDArray[np.float64]: |
| 130 | + raise NotImplementedError("get_grid_origin") |
| 131 | + |
| 132 | + def get_grid_rank(self, grid: int) -> int: |
| 133 | + raise NotImplementedError("get_grid_rank") |
| 134 | + |
| 135 | + def get_grid_shape(self, grid: int, shape: NDArray[np.int_]) -> NDArray[np.int_]: |
| 136 | + raise NotImplementedError("get_grid_shape") |
| 137 | + |
| 138 | + def get_grid_size(self, grid: int) -> int: |
| 139 | + raise NotImplementedError("get_grid_size") |
| 140 | + |
| 141 | + def get_grid_spacing( |
| 142 | + self, grid: int, spacing: NDArray[np.float64] |
| 143 | + ) -> NDArray[np.float64]: |
| 144 | + raise NotImplementedError("get_grid_spacing") |
| 145 | + |
| 146 | + def get_grid_type(self, grid: int) -> str: |
| 147 | + raise NotImplementedError("get_grid_type") |
| 148 | + |
| 149 | + def get_grid_x(self, grid: int, x: NDArray[np.float64]) -> NDArray[np.float64]: |
| 150 | + raise NotImplementedError("get_grid_x") |
| 151 | + |
| 152 | + def get_grid_y(self, grid: int, y: NDArray[np.float64]) -> NDArray[np.float64]: |
| 153 | + raise NotImplementedError("get_grid_y") |
| 154 | + |
| 155 | + def get_grid_z(self, grid: int, z: NDArray[np.float64]) -> NDArray[np.float64]: |
| 156 | + raise NotImplementedError("get_grid_z") |
0 commit comments