issue_comments: 756922963
This data as json
html_url | issue_url | id | node_id | user | created_at | updated_at | author_association | body | reactions | performed_via_github_app | issue |
---|---|---|---|---|---|---|---|---|---|---|---|
https://github.com/pydata/xarray/issues/1385#issuecomment-756922963 | https://api.github.com/repos/pydata/xarray/issues/1385 | 756922963 | MDEyOklzc3VlQ29tbWVudDc1NjkyMjk2Mw== | 53343824 | 2021-01-08T18:26:44Z | 2021-01-08T18:34:49Z | NONE | @dcherian We had looked at a number of options. In the end, the best performance I could achieve was with the work-around pre-processor script, rather than any of the built-in options. It's worth noting that a major part of the slowdown we were experiencing was from the dataframe transform option we were doing after reading the files. Once that was fixed, performance was much better, but not necessarily with any of the expected options. This script reading one-day's worth of NWM q_laterals runs in about 8 seconds (on Cheyenne). If you change the globbing pattern to include a full month, it takes about 380 seconds. setting We are reading everything into memory, which negates the lazy-access benefits of using a dataset and our next steps include looking into that. 300 seconds to read a month isn't totally unacceptable, but we'd like it be faster for the operational runs we'll eventually be doing -- for longer simulations, we may be able to achieve some improvement with asynchronous data access. We'll keep looking into it. (We'll start by trying to adapt the "slightly more sophisticated example" under the docs you referenced here...) Thanks (for the great package and for getting back on this question!) ``` python /glade/scratch/halgren/qlat_mfopen_test.pyimport time import xarray as xr import pandas as pd def get_ql_from_wrf_hydro_mf( qlat_files, index_col="feature_id", value_col="q_lateral" ): """ qlat_files: globbed list of CHRTOUT files containing desired lateral inflows index_col: column/field in the CHRTOUT files with the segment/link id value_col: column/field in the CHRTOUT files with the lateral inflow value
def drop_all_coords(ds): return ds.reset_coords(drop=True) def main():
if name == "main": main() ``` @groutr, @jmccreight |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
224553135 |