Skip to content

Commit

Permalink
deploy: 1784ba3
Browse files Browse the repository at this point in the history
  • Loading branch information
BSchilperoort committed Nov 19, 2024
1 parent 59929a4 commit d7b3ae2
Show file tree
Hide file tree
Showing 97 changed files with 11,921 additions and 0 deletions.
4 changes: 4 additions & 0 deletions python/python-docs/.buildinfo
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Sphinx build info version 1
# This file records the configuration used when building these files. When it is not found, a full rebuild will be done.
config: 5e0266efd8936d82339efa0a461ba660
tags: 645f666f9bcd5a90fca523b33c5a78b7
11 changes: 11 additions & 0 deletions python/python-docs/_sources/autoapi/index.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
API Reference
=============

This page contains auto-generated API reference documentation [#f1]_.

.. toctree::
:titlesonly:

/autoapi/remotebmi/index

.. [#f1] Created with `sphinx-autoapi <https://github.com/readthedocs/sphinx-autoapi>`_
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
remotebmi.client.apptainer
==========================

.. py:module:: remotebmi.client.apptainer
Module Contents
---------------

.. py:class:: BmiClientApptainer(image: str, work_dir: str, input_dirs: collections.abc.Iterable[str] = (), delay: int = 0, capture_logs: bool = True)
Bases: :py:obj:`remotebmi.client.client.RemoteBmiClient`



RemoteBmiClient constructor

:param base_url: Where the remote BMI server is running.
:param timeout: How long a response can take.
Defaults to 1 day. Set to None to disable timeout.
:param max_keepalive_connections: How many connections to keep alive. "keepalive
connections" allow reusing of connections which is more efficient.
However, the R server implementation can break when they are used.
:param client: An optional httpx.Client instance to use. Mainly used for testing.

:raises ValueError: If the base_url is invalid.


.. py:attribute:: work_dir
.. py:attribute:: container
.. py:method:: logs() -> str
Returns complete combined stdout and stderr written by the Apptainer container.

When object was created with `log_enable=False` argument then always returns empty string.



Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
remotebmi.client.client
=======================

.. py:module:: remotebmi.client.client
Module Contents
---------------

.. py:class:: RemoteBmiClient(base_url: str, timeout: int = 60 * 60 * 24, max_keepalive_connections: int = 0, client: httpx.Client | None = None)
Bases: :py:obj:`bmipy.Bmi`



RemoteBmiClient constructor

:param base_url: Where the remote BMI server is running.
:param timeout: How long a response can take.
Defaults to 1 day. Set to None to disable timeout.
:param max_keepalive_connections: How many connections to keep alive. "keepalive
connections" allow reusing of connections which is more efficient.
However, the R server implementation can break when they are used.
:param client: An optional httpx.Client instance to use. Mainly used for testing.

:raises ValueError: If the base_url is invalid.


.. py:method:: initialize(config_file: str) -> None
.. py:method:: update() -> None
.. py:method:: update_until(until: float) -> None
.. py:method:: finalize() -> None
.. py:method:: get_component_name() -> str
.. py:method:: get_input_var_names() -> tuple[str, Ellipsis]
.. py:method:: get_output_var_names() -> tuple[str, Ellipsis]
.. py:method:: get_input_item_count() -> int
.. py:method:: get_output_item_count() -> int
.. py:method:: get_var_grid(name: str) -> int
.. py:method:: get_var_type(name: str) -> str
.. py:method:: get_var_units(name: str) -> str
.. py:method:: get_var_nbytes(name: str) -> int
.. py:method:: get_var_location(name: str) -> str
.. py:method:: get_var_itemsize(name: str) -> int
.. py:method:: get_current_time() -> float
.. py:method:: get_start_time() -> float
.. py:method:: get_end_time() -> float
.. py:method:: get_time_units() -> str
.. py:method:: get_time_step() -> float
.. py:method:: get_value(name: str, dest: numpy.ndarray) -> numpy.ndarray
.. py:method:: get_value_at_indices(name: str, dest: numpy.ndarray, inds: numpy.ndarray) -> numpy.ndarray
.. py:method:: set_value(name: str, src: numpy.ndarray) -> None
.. py:method:: set_value_at_indices(name: str, inds: numpy.ndarray, src: numpy.ndarray) -> None
.. py:method:: get_value_ptr(name: str) -> numpy.ndarray
:abstractmethod:



.. py:method:: get_grid_rank(grid: int) -> int
.. py:method:: get_grid_size(grid: int) -> int
.. py:method:: get_grid_type(grid: int) -> str
.. py:method:: get_grid_origin(grid: int, origin: numpy.ndarray) -> numpy.ndarray
.. py:method:: get_grid_spacing(grid: int, spacing: numpy.ndarray) -> numpy.ndarray
.. py:method:: get_grid_shape(grid: int, shape: numpy.ndarray) -> numpy.ndarray
.. py:method:: get_grid_x(grid: int, x: numpy.ndarray) -> numpy.ndarray
.. py:method:: get_grid_y(grid: int, y: numpy.ndarray) -> numpy.ndarray
.. py:method:: get_grid_z(grid: int, z: numpy.ndarray) -> numpy.ndarray
.. py:method:: get_grid_node_count(grid: int) -> int
.. py:method:: get_grid_face_nodes(grid: int, face_nodes: numpy.ndarray) -> numpy.ndarray
.. py:method:: get_grid_edge_count(grid: int) -> int
.. py:method:: get_grid_edge_nodes(grid: int, edge_nodes: numpy.ndarray) -> numpy.ndarray
.. py:method:: get_grid_face_count(grid: int) -> int
.. py:method:: get_grid_face_edges(grid: int, face_edges: numpy.ndarray) -> numpy.ndarray
.. py:method:: get_grid_nodes_per_face(grid: int, nodes_per_face: numpy.ndarray) -> numpy.ndarray
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
remotebmi.client.docker
=======================

.. py:module:: remotebmi.client.docker
Module Contents
---------------

.. py:class:: BmiClientDocker(image: str, work_dir: str, image_port: int = 50051, host: str | None = None, input_dirs: collections.abc.Iterable[str] = (), user: int = os.getuid(), remove: bool = False, delay: int = 5)
Bases: :py:obj:`remotebmi.client.client.RemoteBmiClient`


.. py:attribute:: work_dir
.. py:attribute:: container
:type: docker.models.containers.Container


.. py:method:: logs() -> str
Returns complete combined stdout and stderr written by the Docker container.



18 changes: 18 additions & 0 deletions python/python-docs/_sources/autoapi/remotebmi/client/index.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
remotebmi.client
================

.. py:module:: remotebmi.client
Submodules
----------

.. toctree::
:maxdepth: 1

/autoapi/remotebmi/client/apptainer/index
/autoapi/remotebmi/client/client/index
/autoapi/remotebmi/client/docker/index
/autoapi/remotebmi/client/utils/index


Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
remotebmi.client.utils
======================

.. py:module:: remotebmi.client.utils
Module Contents
---------------

.. py:function:: get_unique_port(host: str | None = None) -> int
.. py:exception:: DeadContainerError(message: str, exitcode: int, logs: str, *args: Any)
Bases: :py:obj:`ChildProcessError`


Exception for when a container has died.

:param message: Human readable error message
:type message: str
:param exitcode: The non-zero exit code of the container
:type exitcode: int
:param logs: Logs the container produced
:type logs: str

Initialize self. See help(type(self)) for accurate signature.


.. py:attribute:: exitcode
.. py:attribute:: logs
.. py:function:: validate_url(url: str) -> None
Validates a given URL to ensure it has a valid scheme, network location,
and that the scheme is either 'http' or 'https'.

:param url: The URL to validate.
:type url: str

:raises ValueError: If the URL is invalid, i.e., it does not have a scheme,
network location, or the scheme is not 'http' or 'https'.

.. rubric:: Example

validate_url("http://example.com")


17 changes: 17 additions & 0 deletions python/python-docs/_sources/autoapi/remotebmi/index.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
remotebmi
=========

.. py:module:: remotebmi
Submodules
----------

.. toctree::
:maxdepth: 1

/autoapi/remotebmi/client/index
/autoapi/remotebmi/reserve/index
/autoapi/remotebmi/server/index


Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
remotebmi.reserve
=================

.. py:module:: remotebmi.reserve
.. autoapi-nested-parse::

Helpers to reserve numpy arrays for use in some of the Bmi methods as output argument





Module Contents
---------------

.. py:function:: reserve_values(model: bmipy.Bmi, name: str) -> numpy.ndarray
Reserve dest for :func:`bmipy.Bmi.get_value`


.. py:function:: reserve_grid_shape(model: bmipy.Bmi, grid_id: int) -> numpy.ndarray
Reserve shape for :func:`bmipy.Bmi.get_grid_shape`


.. py:function:: reserve_grid_padding(model: bmipy.Bmi, grid_id: int) -> numpy.ndarray
Reserve dest for :func:`bmipy.Bmi.get_grid_spacing` and :func:`bmipy.Bmi.get_grid_origin`


.. py:function:: reserve_grid_nodes(model: bmipy.Bmi, grid_id: int, dim_index: int = 0) -> numpy.ndarray
Reserve dest for :func:`bmipy.Bmi.get_grid_x`, :func:`bmipy.Bmi.get_grid_y` and :func:`bmipy.Bmi.get_grid_z`

The dim_index goes x,y,z and model.get_grid_shape goes z,y,x or y,x so index is inverted


.. py:function:: reserve_values_at_indices(model: bmipy.Bmi, name: str, indices: numpy.ndarray) -> numpy.ndarray
Reserve dest for :func:`bmipy.Bmi.get_value_at_indices`


.. py:function:: reserve_grid_edge_nodes(model: bmipy.Bmi, grid_id: int) -> numpy.ndarray
Reserve edge_nodes for :func:`bmipy.Bmi.get_grid_edge_nodes`


.. py:function:: reserve_grid_nodes_per_face(model: bmipy.Bmi, grid_id: int) -> numpy.ndarray
Reserve nodes_per_face for :func:`bmipy.Bmi.get_grid_nodes_per_face`


.. py:function:: reserve_grid_face_(model: bmipy.Bmi, grid_id: int) -> numpy.ndarray
Reserve face_edges or face_node in respectivly :func:`bmipy.Bmi.get_grid_face_edges` or :func:`bmipy.Bmi.get_grid_face_nodes`


Loading

0 comments on commit d7b3ae2

Please sign in to comment.