Skip to content

Commit

Permalink
start dask when running pipeline, Plot USA function
Browse files Browse the repository at this point in the history
  • Loading branch information
tobin-ford committed Apr 25, 2024
1 parent d507324 commit 606f871
Showing 1 changed file with 22 additions and 4 deletions.
26 changes: 22 additions & 4 deletions pvdeg/scenario.py
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,11 @@ def runPipeline(self):
self.results = results_series

if self.geospatial:


# start dask, not sure if this is the right spot
# add check to see if there is already a dask client running
pvdeg.geospatial.start_dask()

for job in self.pipeline:
func = job['geospatial_job']

Expand Down Expand Up @@ -736,8 +740,22 @@ def dump(

pass

def plot_USA(self):
# inspiration from geospatial.plot_USA()
def plot_USA(
self,
column_from_result : str,
fpath : str = None,
cmap = 'viridis'
):

fig, ax = pvdeg.geospatial.plot_USA(self.results[column_from_result],
cmap=cmap, vmin=0, vmax=None,
title='add_dynamic_title',
cb_title=f'dynamic title : {column_from_result}'
)

# is cwd the right place?
fpath if fpath else [f"os.getcwd/{self.name}-{self.results[column_from_result]}"]
fig.savefig()


pass

0 comments on commit 606f871

Please sign in to comment.