@mat3ra/made 2026.8.7-0 → 2026.8.18-0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (522) hide show
  1. package/dist/js/Material.d.ts +219 -0
  2. package/dist/js/Material.js +457 -0
  3. package/dist/js/basis/basis.d.ts +14 -9
  4. package/dist/js/basis/basis.js +15 -13
  5. package/dist/js/basis/constrained_basis.d.ts +9 -7
  6. package/dist/js/basis/constrained_basis.js +4 -4
  7. package/dist/js/generated/MaterialSchemaMixin.d.ts +5 -0
  8. package/dist/js/generated/MaterialSchemaMixin.js +69 -0
  9. package/dist/js/lattice/lattice.d.ts +4 -3
  10. package/dist/js/lattice/lattice.js +1 -2
  11. package/dist/js/made.d.ts +12 -12
  12. package/dist/js/made.js +38 -5
  13. package/dist/js/parsers/espresso.d.ts +2 -3
  14. package/dist/js/parsers/espresso.js +0 -1
  15. package/dist/js/parsers/native_format_parsers.d.ts +9 -8
  16. package/dist/js/parsers/native_format_parsers.js +6 -6
  17. package/dist/js/parsers/parsers.d.ts +6 -6
  18. package/dist/js/parsers/poscar.d.ts +5 -4
  19. package/dist/js/parsers/poscar.js +3 -2
  20. package/dist/js/parsers/xyz.d.ts +3 -5
  21. package/dist/js/parsers/xyz.js +3 -4
  22. package/dist/js/parsers/xyz_combinatorial_basis.js +3 -1
  23. package/dist/js/tools/basis.d.ts +1 -1
  24. package/dist/js/tools/index.d.ts +7 -7
  25. package/dist/js/tools/material.d.ts +1 -1
  26. package/dist/js/tools/material.js +8 -7
  27. package/dist/js/tools/supercell.d.ts +4 -5
  28. package/dist/js/tools/supercell.js +2 -4
  29. package/dist/js/tools/surface.d.ts +4 -4
  30. package/dist/js/tools/surface.js +2 -7
  31. package/package.json +12 -8
  32. package/.babelrc +0 -10
  33. package/.eslintrc.json +0 -11
  34. package/.gitattributes +0 -1
  35. package/.husky/post-checkout +0 -3
  36. package/.husky/post-commit +0 -3
  37. package/.husky/post-merge +0 -3
  38. package/.husky/pre-commit +0 -6
  39. package/.husky/pre-push +0 -3
  40. package/.mocharc.json +0 -5
  41. package/.pre-commit-config.yaml +0 -26
  42. package/.prettierignore +0 -2
  43. package/.prettierrc +0 -6
  44. package/AGENTS.md +0 -133
  45. package/MANIFEST.in +0 -1
  46. package/data/constants.json +0 -13
  47. package/data/reciprocal_paths.json +0 -111
  48. package/dist/js/material.d.ts +0 -169
  49. package/dist/js/material.js +0 -362
  50. package/images/made/tools/tools_diagram_general.png +0 -3
  51. package/images/made/tools/tools_diagram_interface.png +0 -3
  52. package/pyproject.toml +0 -123
  53. package/src/__init__.py +0 -0
  54. package/src/js/basis/basis.ts +0 -621
  55. package/src/js/basis/constrained_basis.ts +0 -114
  56. package/src/js/basis/coordinates.ts +0 -93
  57. package/src/js/basis/elements.ts +0 -24
  58. package/src/js/basis/helpers.ts +0 -20
  59. package/src/js/basis/labels.ts +0 -6
  60. package/src/js/cell/cell.ts +0 -150
  61. package/src/js/cell/conventional_cell.ts +0 -86
  62. package/src/js/cell/primitive_cell.ts +0 -166
  63. package/src/js/constants/molecule.ts +0 -18
  64. package/src/js/constants.ts +0 -4
  65. package/src/js/constraints/constraints.ts +0 -45
  66. package/src/js/lattice/lattice.ts +0 -306
  67. package/src/js/lattice/lattice_types.ts +0 -134
  68. package/src/js/lattice/reciprocal/lattice_reciprocal.ts +0 -193
  69. package/src/js/lattice/reciprocal/paths.ts +0 -39
  70. package/src/js/lattice/reciprocal/symmetry_points.ts +0 -886
  71. package/src/js/lattice/unit_cell.ts +0 -66
  72. package/src/js/made.ts +0 -62
  73. package/src/js/material.ts +0 -458
  74. package/src/js/parsers/cif.ts +0 -25
  75. package/src/js/parsers/errors.ts +0 -6
  76. package/src/js/parsers/espresso.ts +0 -30
  77. package/src/js/parsers/native_format_parsers.ts +0 -51
  78. package/src/js/parsers/parsers.ts +0 -13
  79. package/src/js/parsers/poscar.ts +0 -212
  80. package/src/js/parsers/xyz.ts +0 -187
  81. package/src/js/parsers/xyz_combinatorial_basis.ts +0 -265
  82. package/src/js/tools/basis.ts +0 -132
  83. package/src/js/tools/cell.ts +0 -41
  84. package/src/js/tools/index.ts +0 -11
  85. package/src/js/tools/material.ts +0 -62
  86. package/src/js/tools/supercell.ts +0 -88
  87. package/src/js/tools/surface.ts +0 -223
  88. package/src/py/__init__.py +0 -0
  89. package/src/py/mat3ra/__init__.py +0 -1
  90. package/src/py/mat3ra/made/__init__.py +0 -7
  91. package/src/py/mat3ra/made/basis/__init__.py +0 -255
  92. package/src/py/mat3ra/made/basis/coordinates.py +0 -43
  93. package/src/py/mat3ra/made/cell/__init__.py +0 -55
  94. package/src/py/mat3ra/made/cell/primitive_cell.py +0 -156
  95. package/src/py/mat3ra/made/data_helper.py +0 -5
  96. package/src/py/mat3ra/made/lattice.py +0 -195
  97. package/src/py/mat3ra/made/material.py +0 -134
  98. package/src/py/mat3ra/made/metadata.py +0 -45
  99. package/src/py/mat3ra/made/reciprocal/__init__.py +0 -5
  100. package/src/py/mat3ra/made/reciprocal/lattice_reciprocal.py +0 -147
  101. package/src/py/mat3ra/made/reciprocal/paths.py +0 -30
  102. package/src/py/mat3ra/made/reciprocal/symmetry_points.py +0 -385
  103. package/src/py/mat3ra/made/tools/README.md +0 -173
  104. package/src/py/mat3ra/made/tools/__init__.py +0 -0
  105. package/src/py/mat3ra/made/tools/analyze/__init__.py +0 -31
  106. package/src/py/mat3ra/made/tools/analyze/basis/__init__.py +0 -3
  107. package/src/py/mat3ra/made/tools/analyze/basis/analyzer.py +0 -50
  108. package/src/py/mat3ra/made/tools/analyze/build_metadata_analyzer.py +0 -32
  109. package/src/py/mat3ra/made/tools/analyze/build_metadata_analyzer_factory.py +0 -31
  110. package/src/py/mat3ra/made/tools/analyze/coordination.py +0 -56
  111. package/src/py/mat3ra/made/tools/analyze/crystal_site/__init__.py +0 -0
  112. package/src/py/mat3ra/made/tools/analyze/crystal_site/adatom_crystal_site_material_analyzer.py +0 -35
  113. package/src/py/mat3ra/made/tools/analyze/crystal_site/adatom_material_analyzer.py +0 -49
  114. package/src/py/mat3ra/made/tools/analyze/crystal_site/crystal_site_analyzer.py +0 -65
  115. package/src/py/mat3ra/made/tools/analyze/crystal_site/voronoi_crystal_site_analyzer.py +0 -47
  116. package/src/py/mat3ra/made/tools/analyze/enums.py +0 -33
  117. package/src/py/mat3ra/made/tools/analyze/fingerprint/__init__.py +0 -4
  118. package/src/py/mat3ra/made/tools/analyze/fingerprint/layers/__init__.py +0 -0
  119. package/src/py/mat3ra/made/tools/analyze/fingerprint/layers/layered_fingerprint_along_axis.py +0 -83
  120. package/src/py/mat3ra/made/tools/analyze/fingerprint/layers/unique_element_string_per_layer.py +0 -9
  121. package/src/py/mat3ra/made/tools/analyze/interface/__init__.py +0 -20
  122. package/src/py/mat3ra/made/tools/analyze/interface/commensurate.py +0 -156
  123. package/src/py/mat3ra/made/tools/analyze/interface/enums.py +0 -60
  124. package/src/py/mat3ra/made/tools/analyze/interface/grain_boundary.py +0 -80
  125. package/src/py/mat3ra/made/tools/analyze/interface/simple.py +0 -251
  126. package/src/py/mat3ra/made/tools/analyze/interface/twisted_nanoribbons.py +0 -91
  127. package/src/py/mat3ra/made/tools/analyze/interface/utils/__init__.py +0 -77
  128. package/src/py/mat3ra/made/tools/analyze/interface/utils/holders.py +0 -14
  129. package/src/py/mat3ra/made/tools/analyze/interface/utils/vector.py +0 -56
  130. package/src/py/mat3ra/made/tools/analyze/interface/zsl.py +0 -259
  131. package/src/py/mat3ra/made/tools/analyze/interface_material.py +0 -45
  132. package/src/py/mat3ra/made/tools/analyze/lattice/__init__.py +0 -2
  133. package/src/py/mat3ra/made/tools/analyze/lattice/analyzer.py +0 -126
  134. package/src/py/mat3ra/made/tools/analyze/lattice/helpers.py +0 -31
  135. package/src/py/mat3ra/made/tools/analyze/lattice_lines.py +0 -30
  136. package/src/py/mat3ra/made/tools/analyze/lattice_planes.py +0 -192
  137. package/src/py/mat3ra/made/tools/analyze/lattice_swap_analyzer.py +0 -105
  138. package/src/py/mat3ra/made/tools/analyze/material.py +0 -276
  139. package/src/py/mat3ra/made/tools/analyze/other.py +0 -434
  140. package/src/py/mat3ra/made/tools/analyze/rdf.py +0 -74
  141. package/src/py/mat3ra/made/tools/analyze/slab.py +0 -76
  142. package/src/py/mat3ra/made/tools/analyze/solid_solution_analyzer.py +0 -171
  143. package/src/py/mat3ra/made/tools/analyze/terrace.py +0 -105
  144. package/src/py/mat3ra/made/tools/analyze/utils.py +0 -162
  145. package/src/py/mat3ra/made/tools/bond_directions/__init__.py +0 -0
  146. package/src/py/mat3ra/made/tools/bond_directions/bond_directions.py +0 -150
  147. package/src/py/mat3ra/made/tools/bond_directions/bond_directions_for_element_list.py +0 -7
  148. package/src/py/mat3ra/made/tools/bond_directions/bond_directions_templates_enum.py +0 -8
  149. package/src/py/mat3ra/made/tools/bond_directions/bond_directions_templates_for_element.py +0 -16
  150. package/src/py/mat3ra/made/tools/build/__init__.py +0 -25
  151. package/src/py/mat3ra/made/tools/build/compound_pristine_structures/two_dimensional/heterostructure/__init__.py +0 -7
  152. package/src/py/mat3ra/made/tools/build/compound_pristine_structures/two_dimensional/heterostructure/helpers.py +0 -59
  153. package/src/py/mat3ra/made/tools/build/compound_pristine_structures/two_dimensional/heterostructure/types.py +0 -26
  154. package/src/py/mat3ra/made/tools/build/compound_pristine_structures/two_dimensional/heterostructure/utils.py +0 -139
  155. package/src/py/mat3ra/made/tools/build/compound_pristine_structures/two_dimensional/interface/__init__.py +0 -47
  156. package/src/py/mat3ra/made/tools/build/compound_pristine_structures/two_dimensional/interface/base/__init__.py +0 -11
  157. package/src/py/mat3ra/made/tools/build/compound_pristine_structures/two_dimensional/interface/base/build_parameters.py +0 -5
  158. package/src/py/mat3ra/made/tools/build/compound_pristine_structures/two_dimensional/interface/base/builder.py +0 -164
  159. package/src/py/mat3ra/made/tools/build/compound_pristine_structures/two_dimensional/interface/base/configuration.py +0 -48
  160. package/src/py/mat3ra/made/tools/build/compound_pristine_structures/two_dimensional/interface/base/helpers.py +0 -134
  161. package/src/py/mat3ra/made/tools/build/compound_pristine_structures/two_dimensional/interface/commensurate/__init__.py +0 -6
  162. package/src/py/mat3ra/made/tools/build/compound_pristine_structures/two_dimensional/interface/commensurate/helpers.py +0 -157
  163. package/src/py/mat3ra/made/tools/build/compound_pristine_structures/two_dimensional/interface/enums.py +0 -7
  164. package/src/py/mat3ra/made/tools/build/compound_pristine_structures/two_dimensional/interface/twisted/__init__.py +0 -7
  165. package/src/py/mat3ra/made/tools/build/compound_pristine_structures/two_dimensional/interface/twisted/configuration.py +0 -13
  166. package/src/py/mat3ra/made/tools/build/compound_pristine_structures/two_dimensional/interface/twisted/helpers.py +0 -70
  167. package/src/py/mat3ra/made/tools/build/compound_pristine_structures/two_dimensional/interface/utils.py +0 -87
  168. package/src/py/mat3ra/made/tools/build/compound_pristine_structures/two_dimensional/interface/zsl/__init__.py +0 -6
  169. package/src/py/mat3ra/made/tools/build/compound_pristine_structures/two_dimensional/interface/zsl/helpers.py +0 -129
  170. package/src/py/mat3ra/made/tools/build/defective_structures/__init__.py +0 -0
  171. package/src/py/mat3ra/made/tools/build/defective_structures/one_dimensional/__init__.py +0 -0
  172. package/src/py/mat3ra/made/tools/build/defective_structures/one_dimensional/grain_boundary_linear/__init__.py +0 -0
  173. package/src/py/mat3ra/made/tools/build/defective_structures/one_dimensional/grain_boundary_linear/build_parameters.py +0 -12
  174. package/src/py/mat3ra/made/tools/build/defective_structures/one_dimensional/grain_boundary_linear/builder.py +0 -17
  175. package/src/py/mat3ra/made/tools/build/defective_structures/one_dimensional/grain_boundary_linear/configuration.py +0 -40
  176. package/src/py/mat3ra/made/tools/build/defective_structures/one_dimensional/grain_boundary_linear/helpers.py +0 -82
  177. package/src/py/mat3ra/made/tools/build/defective_structures/three_dimensional/__init__.py +0 -1
  178. package/src/py/mat3ra/made/tools/build/defective_structures/three_dimensional/solid_solution/__init__.py +0 -9
  179. package/src/py/mat3ra/made/tools/build/defective_structures/three_dimensional/solid_solution/builder.py +0 -37
  180. package/src/py/mat3ra/made/tools/build/defective_structures/three_dimensional/solid_solution/configuration.py +0 -30
  181. package/src/py/mat3ra/made/tools/build/defective_structures/three_dimensional/solid_solution/enums.py +0 -8
  182. package/src/py/mat3ra/made/tools/build/defective_structures/three_dimensional/solid_solution/helpers.py +0 -76
  183. package/src/py/mat3ra/made/tools/build/defective_structures/two_dimensional/__init__.py +0 -0
  184. package/src/py/mat3ra/made/tools/build/defective_structures/two_dimensional/adatom/__init__.py +0 -0
  185. package/src/py/mat3ra/made/tools/build/defective_structures/two_dimensional/adatom/builder.py +0 -11
  186. package/src/py/mat3ra/made/tools/build/defective_structures/two_dimensional/adatom/configuration.py +0 -18
  187. package/src/py/mat3ra/made/tools/build/defective_structures/two_dimensional/adatom/helpers.py +0 -137
  188. package/src/py/mat3ra/made/tools/build/defective_structures/two_dimensional/adatom/types.py +0 -22
  189. package/src/py/mat3ra/made/tools/build/defective_structures/two_dimensional/grain_boundary_planar/__init__.py +0 -0
  190. package/src/py/mat3ra/made/tools/build/defective_structures/two_dimensional/grain_boundary_planar/builder.py +0 -28
  191. package/src/py/mat3ra/made/tools/build/defective_structures/two_dimensional/grain_boundary_planar/configuration.py +0 -55
  192. package/src/py/mat3ra/made/tools/build/defective_structures/two_dimensional/grain_boundary_planar/helpers.py +0 -75
  193. package/src/py/mat3ra/made/tools/build/defective_structures/two_dimensional/island/builder.py +0 -15
  194. package/src/py/mat3ra/made/tools/build/defective_structures/two_dimensional/island/configuration.py +0 -16
  195. package/src/py/mat3ra/made/tools/build/defective_structures/two_dimensional/island/helpers.py +0 -116
  196. package/src/py/mat3ra/made/tools/build/defective_structures/two_dimensional/terrace/build_parameters.py +0 -10
  197. package/src/py/mat3ra/made/tools/build/defective_structures/two_dimensional/terrace/builder.py +0 -30
  198. package/src/py/mat3ra/made/tools/build/defective_structures/two_dimensional/terrace/configuration.py +0 -11
  199. package/src/py/mat3ra/made/tools/build/defective_structures/two_dimensional/terrace/helpers.py +0 -78
  200. package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/__init__.py +0 -0
  201. package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/pair_defect/__init__.py +0 -0
  202. package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/pair_defect/builder.py +0 -31
  203. package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/pair_defect/configuration.py +0 -45
  204. package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/pair_defect/helpers.py +0 -80
  205. package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/point_defect/__init__.py +0 -40
  206. package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/point_defect/atom_placement_method_enum.py +0 -14
  207. package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/point_defect/base/__init__.py +0 -7
  208. package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/point_defect/base/builder.py +0 -42
  209. package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/point_defect/base/configuration.py +0 -27
  210. package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/point_defect/complex_defect_type_enum.py +0 -5
  211. package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/point_defect/factories.py +0 -69
  212. package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/point_defect/helpers.py +0 -92
  213. package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/point_defect/interstitial/__init__.py +0 -7
  214. package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/point_defect/interstitial/builder.py +0 -8
  215. package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/point_defect/interstitial/configuration.py +0 -29
  216. package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/point_defect/interstitial/helpers.py +0 -48
  217. package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/point_defect/interstitial/interstitial_placement_method_enum.py +0 -8
  218. package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/point_defect/point_defect_type_enum.py +0 -8
  219. package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/point_defect/substitutional/__init__.py +0 -7
  220. package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/point_defect/substitutional/builder.py +0 -6
  221. package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/point_defect/substitutional/configuration.py +0 -41
  222. package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/point_defect/substitutional/helpers.py +0 -43
  223. package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/point_defect/substitutional/substitution_placement_method_enum.py +0 -7
  224. package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/point_defect/types.py +0 -24
  225. package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/point_defect/vacancy/__init__.py +0 -7
  226. package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/point_defect/vacancy/builder.py +0 -19
  227. package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/point_defect/vacancy/configuration.py +0 -27
  228. package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/point_defect/vacancy/helpers.py +0 -42
  229. package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/point_defect/vacancy/vacancy_placement_method_enum.py +0 -7
  230. package/src/py/mat3ra/made/tools/build/pristine_structures/__init__.py +0 -0
  231. package/src/py/mat3ra/made/tools/build/pristine_structures/three_dimensional/ideal_crystal/__init__.py +0 -0
  232. package/src/py/mat3ra/made/tools/build/pristine_structures/three_dimensional/ideal_crystal/builder.py +0 -80
  233. package/src/py/mat3ra/made/tools/build/pristine_structures/three_dimensional/ideal_crystal/configurations.py +0 -22
  234. package/src/py/mat3ra/made/tools/build/pristine_structures/three_dimensional/ideal_crystal/helpers.py +0 -40
  235. package/src/py/mat3ra/made/tools/build/pristine_structures/two_dimensional/__init__.py +0 -0
  236. package/src/py/mat3ra/made/tools/build/pristine_structures/two_dimensional/nanoribbon/__init__.py +0 -29
  237. package/src/py/mat3ra/made/tools/build/pristine_structures/two_dimensional/nanoribbon/build_parameters.py +0 -5
  238. package/src/py/mat3ra/made/tools/build/pristine_structures/two_dimensional/nanoribbon/builders.py +0 -56
  239. package/src/py/mat3ra/made/tools/build/pristine_structures/two_dimensional/nanoribbon/configuration.py +0 -33
  240. package/src/py/mat3ra/made/tools/build/pristine_structures/two_dimensional/nanoribbon/helpers.py +0 -76
  241. package/src/py/mat3ra/made/tools/build/pristine_structures/two_dimensional/nanotape/__init__.py +0 -11
  242. package/src/py/mat3ra/made/tools/build/pristine_structures/two_dimensional/nanotape/build_parameters.py +0 -9
  243. package/src/py/mat3ra/made/tools/build/pristine_structures/two_dimensional/nanotape/builders.py +0 -83
  244. package/src/py/mat3ra/made/tools/build/pristine_structures/two_dimensional/nanotape/configuration.py +0 -35
  245. package/src/py/mat3ra/made/tools/build/pristine_structures/two_dimensional/nanotape/helpers.py +0 -62
  246. package/src/py/mat3ra/made/tools/build/pristine_structures/two_dimensional/slab/__init__.py +0 -9
  247. package/src/py/mat3ra/made/tools/build/pristine_structures/two_dimensional/slab/build_parameters.py +0 -8
  248. package/src/py/mat3ra/made/tools/build/pristine_structures/two_dimensional/slab/builder.py +0 -42
  249. package/src/py/mat3ra/made/tools/build/pristine_structures/two_dimensional/slab/configuration.py +0 -99
  250. package/src/py/mat3ra/made/tools/build/pristine_structures/two_dimensional/slab/helpers.py +0 -95
  251. package/src/py/mat3ra/made/tools/build/pristine_structures/two_dimensional/slab/termination_utils.py +0 -14
  252. package/src/py/mat3ra/made/tools/build/pristine_structures/two_dimensional/slab/utils.py +0 -61
  253. package/src/py/mat3ra/made/tools/build/pristine_structures/two_dimensional/slab_strained_supercell/builder.py +0 -22
  254. package/src/py/mat3ra/made/tools/build/pristine_structures/two_dimensional/slab_strained_supercell/configuration.py +0 -17
  255. package/src/py/mat3ra/made/tools/build/pristine_structures/zero_dimensional/__init__.py +0 -0
  256. package/src/py/mat3ra/made/tools/build/pristine_structures/zero_dimensional/nanoparticle/__init__.py +0 -19
  257. package/src/py/mat3ra/made/tools/build/pristine_structures/zero_dimensional/nanoparticle/analyzer.py +0 -86
  258. package/src/py/mat3ra/made/tools/build/pristine_structures/zero_dimensional/nanoparticle/ase_based/__init__.py +0 -7
  259. package/src/py/mat3ra/made/tools/build/pristine_structures/zero_dimensional/nanoparticle/ase_based/builder.py +0 -54
  260. package/src/py/mat3ra/made/tools/build/pristine_structures/zero_dimensional/nanoparticle/ase_based/configuration.py +0 -19
  261. package/src/py/mat3ra/made/tools/build/pristine_structures/zero_dimensional/nanoparticle/enums.py +0 -42
  262. package/src/py/mat3ra/made/tools/build/pristine_structures/zero_dimensional/nanoparticle/helpers.py +0 -127
  263. package/src/py/mat3ra/made/tools/build/pristine_structures/zero_dimensional/nanoparticle/merge_based/__init__.py +0 -7
  264. package/src/py/mat3ra/made/tools/build/pristine_structures/zero_dimensional/nanoparticle/merge_based/builder.py +0 -33
  265. package/src/py/mat3ra/made/tools/build/pristine_structures/zero_dimensional/nanoparticle/merge_based/configuration.py +0 -16
  266. package/src/py/mat3ra/made/tools/build/processed_structures/__init__.py +0 -0
  267. package/src/py/mat3ra/made/tools/build/processed_structures/two_dimensional/__init__.py +0 -0
  268. package/src/py/mat3ra/made/tools/build/processed_structures/two_dimensional/passivation/__init__.py +0 -0
  269. package/src/py/mat3ra/made/tools/build/processed_structures/two_dimensional/passivation/analyzers/__init__.py +0 -9
  270. package/src/py/mat3ra/made/tools/build/processed_structures/two_dimensional/passivation/analyzers/coordination_based_passivation_material_analyzer.py +0 -112
  271. package/src/py/mat3ra/made/tools/build/processed_structures/two_dimensional/passivation/analyzers/passivation_material_analyzer.py +0 -16
  272. package/src/py/mat3ra/made/tools/build/processed_structures/two_dimensional/passivation/analyzers/surface_passivation_material_analyzer.py +0 -32
  273. package/src/py/mat3ra/made/tools/build/processed_structures/two_dimensional/passivation/builder.py +0 -23
  274. package/src/py/mat3ra/made/tools/build/processed_structures/two_dimensional/passivation/configuration.py +0 -31
  275. package/src/py/mat3ra/made/tools/build/processed_structures/two_dimensional/passivation/enums.py +0 -7
  276. package/src/py/mat3ra/made/tools/build/processed_structures/two_dimensional/passivation/helpers.py +0 -151
  277. package/src/py/mat3ra/made/tools/build_components/__init__.py +0 -10
  278. package/src/py/mat3ra/made/tools/build_components/entities/__init__.py +0 -0
  279. package/src/py/mat3ra/made/tools/build_components/entities/auxiliary/__init__.py +0 -0
  280. package/src/py/mat3ra/made/tools/build_components/entities/auxiliary/one_dimensional/miller_indices_2d.py +0 -0
  281. package/src/py/mat3ra/made/tools/build_components/entities/auxiliary/two_dimensional/miller_indices.py +0 -18
  282. package/src/py/mat3ra/made/tools/build_components/entities/auxiliary/two_dimensional/termination.py +0 -33
  283. package/src/py/mat3ra/made/tools/build_components/entities/auxiliary/zero_dimensional/__init__.py +0 -0
  284. package/src/py/mat3ra/made/tools/build_components/entities/auxiliary/zero_dimensional/crystal_site/__init__.py +0 -2
  285. package/src/py/mat3ra/made/tools/build_components/entities/auxiliary/zero_dimensional/crystal_site/crystal_site.py +0 -24
  286. package/src/py/mat3ra/made/tools/build_components/entities/auxiliary/zero_dimensional/crystal_site/crystal_site_list.py +0 -9
  287. package/src/py/mat3ra/made/tools/build_components/entities/auxiliary/zero_dimensional/point_defect_site/builder.py +0 -32
  288. package/src/py/mat3ra/made/tools/build_components/entities/auxiliary/zero_dimensional/point_defect_site/configuration.py +0 -14
  289. package/src/py/mat3ra/made/tools/build_components/entities/auxiliary/zero_dimensional/void_region/__init__.py +0 -0
  290. package/src/py/mat3ra/made/tools/build_components/entities/auxiliary/zero_dimensional/void_region/builder.py +0 -29
  291. package/src/py/mat3ra/made/tools/build_components/entities/auxiliary/zero_dimensional/void_region/configuration.py +0 -19
  292. package/src/py/mat3ra/made/tools/build_components/entities/core/two_dimensional/vacuum/builder.py +0 -48
  293. package/src/py/mat3ra/made/tools/build_components/entities/core/two_dimensional/vacuum/configuration.py +0 -17
  294. package/src/py/mat3ra/made/tools/build_components/entities/core/zero_dimensional/atom/builder.py +0 -25
  295. package/src/py/mat3ra/made/tools/build_components/entities/core/zero_dimensional/atom/configuration.py +0 -8
  296. package/src/py/mat3ra/made/tools/build_components/entities/reusable/__init__.py +0 -0
  297. package/src/py/mat3ra/made/tools/build_components/entities/reusable/base_builder/__init__.py +0 -16
  298. package/src/py/mat3ra/made/tools/build_components/entities/reusable/base_builder/base_configuration_pydantic.py +0 -5
  299. package/src/py/mat3ra/made/tools/build_components/entities/reusable/base_builder/base_single_builder.py +0 -87
  300. package/src/py/mat3ra/made/tools/build_components/entities/reusable/base_builder/build_parameters.py +0 -5
  301. package/src/py/mat3ra/made/tools/build_components/entities/reusable/one_dimensional/__init__.py +0 -0
  302. package/src/py/mat3ra/made/tools/build_components/entities/reusable/one_dimensional/crystal_lattice_lines/__init__.py +0 -4
  303. package/src/py/mat3ra/made/tools/build_components/entities/reusable/one_dimensional/crystal_lattice_lines/builder.py +0 -46
  304. package/src/py/mat3ra/made/tools/build_components/entities/reusable/one_dimensional/crystal_lattice_lines/configuration.py +0 -19
  305. package/src/py/mat3ra/made/tools/build_components/entities/reusable/one_dimensional/crystal_lattice_lines/edge_types.py +0 -51
  306. package/src/py/mat3ra/made/tools/build_components/entities/reusable/one_dimensional/crystal_lattice_lines/helpers.py +0 -58
  307. package/src/py/mat3ra/made/tools/build_components/entities/reusable/one_dimensional/crystal_lattice_lines_unique_repeated/__init__.py +0 -4
  308. package/src/py/mat3ra/made/tools/build_components/entities/reusable/one_dimensional/crystal_lattice_lines_unique_repeated/builder.py +0 -42
  309. package/src/py/mat3ra/made/tools/build_components/entities/reusable/one_dimensional/crystal_lattice_lines_unique_repeated/configuration.py +0 -21
  310. package/src/py/mat3ra/made/tools/build_components/entities/reusable/three_dimensional/supercell/__init__.py +0 -0
  311. package/src/py/mat3ra/made/tools/build_components/entities/reusable/three_dimensional/supercell/configuration.py +0 -11
  312. package/src/py/mat3ra/made/tools/build_components/entities/reusable/three_dimensional/supercell/helpers.py +0 -38
  313. package/src/py/mat3ra/made/tools/build_components/entities/reusable/two_dimensional/__init__.py +0 -24
  314. package/src/py/mat3ra/made/tools/build_components/entities/reusable/two_dimensional/atomic_layers_unique_repeated/__init__.py +0 -7
  315. package/src/py/mat3ra/made/tools/build_components/entities/reusable/two_dimensional/atomic_layers_unique_repeated/builder.py +0 -62
  316. package/src/py/mat3ra/made/tools/build_components/entities/reusable/two_dimensional/atomic_layers_unique_repeated/configuration.py +0 -14
  317. package/src/py/mat3ra/made/tools/build_components/entities/reusable/two_dimensional/atomic_layers_unique_repeated/helpers.py +0 -42
  318. package/src/py/mat3ra/made/tools/build_components/entities/reusable/two_dimensional/crystal_lattice_planes/__init__.py +0 -7
  319. package/src/py/mat3ra/made/tools/build_components/entities/reusable/two_dimensional/crystal_lattice_planes/builder.py +0 -39
  320. package/src/py/mat3ra/made/tools/build_components/entities/reusable/two_dimensional/crystal_lattice_planes/configuration.py +0 -24
  321. package/src/py/mat3ra/made/tools/build_components/entities/reusable/two_dimensional/slab_stack/__init__.py +0 -10
  322. package/src/py/mat3ra/made/tools/build_components/entities/reusable/two_dimensional/slab_stack/builder.py +0 -36
  323. package/src/py/mat3ra/made/tools/build_components/entities/reusable/two_dimensional/slab_stack/configuration.py +0 -31
  324. package/src/py/mat3ra/made/tools/build_components/entities/reusable/two_dimensional/slab_stack/helpers.py +0 -80
  325. package/src/py/mat3ra/made/tools/build_components/entities/reusable/zero_dimensional/__init__.py +0 -0
  326. package/src/py/mat3ra/made/tools/build_components/entities/reusable/zero_dimensional/coordinates_shape_enum.py +0 -8
  327. package/src/py/mat3ra/made/tools/build_components/metadata/__init__.py +0 -2
  328. package/src/py/mat3ra/made/tools/build_components/metadata/build_metadata.py +0 -7
  329. package/src/py/mat3ra/made/tools/build_components/metadata/material_build_metadata.py +0 -35
  330. package/src/py/mat3ra/made/tools/build_components/metadata/material_with_build_metadata.py +0 -8
  331. package/src/py/mat3ra/made/tools/build_components/mixins/__init__.py +0 -2
  332. package/src/py/mat3ra/made/tools/build_components/mixins/convert_generated_items_ase_atoms_mixin.py +0 -8
  333. package/src/py/mat3ra/made/tools/build_components/mixins/convert_generated_items_pymatgen_structure_mixin.py +0 -8
  334. package/src/py/mat3ra/made/tools/build_components/operations/core/combinations/__init__.py +0 -0
  335. package/src/py/mat3ra/made/tools/build_components/operations/core/combinations/enums.py +0 -11
  336. package/src/py/mat3ra/made/tools/build_components/operations/core/combinations/merge/__init__.py +0 -6
  337. package/src/py/mat3ra/made/tools/build_components/operations/core/combinations/merge/build_parameters.py +0 -18
  338. package/src/py/mat3ra/made/tools/build_components/operations/core/combinations/merge/builder.py +0 -93
  339. package/src/py/mat3ra/made/tools/build_components/operations/core/combinations/merge/configuration.py +0 -20
  340. package/src/py/mat3ra/made/tools/build_components/operations/core/combinations/stack/builder.py +0 -83
  341. package/src/py/mat3ra/made/tools/build_components/operations/core/combinations/stack/configuration.py +0 -24
  342. package/src/py/mat3ra/made/tools/build_components/operations/core/modifications/perturb/__init__.py +0 -15
  343. package/src/py/mat3ra/made/tools/build_components/operations/core/modifications/perturb/build_parameters.py +0 -5
  344. package/src/py/mat3ra/made/tools/build_components/operations/core/modifications/perturb/builders/base.py +0 -33
  345. package/src/py/mat3ra/made/tools/build_components/operations/core/modifications/perturb/builders/isometric.py +0 -25
  346. package/src/py/mat3ra/made/tools/build_components/operations/core/modifications/perturb/configuration.py +0 -24
  347. package/src/py/mat3ra/made/tools/build_components/operations/core/modifications/perturb/functions/__init__.py +0 -13
  348. package/src/py/mat3ra/made/tools/build_components/operations/core/modifications/perturb/functions/atomic_mass_dependent_function_holder.py +0 -32
  349. package/src/py/mat3ra/made/tools/build_components/operations/core/modifications/perturb/functions/function_holder.py +0 -80
  350. package/src/py/mat3ra/made/tools/build_components/operations/core/modifications/perturb/functions/maxwell_boltzmann.py +0 -39
  351. package/src/py/mat3ra/made/tools/build_components/operations/core/modifications/perturb/functions/perturbation_function_holder.py +0 -45
  352. package/src/py/mat3ra/made/tools/build_components/operations/core/modifications/perturb/functions/sine_wave_perturbation_function_holder.py +0 -29
  353. package/src/py/mat3ra/made/tools/build_components/operations/core/modifications/perturb/helpers.py +0 -83
  354. package/src/py/mat3ra/made/tools/build_components/operations/core/modifications/strain/__init__.py +0 -5
  355. package/src/py/mat3ra/made/tools/build_components/operations/core/modifications/strain/builder.py +0 -25
  356. package/src/py/mat3ra/made/tools/build_components/operations/core/modifications/strain/configuration.py +0 -23
  357. package/src/py/mat3ra/made/tools/build_components/operations/core/modifications/strain/helpers.py +0 -49
  358. package/src/py/mat3ra/made/tools/build_components/utils.py +0 -44
  359. package/src/py/mat3ra/made/tools/calculate/__init__.py +0 -149
  360. package/src/py/mat3ra/made/tools/calculate/ase/__init__.py +0 -133
  361. package/src/py/mat3ra/made/tools/calculate/ase/constraints.py +0 -91
  362. package/src/py/mat3ra/made/tools/calculate/calculators/__init__.py +0 -4
  363. package/src/py/mat3ra/made/tools/calculate/calculators/interface_material_calculator.py +0 -70
  364. package/src/py/mat3ra/made/tools/calculate/calculators/interface_material_calculator_parameters.py +0 -14
  365. package/src/py/mat3ra/made/tools/calculate/calculators/material_calculator.py +0 -32
  366. package/src/py/mat3ra/made/tools/calculate/calculators/material_calculator_parameters.py +0 -17
  367. package/src/py/mat3ra/made/tools/calculate/interaction_functions.py +0 -23
  368. package/src/py/mat3ra/made/tools/convert/__init__.py +0 -286
  369. package/src/py/mat3ra/made/tools/convert/interface_parts_enum.py +0 -9
  370. package/src/py/mat3ra/made/tools/convert/utils.py +0 -96
  371. package/src/py/mat3ra/made/tools/entities/__init__.py +0 -5
  372. package/src/py/mat3ra/made/tools/entities/coordinate/__init__.py +0 -14
  373. package/src/py/mat3ra/made/tools/entities/coordinate/box_coordinate_condition.py +0 -15
  374. package/src/py/mat3ra/made/tools/entities/coordinate/coordinate_condition.py +0 -16
  375. package/src/py/mat3ra/made/tools/entities/coordinate/coordinate_functions.py +0 -158
  376. package/src/py/mat3ra/made/tools/entities/coordinate/cylinder_coordinate_condition.py +0 -17
  377. package/src/py/mat3ra/made/tools/entities/coordinate/plane_coordinate_condition.py +0 -14
  378. package/src/py/mat3ra/made/tools/entities/coordinate/sphere_coordinate_condition.py +0 -15
  379. package/src/py/mat3ra/made/tools/entities/coordinate/triangular_prism_coordinate_condition.py +0 -26
  380. package/src/py/mat3ra/made/tools/entities/termination_holder.py +0 -12
  381. package/src/py/mat3ra/made/tools/helpers.py +0 -168
  382. package/src/py/mat3ra/made/tools/modify.py +0 -627
  383. package/src/py/mat3ra/made/tools/operations/core/binary.py +0 -106
  384. package/src/py/mat3ra/made/tools/operations/core/unary.py +0 -170
  385. package/src/py/mat3ra/made/tools/operations/core/utils.py +0 -138
  386. package/src/py/mat3ra/made/tools/operations/reusable/unary.py +0 -53
  387. package/src/py/mat3ra/made/tools/optimize.py +0 -55
  388. package/src/py/mat3ra/made/tools/third_party.py +0 -69
  389. package/src/py/mat3ra/made/tools/utils.py +0 -182
  390. package/src/py/mat3ra/made/utils.py +0 -144
  391. package/tests/.gitattributes +0 -1
  392. package/tests/fixtures/AsGe-basis.json +0 -3
  393. package/tests/fixtures/C2H4-translated.json +0 -3
  394. package/tests/fixtures/C2H4.json +0 -3
  395. package/tests/fixtures/FeLiSi-basis.json +0 -3
  396. package/tests/fixtures/FeO.json +0 -3
  397. package/tests/fixtures/Ge2-basis.json +0 -3
  398. package/tests/fixtures/Graphene.json +0 -3
  399. package/tests/fixtures/Graphene.poscar +0 -3
  400. package/tests/fixtures/H2+H-final.json +0 -3
  401. package/tests/fixtures/H2+H-image.json +0 -3
  402. package/tests/fixtures/H2+H-initial.json +0 -3
  403. package/tests/fixtures/H2O.poscar +0 -3
  404. package/tests/fixtures/LiFeSi-basis-labels.json +0 -3
  405. package/tests/fixtures/LiFeSi-basis.json +0 -3
  406. package/tests/fixtures/Na.json +0 -3
  407. package/tests/fixtures/Na4Cl4-cartesian.json +0 -3
  408. package/tests/fixtures/Na4Cl4.json +0 -3
  409. package/tests/fixtures/Na4Cl4.poscar +0 -3
  410. package/tests/fixtures/Ni-hex.json +0 -3
  411. package/tests/fixtures/Ni-hex.poscar +0 -3
  412. package/tests/fixtures/OSi-basis.json +0 -3
  413. package/tests/fixtures/Si-hex.poscar +0 -3
  414. package/tests/fixtures/Si-pwscf.in +0 -3
  415. package/tests/fixtures/Si-slab.json +0 -3
  416. package/tests/fixtures/Si-supercell.json +0 -3
  417. package/tests/fixtures/Si2-basis-repeated.json +0 -3
  418. package/tests/fixtures/Si2-basis.json +0 -3
  419. package/tests/fixtures/Zr1H23Zr1H1.json +0 -3
  420. package/tests/fixtures/Zr1H23Zr1H1.poscar +0 -3
  421. package/tests/fixtures/atomic-constraints.json +0 -3
  422. package/tests/fixtures/hashes.json +0 -3
  423. package/tests/fixtures/si-slab-100.json +0 -3
  424. package/tests/fixtures/si-slab-111-0-vacuum.json +0 -3
  425. package/tests/fixtures/si-slab-111-0.5-vacuum-gamma-120.json +0 -3
  426. package/tests/fixtures/si-slab-111-0.5-vacuum-ratio.json +0 -3
  427. package/tests/fixtures/si-standata.json +0 -3
  428. package/tests/js/basis/basis.ts +0 -247
  429. package/tests/js/cell/cell.ts +0 -182
  430. package/tests/js/cell/primitive_cell.ts +0 -21
  431. package/tests/js/constraints/constraints.ts +0 -11
  432. package/tests/js/fixtures.ts +0 -120
  433. package/tests/js/lattice/lattice.ts +0 -43
  434. package/tests/js/lattice/lattice_reciprocal.ts +0 -104
  435. package/tests/js/material.test.ts +0 -42
  436. package/tests/js/parsers/espresso.ts +0 -15
  437. package/tests/js/parsers/native_formats.ts +0 -35
  438. package/tests/js/parsers/poscar.ts +0 -89
  439. package/tests/js/parsers/xyz.ts +0 -33
  440. package/tests/js/parsers/xyz_combinatorial_basis.ts +0 -156
  441. package/tests/js/setup.ts +0 -6
  442. package/tests/js/tools/basis.ts +0 -22
  443. package/tests/js/tools/supercell.ts +0 -58
  444. package/tests/js/tools/surface.ts +0 -115
  445. package/tests/py/conftest.py +0 -34
  446. package/tests/py/mat3ra/debug_utils.py +0 -75
  447. package/tests/py/unit/__init__.py +0 -0
  448. package/tests/py/unit/fixtures/__init__.py +0 -0
  449. package/tests/py/unit/fixtures/adatom.py +0 -60
  450. package/tests/py/unit/fixtures/bulk.py +0 -162
  451. package/tests/py/unit/fixtures/cuts.py +0 -118
  452. package/tests/py/unit/fixtures/grain_boundary.py +0 -875
  453. package/tests/py/unit/fixtures/interface/commensurate.py +0 -498
  454. package/tests/py/unit/fixtures/interface/gaas_dia.py +0 -837
  455. package/tests/py/unit/fixtures/interface/gr_ni_111_top_hcp.py +0 -123
  456. package/tests/py/unit/fixtures/interface/simple.py +0 -84
  457. package/tests/py/unit/fixtures/interface/twisted_nanoribbons.py +0 -131
  458. package/tests/py/unit/fixtures/interface/zsl.py +0 -756
  459. package/tests/py/unit/fixtures/island.py +0 -336
  460. package/tests/py/unit/fixtures/merge.py +0 -147
  461. package/tests/py/unit/fixtures/monolayer.py +0 -46
  462. package/tests/py/unit/fixtures/nanoparticle.py +0 -116
  463. package/tests/py/unit/fixtures/nanoribbon/__init__.py +0 -0
  464. package/tests/py/unit/fixtures/nanoribbon/armchair.py +0 -102
  465. package/tests/py/unit/fixtures/nanoribbon/nanoribbon.py +0 -145
  466. package/tests/py/unit/fixtures/nanoribbon/zigzag.py +0 -54
  467. package/tests/py/unit/fixtures/pair_defects.py +0 -41
  468. package/tests/py/unit/fixtures/passivated/nanoribbon.py +0 -69
  469. package/tests/py/unit/fixtures/passivated/slab.py +0 -58
  470. package/tests/py/unit/fixtures/point_defects.py +0 -158
  471. package/tests/py/unit/fixtures/slab.py +0 -606
  472. package/tests/py/unit/fixtures/strain.py +0 -42
  473. package/tests/py/unit/fixtures/supercell.py +0 -64
  474. package/tests/py/unit/fixtures/terrace.py +0 -70
  475. package/tests/py/unit/fixtures/thrid_party/ase_atoms.py +0 -13
  476. package/tests/py/unit/test_analyze_lattice_planes.py +0 -131
  477. package/tests/py/unit/test_cell.py +0 -104
  478. package/tests/py/unit/test_data_files.py +0 -68
  479. package/tests/py/unit/test_lattice.py +0 -103
  480. package/tests/py/unit/test_lattice_type_extended.py +0 -53
  481. package/tests/py/unit/test_material.py +0 -158
  482. package/tests/py/unit/test_operations.py +0 -126
  483. package/tests/py/unit/test_primitive_cell.py +0 -118
  484. package/tests/py/unit/test_reciprocal_lattice.py +0 -86
  485. package/tests/py/unit/test_reciprocal_paths.py +0 -64
  486. package/tests/py/unit/test_symmetry_points.py +0 -151
  487. package/tests/py/unit/test_tools_analyze.py +0 -219
  488. package/tests/py/unit/test_tools_analyze_basis.py +0 -105
  489. package/tests/py/unit/test_tools_analyze_interface.py +0 -223
  490. package/tests/py/unit/test_tools_analyze_interface_material.py +0 -63
  491. package/tests/py/unit/test_tools_analyze_interface_zsl.py +0 -187
  492. package/tests/py/unit/test_tools_analyze_lattice.py +0 -74
  493. package/tests/py/unit/test_tools_analyze_swap.py +0 -80
  494. package/tests/py/unit/test_tools_build.py +0 -158
  495. package/tests/py/unit/test_tools_build_defect/__init__.py +0 -0
  496. package/tests/py/unit/test_tools_build_defect/test_adatom.py +0 -84
  497. package/tests/py/unit/test_tools_build_defect/test_island.py +0 -45
  498. package/tests/py/unit/test_tools_build_defect/test_pair_defect.py +0 -84
  499. package/tests/py/unit/test_tools_build_defect/test_point_defect.py +0 -196
  500. package/tests/py/unit/test_tools_build_defect/test_slab_stack.py +0 -30
  501. package/tests/py/unit/test_tools_build_defect/test_solid_solution.py +0 -90
  502. package/tests/py/unit/test_tools_build_defect/test_terrace.py +0 -44
  503. package/tests/py/unit/test_tools_build_grain_boundary.py +0 -133
  504. package/tests/py/unit/test_tools_build_heterostructure.py +0 -46
  505. package/tests/py/unit/test_tools_build_interface.py +0 -292
  506. package/tests/py/unit/test_tools_build_interface_zsl.py +0 -263
  507. package/tests/py/unit/test_tools_build_maxwell_disorder.py +0 -123
  508. package/tests/py/unit/test_tools_build_metadata.py +0 -79
  509. package/tests/py/unit/test_tools_build_monolayer.py +0 -33
  510. package/tests/py/unit/test_tools_build_nanoparticle.py +0 -42
  511. package/tests/py/unit/test_tools_build_nanoribbon.py +0 -45
  512. package/tests/py/unit/test_tools_build_passivation.py +0 -85
  513. package/tests/py/unit/test_tools_build_perturbation.py +0 -103
  514. package/tests/py/unit/test_tools_build_slab.py +0 -382
  515. package/tests/py/unit/test_tools_build_strain.py +0 -36
  516. package/tests/py/unit/test_tools_build_supercell.py +0 -47
  517. package/tests/py/unit/test_tools_calculate.py +0 -67
  518. package/tests/py/unit/test_tools_convert.py +0 -174
  519. package/tests/py/unit/test_tools_modify.py +0 -248
  520. package/tests/py/unit/utils.py +0 -142
  521. package/tsconfig-transpile.json +0 -3
  522. package/tsconfig.json +0 -3
