ewatercycle.testing.fake_models =============================== .. py:module:: ewatercycle.testing.fake_models .. autoapi-nested-parse:: Fake BMI models. Module Contents --------------- .. py:exception:: SomeError Bases: :py:obj:`Exception` Common base class for all non-exit exceptions. Initialize self. See help(type(self)) for accurate signature. .. py:class:: FailingModel(exc=SomeError()) Bases: :py:obj:`bmipy.Bmi` .. py:attribute:: exc .. py:method:: initialize(filename) .. py:method:: update() .. py:method:: update_until(time: float) -> None .. py:method:: finalize() .. py:method:: get_component_name() .. py:method:: get_input_item_count() -> int .. py:method:: get_output_item_count() -> int .. py:method:: get_input_var_names() .. py:method:: get_output_var_names() .. py:method:: get_start_time() .. py:method:: get_current_time() .. py:method:: get_end_time() .. py:method:: get_time_step() .. py:method:: get_time_units() .. py:method:: get_var_type(name) .. py:method:: get_var_units(name) .. py:method:: get_var_itemsize(name) .. py:method:: get_var_nbytes(name) .. py:method:: get_var_grid(name) .. py:method:: get_value(name, dest) .. py:method:: get_value_ptr(name) .. py:method:: get_value_at_indices(name, dest, inds) .. py:method:: set_value(name, src) .. py:method:: set_value_at_indices(name, inds, src) .. py:method:: get_grid_shape(grid, shape) .. py:method:: get_grid_x(grid, x) .. py:method:: get_grid_y(grid, y) .. py:method:: get_grid_z(grid, z) .. py:method:: get_grid_spacing(grid, spacing) .. py:method:: get_grid_origin(grid, origin) .. py:method:: get_grid_rank(grid) .. py:method:: get_grid_size(grid) .. py:method:: get_grid_type(grid) .. py:method:: get_var_location(name: str) -> str .. py:method:: get_grid_node_count(grid: int) -> int .. py:method:: get_grid_edge_count(grid: int) -> int .. py:method:: get_grid_face_count(grid: int) -> int .. py:method:: get_grid_edge_nodes(grid: int, edge_nodes: numpy.ndarray) -> numpy.ndarray .. py:method:: get_grid_face_nodes(grid: int, face_nodes: numpy.ndarray) -> numpy.ndarray .. py:method:: get_grid_nodes_per_face(grid: int, nodes_per_face: numpy.ndarray) -> numpy.ndarray .. py:method:: get_grid_face_edges(grid: int, face_edges: numpy.ndarray) -> numpy.ndarray .. py:class:: NotImplementedModel(exc=NotImplementedError()) Bases: :py:obj:`FailingModel` .. py:class:: WithMocksMixin Mock the bmi methods that return None and have no getter companion. Use `instance.mock..assert_called_once_with()` to check if the method is called correctly. .. py:attribute:: mock .. py:method:: initialize(config_file: str) -> None .. py:method:: finalize() .. py:class:: WithDailyMixin Mock the bmi methods that deal wtih time. Behaves like a daily model which started since epoch. .. py:attribute:: time :value: 0.0 .. py:method:: update() .. py:method:: get_current_time() .. py:method:: get_start_time() .. py:method:: get_end_time() .. py:method:: get_time_step() .. py:method:: get_time_units() .. py:class:: DummyModelWith2DRectilinearGrid Bases: :py:obj:`WithMocksMixin`, :py:obj:`WithDailyMixin`, :py:obj:`NotImplementedModel` Mock the bmi methods that return None and have no getter companion. Use `instance.mock..assert_called_once_with()` to check if the method is called correctly. .. py:attribute:: dtype .. py:attribute:: value .. py:method:: get_output_var_names() -> tuple[str] .. py:method:: get_input_var_names() .. py:method:: get_var_type(name) .. py:method:: get_var_grid(name) .. py:method:: get_var_units(name) .. py:method:: get_var_itemsize(name) .. py:method:: get_var_nbytes(name) .. py:method:: get_grid_type(grid) .. py:method:: get_grid_size(grid) .. py:method:: get_grid_rank(grid: int) -> int .. py:method:: get_grid_shape(grid: int, shape: numpy.ndarray) -> numpy.ndarray .. py:method:: get_value(name, dest) .. py:method:: get_value_at_indices(name, dest, inds) .. py:method:: set_value(name, src) .. py:method:: set_value_at_indices(name, inds, src) .. py:method:: get_grid_x(grid: int, x: numpy.ndarray) -> numpy.ndarray .. py:method:: get_grid_y(grid: int, y: numpy.ndarray) -> numpy.ndarray