Add covfie binary field map loaders#2335
Merged
sethrj merged 6 commits intoMar 30, 2026
Merged
Conversation
added 2 commits
March 26, 2026 13:38
Add load_covfie_cart_field and load_covfie_rz_field free functions that deserialize covfie binary files into CartMapFieldInput and RZMapFieldInput. The loaders use a deserialization_interp_t typedef to make explicit that stateless covfie backends (linear, nearest_neighbour, etc.) produce identical binary formats. No unit conversion is applied; values are assumed to be in native Celeritas units. Prompt: "Add functions to load 3D Cartesian and 2D RZ cylindrical magnetic field maps from covfie binary files into Celeritas field input structs" Assisted-by: Claude Code (claude-opus-4-6)
Add CovfieCartImportTest and CovfieRZImportTest that generate small covfie binary files at test time (2x3x4 Cartesian, 2x3 RZ) with analytic field values, then verify that the loaders correctly recover grid dimensions, bounds from the affine transform, and field values at known indices to confirm stride ordering. Prompt: "Add unit tests for the covfie binary field map loaders using small generated test files with known analytic field values" Assisted-by: Claude Code (claude-opus-4-6)
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #2335 +/- ##
===========================================
- Coverage 87.20% 87.19% -0.01%
===========================================
Files 1373 1374 +1
Lines 43581 43678 +97
Branches 13785 13394 -391
===========================================
+ Hits 38005 38086 +81
+ Misses 4535 4362 -173
- Partials 1041 1230 +189
🚀 New features to boost your workflow:
|
Test summary 5 617 files 9 101 suites 20m 1s ⏱️ Results for commit 1c4f6fd. ♻️ This comment has been updated with latest results. |
sethrj
marked this pull request as ready for review
March 27, 2026 05:43
sethrj
approved these changes
Mar 27, 2026
sethrj
left a comment
Member
There was a problem hiding this comment.
Thanks a bunch for splitting this up! Made it much easier to review. I have a few fixes that should be easy for copilot to address ;)
added 3 commits
March 30, 2026 13:36
Extract repeated axis-grid recovery into an anonymous from_affine helper. Remove unnecessary static_casts (float-to-double widening, size_t in strided_view.at). Guard declarations with CELERITAS_USE_COVFIE and provide inline CELER_NOT_CONFIGURED stubs so downstream code compiles without covfie. Prompt: "Address PR review: refactor axis grid extraction into a from_affine helper, remove unnecessary casts, add not-configured stubs for non-covfie builds" Assisted-by: Claude Code (claude-opus-4-6)
Move write_cart_covfie and write_rz_covfie from Fields.test.cc into CovfieTestField.hh and CovfieTestField.covfie.cc, conditionally built when covfie is enabled. Provide inline CELER_NOT_CONFIGURED stubs for non-covfie builds so disabled tests still compile. Prompt: "Move covfie test field construction to a separate header and source file that gets conditionally built into the test library" Assisted-by: Claude Code (claude-opus-4-6)
Replace inline covfie includes and helper functions with the CovfieTestField and LoadCovfieField headers included at the top of the file. Covfie import tests now compile in both covfie and non-covfie builds, skipped via DISABLED_ prefix when covfie is off. Prompt: "Remove mid-file covfie includes from test file and make tests compile without covfie using DISABLED prefix" Assisted-by: Claude Code (claude-opus-4-6)
Contributor
Author
|
@sethrj Tried to address the previous comments. Let me know if anything else is needed. The tests still pass after refactoring. |
sethrj
enabled auto-merge (squash)
March 30, 2026 18:01
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.
Title
Add covfie binary field map loaders
Description
Add load_covfie_cart_field and load_covfie_rz_field free functions that deserialize covfie binary files into CartMapFieldInput and
RZMapFieldInput.
This PR is AI-assisted (Claude Code, claude-opus-4-6). Follows from discussion in #2298