Skip to content

Optimize core symmetry/XRD/CIF hot paths#333

Merged
qzhu2017 merged 1 commit intoMaterSim:masterfrom
rlaplaza:perf/core-low-risk-optimizations
Mar 20, 2026
Merged

Optimize core symmetry/XRD/CIF hot paths#333
qzhu2017 merged 1 commit intoMaterSim:masterfrom
rlaplaza:perf/core-low-risk-optimizations

Conversation

@rlaplaza
Copy link
Contributor

Summary

  • Cache parsed symmetry data in get_wyckoffs, get_wyckoff_symmetry, and get_generators to avoid repeated parsing/object construction while preserving mutable return contracts.
  • Replace quadratic hkl family grouping in XRD.get_unique_families with canonical-key dictionary grouping.
  • Replace repeated np.append(..., axis=0) growth in CIF molecular coordinate assembly with single-pass accumulation + np.concatenate.

Test plan

  • pytest tests/test_symmetry.py tests/test_wyckoff.py tests/test_xrd.py tests/test_molecule.py tests/test_crystal.py
  • Lint check on edited files (pyxtal/symmetry.py, pyxtal/XRD.py, pyxtal/io.py)

Cache parsed symmetry data and remove repeated quadratic/list-growth patterns to reduce repeated-call overhead while preserving existing behavior and test expectations.

Made-with: Cursor
@qzhu2017 qzhu2017 merged commit 975900b into MaterSim:master Mar 20, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants