Skip to content

Commit

Permalink
Merge pull request #113 from NREL/expanded_geo_testing
Browse files Browse the repository at this point in the history
Expanded geo testing
  • Loading branch information
martin-springer authored Aug 19, 2024
2 parents 77d8001 + ca170fa commit 42eaa0d
Show file tree
Hide file tree
Showing 11 changed files with 1,919 additions and 310 deletions.
5 changes: 3 additions & 2 deletions docs/source/whatsnew/releases/v0.4.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,12 @@ Scenarios

Geospatial Improvements

* Autotemplating system for geospatial analysis using `pvdeg.geospatial.autotemplate`
* Autotemplating system for geospatial analysis using `pvdeg.geospatial.autotemplate`.
* New module `pvdeg.decorators` that contains `pvdeg` specific decorator functions.
* Implemented `geospatial_result_type` decorator to update functions and preform runtime introspection to determine if a function is autotemplate-able.
* `Geospatial Templates.ipynb` notebook to showcase new and old templating functionality for users.
* Implemented testing for geospatial analysis
* Implemented testing for geospatial analysis.
* Added chunked and unchunked testing.

Symbolic Evaluation

Expand Down
5 changes: 2 additions & 3 deletions pvdeg/geospatial.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
from typing import Tuple
from shapely import LineString, MultiLineString


def start_dask(hpc=None):
"""
Starts a dask cluster for parallel processing.
Expand Down Expand Up @@ -271,12 +270,12 @@ def output_template(

output_template = xr.Dataset(
data_vars={
var: (dim, da.empty([dims_size[d] for d in dim]), attrs.get(var))
var: (dim, da.empty([dims_size[d] for d in dim]), attrs.get(var)) # this will produce a dask array with 1 chunk of the same size as the input
for var, dim in shapes.items()
},
coords={dim: ds_gids[dim] for dim in dims},
attrs=global_attrs,
) # moved chunks down from here
)

if ds_gids.chunks: # chunk to match input
output_template = output_template.chunk({dim: ds_gids.chunks[dim] for dim in dims})
Expand Down
Loading

0 comments on commit 42eaa0d

Please sign in to comment.