NREL / rex

REsource eXtraction Tool (rex)
https://nrel.github.io/rex
BSD 3-Clause "New" or "Revised" License
19 stars 10 forks source link

Wildcard support for list input to `MultiTimeResource` #180

Closed ppinchuk closed 1 month ago

ppinchuk commented 1 month ago

Allow MultiTimeResource to accept wildcards in list so you can do something like:

from rex import MultiYearWindResource

files = [
    "/datasets/WIND/conus/v1.0.0/wtk_conus_*.h5",
    "/scratch/ppinchuk/HRRR/HRRR*.h5",
]

with MultiYearWindResource(files) as res:
    print(res.time_index.year.unique())
--------------------------------------------
Index([2007, 2008, 2009, 2010, 2011, 2012, 2013, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023], dtype='int32')

Any foreseeable pitfalls here that I may be missing?