Repository navigation
Distance localization: let parameters without a grid be updated or left out - #185
Merged
KriFos1 merged 1 commit intoOct 28, 2026
Merged
Conversation
…ft out A state holding scalars besides a field could not use distance_loc. A parameter with no localization entry gets a zero mask, sized from its prior's nx/ny/nz, which a gridless prior does not have: KeyError 'nx'. And there was no way to have such a parameter updated at all, since an entry places a kernel on the field. - A parameter without a grid is sized from its mean, as the prior draws it. - `unlocalized = [...]` names parameters that every datum updates with weight one; it must name parameters of the state. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
KriFos1
approved these changes
Oct 28, 2026
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.
Distance-based localization (
distance_loc) could not be used on a state that holds scalars besides a field, e.g.state = ["permx", "sor", "vo"]:nx/ny/nz. A prior without a grid (Draw a prior without a grid as scalars, instead of dropping it #180) has none, so the analysis raisedKeyError: 'nx'.Change
A parameter without a grid is sized from its mean, as
StateLayout.from_prior_infodraws it (and has no inactive cells to drop).A new
unlocalizedkey lists parameters that every datum updates with weight one:It must name parameters of the state; anything else is an error. A parameter that is neither in
unlocalizednor in an entry keeps getting weight zero, as before.Verified
tests/assimilation/test_distance_loc.py(gridless parameter without an entry,unlocalizedparameters of both kinds, a misspelt name); all three fail without the change.sorandvo), with Gaspari-Cohn tapers at the wells for the field and the two scalarsunlocalized.miniresextra).ruffclean.🤖 Generated with Claude Code