Repository navigation
fix(simulate): build the refnx structure with each layer once - #15
Merged
Merged
Conversation
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.
Closes #12.
build_structureput the n layers intoStack(name='MultiLayer', repeats=len(params)), so refnx repeated the whole n-layer stack n times: a 2-layer sample was simulated as 4 layers, a 3-layer sample as 9. Single-layer data were unaffected (repeats=1). Every multi-layer curve generated with this function therefore carried truth labels (thickness, roughness, SLD per layer) that did not describe the simulated structure. The structure is now air | layer 1 | ... | layer n | substrate.Tests: the slab table holds each layer once in order; the curve equals the one refnx computes for the explicit structure (rtol 1e-10).
Affected data (inference from the code path): any HDF5 dataset made by
simul_refnxwith more than one layer; models trained on them learned mislabelled multi-layer examples. They need regeneration before multi-layer results are reported. Physics reviewed by boss.local-ci:
uv run pytest -q27 passed, 1 skipped. GitHub Actions does not start (billing, DotFiles#184).