fix asdftool diff output for arrays in list #1672
Merged
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.
#1652 introduced a bug where running
asdftool diff
on files that contain an array nested within a list would fail. See the following traceback:This PR fixes (and adds a test for) the bug by modifying asdftool diff to use
print_in_tree
(which handles theArrayNode
instance keys). This has the positive side-effect of allowing the array difference output to be nested within the diff tree. Using two of the test data files and runningasdftool diff ndarray0.asdf ndarray1.asdf
prior to this PR outputs:With this PR the output is more consistent with the format of other differences (shown nested within the diff tree):
The above issue was revealed when jwst increased it's upper asdf pin which was constraining crds tests to only test against asdf less than 3. It turns out that crds is directly using the
asdftool diff
output:https://github.com/spacetelescope/crds/blob/d5d92a1c937d13f4a80360b9de71935e835e0d40/crds/diff.py#L368
and after this PR crds tests will need to be updated as they are still expecting the old (pre 3) output:
https://github.com/spacetelescope/crds/blob/d5d92a1c937d13f4a80360b9de71935e835e0d40/test/test_diff.py#L181
A test PR is open for crds that uses asdf from the source branch for this PR and includes a number of other asdf 3.0 fixes (and currently has passing tests showing that the fix in this PR is sufficient for that portion of the crds/asdf-3.0 issues). spacetelescope/crds#1004