Skip to content

Some potential QoL improvements#26

Open
icweaver wants to merge 10 commits intomainfrom
access
Open

Some potential QoL improvements#26
icweaver wants to merge 10 commits intomainfrom
access

Conversation

@icweaver
Copy link
Member

@icweaver icweaver commented Mar 21, 2026

Some QoL improvements. Happy to make any edits / drop what doesn't seem helpful.

1. File I/O load/save (depends on JuliaIO/FileIO.jl#427)

# Before
af = ASDF.load_file(...)

# After
af = load(...) # And same for save

To-do:

2. More permissive construction

# Before
af_paylod = Dict{Any, Any}(...); save(..., af_payload)

# After
af_paylod = Dict(...); save(..., af_payload)

3. Direct field access

# Before
af.metadata["field1"]

# After
af["field1"]

4. Cleaned up show method a bit

# Before
ASDF.ASDFFile("test/blue_upchan_gain.00000000.asdf", Dict{Any, Any}(0 => Dict{Any, Any}("dish_index" => ASDF.NDArray(ASDF.LazyBlockHeaders(ASDF.BlockHeader[ASDF.BlockHeader(IOStream(<file test/blue_upchan_gain.00000000.asdf>), 649, UInt8[0xd3, 0x42, 0x4c, 0x4b], 0x0030, 0x00000000, UInt8[0x62, 0x6c, 0x73, 0x63], 0x0000000000000041, 0x0000000000000041, 0x0000000000000200, UInt8[0xf6, 0x34, 0x97, 0x16, 0xb2, 0x55, 0x1e, 0xa7, 0x2f, 0xd5, 0xb9, 0xb6, 0x3a, 0x86, 0x7d, 0x32])]), nothing, Int32[-1 -1; 42 53; 43 54], [2, 3], "int32", "little", 0, [12, 4]), "buffer" => ASDF.NDArray(ASDF.LazyBlockHeaders(ASDF.BlockHeader[ASDF.BlockHeader(IOStream(<file test/blue_upchan_gain.00000000.asdf>), 649, UInt8[0xd3, 0x42, 0x4c, 0x4b], 0x0030, 0x00000000, UInt8[0x62, 0x6c, 0x73, 0x63], 0x0000000000000041, 0x0000000000000041, 0x0000000000000200, UInt8[0xf6, 0x34, 0x97, 0x16, 0xb2, 0x55, 0x1e, 0xa7, 0x2f, 0xd5, 0xb9, 0xb6, 0x3a, 0x86, 0x7d, 0x32])]), 0, nothing, [256], "float16", "little", 0, [2]), "dim_names" => ["Fbar"]), "asdf/library" => Dict{Any, Any}("name" => "asdf-cxx", "author" => "Erik Schnetter", "homepage" => "https://github.com/eschnett/asdf-cxx", "version" => "7.2.0")), ASDF.LazyBlockHeaders(ASDF.BlockHeader[ASDF.BlockHeader(IOStream(<file test/blue_upchan_gain.00000000.asdf>), 649, UInt8[0xd3, 0x42, 0x4c, 0x4b], 0x0030, 0x00000000, UInt8[0x62, 0x6c, 0x73, 0x63], 0x0000000000000041, 0x0000000000000041, 0x0000000000000200, UInt8[0xf6, 0x34, 0x97, 0x16, 0xb2, 0x55, 0x1e, 0xa7, 0x2f, 0xd5, 0xb9, 0xb6, 0x3a, 0x86, 0x7d, 0x32])]))
# After
test/blue_upchan_gain.00000000.asdf
├─ 0::Int64
│  ├─ buffer::ASDF.NDArray | shape = [256]
│  ├─ dim_names::Vector{String} | shape = (1,)
│  └─ dish_index::ASDF.NDArray | shape = [2, 3]
└─ asdf/library::String
   ├─ author::String | Erik Schnetter
   ├─ homepage::String | https://github.com/eschnett/asdf-cxx
   ├─ name::String | asdf-cxx
   └─ version::String | 7.2.0

This was referenced Mar 21, 2026
@codecov
Copy link

codecov bot commented Mar 23, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.04%. Comparing base (c6f56b0) to head (d17aef5).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #26      +/-   ##
==========================================
- Coverage   95.28%   95.04%   -0.24%     
==========================================
  Files           1        1              
  Lines         318      323       +5     
==========================================
+ Hits          303      307       +4     
- Misses         15       16       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@icweaver icweaver mentioned this pull request Mar 23, 2026
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant