pvdeg.geospatial.auto_template#
- pvdeg.geospatial.auto_template(func: Callable, ds_gids: Dataset) Dataset[source]#
Automatically create a template for a target function: func.
Only works on functions that have the numeric_or_timeseries and shape_names attributes. These attributes are assigned at function definition with the @geospatial_quick_shape decorator.
Otherwise you will have to create your own template using geospatial.output_template. See the Geospatial Templates Notebook for more information.
Examples
The function returns a numeric value >>> pvdeg.design.edge_seal_width
the function returns a timeseries result >>> pvdeg.module.humidity
Counter example#
the function could either return a single numeric or a series based on changed in the input. Because it does not have a known result shape we cannot determine the attributes required for autotemplating ahead of time.
- param func:
function to create template from. This will raise an error if the function was not declared with the @geospatial_quick_shape decorator.
- type func:
callable
- param ds_gids:
- Dataset containing the gids and their associated dimensions. (geospatial weather
dataset)
Dataset should already be chunked.
- type ds_gids:
xarray.Dataset
- returns:
output_template (xarray.Dataset) – Template for output data.