Repository navigation
Conversation
A list of Py-ART Grids was converted inside a redundant outer loop, so every grid went through read_from_pyart_grid once per grid in the list. The conversion pops the radar location data from the Grid, so the second pass raised KeyError: 'data' for any list of two or more Py-ART Grids. Closes openradar#167
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #167
get_dd_wind_fieldconverted a list of Py-ART Grids inside a redundant outer loop:so every grid went through
read_from_pyart_gridonce per grid in the list. That conversion popsdatafrom the Grid'sradar_latitude/radar_longitude/radar_altitudedicts, so the second pass over the first grid fails withKeyError: 'data'. In practice, passing two or more Py-ART Grids straight toget_dd_wind_fieldalways failed. Lists of xarray Datasets and a single Py-ART Grid were not affected.This PR drops the outer loop so each grid is converted once.
Testing: added
test_list_of_pyart_grids, which passes two Py-ART test grids toget_dd_wind_field. It fails onmainwithKeyError: 'data'and passes with this change. The rest oftest_cost_functions.py,test_initialization.pyandtest_retrieval.pypasses locally on the SciPy engine (Jax/TensorFlow tests skipped). I left outtest_get_iem_data(network) andtest_twpice_case_parallel(dask), and the two HRRR tests fail only becausecfgribisn't installed in my environment. ruff and black are clean on the changed files.