Geometry API: Base class

Module to connect to the database API to retrieve and operate on geometry data.

class owimetadatabase_preprocessor.geometry.io.GeometryAPI(api_root: str = 'https://owimetadatabase.owilab.be/api/v1', api_subdir: str = '/geometry/userroutes/', token: str | None = None, uname: str | None = None, password: str | None = None, **kwargs)

Bases: API

Class to connect to the geometry data API with methods to retrieve data.

__init__(api_root: str = 'https://owimetadatabase.owilab.be/api/v1', api_subdir: str = '/geometry/userroutes/', token: str | None = None, uname: str | None = None, password: str | None = None, **kwargs) None

Create an instance of the GeometryAPI class with the required parameters.

Parameters:
  • api_root – Optional: root URL of the API endpoint, the default working database url is provided.

  • api_subdir – Optional: subdirectory of the API endpooint url for specific type of data.

  • token – Optional: token to access the API.

  • uname – Optional: username to access the API.

  • password – Optional: password to access the API.

  • kwargs – Additional parameters to pass to the API.

Returns:

None

get_subassemblies(projectsite: str | None = None, assetlocation: str | None = None, subassembly_type: str | None = None) Dict[str, DataFrame | bool | int64 | None]

Get all structure subassemblies blocks for a given location.

Parameters:
  • projectsite – Title of the projectsite.

  • assetlocation – Title of the asset location.

  • subassembly_type – Type of the subassembly.

Returns:

Dictionary with the following keys:

  • ”data”: Pandas dataframe with the location data for each project

  • ”exists”: Boolean indicating whether matching records are found

get_buildingblocks(projectsite: str | None = None, assetlocation: str | None = None, subassembly_type: str | None = None, subassembly_id: str | None = None) Dict[str, DataFrame | bool | int64 | None]

Get all building blocks for a given location.

Parameters:
  • projectsite – Title of the projectsite.

  • assetlocation – Title of the asset location.

  • subassembly_type – Type of the subassemblies.

  • subassembly_id – ID of the subassembly.

Returns:

Dictionary with the following keys:

  • ”data”: Pandas dataframe with the location data for each project

  • ”exists”: Boolean indicating whether matching records are found

get_materials() Dict[str, DataFrame | bool | int64 | None]

Get all the materials of building blocks.

Returns:

Dictionary with the following keys:

  • ”data”: Pandas dataframe with the location data for each project

  • ”exists”: Boolean indicating whether matching records are found

get_subassembly_objects(turbine: str, subassembly: str | None = None) Dict[str, SubAssembly]

Get all subassemblies for a given turbine, divided by type.

Parameters:
  • turbine – Turbine title (e.g. ‘BBC01’)

  • subassembly – Sub-assembly type (e.g. ‘MP’, ‘TW’, ‘TP’)

Returns:

Dictionary with the following keys:

  • ”TW”: SubAssembly object for the tower

  • ”TP”: SubAssembly object for the transition piece

  • ”MP”: SubAssembly object for the monopile

get_owt_geometry_processor(turbines: str | List[str], tower_base: float | List[float] | None = None, monopile_head: float | List[float] | None = None) OWTs

Return the required processing class.

Parameters:
  • turbines – Title(s) of the turbines.

  • tower_base – Optional: height(s) of the tower base.

  • monopile_head – Optional: height(s) of the monopile head.

Returns:

OWTs object: containing information about all the requested turbines.

plot_turbines(turbines: List[str] | str, figures_per_line: int = 5, return_fig: bool = True, show_fig: bool = True) None

Plot turbines’ frontal geometry.

Parameters:
  • turbines – Title(s) of the turbines.

  • figures_per_line – Number of figures per line.

  • return_fig – Optional: whether to return the figure.

  • show_fig – Optional: whether to show the figure.

Returns:

Plotly figure object with selected turbines front profiles (if requested) or nothing.