2.1. okada

OkadaPy—a Python toolkit for evaluating analytical deformation models.

copyright:

2024, Conor A. Bacon.

license:

GNU General Public License, Version 3 (https://www.gnu.org/licenses/gpl-3.0.html)

2.1.1. okada.cli

A command-line interface to the OkadaPy package.

copyright:

2024, Conor A. Bacon.

license:

GNU General Public License, Version 3 (https://www.gnu.org/licenses/gpl-3.0.html)

okada.cli.main(args=None)[source]

Entry point for the okada command-line utility.

2.1.2. okada.model

copyright:

2024, Conor A. Bacon.

license:

GNU General Public License, Version 3 (https://www.gnu.org/licenses/gpl-3.0.html)

class okada.model.Model(poisson_ratio: float, youngs_modulus: float, friction_coefficient: float, elements: list, x_coords: ndarray, y_coords: ndarray, size: list[float] | None = None, xsection: list[float] | None = None, map_: list[float] | None = None, transformer: Transformer | None = None)[source]

Bases: object

Class to encapsulate model information for OkadaPy.

elements: list
friction_coefficient: float
property grid_bounds_coords: list[tuple[float], tuple[float]]

Get lat/lon coordinate bounds for the model grid.

property grid_bounds_xy: list[tuple[float], tuple[float]]

Get x and y coordinate bounds for the model grid.

property grid_coords: tuple[ndarray, ndarray]

Get lat/lon coordinates of all nodes in model grid.

property grid_xy: tuple[ndarray, ndarray]

Get x and y coordinates of all nodes in model grid.

map_: list[float] | None = None
poisson_ratio: float
property raw_elements: ndarray

Prepare all model elements for computation, which assumes parameters have specific positions in a flattened, contiguous array.

size: list[float] | None = None
transformer: Transformer | None = None
x_coords: ndarray
xsection: list[float] | None = None
y_coords: ndarray
youngs_modulus: float
okada.model.read(model_file: str, file_format: str = None) Model[source]

Parse a model file into the Model dataclass.

Parameters:
  • model_file (Path to a file containing the model to load.)

  • file_format (A string identifier for a specific file format e.g. "COULOMB")

Returns:

model

Return type:

The model in the OkadaPy Model format.

Raises:
  • FileNotFoundError – If the specified model_file does not exist.:

  • Exception – If the model file format could not be detected.:

2.1.3. okada.results

copyright:

2024, Conor A. Bacon.

license:

GNU General Public License, Version 3 (https://www.gnu.org/licenses/gpl-3.0.html)

class okada.results.DisplacementResult(x_coords: ndarray, y_coords: ndarray, displacement: ndarray)[source]

Bases: Result

Class to encapsulate computed displacement results for OkadaPy.

displacement: ndarray
class okada.results.Result(x_coords: ndarray, y_coords: ndarray)[source]

Bases: object

Class to encapsulate computed results for OkadaPy.

x_coords: ndarray
y_coords: ndarray
class okada.results.StrainResult(x_coords: ndarray, y_coords: ndarray, strain: ndarray)[source]

Bases: Result

Class to encapsulate computed strain results for OkadaPy.

strain: ndarray
class okada.results.StressResult(x_coords: ndarray, y_coords: ndarray, stress: ndarray)[source]

Bases: Result

Class to encapsulate computed stress results for OkadaPy.

shmax_vectors()[source]
stress: ndarray

2.1.4. okada.utils

Module of utilities for the OkadaPy package.

copyright:

2024, Conor A. Bacon.

license:

GNU General Public License, Version 3 (https://www.gnu.org/licenses/gpl-3.0.html)

okada.utils.timeit(*args_, **kwargs_)[source]

Function wrapper that measures the time elapsed during its execution.