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_subdir: str = '/geometry/userroutes/', **kwargs)
Bases:
API
Class to connect to the geometry data API with methods to retrieve data.
- __init__(api_subdir: str = '/geometry/userroutes/', **kwargs) None
Create an instance of the GeometryAPI class with the required parameters.
- Parameters:
api_subdir – Optional: subdirectory of the API endpooint url for specific type of data.
kwargs – Additional parameters to pass to the API (see the base class).
- 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.
- get_monopile_pyles(projectsite, assetlocation, cutoff_point=nan)
Returns a dataframe with the monopile geometry with the mudline as reference
- Parameters:
water_depth – Water depth in mLAT
projectsite – Name of the project site
assetlocation – Name of the wind turbine location
cutoff_point – Elevation of the load application point in (mLAT) above the mudline
- Returns:
- plot_turbines(turbines: List[str] | str, figures_per_line: int = 5, return_fig: bool = False) Figure | None
Plot turbines’ frontal geometry.
- Parameters:
turbines – Title(s) of the turbines.
figures_per_line – Number of figures per line.
return_fig – Boolean indicating whether to return the figure.
- Returns:
Plotly figure object with selected turbines front profiles (if requested) or nothing.