Repository navigation
Fix selective_delete! on arrays of structures; promote plain-float expression results in non-Float64 IDSs - #114
Merged
Merged
Conversation
…loat64 IDSs An expression that returns a literal 0.0 or zeros(n) failed the return-type assertion in an IDS whose element type is not Float64 (dual numbers, measurements). Float64 IDSs keep the strict check. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…not Float64 Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The loop over an array of structures returned after its first element, so only the first element was processed. All elements are now visited and the function always returns a Bool (true if anything was deleted). Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #114 +/- ##
==========================================
+ Coverage 43.93% 44.02% +0.08%
==========================================
Files 16 16
Lines 31551 31556 +5
==========================================
+ Hits 13862 13891 +29
+ Misses 17689 17665 -24 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Two independent fixes. Both came out of running whole-plasma FUSE workflows on a
ddwhose element type is a ForwardDiff dual.1.
selective_delete!only processed the first element of an array of structuresThe array method had
returninside itsforloop:so a path such as
core_profiles.profiles_1d[:].ion[:].densitywas deleted on the first ion of the first time slice only. The method could also returnnothinginstead of aBool.Now every element is visited and the function returns
trueif anything was deleted,falseotherwise. New test filetest/runtests_selective_delete.jl(there was no test of this function).Behaviour change downstream. The only caller I found is
FUSE.restore_init_expressions!. With one time slice the difference is limited to the second and later ions or sources. With time-dependent input, every listed field is now turned back into an expression on every slice, as the caller intends. A companion FUSE change (same branch name, PR to follow) keeps a stored main-ion density and a stored ion rotation through that step; without it, time-dependent runs that replay rotation change. The two should be merged together.2. Expressions returning plain floats in a non-Float64 IDS
An expression that returns a literal
0.0orzeros(n)failed the return-type assertion when the IDS element type is notFloat64(dual numbers, measurements). Such results are now converted to the element type of the IDS.Float64IDSs keep the strict check, so nothing changes for them.Tests
Pkg.test()passes locally on Julia 1.11.7, including the newselective_delete!test (15 assertions) and the test added for the expression promotion.🤖 Generated with Claude Code