Repository navigation
feat: port March-Dollase texture (#119) and TOF profile (#120) to nanobind - #122
Merged
Merged
Conversation
…obind - Bind TextureMarchDollase and PowderPatternDiffraction.GetTextureMarchDollase. SetPhasePar is bound directly (no RefinablePar workaround) since the objcryst submodule (ba6ca89, vincefn/objcryst#105) now clicks the texture clock; DeletePhase is also exposed. - TextureMarchDollase has RefinableObj as a second (non-zero offset) base, so it is registered standalone with bind_refinableobj_forwarding and added to extractRefinableObjArg. - Bind ReflectionProfileDoubleExponentialPseudoVoigt; SetProfile gives a TOF profile copy the crystal's unit cell. - Port tests and news items, with extra DeletePhase tests. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
- Pass submodules: 'true' to the scikit-package reusable workflows, so that extern/objcryst is available when building. - Exclude extern/ (objcryst submodule, vendored cctbx and newmat) from pre-commit hooks. - Remove duplicated test_lsq_compiled_refined_obj_erase_all_param_set (F811) and fix a typo flagged by codespell. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Collaborator
Author
|
pre-commit.ci run |
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…tofix Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
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.
What problem does this PR address?
Ports the remaining
mainPRs intonanobind_migration_test. #107, #113, #115 and #116 were already ported in 117cb30.TextureMarchDollaseand addsPowderPatternDiffraction.GetTextureMarchDollase.extern/objcrystsubmodule is at ba6ca89, which includes Invalidate March-Dollase texture cache in SetPhasePar, implement DeletePhase vincefn/objcryst#105. That fix makesSetPhaseParmark the texture as changed so the pattern is recalculated, and it addsDeletePhase. SoSetPhaseParis bound directly, without feat: expose March-Dollase preferred-orientation correction #119's workaround through the RefinablePars, andDeletePhaseis also exposed.TextureMarchDollase : public ScatteringCorr, public RefinableObjhasRefinableObjas its second base, at a non-zero offset. Nanobind's base casting doesn't handle that:GetNbPar()returned 0. The class is therefore registered without a declared base and usesbind_refinableobj_forwarding(). It is also added toextractRefinableObjArg, and the case is documented innanobind_migration_notes.md.ReflectionProfileDoubleExponentialPseudoVoigt, with keep-alive rules equivalent to the Boost ones.SetProfilegives a TOF profile copy the crystal's unit cell.DeletePhasetests: out-of-range index, parameter renaming, and pattern recalculation. News items are copied frommain; the March-Dollase entry is reworded for the points above.CI fixes: this is the first PR against
nanobind_migration_test, so CI had never run on this branch.submodules: "true"to the scikit-package workflows, soextern/objcrystis checked out.extern/code from pre-commit.test_lsq.py(flake8 F811) and fix a typo.nanobind_migration_notes.mdthat prettier changed on every run.What should the reviewer(s) do?
Review and merge into
nanobind_migration_test. Validation, macOS arm64, Python 3.13:pip install -e . --no-build-isolation -Cbuild-dir=build: passed.pytest tests/ -q: 189 passed. Thenanobind: leakedwarnings are the existing ones noted innanobind_migration_notes.md.This PR introduces a public-facing change (e.g., figures, CLI input/output, API).