UW-Hydro / pysumma

Python module for managing SUMMA simulations
BSD 3-Clause "New" or "Revised" License
16 stars 18 forks source link

Implement top level functions for managing output files #130

Open arbennett opened 4 years ago

arbennett commented 4 years ago

One candidate:

def merge(file_list: list[str]) -> xr.Dataset:
    out_ds = []
    for f in file_list:
        ds = xr.open_dataset(f)
        ds['hru'] = ds['hruId']
        ds['gru'] = ds['gruId']
        out_ds.append(ds)
    return xr.merge(out_ds)