You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: docs/source/whatsnew/releases/v0.4.3.rst
+5-3
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,10 @@
1
-
v0.4.3 (2024-10-10)
2
-
===================
1
+
v0.4.3 (2024-11-1)
2
+
=======================
3
3
4
4
Enhancements
5
-
------------
5
+
-------------
6
+
``pvdeg.geospatial.analysis`` implements autotemplating. No need to specify a template for common ``pvdeg`` functions during analysis. Manually creating and providing templates is still an option. Docstrings updated with examples.
7
+
6
8
Suite of utility functions to facilitate accessing material parameter json files.
7
9
8
10
* ``pvdeg.utilities.read_material`` creates a public api to replace the private ``pvdeg.untility._read_material`` function (to be deprecated soon)
Generates a xarray template for output data. Output variables and
248
260
associated dimensions need to be specified via the shapes dictionary.
249
261
The dimension length are derived from the input data. Additonal output
250
262
dimensions can be defined with the add_dims argument.
251
263
264
+
Examples
265
+
--------
266
+
Providing the shapes dictionary can be confusing. Here is what the `shapes` dictionary should look like for `pvdeg.standards.standoff`.
267
+
Refer to the docstring, the function will have one result per location so the only dimension for each return value is "gid", a geospatial ID number.
268
+
269
+
.. code-block:: python
270
+
shapes = {
271
+
"x": ("gid",),
272
+
"T98_inf": ("gid",),
273
+
"T98_0": ("gid",),
274
+
}
275
+
276
+
**Note: The dimensions are stored in a tuple, this this why all of the parenthesis have commas after the single string, otherwise python will interpret the value as a string.**
277
+
278
+
This is what the shapes dictinoary should look like for `pvdeg.humidity.module`. Refering to the docstring,
279
+
we can see that the function will return a timeseries result for each location. This means we need dimensions of "gid" and "time".
280
+
281
+
.. code-block:: python
282
+
shapes = {
283
+
"RH_surface_outside": ("gid", "time"),
284
+
"RH_front_encap": ("gid", "time"),
285
+
"RH_back_encap": ("gid", "time"),
286
+
"RH_backsheet": ("gid", "time"),
287
+
}
288
+
252
289
Parameters
253
290
----------
254
291
ds_gids : xarray.Dataset
@@ -290,9 +327,9 @@ def output_template(
290
327
returnoutput_template
291
328
292
329
293
-
# we should be able to get rid of this with the new autotemplating function and decorator
294
-
# this is helpful for users so we should move it to a section in the documenation,
295
-
# discuss with group
330
+
# This has been replaced with pvdeg.geospatial.auto_templates inside of pvdeg.geospatial.analysis.
331
+
# it is here for completeness. it can be removed.
332
+
@decorators.deprecated(reason="use geospatial.auto_template or create a template with geospatial.output_template")
296
333
deftemplate_parameters(func):
297
334
"""
298
335
Output parameters for xarray template.
@@ -410,18 +447,39 @@ def zero_template(
410
447
411
448
returnres
412
449
450
+
defcan_auto_template(func) ->None:
451
+
"""
452
+
Check if we can use `geospatial.auto_template on a given function.
453
+
454
+
Raise an error if the function was not declared with the `@geospatial_quick_shape` decorator.
455
+
No error raised if we can run `geospatial.auto_template` on provided function, `func`.
0 commit comments