Commit 93cf91d
committed
refactor(structure): extract constants, fix cyclic imports, improve repr/docs/tests
- Extract shared constants into src/aiida_atomistic/data/structure/constants.py and
update imports across the package to break a circular import chain that caused
Sphinx AutoAPI warnings.
- Make `Site.__repr__` robust to missing positions to avoid TypeError in notebooks.
- Rework `Structure.__repr__` and add `__str__` to present a safe, informative
summary without calling `super().__repr__()` (prevents recursion with AiiDA Node repr).
- Update `utils.sites_from_kinds` to accept both list and dict kinds formats for
more flexible initialization.
- Add comprehensive tests for property setters/removers: tests/data/test_property_setters.py.
- Document remove-property methods and clarify property-setting vs validation semantics;
clarify `StructureBuilder` role; document that `magmom` and `magnetization` are
mutually exclusive per site.
- Minor validator and utility fixes (freeze_pbc validator ordering, small import fixes).
Why:
- Removes AutoAPI cyclic import warnings and prevents runtime repr-related errors
in notebooks and interactive sessions.
- Improves developer ergonomics and documents expected behaviour for magnetic
properties and property removal.
Testing:
- Run unit tests: pytest -q
- Rebuild docs: cd docs && make html
Notes:
- Internal refactor only: no intended public API breaking changes. Maintainers
should note the new `constants.py` location for internal imports.1 parent 8066a3c commit 93cf91d
File tree
73 files changed
+6792
-6305
lines changed- docs/source
- how_to
- in_depth
- quick_start
- reference/api/auto/aiida_atomistic
- data
- structure
- constants
- getter_mixin
- hubbard_qe_utils
- kind
- models
- setter_mixin
- site
- structure
- utils
- tutorials
- examples
- SDATA
- structure
- src/aiida_atomistic
- data
- structure
- tests
- data
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
73 files changed
+6792
-6305
lines changedThis file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
100 | | - | |
| 100 | + | |
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
107 | | - | |
| 107 | + | |
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
| |||
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
| 122 | + | |
| 123 | + | |
122 | 124 | | |
123 | 125 | | |
124 | 126 | | |
| |||
0 commit comments