windwhisper.windturbines ======================== .. py:module:: windwhisper.windturbines .. autoapi-nested-parse:: Wind turbine specifications, model training and emission estimation. Classes ------- .. autoapisummary:: windwhisper.windturbines.WindTurbines Functions --------- .. autoapisummary:: windwhisper.windturbines.train_wind_turbine_model windwhisper.windturbines.load_model windwhisper.windturbines.check_wind_turbine_specs Module Contents --------------- .. py:function:: train_wind_turbine_model(file_path = None) Train the wind turbine noise emission model. :param file_path: Optional path to the training CSV file. :type file_path: str | None :returns: Trained scikit-learn model and the list of noise column names. :rtype: tuple[sklearn.base.RegressorMixin, list[str]] :raises FileNotFoundError: If the training dataset cannot be located. :raises ValueError: When the provided file is not a CSV file. .. py:function:: load_model(filepath=None) Load a previously trained wind turbine emission model. :param filepath: Optional path to the ``.skops`` model archive. :type filepath: str | Path | None :returns: Trained model and the list of noise column names. :rtype: tuple[sklearn.base.RegressorMixin, list[str]] :raises FileNotFoundError: If the model archive does not exist. .. py:function:: check_wind_turbine_specs(wind_turbines) Validate user-provided turbine specifications. :param wind_turbines: Mapping of turbine identifiers to specification dictionaries. :type wind_turbines: dict :returns: Normalised turbine specifications with numeric values. :rtype: dict :raises KeyError: If a required field is missing. :raises ValueError: If numeric fields are invalid or positions are malformed. .. py:class:: WindTurbines(wind_turbines, model_file = None, retrain_model = False, dataset_file = None, wind_speed_data = None, elevation_data = None, humidity = 70, temperature = 10) Manage wind turbine specifications and noise emission predictions. .. py:attribute:: noise_propagation :value: None .. py:attribute:: ws :value: None .. py:attribute:: wind_turbines .. py:method:: fetch_noise_level_vs_wind_speed() Predict emission spectra for wind speeds between 3 and 12 m/s. .. py:method:: plot_noise_curve() Plot modelled noise levels for all turbines and wind speeds. .. py:method:: fetch_wind_speeds(wind_speed_data = None) Attach hourly wind speed profiles to each turbine specification. :param wind_speed_data: Precomputed dataset or path used to initialise :class:`windwhisper.windspeed.WindSpeed`. :type wind_speed_data: xarray.DataArray | str | None