Repository navigation
feat: add PeakProfiles to profiles.py - #6
Merged
Merged
Conversation
Contributor
Author
|
@sbillinge ready for review. Please merge #5 first. |
This was referenced 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.
Please merge #5 first.
Adding the first two peak profile components, built on the
Componenthelpers:PseudoVoigtProfile(the default):U, V, W, eta0, eta1, asym0, asym1, asym2, wrapping pyobjcryst'sReflectionProfilePseudoVoigt.TCHProfile:U, V, W, X, Y, Z, P, LGmix, wrappingReflectionProfilePseudoVoigtTCH. It is symmetric, which is why pseudo-Voigt stays the default for lab data.Each profile is three short methods.
__init__creates its Parameters from a fresh pyobjcryst profile, with ObjCryst's defaults and limits.installputs a fresh pyobjcryst profile on a pattern's diffraction component, andupdatepushes the Parameter values into it. pyobjcryst'sSetProfileinstalls a copy, soupdatealways writes intodiffraction.GetProfile(). The profiles keep no reference to the pyobjcryst objects, so one profile can serve several patterns. The generator will use that when phases share a profile.The tests use plain pyobjcryst patterns for PbSO4 (
tests/testdata/PbSO4-Wyckoff.cif, from GSAS-II's test inputs), so the profiles are tested before the generator is rebuilt on them. They check that:updategives the same pattern as setting the value directly in pyobjcryst.BackToBackExponentialProfile(time of flight) stays a stub, because pyobjcryst doesn't bind ObjCryst's TOF profile yet.Also in this PR: a small cleanup of the
Componenttests from the previous PR. Two one-line fixtures are inlined, andrefinable_par_nameis renamed topyobjcryst_par_namefor readability. Test behaviour is unchanged.CI will fail, as on the previous PR: the tests need pyobjcryst
main, and the conda-forge release doesn't have these profile classes. Local results, with pyobjcryst built frommain:What should the reviewer(s) do?
Please review the two profiles and their tests.