@@ -0,0 +1,219 @@
1
+ import { InMemoryEntity } from "@mat3ra/code/dist/js/entity";
2
+ import { type Defaultable } from "@mat3ra/code/dist/js/entity/mixins/DefaultableMixin";
3
+ import { type HasMetadata } from "@mat3ra/code/dist/js/entity/mixins/HasMetadataMixin";
4
+ import { type NamedEntity } from "@mat3ra/code/dist/js/entity/mixins/NamedEntityMixin";
5
+ import type { JSONSchema } from "@mat3ra/esse/dist/js/esse/utils";
6
+ import type { AtomicConstraintsSchema, BasisSchema, ConsistencyCheck, DerivedPropertiesSchema, FileSourceSchema, LatticeSchema, MaterialEnhancedHashedSchema, MaterialEnhancedSchema, MaterialHashedSchema, MaterialSchema } from "@mat3ra/esse/dist/js/types";
7
+ import { type BasisConfig } from "./basis/basis";
8
+ import { type ConstrainedBasisConfig, ConstrainedBasis } from "./basis/constrained_basis";
9
+ import { type MaterialSchemaMixin } from "./generated/MaterialSchemaMixin";
10
+ import { Lattice } from "./lattice/lattice";
11
+ export type PartialBy<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
12
+ /**
13
+ * Bundle of material JSON-schema variants used by {@link Material} projections.
14
+ * Web-app passes extended schemas here so `toJSON*` return types stay precise.
15
+ */
16
+ export type MaterialSchemaMap = {
17
+ pure: MaterialSchema;
18
+ enhanced: MaterialEnhancedSchema;
19
+ hashed: MaterialHashedSchema;
20
+ enhancedHashed: MaterialEnhancedHashedSchema;
21
+ };
22
+ /** Default ESSE schema map (no web-app extensions). */
23
+ export type DefaultMaterialSchemas = MaterialSchemaMap;
24
+ /**
25
+ * Constructor config: constraints/hash/metadata optional — normalized in the constructor
26
+ * (`parseConstrainedBasis` + {@link Material.updateHash}; `metadata` defaults to `{}`).
27
+ */
28
+ export type MaterialConfig<S extends MaterialEnhancedHashedSchema = MaterialEnhancedHashedSchema> = Omit<PartialBy<S, "name" | "metadata" | "hash" | "scaledHash">, "basis"> & {
29
+ basis: MaterialSchema["basis"] | MaterialEnhancedSchema["basis"];
30
+ };
31
+ export declare const defaultMaterialConfig: MaterialEnhancedSchema;
32
+ interface BaseMaterial<S extends MaterialEnhancedHashedSchema = MaterialEnhancedHashedSchema> extends MaterialSchemaMixin, NamedEntity, Defaultable, Required<HasMetadata<S["metadata"]>> {
33
+ }
34
+ declare class BaseMaterial<S extends MaterialEnhancedHashedSchema = MaterialEnhancedHashedSchema> extends InMemoryEntity<S> {
35
+ }
36
+ /**
37
+ * Unified material. Pass extended schemas via {@link MaterialSchemaMap} so each
38
+ * `toJSON*` returns the web-app (or other host) schema type.
39
+ *
40
+ * @example
41
+ * ```ts
42
+ * type WebappSchemas = {
43
+ * pure: MaterialSchema;
44
+ * enhanced: WebappMaterialEnhancedSchema;
45
+ * hashed: WebappMaterialHashedSchema;
46
+ * enhancedHashed: WebappMaterialEnhancedSchema;
47
+ * };
48
+ * class CoreMaterial extends Material<WebappSchemas> {}
49
+ * ```
50
+ */
51
+ declare class Material<Schemas extends MaterialSchemaMap = DefaultMaterialSchemas> extends BaseMaterial<Schemas["enhancedHashed"]> {
52
+ static createDefault: () => Material<MaterialSchemaMap>;
53
+ /**
54
+ * Schema used by {@link InMemoryEntity.clean} / {@link toJSON}.
55
+ * Defaults to enhanced+hashed; subclasses / web-app Core* may override.
56
+ */
57
+ static get jsonSchema(): JSONSchema;
58
+ /** Schema for {@link toJSONPure} — override in web-app if the base material schema is extended. */
59
+ static get jsonSchemaPure(): JSONSchema;
60
+ /** Schema for {@link toJSONEnhanced}. */
61
+ static get jsonSchemaEnhanced(): JSONSchema;
62
+ /** Schema for {@link toJSONHashed}. */
63
+ static get jsonSchemaHashed(): JSONSchema;
64
+ /** Schema for {@link toJSONEnhancedHashed}. */
65
+ static get jsonSchemaEnhancedHashed(): JSONSchema;
66
+ static get defaultConfig(): MaterialEnhancedSchema;
67
+ static constructMaterialFileSource(fileName: string, fileContent: string, fileExtension: string): FileSourceSchema;
68
+ /**
69
+ * @param config - Partial entity input. `basis.constraints` / `hash` / `metadata` may be omitted;
70
+ * constraints and hash are filled here; missing `metadata` becomes `{}`.
71
+ * `NoInfer` keeps `Schemas` from being inferred from the config object literal.
72
+ */
73
+ constructor(config: NoInfer<MaterialConfig>);
74
+ get hash(): Schemas["enhancedHashed"]["hash"];
75
+ set hash(value: Schemas["enhancedHashed"]["hash"]);
76
+ get scaledHash(): Schemas["enhancedHashed"]["scaledHash"];
77
+ set scaledHash(value: Schemas["enhancedHashed"]["scaledHash"]);
78
+ /**
79
+ * Recompute and store {@link hash} from the current basis/lattice (or InChI if non-periodic).
80
+ * When non-periodic but InChI is not derived yet (e.g. designer toggle before butler), use
81
+ * geometric hash so setters do not throw — same practical UX as main before auto-updateHash.
82
+ */
83
+ updateHash(): void;
84
+ get basis(): Schemas["enhancedHashed"]["basis"];
85
+ set basis(value: Schemas["enhancedHashed"]["basis"]);
86
+ get lattice(): Schemas["enhancedHashed"]["lattice"];
87
+ set lattice(value: Schemas["enhancedHashed"]["lattice"]);
88
+ updateFormula(): void;
89
+ /**
90
+ * @summary Returns the specific derived property (as specified by name) for a material.
91
+ */
92
+ getDerivedPropertyByName(name: string): {
93
+ name?: "volume";
94
+ units?: "angstrom^3";
95
+ value: number;
96
+ } | {
97
+ name?: "density";
98
+ units?: "g/cm^3";
99
+ value: number;
100
+ } | {
101
+ pointGroupSymbol?: string;
102
+ spaceGroupSymbol?: string;
103
+ tolerance?: {
104
+ units?: "angstrom";
105
+ value: number;
106
+ };
107
+ name?: "symmetry";
108
+ } | {
109
+ name?: "elemental_ratio";
110
+ value: number;
111
+ element?: string;
112
+ } | {
113
+ name?: "p-norm";
114
+ degree?: number;
115
+ value: number;
116
+ } | {
117
+ name?: "inchi";
118
+ value: string;
119
+ } | {
120
+ name?: "inchi_key";
121
+ value: string;
122
+ } | undefined;
123
+ /**
124
+ * @summary Returns the derived properties array for a material.
125
+ */
126
+ getDerivedProperties(): DerivedPropertiesSchema;
127
+ unsetFileProps(): void;
128
+ setBasis(basis: BasisConfig | ConstrainedBasisConfig): void;
129
+ setBasis(basis: string, format: "xyz", units?: BasisSchema["units"]): void;
130
+ private setBasisConstraints;
131
+ setBasisConstraintsFromArrayOfObjects(constraints: AtomicConstraintsSchema): void;
132
+ getBasis(): ConstrainedBasis;
133
+ setLattice(lattice: LatticeSchema): void;
134
+ getLattice(): Lattice;
135
+ /**
136
+ * High-level access to unique elements from material instead of basis.
137
+ */
138
+ get uniqueElements(): ("H" | "He" | "Li" | "Be" | "B" | "C" | "N" | "O" | "F" | "Ne" | "Na" | "Mg" | "Al" | "Si" | "P" | "S" | "Cl" | "Ar" | "K" | "Ca" | "Sc" | "Ti" | "V" | "Cr" | "Mn" | "Fe" | "Co" | "Ni" | "Cu" | "Zn" | "Ga" | "Ge" | "As" | "Se" | "Br" | "Kr" | "Rb" | "Sr" | "Y" | "Zr" | "Nb" | "Mo" | "Tc" | "Ru" | "Rh" | "Pd" | "Ag" | "Cd" | "In" | "Sn" | "Sb" | "Te" | "I" | "Xe" | "Cs" | "Ba" | "La" | "Ce" | "Pr" | "Nd" | "Pm" | "Sm" | "Eu" | "Gd" | "Tb" | "Dy" | "Ho" | "Er" | "Tm" | "Yb" | "Lu" | "Hf" | "Ta" | "W" | "Re" | "Os" | "Ir" | "Pt" | "Au" | "Hg" | "Tl" | "Pb" | "Bi" | "Po" | "At" | "Rn" | "Fr" | "Ra" | "Ac" | "Th" | "Pa" | "U" | "Np" | "Pu" | "Am" | "Cm" | "Bk" | "Cf" | "Es" | "Fm" | "Md" | "No" | "Lr" | "Rf" | "Db" | "Sg" | "Bh" | "Hs" | "Mt" | "Ds" | "Rg" | "Cn" | "Nh" | "Fl" | "Mc" | "Lv" | "Ts" | "Og" | "X" | "Vac")[];
139
+ /**
140
+ * Returns the inchi string from the derivedProperties for a non-periodic material, or throws an error if the
141
+ * inchi cannot be found.
142
+ * @returns {String}
143
+ */
144
+ getInchiStringForHash(): string;
145
+ /**
146
+ * Calculates hash from basis and lattice. Algorithm expects the following:
147
+ * - asserts lattice units to be angstrom
148
+ * - asserts basis units to be crystal
149
+ * - asserts basis coordinates and lattice measurements are rounded to hash precision
150
+ * - forms strings for lattice and basis
151
+ * - creates MD5 hash from basisStr + latticeStr + salt
152
+ * @param salt Salt for hashing, empty string by default.
153
+ * @param isScaled Whether to scale the lattice parameter 'a' to 1.
154
+ */
155
+ calculateHash(salt?: string, isScaled?: boolean, bypassNonPeriodicCheck?: boolean): string;
156
+ /**
157
+ * Converts basis to crystal/fractional coordinates.
158
+ */
159
+ toCrystal(): void;
160
+ /**
161
+ * Converts current material's basis coordinates to cartesian.
162
+ * No changes if coordinates already cartesian.
163
+ */
164
+ toCartesian(): void;
165
+ /**
166
+ * Returns material's basis in XYZ format (includes atomic constraints when present).
167
+ */
168
+ getBasisAsXyz(fractional?: boolean): string;
169
+ /**
170
+ * Returns material in Quantum Espresso output format:
171
+ * ```
172
+ * CELL_PARAMETERS (angstroms)
173
+ * -0.543131284 -0.000000000 0.543131284
174
+ * -0.000000000 0.543131284 0.543131284
175
+ * -0.543131284 0.543131284 0.000000000
176
+ *
177
+ * ATOMIC_POSITIONS (crystal)
178
+ * Si 0.000000000 0.000000000 -0.000000000
179
+ * Si 0.250000000 0.250000000 0.250000000
180
+ * ```
181
+ */
182
+ getAsQEFormat(): string;
183
+ /**
184
+ * Returns material in POSCAR format. Pass `true` to ignore original poscar source and re-serialize.
185
+ */
186
+ getAsPOSCAR(ignoreOriginal?: boolean, omitConstraints?: boolean): string;
187
+ /**
188
+ * Returns a copy of the material with conventional cell constructed instead of primitive.
189
+ */
190
+ getACopyWithConventionalCell(): this;
191
+ /**
192
+ * @summary a series of checks for the material and returns an array of results in ConsistencyChecks format.
193
+ * @returns Array of checks results
194
+ */
195
+ getConsistencyChecks(): ConsistencyCheck[];
196
+ /**
197
+ * @summary a series of checks for the material's basis and returns an array of results in ConsistencyChecks format.
198
+ * @returns Array of checks results
199
+ */
200
+ getBasisConsistencyChecks(): ConsistencyCheck[];
201
+ /**
202
+ * Full material JSON: constrained basis + hash fields from live getters.
203
+ * Variants below AJV-clean this payload against the matching ESSE schema.
204
+ * Builds from `_json` (not `super.toJSON`) so we do not pre-clean against
205
+ * {@link Material.jsonSchema} before projecting to a narrower schema.
206
+ */
207
+ private getFullJSON;
208
+ /**
209
+ * Clone {@link getFullJSON} and validate/clean against `jsonSchema` via AJV
210
+ * (same path as {@link InMemoryEntity.validateData} / {@link InMemoryEntity.clean}).
211
+ */
212
+ private cleanFullJSONAgainstSchema;
213
+ toJSONPure(): Schemas["pure"];
214
+ toJSONEnhanced(): Schemas["enhanced"];
215
+ toJSONHashed(): Schemas["hashed"];
216
+ toJSONEnhancedHashed(): Schemas["enhancedHashed"];
217
+ toJSON(): Schemas["enhancedHashed"];
218
+ }
219
+ export default Material;
@@ -0,0 +1,457 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.defaultMaterialConfig = void 0;
7
+ const entity_1 = require("@mat3ra/code/dist/js/entity");
8
+ const in_memory_1 = require("@mat3ra/code/dist/js/entity/in_memory");
9
+ const DefaultableMixin_1 = require("@mat3ra/code/dist/js/entity/mixins/DefaultableMixin");
10
+ const HasMetadataMixin_1 = require("@mat3ra/code/dist/js/entity/mixins/HasMetadataMixin");
11
+ const NamedEntityMixin_1 = require("@mat3ra/code/dist/js/entity/mixins/NamedEntityMixin");
12
+ const clone_1 = require("@mat3ra/code/dist/js/utils/clone");
13
+ const JSONSchemasInterface_1 = __importDefault(require("@mat3ra/esse/dist/js/esse/JSONSchemasInterface"));
14
+ const crypto_js_1 = __importDefault(require("crypto-js"));
15
+ const constrained_basis_1 = require("./basis/constrained_basis");
16
+ const conventional_cell_1 = require("./cell/conventional_cell");
17
+ const constraints_1 = require("./constraints/constraints");
18
+ const MaterialSchemaMixin_1 = require("./generated/MaterialSchemaMixin");
19
+ const lattice_1 = require("./lattice/lattice");
20
+ const parsers_1 = __importDefault(require("./parsers/parsers"));
21
+ const supercell_1 = __importDefault(require("./tools/supercell"));
22
+ /** ESSE `$id` values for material schema variants. */
23
+ const MATERIAL_SCHEMA_IDS = {
24
+ pure: "material",
25
+ enhanced: "material-enhanced",
26
+ hashed: "material-hashed",
27
+ enhancedHashed: "material-enhanced-hashed",
28
+ };
29
+ function parseConstrainedBasis(textOrObject, format, units) {
30
+ if (typeof textOrObject === "string") {
31
+ if (format !== "xyz") {
32
+ throw new Error("Invalid format");
33
+ }
34
+ return parsers_1.default.xyz.toBasisConfig(textOrObject, units);
35
+ }
36
+ if ("constraints" in textOrObject) {
37
+ return textOrObject;
38
+ }
39
+ return { ...textOrObject, constraints: [] };
40
+ }
41
+ exports.defaultMaterialConfig = {
42
+ name: "Silicon FCC",
43
+ basis: {
44
+ elements: [
45
+ {
46
+ id: 0,
47
+ value: "Si",
48
+ },
49
+ {
50
+ id: 1,
51
+ value: "Si",
52
+ },
53
+ ],
54
+ coordinates: [
55
+ {
56
+ id: 0,
57
+ value: [0.0, 0.0, 0.0],
58
+ },
59
+ {
60
+ id: 1,
61
+ value: [0.25, 0.25, 0.25],
62
+ },
63
+ ],
64
+ units: "crystal",
65
+ constraints: [],
66
+ },
67
+ lattice: {
68
+ // Primitive cell for Diamond FCC Silicon at ambient conditions
69
+ type: "FCC",
70
+ a: 3.867,
71
+ b: 3.867,
72
+ c: 3.867,
73
+ alpha: 60,
74
+ beta: 60,
75
+ gamma: 60,
76
+ units: {
77
+ length: "angstrom",
78
+ angle: "degree",
79
+ },
80
+ },
81
+ metadata: {},
82
+ };
83
+ class BaseMaterial extends entity_1.InMemoryEntity {
84
+ }
85
+ (0, MaterialSchemaMixin_1.materialSchemaMixin)(BaseMaterial.prototype);
86
+ (0, NamedEntityMixin_1.namedEntityMixin)(BaseMaterial.prototype);
87
+ (0, DefaultableMixin_1.defaultableEntityMixin)(BaseMaterial);
88
+ (0, HasMetadataMixin_1.hasMetadataMixin)(BaseMaterial.prototype);
89
+ /**
90
+ * Unified material. Pass extended schemas via {@link MaterialSchemaMap} so each
91
+ * `toJSON*` returns the web-app (or other host) schema type.
92
+ *
93
+ * @example
94
+ * ```ts
95
+ * type WebappSchemas = {
96
+ * pure: MaterialSchema;
97
+ * enhanced: WebappMaterialEnhancedSchema;
98
+ * hashed: WebappMaterialHashedSchema;
99
+ * enhancedHashed: WebappMaterialEnhancedSchema;
100
+ * };
101
+ * class CoreMaterial extends Material<WebappSchemas> {}
102
+ * ```
103
+ */
104
+ class Material extends BaseMaterial {
105
+ /**
106
+ * Schema used by {@link InMemoryEntity.clean} / {@link toJSON}.
107
+ * Defaults to enhanced+hashed; subclasses / web-app Core* may override.
108
+ */
109
+ static get jsonSchema() {
110
+ return this.jsonSchemaEnhancedHashed;
111
+ }
112
+ /** Schema for {@link toJSONPure} — override in web-app if the base material schema is extended. */
113
+ static get jsonSchemaPure() {
114
+ return JSONSchemasInterface_1.default.getRequiredSchemaById(MATERIAL_SCHEMA_IDS.pure);
115
+ }
116
+ /** Schema for {@link toJSONEnhanced}. */
117
+ static get jsonSchemaEnhanced() {
118
+ return JSONSchemasInterface_1.default.getRequiredSchemaById(MATERIAL_SCHEMA_IDS.enhanced);
119
+ }
120
+ /** Schema for {@link toJSONHashed}. */
121
+ static get jsonSchemaHashed() {
122
+ return JSONSchemasInterface_1.default.getRequiredSchemaById(MATERIAL_SCHEMA_IDS.hashed);
123
+ }
124
+ /** Schema for {@link toJSONEnhancedHashed}. */
125
+ static get jsonSchemaEnhancedHashed() {
126
+ return JSONSchemasInterface_1.default.getRequiredSchemaById(MATERIAL_SCHEMA_IDS.enhancedHashed);
127
+ }
128
+ static get defaultConfig() {
129
+ return exports.defaultMaterialConfig;
130
+ }
131
+ static constructMaterialFileSource(fileName, fileContent, fileExtension) {
132
+ return {
133
+ extension: fileExtension,
134
+ filename: fileName,
135
+ text: fileContent,
136
+ hash: crypto_js_1.default.MD5(fileContent).toString(),
137
+ };
138
+ }
139
+ /**
140
+ * @param config - Partial entity input. `basis.constraints` / `hash` / `metadata` may be omitted;
141
+ * constraints and hash are filled here; missing `metadata` becomes `{}`.
142
+ * `NoInfer` keeps `Schemas` from being inferred from the config object literal.
143
+ */
144
+ constructor(config) {
145
+ var _a, _b, _c, _d;
146
+ const basis = parseConstrainedBasis(config.basis);
147
+ super({
148
+ ...config,
149
+ basis,
150
+ name: (_b = (_a = config.name) !== null && _a !== void 0 ? _a : config.formula) !== null && _b !== void 0 ? _b : "",
151
+ metadata: (_c = config.metadata) !== null && _c !== void 0 ? _c : {},
152
+ hash: (_d = config.hash) !== null && _d !== void 0 ? _d : "",
153
+ });
154
+ this.formula = config.formula || this.getBasis().formula;
155
+ this.name = this.name || this.formula;
156
+ this.updateHash();
157
+ }
158
+ get hash() {
159
+ return this.requiredProp("hash");
160
+ }
161
+ set hash(value) {
162
+ this.setProp("hash", value);
163
+ }
164
+ get scaledHash() {
165
+ return this.prop("scaledHash");
166
+ }
167
+ set scaledHash(value) {
168
+ this.setProp("scaledHash", value);
169
+ }
170
+ /**
171
+ * Recompute and store {@link hash} from the current basis/lattice (or InChI if non-periodic).
172
+ * When non-periodic but InChI is not derived yet (e.g. designer toggle before butler), use
173
+ * geometric hash so setters do not throw — same practical UX as main before auto-updateHash.
174
+ */
175
+ updateHash() {
176
+ const hasInchi = Boolean(this.getDerivedPropertyByName("inchi"));
177
+ this.hash =
178
+ this.isNonPeriodic && !hasInchi
179
+ ? this.calculateHash("", false, true)
180
+ : this.calculateHash();
181
+ }
182
+ // Override schema-mixin accessors so basis/lattice changes keep hash in sync.
183
+ get basis() {
184
+ return this.requiredProp("basis");
185
+ }
186
+ set basis(value) {
187
+ this.setProp("basis", value);
188
+ this.updateHash();
189
+ }
190
+ get lattice() {
191
+ return this.requiredProp("lattice");
192
+ }
193
+ set lattice(value) {
194
+ this.setProp("lattice", value);
195
+ this.updateHash();
196
+ }
197
+ updateFormula() {
198
+ const basis = this.getBasis();
199
+ this.formula = basis.formula;
200
+ this.unitCellFormula = basis.unitCellFormula;
201
+ }
202
+ /**
203
+ * @summary Returns the specific derived property (as specified by name) for a material.
204
+ */
205
+ getDerivedPropertyByName(name) {
206
+ return this.getDerivedProperties().find((x) => x.name === name);
207
+ }
208
+ /**
209
+ * @summary Returns the derived properties array for a material.
210
+ */
211
+ getDerivedProperties() {
212
+ var _a;
213
+ return (_a = this.derivedProperties) !== null && _a !== void 0 ? _a : [];
214
+ }
215
+ unsetFileProps() {
216
+ this.unsetProp("src");
217
+ this.unsetProp("icsdId");
218
+ this.unsetProp("external");
219
+ }
220
+ setBasis(textOrObject, format, units) {
221
+ this.basis = parseConstrainedBasis(textOrObject, format, units);
222
+ this.unsetFileProps();
223
+ this.updateFormula();
224
+ }
225
+ setBasisConstraints(constraints) {
226
+ this.setBasis({
227
+ ...this.basis,
228
+ constraints: constraints.map((constraint) => ({
229
+ id: constraint.id,
230
+ value: constraint.value,
231
+ })),
232
+ });
233
+ }
234
+ setBasisConstraintsFromArrayOfObjects(constraints) {
235
+ this.setBasisConstraints(constraints.map((constraint) => constraints_1.Constraint.fromValueAndId(constraint.value, constraint.id)));
236
+ }
237
+ getBasis() {
238
+ return new constrained_basis_1.ConstrainedBasis({
239
+ ...parseConstrainedBasis(this.basis),
240
+ cell: this.getLattice().vectors,
241
+ });
242
+ }
243
+ setLattice(lattice) {
244
+ const basis = this.getBasis();
245
+ const originalIsInCrystalUnits = basis.isInCrystalUnits;
246
+ basis.toCartesian();
247
+ basis.cell = new lattice_1.Lattice(lattice).vectors;
248
+ if (originalIsInCrystalUnits) {
249
+ basis.toCrystal();
250
+ }
251
+ this.basis = basis.toJSON();
252
+ this.lattice = lattice;
253
+ this.unsetFileProps();
254
+ }
255
+ getLattice() {
256
+ return new lattice_1.Lattice(this.lattice);
257
+ }
258
+ /**
259
+ * High-level access to unique elements from material instead of basis.
260
+ */
261
+ get uniqueElements() {
262
+ return this.getBasis().uniqueElements;
263
+ }
264
+ /**
265
+ * Returns the inchi string from the derivedProperties for a non-periodic material, or throws an error if the
266
+ * inchi cannot be found.
267
+ * @returns {String}
268
+ */
269
+ getInchiStringForHash() {
270
+ const inchi = this.getDerivedPropertyByName("inchi");
271
+ if (inchi) {
272
+ return inchi.value;
273
+ }
274
+ throw new Error("Hash cannot be created. Missing InChI string in derivedProperties");
275
+ }
276
+ /**
277
+ * Calculates hash from basis and lattice. Algorithm expects the following:
278
+ * - asserts lattice units to be angstrom
279
+ * - asserts basis units to be crystal
280
+ * - asserts basis coordinates and lattice measurements are rounded to hash precision
281
+ * - forms strings for lattice and basis
282
+ * - creates MD5 hash from basisStr + latticeStr + salt
283
+ * @param salt Salt for hashing, empty string by default.
284
+ * @param isScaled Whether to scale the lattice parameter 'a' to 1.
285
+ */
286
+ calculateHash(salt = "", isScaled = false, bypassNonPeriodicCheck = false) {
287
+ let message;
288
+ if (!this.isNonPeriodic || bypassNonPeriodicCheck) {
289
+ message =
290
+ this.getBasis().hashString +
291
+ "#" +
292
+ this.getLattice().getHashString(isScaled) +
293
+ "#" +
294
+ salt;
295
+ }
296
+ else {
297
+ message = this.getInchiStringForHash();
298
+ }
299
+ return crypto_js_1.default.MD5(message).toString();
300
+ }
301
+ /**
302
+ * Converts basis to crystal/fractional coordinates.
303
+ */
304
+ toCrystal() {
305
+ this.setBasis(this.getBasis().toCrystal().toJSON());
306
+ }
307
+ /**
308
+ * Converts current material's basis coordinates to cartesian.
309
+ * No changes if coordinates already cartesian.
310
+ */
311
+ toCartesian() {
312
+ this.setBasis(this.getBasis().toCartesian().toJSON());
313
+ }
314
+ /**
315
+ * Returns material's basis in XYZ format (includes atomic constraints when present).
316
+ */
317
+ getBasisAsXyz(fractional = false) {
318
+ return parsers_1.default.xyz.fromMaterial(this.toJSONEnhanced(), fractional);
319
+ }
320
+ /**
321
+ * Returns material in Quantum Espresso output format:
322
+ * ```
323
+ * CELL_PARAMETERS (angstroms)
324
+ * -0.543131284 -0.000000000 0.543131284
325
+ * -0.000000000 0.543131284 0.543131284
326
+ * -0.543131284 0.543131284 0.000000000
327
+ *
328
+ * ATOMIC_POSITIONS (crystal)
329
+ * Si 0.000000000 0.000000000 -0.000000000
330
+ * Si 0.250000000 0.250000000 0.250000000
331
+ * ```
332
+ */
333
+ getAsQEFormat() {
334
+ return parsers_1.default.espresso.toEspressoFormat(this.toJSONPure());
335
+ }
336
+ /**
337
+ * Returns material in POSCAR format. Pass `true` to ignore original poscar source and re-serialize.
338
+ */
339
+ getAsPOSCAR(ignoreOriginal = false, omitConstraints = false) {
340
+ var _a;
341
+ // By default return original source if exists
342
+ if (((_a = this.src) === null || _a === void 0 ? void 0 : _a.extension) === "poscar" && !ignoreOriginal) {
343
+ return this.src.text;
344
+ }
345
+ return parsers_1.default.poscar.toPoscar(this.toJSONEnhanced(), omitConstraints);
346
+ }
347
+ /**
348
+ * Returns a copy of the material with conventional cell constructed instead of primitive.
349
+ */
350
+ getACopyWithConventionalCell() {
351
+ const material = this.clone();
352
+ const lattice = this.getLattice();
353
+ // if conventional and primitive cells are the same => return a copy.
354
+ if ((0, conventional_cell_1.isConventionalCellSameAsPrimitiveForLatticeType)(lattice.type)) {
355
+ return material;
356
+ }
357
+ const conventionalSupercellMatrix = conventional_cell_1.PRIMITIVE_TO_CONVENTIONAL_CELL_MULTIPLIERS[lattice.type];
358
+ const conventionalLatticeType = conventional_cell_1.PRIMITIVE_TO_CONVENTIONAL_CELL_LATTICE_TYPES[lattice.type];
359
+ const config = supercell_1.default.generateConfig(this, conventionalSupercellMatrix);
360
+ config.lattice.type = conventionalLatticeType;
361
+ config.name = `${this.name} - conventional cell`;
362
+ return this.clone(config);
363
+ }
364
+ /**
365
+ * @summary a series of checks for the material and returns an array of results in ConsistencyChecks format.
366
+ * @returns Array of checks results
367
+ */
368
+ getConsistencyChecks() {
369
+ const basisChecks = this.getBasisConsistencyChecks();
370
+ // any other Material checks can be added here
371
+ return basisChecks;
372
+ }
373
+ /**
374
+ * @summary a series of checks for the material's basis and returns an array of results in ConsistencyChecks format.
375
+ * @returns Array of checks results
376
+ */
377
+ getBasisConsistencyChecks() {
378
+ const checks = [];
379
+ const limit = 1000;
380
+ const basis = this.getBasis();
381
+ if (basis.elements.length < limit) {
382
+ const overlappingAtomsGroups = basis.getOverlappingAtoms();
383
+ overlappingAtomsGroups.forEach(({ id1, id2, element1, element2 }) => {
384
+ checks.push({
385
+ key: `basis.coordinates.${id1}`,
386
+ name: "atomsOverlap",
387
+ severity: "warning",
388
+ message: `Atom ${element1} is too close to ${element2} at position ${id2 + 1}`,
389
+ }, {
390
+ key: `basis.coordinates.${id2}`,
391
+ name: "atomsOverlap",
392
+ severity: "warning",
393
+ message: `Atom ${element2} is too close to ${element1} at position ${id1 + 1}`,
394
+ });
395
+ });
396
+ }
397
+ return checks;
398
+ }
399
+ /**
400
+ * Full material JSON: constrained basis + hash fields from live getters.
401
+ * Variants below AJV-clean this payload against the matching ESSE schema.
402
+ * Builds from `_json` (not `super.toJSON`) so we do not pre-clean against
403
+ * {@link Material.jsonSchema} before projecting to a narrower schema.
404
+ */
405
+ getFullJSON() {
406
+ const fullJSON = {
407
+ ...(0, clone_1.clone)(this._json),
408
+ lattice: this.getLattice().toJSON(),
409
+ basis: this.getBasis().toJSON(),
410
+ isNonPeriodic: this.isNonPeriodic,
411
+ hash: this.hash,
412
+ };
413
+ if (this.scaledHash !== undefined) {
414
+ fullJSON.scaledHash = this.scaledHash;
415
+ }
416
+ return fullJSON;
417
+ }
418
+ /**
419
+ * Clone {@link getFullJSON} and validate/clean against `jsonSchema` via AJV
420
+ * (same path as {@link InMemoryEntity.validateData} / {@link InMemoryEntity.clean}).
421
+ */
422
+ cleanFullJSONAgainstSchema(jsonSchema) {
423
+ var _a, _b, _c;
424
+ try {
425
+ return this.constructor.validateData((0, clone_1.deepClone)(this.getFullJSON()), true, jsonSchema);
426
+ }
427
+ catch (err) {
428
+ // validateData throws EntityError with only the code as message — log details for DevTools.
429
+ if (err instanceof in_memory_1.EntityError) {
430
+ console.error("Material.toJSON validation failed", {
431
+ code: err.code,
432
+ error: (_a = err.details) === null || _a === void 0 ? void 0 : _a.error,
433
+ json: (_b = err.details) === null || _b === void 0 ? void 0 : _b.json,
434
+ schema: (_c = err.details) === null || _c === void 0 ? void 0 : _c.schema,
435
+ });
436
+ }
437
+ throw err;
438
+ }
439
+ }
440
+ toJSONPure() {
441
+ return this.cleanFullJSONAgainstSchema(this.constructor.jsonSchemaPure);
442
+ }
443
+ toJSONEnhanced() {
444
+ return this.cleanFullJSONAgainstSchema(this.constructor.jsonSchemaEnhanced);
445
+ }
446
+ toJSONHashed() {
447
+ return this.cleanFullJSONAgainstSchema(this.constructor.jsonSchemaHashed);
448
+ }
449
+ toJSONEnhancedHashed() {
450
+ return this.cleanFullJSONAgainstSchema(this.constructor.jsonSchemaEnhancedHashed);
451
+ }
452
+ toJSON() {
453
+ // Same payload as toJSONEnhancedHashed when jsonSchema is the enhanced-hashed default.
454
+ return this.cleanFullJSONAgainstSchema(this.constructor.jsonSchema);
455
+ }
456
+ }
457
+ exports.default = Material;