Skip to content

Instantly share code, notes, and snippets.

@sunt05
Created June 15, 2022 14:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sunt05/3ebdb0b810fe845723a04b52fec98640 to your computer and use it in GitHub Desktop.
Save sunt05/3ebdb0b810fe845723a04b52fec98640 to your computer and use it in GitHub Desktop.
workaround for resolving memory limit issue when running supy for a large number of grids
import supy as sp
import pandas as pd
# using a short period of forcing for example
df_forcing_test = df_forcing.loc["2021-7-1"]
# create an empty list to store dataframes
list_res = []
for grid in df_state_init.index:
df_out, df_state_fina = sp.run_supy(df_forcing_test, df_state_init.loc[[grid]])
list_res.append(df_out)
# concatenate the results
df_res = pd.concat(list_res, axis=0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment