Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix dropping non-dimensional coordinates in grid_to_table #441

Merged
merged 6 commits into from
Apr 11, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions verde/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -637,6 +637,11 @@
# Need to flip the coordinates because the names are in northing and
# easting order
coordinates = [i.ravel() for i in np.meshgrid(east, north)][::-1]
# Identify and add extra coordinates
extra = [coord for coord in grid.coords.keys() if coord not in coordinate_names]
for coord in extra:
coordinates.append(grid[coord].values.ravel())
coordinate_names.append(coord)

Check warning on line 644 in verde/utils.py

View check run for this annotation

Codecov / codecov/patch

verde/utils.py#L643-L644

Added lines #L643 - L644 were not covered by tests
data_dict = dict(zip(coordinate_names, coordinates))
data_dict.update(dict(zip(data_names, data_arrays)))
return pd.DataFrame(data_dict)
Expand Down
Loading