Fix for closed_wall_R/Z warning on load#350
Open
mikekryjak wants to merge 3 commits into
Open
Conversation
Patch for older Hypnotoad grids Hypnotoad was writing closed_wall_R/Z with a "t" dim before, which would cause an xBOUT warning. This was resolved boutproject/hypnotoad#191. This PR does the same fix xBOUT side for older grids.
27561b0 to
90a83c3
Compare
For closed_wall_RZ The variables closed_wall_R/Z have a dimension closed_wall, which would be detected as a scalar here since it's not in the hardcoded dims.
dschwoerer
reviewed
Jun 16, 2026
| return grid | ||
|
|
||
| if grid["closed_wall_Z"].dims != ("t",): | ||
| return grid |
Contributor
There was a problem hiding this comment.
Is this needed? Should we not just check if they are a 1D arrays, and if so, fix it up?
| return "reload" | ||
| elif "t" in ds.dims: | ||
|
|
||
| _update_legacy_closed_wall_dimension(ds) |
Contributor
There was a problem hiding this comment.
Suggested change
| _update_legacy_closed_wall_dimension(ds) | |
| ds = _update_legacy_closed_wall_dimension(ds) |
| return grid | ||
|
|
||
| for name in ("closed_wall_R", "closed_wall_Z"): | ||
| attrs = grid[name].attrs.copy() |
Contributor
There was a problem hiding this comment.
Do we need the copy? What happens if we just take the attrs? They do not seem to be modified later, as far as I can tell.
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.
closed_wall_Randclosed_wall_Zused to be defined over atdimension, which caused a warning on unrecognised variable on grid load. This was resolved in Hypnotoad by changing the coordinate toclosed_wall: boutproject/hypnotoad#191This PR reproduces this fix on the xBOUT side for legacy grids which still have the
tcoordinate, and addsclosed_wallto the list of acceptable dimensions.This PR supersedes #338.