asdf info block display#2014
Conversation
* `info` now optionally prints a table containing block header metadata for each block in the source file * Added `show_blocks` parameter to enable/disable block tables which defaults to `False`
braingram
left a comment
There was a problem hiding this comment.
Thanks for working on this. I left a few comments. Overall this is an improvement to the inspectability of files.
As noted I'm not against adding type hints. To check those are correct we'd benefit from first adding a type checker. If you're interested in adding type hints would you make a separate PR that sets up mypy for this project as a pre-commit hook (and addresses any configuration and other issues that might uncover)?
Once the comments are addressed would you update this PR with a comment showing some example block info output?
* Non-printing trailing `\0` bytes are now stripped * Invalid unicode bytes are now replaced with slash escape characters
* Updated block display tests to also check `asdf.info` output
* Converted tests to snapshot tests using syrupy * Added new `ndarray2.asdf` file which contains multiple blocks with different compression types
don't impact snapshot testing
braingram
left a comment
There was a problem hiding this comment.
One minor request to update the test data with padded blocks so that used_size != allocated_size.
braingram
left a comment
There was a problem hiding this comment.
Thanks! This looks great and funny enough I was handed an ASDF file today that I already wanted to use this new feature on :)
Description
show_blocksparameter toAsdfFile.infomethod which defaults toFalse--show-blocksargument toinfoCLI commandlibasdfcommandCloses #1923
Example Output