@mat3ra/made 2026.8.13-0 → 2026.8.26-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.
- package/package.json +9 -5
- package/.babelrc +0 -10
- package/.eslintrc.json +0 -11
- package/.gitattributes +0 -1
- package/.husky/post-checkout +0 -3
- package/.husky/post-commit +0 -3
- package/.husky/post-merge +0 -3
- package/.husky/pre-commit +0 -6
- package/.husky/pre-push +0 -3
- package/.mocharc.json +0 -5
- package/.pre-commit-config.yaml +0 -26
- package/.prettierignore +0 -2
- package/.prettierrc +0 -6
- package/AGENTS.md +0 -133
- package/MANIFEST.in +0 -1
- package/data/constants.json +0 -13
- package/data/reciprocal_paths.json +0 -111
- package/images/made/tools/tools_diagram_general.png +0 -3
- package/images/made/tools/tools_diagram_interface.png +0 -3
- package/pyproject.toml +0 -123
- package/scripts/generate-mixins.ts +0 -28
- package/src/__init__.py +0 -0
- package/src/js/Material.ts +0 -618
- package/src/js/basis/basis.ts +0 -634
- package/src/js/basis/constrained_basis.ts +0 -115
- package/src/js/basis/coordinates.ts +0 -92
- package/src/js/basis/elements.ts +0 -24
- package/src/js/basis/helpers.ts +0 -20
- package/src/js/basis/labels.ts +0 -6
- package/src/js/cell/cell.ts +0 -149
- package/src/js/cell/conventional_cell.ts +0 -86
- package/src/js/cell/primitive_cell.ts +0 -166
- package/src/js/constants/molecule.ts +0 -18
- package/src/js/constants.ts +0 -4
- package/src/js/constraints/constraints.ts +0 -45
- package/src/js/generated/MaterialSchemaMixin.ts +0 -79
- package/src/js/lattice/lattice.ts +0 -308
- package/src/js/lattice/lattice_types.ts +0 -134
- package/src/js/lattice/reciprocal/lattice_reciprocal.ts +0 -206
- package/src/js/lattice/reciprocal/paths.ts +0 -39
- package/src/js/lattice/reciprocal/symmetry_points.ts +0 -886
- package/src/js/lattice/unit_cell.ts +0 -66
- package/src/js/made.ts +0 -62
- package/src/js/parsers/cif.ts +0 -25
- package/src/js/parsers/errors.ts +0 -6
- package/src/js/parsers/espresso.ts +0 -29
- package/src/js/parsers/native_format_parsers.ts +0 -52
- package/src/js/parsers/parsers.ts +0 -13
- package/src/js/parsers/poscar.ts +0 -218
- package/src/js/parsers/xyz.ts +0 -190
- package/src/js/parsers/xyz_combinatorial_basis.ts +0 -268
- package/src/js/tools/basis.ts +0 -131
- package/src/js/tools/cell.ts +0 -40
- package/src/js/tools/index.ts +0 -11
- package/src/js/tools/material.ts +0 -64
- package/src/js/tools/supercell.ts +0 -89
- package/src/js/tools/surface.ts +0 -213
- package/src/py/__init__.py +0 -0
- package/src/py/mat3ra/__init__.py +0 -1
- package/src/py/mat3ra/made/__init__.py +0 -7
- package/src/py/mat3ra/made/basis/__init__.py +0 -255
- package/src/py/mat3ra/made/basis/coordinates.py +0 -43
- package/src/py/mat3ra/made/cell/__init__.py +0 -55
- package/src/py/mat3ra/made/cell/primitive_cell.py +0 -156
- package/src/py/mat3ra/made/data_helper.py +0 -5
- package/src/py/mat3ra/made/lattice.py +0 -195
- package/src/py/mat3ra/made/material.py +0 -135
- package/src/py/mat3ra/made/metadata.py +0 -45
- package/src/py/mat3ra/made/reciprocal/__init__.py +0 -5
- package/src/py/mat3ra/made/reciprocal/lattice_reciprocal.py +0 -147
- package/src/py/mat3ra/made/reciprocal/paths.py +0 -30
- package/src/py/mat3ra/made/reciprocal/symmetry_points.py +0 -385
- package/src/py/mat3ra/made/tools/README.md +0 -173
- package/src/py/mat3ra/made/tools/__init__.py +0 -0
- package/src/py/mat3ra/made/tools/analyze/__init__.py +0 -31
- package/src/py/mat3ra/made/tools/analyze/basis/__init__.py +0 -3
- package/src/py/mat3ra/made/tools/analyze/basis/analyzer.py +0 -50
- package/src/py/mat3ra/made/tools/analyze/build_metadata_analyzer.py +0 -32
- package/src/py/mat3ra/made/tools/analyze/build_metadata_analyzer_factory.py +0 -31
- package/src/py/mat3ra/made/tools/analyze/coordination.py +0 -56
- package/src/py/mat3ra/made/tools/analyze/crystal_site/__init__.py +0 -0
- package/src/py/mat3ra/made/tools/analyze/crystal_site/adatom_crystal_site_material_analyzer.py +0 -35
- package/src/py/mat3ra/made/tools/analyze/crystal_site/adatom_material_analyzer.py +0 -49
- package/src/py/mat3ra/made/tools/analyze/crystal_site/crystal_site_analyzer.py +0 -65
- package/src/py/mat3ra/made/tools/analyze/crystal_site/voronoi_crystal_site_analyzer.py +0 -47
- package/src/py/mat3ra/made/tools/analyze/enums.py +0 -33
- package/src/py/mat3ra/made/tools/analyze/fingerprint/__init__.py +0 -4
- package/src/py/mat3ra/made/tools/analyze/fingerprint/layers/__init__.py +0 -0
- package/src/py/mat3ra/made/tools/analyze/fingerprint/layers/layered_fingerprint_along_axis.py +0 -83
- package/src/py/mat3ra/made/tools/analyze/fingerprint/layers/unique_element_string_per_layer.py +0 -9
- package/src/py/mat3ra/made/tools/analyze/interface/__init__.py +0 -20
- package/src/py/mat3ra/made/tools/analyze/interface/commensurate.py +0 -156
- package/src/py/mat3ra/made/tools/analyze/interface/enums.py +0 -60
- package/src/py/mat3ra/made/tools/analyze/interface/grain_boundary.py +0 -80
- package/src/py/mat3ra/made/tools/analyze/interface/simple.py +0 -251
- package/src/py/mat3ra/made/tools/analyze/interface/twisted_nanoribbons.py +0 -91
- package/src/py/mat3ra/made/tools/analyze/interface/utils/__init__.py +0 -77
- package/src/py/mat3ra/made/tools/analyze/interface/utils/holders.py +0 -14
- package/src/py/mat3ra/made/tools/analyze/interface/utils/vector.py +0 -56
- package/src/py/mat3ra/made/tools/analyze/interface/zsl.py +0 -259
- package/src/py/mat3ra/made/tools/analyze/interface_material.py +0 -45
- package/src/py/mat3ra/made/tools/analyze/lattice/__init__.py +0 -2
- package/src/py/mat3ra/made/tools/analyze/lattice/analyzer.py +0 -126
- package/src/py/mat3ra/made/tools/analyze/lattice/helpers.py +0 -31
- package/src/py/mat3ra/made/tools/analyze/lattice_lines.py +0 -30
- package/src/py/mat3ra/made/tools/analyze/lattice_planes.py +0 -192
- package/src/py/mat3ra/made/tools/analyze/lattice_swap_analyzer.py +0 -105
- package/src/py/mat3ra/made/tools/analyze/material.py +0 -276
- package/src/py/mat3ra/made/tools/analyze/other.py +0 -434
- package/src/py/mat3ra/made/tools/analyze/rdf.py +0 -74
- package/src/py/mat3ra/made/tools/analyze/slab.py +0 -76
- package/src/py/mat3ra/made/tools/analyze/solid_solution_analyzer.py +0 -171
- package/src/py/mat3ra/made/tools/analyze/terrace.py +0 -105
- package/src/py/mat3ra/made/tools/analyze/utils.py +0 -162
- package/src/py/mat3ra/made/tools/bond_directions/__init__.py +0 -0
- package/src/py/mat3ra/made/tools/bond_directions/bond_directions.py +0 -150
- package/src/py/mat3ra/made/tools/bond_directions/bond_directions_for_element_list.py +0 -7
- package/src/py/mat3ra/made/tools/bond_directions/bond_directions_templates_enum.py +0 -8
- package/src/py/mat3ra/made/tools/bond_directions/bond_directions_templates_for_element.py +0 -16
- package/src/py/mat3ra/made/tools/build/__init__.py +0 -25
- package/src/py/mat3ra/made/tools/build/compound_pristine_structures/two_dimensional/heterostructure/__init__.py +0 -7
- package/src/py/mat3ra/made/tools/build/compound_pristine_structures/two_dimensional/heterostructure/helpers.py +0 -59
- package/src/py/mat3ra/made/tools/build/compound_pristine_structures/two_dimensional/heterostructure/types.py +0 -26
- package/src/py/mat3ra/made/tools/build/compound_pristine_structures/two_dimensional/heterostructure/utils.py +0 -139
- package/src/py/mat3ra/made/tools/build/compound_pristine_structures/two_dimensional/interface/__init__.py +0 -47
- package/src/py/mat3ra/made/tools/build/compound_pristine_structures/two_dimensional/interface/base/__init__.py +0 -11
- package/src/py/mat3ra/made/tools/build/compound_pristine_structures/two_dimensional/interface/base/build_parameters.py +0 -5
- package/src/py/mat3ra/made/tools/build/compound_pristine_structures/two_dimensional/interface/base/builder.py +0 -164
- package/src/py/mat3ra/made/tools/build/compound_pristine_structures/two_dimensional/interface/base/configuration.py +0 -48
- package/src/py/mat3ra/made/tools/build/compound_pristine_structures/two_dimensional/interface/base/helpers.py +0 -134
- package/src/py/mat3ra/made/tools/build/compound_pristine_structures/two_dimensional/interface/commensurate/__init__.py +0 -6
- package/src/py/mat3ra/made/tools/build/compound_pristine_structures/two_dimensional/interface/commensurate/helpers.py +0 -157
- package/src/py/mat3ra/made/tools/build/compound_pristine_structures/two_dimensional/interface/enums.py +0 -7
- package/src/py/mat3ra/made/tools/build/compound_pristine_structures/two_dimensional/interface/twisted/__init__.py +0 -7
- package/src/py/mat3ra/made/tools/build/compound_pristine_structures/two_dimensional/interface/twisted/configuration.py +0 -13
- package/src/py/mat3ra/made/tools/build/compound_pristine_structures/two_dimensional/interface/twisted/helpers.py +0 -70
- package/src/py/mat3ra/made/tools/build/compound_pristine_structures/two_dimensional/interface/utils.py +0 -87
- package/src/py/mat3ra/made/tools/build/compound_pristine_structures/two_dimensional/interface/zsl/__init__.py +0 -6
- package/src/py/mat3ra/made/tools/build/compound_pristine_structures/two_dimensional/interface/zsl/helpers.py +0 -129
- package/src/py/mat3ra/made/tools/build/defective_structures/__init__.py +0 -0
- package/src/py/mat3ra/made/tools/build/defective_structures/one_dimensional/__init__.py +0 -0
- package/src/py/mat3ra/made/tools/build/defective_structures/one_dimensional/grain_boundary_linear/__init__.py +0 -0
- package/src/py/mat3ra/made/tools/build/defective_structures/one_dimensional/grain_boundary_linear/build_parameters.py +0 -12
- package/src/py/mat3ra/made/tools/build/defective_structures/one_dimensional/grain_boundary_linear/builder.py +0 -17
- package/src/py/mat3ra/made/tools/build/defective_structures/one_dimensional/grain_boundary_linear/configuration.py +0 -40
- package/src/py/mat3ra/made/tools/build/defective_structures/one_dimensional/grain_boundary_linear/helpers.py +0 -82
- package/src/py/mat3ra/made/tools/build/defective_structures/three_dimensional/__init__.py +0 -1
- package/src/py/mat3ra/made/tools/build/defective_structures/three_dimensional/solid_solution/__init__.py +0 -9
- package/src/py/mat3ra/made/tools/build/defective_structures/three_dimensional/solid_solution/builder.py +0 -37
- package/src/py/mat3ra/made/tools/build/defective_structures/three_dimensional/solid_solution/configuration.py +0 -30
- package/src/py/mat3ra/made/tools/build/defective_structures/three_dimensional/solid_solution/enums.py +0 -8
- package/src/py/mat3ra/made/tools/build/defective_structures/three_dimensional/solid_solution/helpers.py +0 -76
- package/src/py/mat3ra/made/tools/build/defective_structures/two_dimensional/__init__.py +0 -0
- package/src/py/mat3ra/made/tools/build/defective_structures/two_dimensional/adatom/__init__.py +0 -0
- package/src/py/mat3ra/made/tools/build/defective_structures/two_dimensional/adatom/builder.py +0 -11
- package/src/py/mat3ra/made/tools/build/defective_structures/two_dimensional/adatom/configuration.py +0 -18
- package/src/py/mat3ra/made/tools/build/defective_structures/two_dimensional/adatom/helpers.py +0 -137
- package/src/py/mat3ra/made/tools/build/defective_structures/two_dimensional/adatom/types.py +0 -22
- package/src/py/mat3ra/made/tools/build/defective_structures/two_dimensional/grain_boundary_planar/__init__.py +0 -0
- package/src/py/mat3ra/made/tools/build/defective_structures/two_dimensional/grain_boundary_planar/builder.py +0 -28
- package/src/py/mat3ra/made/tools/build/defective_structures/two_dimensional/grain_boundary_planar/configuration.py +0 -55
- package/src/py/mat3ra/made/tools/build/defective_structures/two_dimensional/grain_boundary_planar/helpers.py +0 -75
- package/src/py/mat3ra/made/tools/build/defective_structures/two_dimensional/island/builder.py +0 -15
- package/src/py/mat3ra/made/tools/build/defective_structures/two_dimensional/island/configuration.py +0 -16
- package/src/py/mat3ra/made/tools/build/defective_structures/two_dimensional/island/helpers.py +0 -116
- package/src/py/mat3ra/made/tools/build/defective_structures/two_dimensional/terrace/build_parameters.py +0 -10
- package/src/py/mat3ra/made/tools/build/defective_structures/two_dimensional/terrace/builder.py +0 -30
- package/src/py/mat3ra/made/tools/build/defective_structures/two_dimensional/terrace/configuration.py +0 -11
- package/src/py/mat3ra/made/tools/build/defective_structures/two_dimensional/terrace/helpers.py +0 -78
- package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/__init__.py +0 -0
- package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/pair_defect/__init__.py +0 -0
- package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/pair_defect/builder.py +0 -31
- package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/pair_defect/configuration.py +0 -45
- package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/pair_defect/helpers.py +0 -80
- package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/point_defect/__init__.py +0 -40
- package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/point_defect/atom_placement_method_enum.py +0 -14
- package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/point_defect/base/__init__.py +0 -7
- package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/point_defect/base/builder.py +0 -42
- package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/point_defect/base/configuration.py +0 -27
- package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/point_defect/complex_defect_type_enum.py +0 -5
- package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/point_defect/factories.py +0 -69
- package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/point_defect/helpers.py +0 -92
- package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/point_defect/interstitial/__init__.py +0 -7
- package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/point_defect/interstitial/builder.py +0 -8
- package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/point_defect/interstitial/configuration.py +0 -29
- package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/point_defect/interstitial/helpers.py +0 -48
- package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/point_defect/interstitial/interstitial_placement_method_enum.py +0 -8
- package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/point_defect/point_defect_type_enum.py +0 -8
- package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/point_defect/substitutional/__init__.py +0 -7
- package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/point_defect/substitutional/builder.py +0 -6
- package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/point_defect/substitutional/configuration.py +0 -41
- package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/point_defect/substitutional/helpers.py +0 -43
- package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/point_defect/substitutional/substitution_placement_method_enum.py +0 -7
- package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/point_defect/types.py +0 -24
- package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/point_defect/vacancy/__init__.py +0 -7
- package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/point_defect/vacancy/builder.py +0 -19
- package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/point_defect/vacancy/configuration.py +0 -27
- package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/point_defect/vacancy/helpers.py +0 -42
- package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/point_defect/vacancy/vacancy_placement_method_enum.py +0 -7
- package/src/py/mat3ra/made/tools/build/pristine_structures/__init__.py +0 -0
- package/src/py/mat3ra/made/tools/build/pristine_structures/three_dimensional/ideal_crystal/__init__.py +0 -0
- package/src/py/mat3ra/made/tools/build/pristine_structures/three_dimensional/ideal_crystal/builder.py +0 -80
- package/src/py/mat3ra/made/tools/build/pristine_structures/three_dimensional/ideal_crystal/configurations.py +0 -22
- package/src/py/mat3ra/made/tools/build/pristine_structures/three_dimensional/ideal_crystal/helpers.py +0 -40
- package/src/py/mat3ra/made/tools/build/pristine_structures/two_dimensional/__init__.py +0 -0
- package/src/py/mat3ra/made/tools/build/pristine_structures/two_dimensional/nanoribbon/__init__.py +0 -29
- package/src/py/mat3ra/made/tools/build/pristine_structures/two_dimensional/nanoribbon/build_parameters.py +0 -5
- package/src/py/mat3ra/made/tools/build/pristine_structures/two_dimensional/nanoribbon/builders.py +0 -56
- package/src/py/mat3ra/made/tools/build/pristine_structures/two_dimensional/nanoribbon/configuration.py +0 -33
- package/src/py/mat3ra/made/tools/build/pristine_structures/two_dimensional/nanoribbon/helpers.py +0 -76
- package/src/py/mat3ra/made/tools/build/pristine_structures/two_dimensional/nanotape/__init__.py +0 -11
- package/src/py/mat3ra/made/tools/build/pristine_structures/two_dimensional/nanotape/build_parameters.py +0 -9
- package/src/py/mat3ra/made/tools/build/pristine_structures/two_dimensional/nanotape/builders.py +0 -83
- package/src/py/mat3ra/made/tools/build/pristine_structures/two_dimensional/nanotape/configuration.py +0 -35
- package/src/py/mat3ra/made/tools/build/pristine_structures/two_dimensional/nanotape/helpers.py +0 -62
- package/src/py/mat3ra/made/tools/build/pristine_structures/two_dimensional/slab/__init__.py +0 -9
- package/src/py/mat3ra/made/tools/build/pristine_structures/two_dimensional/slab/build_parameters.py +0 -8
- package/src/py/mat3ra/made/tools/build/pristine_structures/two_dimensional/slab/builder.py +0 -42
- package/src/py/mat3ra/made/tools/build/pristine_structures/two_dimensional/slab/configuration.py +0 -99
- package/src/py/mat3ra/made/tools/build/pristine_structures/two_dimensional/slab/helpers.py +0 -95
- package/src/py/mat3ra/made/tools/build/pristine_structures/two_dimensional/slab/termination_utils.py +0 -14
- package/src/py/mat3ra/made/tools/build/pristine_structures/two_dimensional/slab/utils.py +0 -61
- package/src/py/mat3ra/made/tools/build/pristine_structures/two_dimensional/slab_strained_supercell/builder.py +0 -22
- package/src/py/mat3ra/made/tools/build/pristine_structures/two_dimensional/slab_strained_supercell/configuration.py +0 -17
- package/src/py/mat3ra/made/tools/build/pristine_structures/zero_dimensional/__init__.py +0 -0
- package/src/py/mat3ra/made/tools/build/pristine_structures/zero_dimensional/nanoparticle/__init__.py +0 -19
- package/src/py/mat3ra/made/tools/build/pristine_structures/zero_dimensional/nanoparticle/analyzer.py +0 -86
- package/src/py/mat3ra/made/tools/build/pristine_structures/zero_dimensional/nanoparticle/ase_based/__init__.py +0 -7
- package/src/py/mat3ra/made/tools/build/pristine_structures/zero_dimensional/nanoparticle/ase_based/builder.py +0 -54
- package/src/py/mat3ra/made/tools/build/pristine_structures/zero_dimensional/nanoparticle/ase_based/configuration.py +0 -19
- package/src/py/mat3ra/made/tools/build/pristine_structures/zero_dimensional/nanoparticle/enums.py +0 -42
- package/src/py/mat3ra/made/tools/build/pristine_structures/zero_dimensional/nanoparticle/helpers.py +0 -127
- package/src/py/mat3ra/made/tools/build/pristine_structures/zero_dimensional/nanoparticle/merge_based/__init__.py +0 -7
- package/src/py/mat3ra/made/tools/build/pristine_structures/zero_dimensional/nanoparticle/merge_based/builder.py +0 -33
- package/src/py/mat3ra/made/tools/build/pristine_structures/zero_dimensional/nanoparticle/merge_based/configuration.py +0 -16
- package/src/py/mat3ra/made/tools/build/processed_structures/__init__.py +0 -0
- package/src/py/mat3ra/made/tools/build/processed_structures/two_dimensional/__init__.py +0 -0
- package/src/py/mat3ra/made/tools/build/processed_structures/two_dimensional/passivation/__init__.py +0 -0
- package/src/py/mat3ra/made/tools/build/processed_structures/two_dimensional/passivation/analyzers/__init__.py +0 -9
- package/src/py/mat3ra/made/tools/build/processed_structures/two_dimensional/passivation/analyzers/coordination_based_passivation_material_analyzer.py +0 -112
- package/src/py/mat3ra/made/tools/build/processed_structures/two_dimensional/passivation/analyzers/passivation_material_analyzer.py +0 -16
- package/src/py/mat3ra/made/tools/build/processed_structures/two_dimensional/passivation/analyzers/surface_passivation_material_analyzer.py +0 -32
- package/src/py/mat3ra/made/tools/build/processed_structures/two_dimensional/passivation/builder.py +0 -23
- package/src/py/mat3ra/made/tools/build/processed_structures/two_dimensional/passivation/configuration.py +0 -31
- package/src/py/mat3ra/made/tools/build/processed_structures/two_dimensional/passivation/enums.py +0 -7
- package/src/py/mat3ra/made/tools/build/processed_structures/two_dimensional/passivation/helpers.py +0 -151
- package/src/py/mat3ra/made/tools/build_components/__init__.py +0 -10
- package/src/py/mat3ra/made/tools/build_components/entities/__init__.py +0 -0
- package/src/py/mat3ra/made/tools/build_components/entities/auxiliary/__init__.py +0 -0
- package/src/py/mat3ra/made/tools/build_components/entities/auxiliary/one_dimensional/miller_indices_2d.py +0 -0
- package/src/py/mat3ra/made/tools/build_components/entities/auxiliary/two_dimensional/miller_indices.py +0 -18
- package/src/py/mat3ra/made/tools/build_components/entities/auxiliary/two_dimensional/termination.py +0 -33
- package/src/py/mat3ra/made/tools/build_components/entities/auxiliary/zero_dimensional/__init__.py +0 -0
- package/src/py/mat3ra/made/tools/build_components/entities/auxiliary/zero_dimensional/crystal_site/__init__.py +0 -2
- package/src/py/mat3ra/made/tools/build_components/entities/auxiliary/zero_dimensional/crystal_site/crystal_site.py +0 -24
- package/src/py/mat3ra/made/tools/build_components/entities/auxiliary/zero_dimensional/crystal_site/crystal_site_list.py +0 -9
- package/src/py/mat3ra/made/tools/build_components/entities/auxiliary/zero_dimensional/point_defect_site/builder.py +0 -32
- package/src/py/mat3ra/made/tools/build_components/entities/auxiliary/zero_dimensional/point_defect_site/configuration.py +0 -14
- package/src/py/mat3ra/made/tools/build_components/entities/auxiliary/zero_dimensional/void_region/__init__.py +0 -0
- package/src/py/mat3ra/made/tools/build_components/entities/auxiliary/zero_dimensional/void_region/builder.py +0 -29
- package/src/py/mat3ra/made/tools/build_components/entities/auxiliary/zero_dimensional/void_region/configuration.py +0 -19
- package/src/py/mat3ra/made/tools/build_components/entities/core/two_dimensional/vacuum/builder.py +0 -48
- package/src/py/mat3ra/made/tools/build_components/entities/core/two_dimensional/vacuum/configuration.py +0 -17
- package/src/py/mat3ra/made/tools/build_components/entities/core/zero_dimensional/atom/builder.py +0 -25
- package/src/py/mat3ra/made/tools/build_components/entities/core/zero_dimensional/atom/configuration.py +0 -8
- package/src/py/mat3ra/made/tools/build_components/entities/reusable/__init__.py +0 -0
- package/src/py/mat3ra/made/tools/build_components/entities/reusable/base_builder/__init__.py +0 -16
- package/src/py/mat3ra/made/tools/build_components/entities/reusable/base_builder/base_configuration_pydantic.py +0 -5
- package/src/py/mat3ra/made/tools/build_components/entities/reusable/base_builder/base_single_builder.py +0 -87
- package/src/py/mat3ra/made/tools/build_components/entities/reusable/base_builder/build_parameters.py +0 -5
- package/src/py/mat3ra/made/tools/build_components/entities/reusable/one_dimensional/__init__.py +0 -0
- package/src/py/mat3ra/made/tools/build_components/entities/reusable/one_dimensional/crystal_lattice_lines/__init__.py +0 -4
- package/src/py/mat3ra/made/tools/build_components/entities/reusable/one_dimensional/crystal_lattice_lines/builder.py +0 -46
- package/src/py/mat3ra/made/tools/build_components/entities/reusable/one_dimensional/crystal_lattice_lines/configuration.py +0 -19
- package/src/py/mat3ra/made/tools/build_components/entities/reusable/one_dimensional/crystal_lattice_lines/edge_types.py +0 -51
- package/src/py/mat3ra/made/tools/build_components/entities/reusable/one_dimensional/crystal_lattice_lines/helpers.py +0 -58
- package/src/py/mat3ra/made/tools/build_components/entities/reusable/one_dimensional/crystal_lattice_lines_unique_repeated/__init__.py +0 -4
- package/src/py/mat3ra/made/tools/build_components/entities/reusable/one_dimensional/crystal_lattice_lines_unique_repeated/builder.py +0 -42
- package/src/py/mat3ra/made/tools/build_components/entities/reusable/one_dimensional/crystal_lattice_lines_unique_repeated/configuration.py +0 -21
- package/src/py/mat3ra/made/tools/build_components/entities/reusable/three_dimensional/supercell/__init__.py +0 -0
- package/src/py/mat3ra/made/tools/build_components/entities/reusable/three_dimensional/supercell/configuration.py +0 -11
- package/src/py/mat3ra/made/tools/build_components/entities/reusable/three_dimensional/supercell/helpers.py +0 -38
- package/src/py/mat3ra/made/tools/build_components/entities/reusable/two_dimensional/__init__.py +0 -24
- package/src/py/mat3ra/made/tools/build_components/entities/reusable/two_dimensional/atomic_layers_unique_repeated/__init__.py +0 -7
- package/src/py/mat3ra/made/tools/build_components/entities/reusable/two_dimensional/atomic_layers_unique_repeated/builder.py +0 -62
- package/src/py/mat3ra/made/tools/build_components/entities/reusable/two_dimensional/atomic_layers_unique_repeated/configuration.py +0 -14
- package/src/py/mat3ra/made/tools/build_components/entities/reusable/two_dimensional/atomic_layers_unique_repeated/helpers.py +0 -42
- package/src/py/mat3ra/made/tools/build_components/entities/reusable/two_dimensional/crystal_lattice_planes/__init__.py +0 -7
- package/src/py/mat3ra/made/tools/build_components/entities/reusable/two_dimensional/crystal_lattice_planes/builder.py +0 -39
- package/src/py/mat3ra/made/tools/build_components/entities/reusable/two_dimensional/crystal_lattice_planes/configuration.py +0 -24
- package/src/py/mat3ra/made/tools/build_components/entities/reusable/two_dimensional/slab_stack/__init__.py +0 -10
- package/src/py/mat3ra/made/tools/build_components/entities/reusable/two_dimensional/slab_stack/builder.py +0 -36
- package/src/py/mat3ra/made/tools/build_components/entities/reusable/two_dimensional/slab_stack/configuration.py +0 -31
- package/src/py/mat3ra/made/tools/build_components/entities/reusable/two_dimensional/slab_stack/helpers.py +0 -80
- package/src/py/mat3ra/made/tools/build_components/entities/reusable/zero_dimensional/__init__.py +0 -0
- package/src/py/mat3ra/made/tools/build_components/entities/reusable/zero_dimensional/coordinates_shape_enum.py +0 -8
- package/src/py/mat3ra/made/tools/build_components/metadata/__init__.py +0 -2
- package/src/py/mat3ra/made/tools/build_components/metadata/build_metadata.py +0 -7
- package/src/py/mat3ra/made/tools/build_components/metadata/material_build_metadata.py +0 -35
- package/src/py/mat3ra/made/tools/build_components/metadata/material_with_build_metadata.py +0 -8
- package/src/py/mat3ra/made/tools/build_components/mixins/__init__.py +0 -2
- package/src/py/mat3ra/made/tools/build_components/mixins/convert_generated_items_ase_atoms_mixin.py +0 -8
- package/src/py/mat3ra/made/tools/build_components/mixins/convert_generated_items_pymatgen_structure_mixin.py +0 -8
- package/src/py/mat3ra/made/tools/build_components/operations/core/combinations/__init__.py +0 -0
- package/src/py/mat3ra/made/tools/build_components/operations/core/combinations/enums.py +0 -11
- package/src/py/mat3ra/made/tools/build_components/operations/core/combinations/merge/__init__.py +0 -6
- package/src/py/mat3ra/made/tools/build_components/operations/core/combinations/merge/build_parameters.py +0 -18
- package/src/py/mat3ra/made/tools/build_components/operations/core/combinations/merge/builder.py +0 -93
- package/src/py/mat3ra/made/tools/build_components/operations/core/combinations/merge/configuration.py +0 -20
- package/src/py/mat3ra/made/tools/build_components/operations/core/combinations/stack/builder.py +0 -83
- package/src/py/mat3ra/made/tools/build_components/operations/core/combinations/stack/configuration.py +0 -24
- package/src/py/mat3ra/made/tools/build_components/operations/core/modifications/perturb/__init__.py +0 -15
- package/src/py/mat3ra/made/tools/build_components/operations/core/modifications/perturb/build_parameters.py +0 -5
- package/src/py/mat3ra/made/tools/build_components/operations/core/modifications/perturb/builders/base.py +0 -33
- package/src/py/mat3ra/made/tools/build_components/operations/core/modifications/perturb/builders/isometric.py +0 -25
- package/src/py/mat3ra/made/tools/build_components/operations/core/modifications/perturb/configuration.py +0 -24
- package/src/py/mat3ra/made/tools/build_components/operations/core/modifications/perturb/functions/__init__.py +0 -13
- package/src/py/mat3ra/made/tools/build_components/operations/core/modifications/perturb/functions/atomic_mass_dependent_function_holder.py +0 -32
- package/src/py/mat3ra/made/tools/build_components/operations/core/modifications/perturb/functions/function_holder.py +0 -80
- package/src/py/mat3ra/made/tools/build_components/operations/core/modifications/perturb/functions/maxwell_boltzmann.py +0 -39
- package/src/py/mat3ra/made/tools/build_components/operations/core/modifications/perturb/functions/perturbation_function_holder.py +0 -45
- package/src/py/mat3ra/made/tools/build_components/operations/core/modifications/perturb/functions/sine_wave_perturbation_function_holder.py +0 -29
- package/src/py/mat3ra/made/tools/build_components/operations/core/modifications/perturb/helpers.py +0 -83
- package/src/py/mat3ra/made/tools/build_components/operations/core/modifications/strain/__init__.py +0 -5
- package/src/py/mat3ra/made/tools/build_components/operations/core/modifications/strain/builder.py +0 -25
- package/src/py/mat3ra/made/tools/build_components/operations/core/modifications/strain/configuration.py +0 -23
- package/src/py/mat3ra/made/tools/build_components/operations/core/modifications/strain/helpers.py +0 -49
- package/src/py/mat3ra/made/tools/build_components/utils.py +0 -44
- package/src/py/mat3ra/made/tools/calculate/__init__.py +0 -149
- package/src/py/mat3ra/made/tools/calculate/ase/__init__.py +0 -133
- package/src/py/mat3ra/made/tools/calculate/ase/constraints.py +0 -91
- package/src/py/mat3ra/made/tools/calculate/calculators/__init__.py +0 -4
- package/src/py/mat3ra/made/tools/calculate/calculators/interface_material_calculator.py +0 -70
- package/src/py/mat3ra/made/tools/calculate/calculators/interface_material_calculator_parameters.py +0 -14
- package/src/py/mat3ra/made/tools/calculate/calculators/material_calculator.py +0 -32
- package/src/py/mat3ra/made/tools/calculate/calculators/material_calculator_parameters.py +0 -17
- package/src/py/mat3ra/made/tools/calculate/interaction_functions.py +0 -23
- package/src/py/mat3ra/made/tools/convert/__init__.py +0 -286
- package/src/py/mat3ra/made/tools/convert/interface_parts_enum.py +0 -9
- package/src/py/mat3ra/made/tools/convert/utils.py +0 -96
- package/src/py/mat3ra/made/tools/entities/__init__.py +0 -5
- package/src/py/mat3ra/made/tools/entities/coordinate/__init__.py +0 -14
- package/src/py/mat3ra/made/tools/entities/coordinate/box_coordinate_condition.py +0 -15
- package/src/py/mat3ra/made/tools/entities/coordinate/coordinate_condition.py +0 -16
- package/src/py/mat3ra/made/tools/entities/coordinate/coordinate_functions.py +0 -158
- package/src/py/mat3ra/made/tools/entities/coordinate/cylinder_coordinate_condition.py +0 -17
- package/src/py/mat3ra/made/tools/entities/coordinate/plane_coordinate_condition.py +0 -14
- package/src/py/mat3ra/made/tools/entities/coordinate/sphere_coordinate_condition.py +0 -15
- package/src/py/mat3ra/made/tools/entities/coordinate/triangular_prism_coordinate_condition.py +0 -26
- package/src/py/mat3ra/made/tools/entities/termination_holder.py +0 -12
- package/src/py/mat3ra/made/tools/helpers.py +0 -168
- package/src/py/mat3ra/made/tools/modify.py +0 -627
- package/src/py/mat3ra/made/tools/operations/core/binary.py +0 -106
- package/src/py/mat3ra/made/tools/operations/core/unary.py +0 -170
- package/src/py/mat3ra/made/tools/operations/core/utils.py +0 -138
- package/src/py/mat3ra/made/tools/operations/reusable/unary.py +0 -53
- package/src/py/mat3ra/made/tools/optimize.py +0 -55
- package/src/py/mat3ra/made/tools/third_party.py +0 -69
- package/src/py/mat3ra/made/tools/utils.py +0 -182
- package/src/py/mat3ra/made/utils.py +0 -144
- package/tests/.gitattributes +0 -1
- package/tests/fixtures/AsGe-basis.json +0 -3
- package/tests/fixtures/C2H4-translated.json +0 -3
- package/tests/fixtures/C2H4.json +0 -3
- package/tests/fixtures/FeLiSi-basis.json +0 -3
- package/tests/fixtures/FeO.json +0 -3
- package/tests/fixtures/Ge2-basis.json +0 -3
- package/tests/fixtures/Graphene.json +0 -3
- package/tests/fixtures/Graphene.poscar +0 -3
- package/tests/fixtures/H2+H-final.json +0 -3
- package/tests/fixtures/H2+H-image.json +0 -3
- package/tests/fixtures/H2+H-initial.json +0 -3
- package/tests/fixtures/H2O.poscar +0 -3
- package/tests/fixtures/LiFeSi-basis-labels.json +0 -3
- package/tests/fixtures/LiFeSi-basis.json +0 -3
- package/tests/fixtures/Na.json +0 -3
- package/tests/fixtures/Na4Cl4-cartesian.json +0 -3
- package/tests/fixtures/Na4Cl4.json +0 -3
- package/tests/fixtures/Na4Cl4.poscar +0 -3
- package/tests/fixtures/Ni-hex.json +0 -3
- package/tests/fixtures/Ni-hex.poscar +0 -3
- package/tests/fixtures/OSi-basis.json +0 -3
- package/tests/fixtures/Si-hex.poscar +0 -3
- package/tests/fixtures/Si-pwscf.in +0 -3
- package/tests/fixtures/Si-slab.json +0 -3
- package/tests/fixtures/Si-supercell.json +0 -3
- package/tests/fixtures/Si2-basis-repeated.json +0 -3
- package/tests/fixtures/Si2-basis.json +0 -3
- package/tests/fixtures/Zr1H23Zr1H1.json +0 -3
- package/tests/fixtures/Zr1H23Zr1H1.poscar +0 -3
- package/tests/fixtures/atomic-constraints.json +0 -3
- package/tests/fixtures/hashes.json +0 -3
- package/tests/fixtures/si-slab-100.json +0 -3
- package/tests/fixtures/si-slab-111-0-vacuum.json +0 -3
- package/tests/fixtures/si-slab-111-0.5-vacuum-gamma-120.json +0 -3
- package/tests/fixtures/si-slab-111-0.5-vacuum-ratio.json +0 -3
- package/tests/fixtures/si-standata.json +0 -3
- package/tests/js/basis/basis.ts +0 -247
- package/tests/js/cell/cell.ts +0 -182
- package/tests/js/cell/primitive_cell.ts +0 -21
- package/tests/js/constraints/constraints.ts +0 -11
- package/tests/js/fixtures.ts +0 -123
- package/tests/js/lattice/lattice.ts +0 -43
- package/tests/js/lattice/lattice_reciprocal.ts +0 -104
- package/tests/js/material/material.ts +0 -161
- package/tests/js/parsers/espresso.ts +0 -12
- package/tests/js/parsers/native_formats.ts +0 -35
- package/tests/js/parsers/poscar.ts +0 -89
- package/tests/js/parsers/xyz.ts +0 -33
- package/tests/js/parsers/xyz_combinatorial_basis.ts +0 -156
- package/tests/js/register-esse-schemas.cjs +0 -10
- package/tests/js/setup.ts +0 -6
- package/tests/js/tools/basis.ts +0 -22
- package/tests/js/tools/supercell.ts +0 -58
- package/tests/js/tools/surface.ts +0 -111
- package/tests/py/conftest.py +0 -34
- package/tests/py/mat3ra/debug_utils.py +0 -75
- package/tests/py/unit/__init__.py +0 -0
- package/tests/py/unit/fixtures/__init__.py +0 -0
- package/tests/py/unit/fixtures/adatom.py +0 -60
- package/tests/py/unit/fixtures/bulk.py +0 -162
- package/tests/py/unit/fixtures/cuts.py +0 -118
- package/tests/py/unit/fixtures/grain_boundary.py +0 -875
- package/tests/py/unit/fixtures/interface/commensurate.py +0 -498
- package/tests/py/unit/fixtures/interface/gaas_dia.py +0 -837
- package/tests/py/unit/fixtures/interface/gr_ni_111_top_hcp.py +0 -123
- package/tests/py/unit/fixtures/interface/simple.py +0 -84
- package/tests/py/unit/fixtures/interface/twisted_nanoribbons.py +0 -131
- package/tests/py/unit/fixtures/interface/zsl.py +0 -756
- package/tests/py/unit/fixtures/island.py +0 -336
- package/tests/py/unit/fixtures/merge.py +0 -147
- package/tests/py/unit/fixtures/monolayer.py +0 -46
- package/tests/py/unit/fixtures/nanoparticle.py +0 -116
- package/tests/py/unit/fixtures/nanoribbon/__init__.py +0 -0
- package/tests/py/unit/fixtures/nanoribbon/armchair.py +0 -102
- package/tests/py/unit/fixtures/nanoribbon/nanoribbon.py +0 -145
- package/tests/py/unit/fixtures/nanoribbon/zigzag.py +0 -54
- package/tests/py/unit/fixtures/pair_defects.py +0 -41
- package/tests/py/unit/fixtures/passivated/nanoribbon.py +0 -69
- package/tests/py/unit/fixtures/passivated/slab.py +0 -58
- package/tests/py/unit/fixtures/point_defects.py +0 -158
- package/tests/py/unit/fixtures/slab.py +0 -606
- package/tests/py/unit/fixtures/strain.py +0 -42
- package/tests/py/unit/fixtures/supercell.py +0 -64
- package/tests/py/unit/fixtures/terrace.py +0 -70
- package/tests/py/unit/fixtures/thrid_party/ase_atoms.py +0 -13
- package/tests/py/unit/test_analyze_lattice_planes.py +0 -131
- package/tests/py/unit/test_cell.py +0 -104
- package/tests/py/unit/test_data_files.py +0 -68
- package/tests/py/unit/test_lattice.py +0 -103
- package/tests/py/unit/test_lattice_type_extended.py +0 -53
- package/tests/py/unit/test_material.py +0 -158
- package/tests/py/unit/test_operations.py +0 -126
- package/tests/py/unit/test_primitive_cell.py +0 -118
- package/tests/py/unit/test_reciprocal_lattice.py +0 -86
- package/tests/py/unit/test_reciprocal_paths.py +0 -64
- package/tests/py/unit/test_symmetry_points.py +0 -151
- package/tests/py/unit/test_tools_analyze.py +0 -219
- package/tests/py/unit/test_tools_analyze_basis.py +0 -105
- package/tests/py/unit/test_tools_analyze_interface.py +0 -223
- package/tests/py/unit/test_tools_analyze_interface_material.py +0 -63
- package/tests/py/unit/test_tools_analyze_interface_zsl.py +0 -187
- package/tests/py/unit/test_tools_analyze_lattice.py +0 -74
- package/tests/py/unit/test_tools_analyze_swap.py +0 -80
- package/tests/py/unit/test_tools_build.py +0 -158
- package/tests/py/unit/test_tools_build_defect/__init__.py +0 -0
- package/tests/py/unit/test_tools_build_defect/test_adatom.py +0 -84
- package/tests/py/unit/test_tools_build_defect/test_island.py +0 -45
- package/tests/py/unit/test_tools_build_defect/test_pair_defect.py +0 -84
- package/tests/py/unit/test_tools_build_defect/test_point_defect.py +0 -196
- package/tests/py/unit/test_tools_build_defect/test_slab_stack.py +0 -30
- package/tests/py/unit/test_tools_build_defect/test_solid_solution.py +0 -90
- package/tests/py/unit/test_tools_build_defect/test_terrace.py +0 -44
- package/tests/py/unit/test_tools_build_grain_boundary.py +0 -133
- package/tests/py/unit/test_tools_build_heterostructure.py +0 -46
- package/tests/py/unit/test_tools_build_interface.py +0 -292
- package/tests/py/unit/test_tools_build_interface_zsl.py +0 -263
- package/tests/py/unit/test_tools_build_maxwell_disorder.py +0 -123
- package/tests/py/unit/test_tools_build_metadata.py +0 -79
- package/tests/py/unit/test_tools_build_monolayer.py +0 -33
- package/tests/py/unit/test_tools_build_nanoparticle.py +0 -42
- package/tests/py/unit/test_tools_build_nanoribbon.py +0 -45
- package/tests/py/unit/test_tools_build_passivation.py +0 -85
- package/tests/py/unit/test_tools_build_perturbation.py +0 -103
- package/tests/py/unit/test_tools_build_slab.py +0 -382
- package/tests/py/unit/test_tools_build_strain.py +0 -36
- package/tests/py/unit/test_tools_build_supercell.py +0 -47
- package/tests/py/unit/test_tools_calculate.py +0 -67
- package/tests/py/unit/test_tools_convert.py +0 -174
- package/tests/py/unit/test_tools_modify.py +0 -248
- package/tests/py/unit/utils.py +0 -142
- package/tsconfig-transpile.json +0 -3
- package/tsconfig.json +0 -3
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
from typing import List, Optional
|
|
2
|
-
|
|
3
|
-
from mat3ra.made.tools.build_components.entities.reusable.base_builder import BaseBuilderParameters
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
class TerraceBuildParameters(BaseBuilderParameters):
|
|
7
|
-
rotate_to_match_pbc: bool = True
|
|
8
|
-
axis: List[int] = [0, 1, 0]
|
|
9
|
-
angle: float = 0.0
|
|
10
|
-
new_lattice_vectors: Optional[List[List[float]]] = None
|
package/src/py/mat3ra/made/tools/build/defective_structures/two_dimensional/terrace/builder.py
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
from typing import Type
|
|
2
|
-
|
|
3
|
-
from .build_parameters import TerraceBuildParameters
|
|
4
|
-
from .configuration import TerraceDefectConfiguration
|
|
5
|
-
from .....build_components import MaterialWithBuildMetadata
|
|
6
|
-
from .....build_components.entities.reusable.two_dimensional.slab_stack.builder import SlabStackBuilder
|
|
7
|
-
from .....modify import translate_to_z_level
|
|
8
|
-
from .....operations.core.unary import edit_cell, rotate
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
class TerraceDefectBuilder(SlabStackBuilder):
|
|
12
|
-
_ConfigurationType: Type[TerraceDefectConfiguration] = TerraceDefectConfiguration
|
|
13
|
-
_BuildParametersType: Type[TerraceBuildParameters] = TerraceBuildParameters
|
|
14
|
-
_DefaultBuildParameters: TerraceBuildParameters = TerraceBuildParameters()
|
|
15
|
-
|
|
16
|
-
def get_name_suffix(self, configuration: TerraceDefectConfiguration) -> str:
|
|
17
|
-
return f"Terrace {configuration.cut_direction}"
|
|
18
|
-
|
|
19
|
-
def _generate(self, configuration: TerraceDefectConfiguration) -> MaterialWithBuildMetadata:
|
|
20
|
-
material = super()._generate(configuration)
|
|
21
|
-
build_params = self.build_parameters if self.build_parameters else self._DefaultBuildParameters
|
|
22
|
-
if build_params.rotate_to_match_pbc:
|
|
23
|
-
axis = build_params.axis
|
|
24
|
-
angle = build_params.angle
|
|
25
|
-
new_lattice_vectors = build_params.new_lattice_vectors
|
|
26
|
-
translated_material = translate_to_z_level(material, "center")
|
|
27
|
-
adjusted_material = edit_cell(translated_material, new_lattice_vectors)
|
|
28
|
-
material = rotate(adjusted_material, axis, angle)
|
|
29
|
-
|
|
30
|
-
return material
|
package/src/py/mat3ra/made/tools/build/defective_structures/two_dimensional/terrace/configuration.py
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
from typing import List
|
|
2
|
-
|
|
3
|
-
from mat3ra.esse.models.materials_category.defective_structures.two_dimensional.terrace.configuration import (
|
|
4
|
-
TerraceDefectConfigurationSchema,
|
|
5
|
-
)
|
|
6
|
-
|
|
7
|
-
from .....build_components.entities.reusable.two_dimensional.slab_stack.configuration import SlabStackConfiguration
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
class TerraceDefectConfiguration(SlabStackConfiguration, TerraceDefectConfigurationSchema):
|
|
11
|
-
cut_direction: List[int] = [1, 0, 0]
|
package/src/py/mat3ra/made/tools/build/defective_structures/two_dimensional/terrace/helpers.py
DELETED
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
from typing import Optional, List
|
|
2
|
-
|
|
3
|
-
from .build_parameters import TerraceBuildParameters
|
|
4
|
-
from .builder import TerraceDefectBuilder
|
|
5
|
-
from .configuration import TerraceDefectConfiguration
|
|
6
|
-
from .....analyze.terrace import TerraceMaterialAnalyzer
|
|
7
|
-
from .....build_components import MaterialWithBuildMetadata
|
|
8
|
-
from mat3ra.made.tools.build.pristine_structures.two_dimensional.slab.builder import SlabBuilder
|
|
9
|
-
from .....build_components.entities.reusable.two_dimensional.slab_stack.helpers import (
|
|
10
|
-
recreate_slab_with_fractional_layers,
|
|
11
|
-
)
|
|
12
|
-
from .....entities.coordinate import PlaneCoordinateCondition
|
|
13
|
-
from .....modify import filter_by_condition_on_coordinates
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
def create_defect_terrace(
|
|
17
|
-
slab: MaterialWithBuildMetadata,
|
|
18
|
-
cut_direction: Optional[List[int]] = None,
|
|
19
|
-
pivot_coordinate: Optional[List[float]] = None,
|
|
20
|
-
number_of_added_layers: float = 1.0,
|
|
21
|
-
use_cartesian_coordinates: bool = False,
|
|
22
|
-
rotate_to_match_pbc: bool = True,
|
|
23
|
-
) -> MaterialWithBuildMetadata:
|
|
24
|
-
"""
|
|
25
|
-
Create a terrace at the specified position on the surface of the material.
|
|
26
|
-
|
|
27
|
-
Args:
|
|
28
|
-
slab: The original slab material to which the terrace will be added.
|
|
29
|
-
cut_direction: The direction of the cut in lattice directions, Miller indices.
|
|
30
|
-
pivot_coordinate: The center position of the terrace.
|
|
31
|
-
number_of_added_layers: The number of added layers to the slab which will form the terrace
|
|
32
|
-
use_cartesian_coordinates: Whether to use Cartesian coordinates for the center position.
|
|
33
|
-
rotate_to_match_pbc: Whether to rotate the material to match the periodic boundary conditions.
|
|
34
|
-
Returns:
|
|
35
|
-
The material with the terrace added.
|
|
36
|
-
"""
|
|
37
|
-
if cut_direction is None:
|
|
38
|
-
cut_direction = [0, 0, 1]
|
|
39
|
-
if pivot_coordinate is None:
|
|
40
|
-
pivot_coordinate = [0.5, 0.5, 0.5]
|
|
41
|
-
|
|
42
|
-
terrace_analyzer = TerraceMaterialAnalyzer(
|
|
43
|
-
material=slab, cut_direction=cut_direction, number_of_added_layers=number_of_added_layers
|
|
44
|
-
)
|
|
45
|
-
|
|
46
|
-
additional_slab_material = recreate_slab_with_fractional_layers(slab, number_of_added_layers)
|
|
47
|
-
|
|
48
|
-
normalized_direction_vector = terrace_analyzer.cut_direction_vector
|
|
49
|
-
|
|
50
|
-
condition = PlaneCoordinateCondition(
|
|
51
|
-
plane_normal=normalized_direction_vector,
|
|
52
|
-
plane_point_coordinate=pivot_coordinate,
|
|
53
|
-
).condition
|
|
54
|
-
|
|
55
|
-
slab_in_stack_config = terrace_analyzer.slab_configuration_with_no_vacuum
|
|
56
|
-
slab_build_parameters = terrace_analyzer.build_parameters
|
|
57
|
-
|
|
58
|
-
slab_in_stack = SlabBuilder(build_parameters=slab_build_parameters).get_material(slab_in_stack_config)
|
|
59
|
-
isolated_defect = filter_by_condition_on_coordinates(
|
|
60
|
-
material=additional_slab_material,
|
|
61
|
-
condition=condition,
|
|
62
|
-
use_cartesian_coordinates=use_cartesian_coordinates,
|
|
63
|
-
)
|
|
64
|
-
vacuum = terrace_analyzer.get_slab_vacuum_configuration()
|
|
65
|
-
|
|
66
|
-
terrace_configuration = TerraceDefectConfiguration(
|
|
67
|
-
stack_components=[slab_in_stack, isolated_defect, vacuum], cut_direction=cut_direction
|
|
68
|
-
)
|
|
69
|
-
|
|
70
|
-
angle = terrace_analyzer.angle
|
|
71
|
-
axis = terrace_analyzer.rotation_axis
|
|
72
|
-
new_lattice_vectors = terrace_analyzer.new_lattice_vectors
|
|
73
|
-
parameters = TerraceBuildParameters(
|
|
74
|
-
rotate_to_match_pbc=rotate_to_match_pbc, angle=angle, axis=axis, new_lattice_vectors=new_lattice_vectors
|
|
75
|
-
)
|
|
76
|
-
terrace = TerraceDefectBuilder(build_parameters=parameters).get_material(terrace_configuration)
|
|
77
|
-
|
|
78
|
-
return terrace
|
|
File without changes
|
package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/pair_defect/__init__.py
DELETED
|
File without changes
|
package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/pair_defect/builder.py
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
from typing import Type, Union
|
|
2
|
-
|
|
3
|
-
from mat3ra.made.material import Material
|
|
4
|
-
from .configuration import PairDefectConfiguration
|
|
5
|
-
from ..point_defect.base.builder import PointDefectBuilder
|
|
6
|
-
from ..point_defect.vacancy.builder import VacancyDefectBuilder
|
|
7
|
-
from .....build_components import MaterialWithBuildMetadata, TypeConfiguration
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
class PairDefectBuilder(VacancyDefectBuilder, PointDefectBuilder):
|
|
11
|
-
_ConfigurationType: Type[PairDefectConfiguration] = PairDefectConfiguration
|
|
12
|
-
|
|
13
|
-
def _update_material_name(
|
|
14
|
-
self, material: Union[Material, MaterialWithBuildMetadata], configuration: TypeConfiguration
|
|
15
|
-
) -> Material:
|
|
16
|
-
host_material = configuration.merge_components[0]
|
|
17
|
-
|
|
18
|
-
primary_defect_name = (
|
|
19
|
-
configuration.merge_components[1].element.chemical_element.value
|
|
20
|
-
if hasattr(configuration.merge_components[1].element.chemical_element, "value")
|
|
21
|
-
else configuration.merge_components[1].element.chemical_element
|
|
22
|
-
)
|
|
23
|
-
secondary_defect_name = (
|
|
24
|
-
configuration.merge_components[2].element.chemical_element.value
|
|
25
|
-
if hasattr(configuration.merge_components[2].element.chemical_element, "value")
|
|
26
|
-
else configuration.merge_components[2].element.chemical_element
|
|
27
|
-
)
|
|
28
|
-
if host_material:
|
|
29
|
-
material.name = f"{host_material.name}, Pair Defect: {primary_defect_name} + {secondary_defect_name}"
|
|
30
|
-
|
|
31
|
-
return material
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
from typing import List, Union
|
|
2
|
-
|
|
3
|
-
# fmt: off
|
|
4
|
-
from mat3ra.esse.models.materials_category.defective_structures.zero_dimensional. \
|
|
5
|
-
point_defect.base_configuration import (
|
|
6
|
-
PointDefectBaseConfigurationSchema,
|
|
7
|
-
)
|
|
8
|
-
# fmt: on
|
|
9
|
-
from mat3ra.esse.models.materials_category_components.operations.core.combinations.merge import MergeMethodsEnum
|
|
10
|
-
|
|
11
|
-
from mat3ra.made.material import Material
|
|
12
|
-
from ..point_defect.base.configuration import PointDefectConfiguration
|
|
13
|
-
from .....build_components import MaterialWithBuildMetadata
|
|
14
|
-
from .....build_components.entities.auxiliary.zero_dimensional.point_defect_site.configuration import (
|
|
15
|
-
PointDefectSiteConfiguration,
|
|
16
|
-
)
|
|
17
|
-
from .....build_components.operations.core.combinations.merge.configuration import MergeConfiguration
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
class PairDefectConfiguration(MergeConfiguration, PointDefectBaseConfigurationSchema):
|
|
21
|
-
"""
|
|
22
|
-
Configuration for building a pair defect by merging materials.
|
|
23
|
-
|
|
24
|
-
Args:
|
|
25
|
-
merge_components: List containing [crystal, primary_defect_configuration, secondary_defect_configuration].
|
|
26
|
-
merge_method: Method to use for merging.
|
|
27
|
-
"""
|
|
28
|
-
|
|
29
|
-
type: str = "PairDefectConfiguration"
|
|
30
|
-
merge_components: List[Union[Material, PointDefectSiteConfiguration]]
|
|
31
|
-
merge_method: MergeMethodsEnum = MergeMethodsEnum.REPLACE
|
|
32
|
-
|
|
33
|
-
@classmethod
|
|
34
|
-
def from_parameters(
|
|
35
|
-
cls,
|
|
36
|
-
crystal: Union[Material, MaterialWithBuildMetadata],
|
|
37
|
-
primary_defect_configuration: PointDefectConfiguration,
|
|
38
|
-
secondary_defect_configuration: PointDefectConfiguration,
|
|
39
|
-
**kwargs,
|
|
40
|
-
):
|
|
41
|
-
primary_defect_site_configuration = primary_defect_configuration.merge_components[1]
|
|
42
|
-
secondary_defect_site_configuration = secondary_defect_configuration.merge_components[1]
|
|
43
|
-
return cls(
|
|
44
|
-
merge_components=[crystal, primary_defect_site_configuration, secondary_defect_site_configuration], **kwargs
|
|
45
|
-
)
|
package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/pair_defect/helpers.py
DELETED
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
from typing import List, Optional, Union
|
|
2
|
-
|
|
3
|
-
from mat3ra.made.material import Material
|
|
4
|
-
from .builder import PairDefectBuilder
|
|
5
|
-
from .configuration import PairDefectConfiguration
|
|
6
|
-
from ..point_defect import (
|
|
7
|
-
PointDefectTypeEnum,
|
|
8
|
-
VacancyPlacementMethodEnum,
|
|
9
|
-
SubstitutionPlacementMethodEnum,
|
|
10
|
-
InterstitialPlacementMethodEnum,
|
|
11
|
-
AtomPlacementMethodEnum,
|
|
12
|
-
create_defect_configuration,
|
|
13
|
-
)
|
|
14
|
-
from .....build_components import MaterialWithBuildMetadata
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
def create_defect_pair(
|
|
18
|
-
material: Union[Material, MaterialWithBuildMetadata],
|
|
19
|
-
defect_type_1: Optional[PointDefectTypeEnum] = None,
|
|
20
|
-
coordinate_1: Optional[List[float]] = None,
|
|
21
|
-
element_1: Optional[str] = None,
|
|
22
|
-
placement_method_1: Union[
|
|
23
|
-
VacancyPlacementMethodEnum,
|
|
24
|
-
SubstitutionPlacementMethodEnum,
|
|
25
|
-
InterstitialPlacementMethodEnum,
|
|
26
|
-
AtomPlacementMethodEnum,
|
|
27
|
-
] = AtomPlacementMethodEnum.EXACT_COORDINATE,
|
|
28
|
-
defect_type_2: Optional[PointDefectTypeEnum] = None,
|
|
29
|
-
coordinate_2: Optional[List[float]] = None,
|
|
30
|
-
element_2: Optional[str] = None,
|
|
31
|
-
placement_method_2: Union[
|
|
32
|
-
VacancyPlacementMethodEnum,
|
|
33
|
-
SubstitutionPlacementMethodEnum,
|
|
34
|
-
InterstitialPlacementMethodEnum,
|
|
35
|
-
AtomPlacementMethodEnum,
|
|
36
|
-
] = AtomPlacementMethodEnum.EXACT_COORDINATE,
|
|
37
|
-
use_cartesian_coordinates: bool = False,
|
|
38
|
-
) -> Material:
|
|
39
|
-
"""
|
|
40
|
-
Create a pair defect in the given material.
|
|
41
|
-
|
|
42
|
-
Args:
|
|
43
|
-
material: The host material.
|
|
44
|
-
defect_type_1: Type of the first defect.
|
|
45
|
-
coordinate_1: Coordinate for the first defect.
|
|
46
|
-
element_1: Element for substitution/interstitial defects.
|
|
47
|
-
placement_method_1: Method to resolve the final coordinate for the first defect.
|
|
48
|
-
defect_type_2: Type of the second defect.
|
|
49
|
-
coordinate_2: Coordinate for the second defect.
|
|
50
|
-
element_2: Element for substitution/interstitial defects.
|
|
51
|
-
placement_method_2: Method to resolve the final coordinate for the second defect.
|
|
52
|
-
use_cartesian_coordinates: Whether the coordinates are in Cartesian units.
|
|
53
|
-
|
|
54
|
-
Returns:
|
|
55
|
-
material: Union[Material, MaterialWithBuildMetadata] with the pair defect applied.
|
|
56
|
-
"""
|
|
57
|
-
if not defect_type_1 or not coordinate_1:
|
|
58
|
-
raise ValueError("defect_type_1 and coordinate_1 must be provided.")
|
|
59
|
-
configuration_1 = create_defect_configuration(
|
|
60
|
-
material,
|
|
61
|
-
defect_type_1,
|
|
62
|
-
coordinate_1,
|
|
63
|
-
element_1,
|
|
64
|
-
placement_method_1,
|
|
65
|
-
use_cartesian_coordinates,
|
|
66
|
-
)
|
|
67
|
-
if not defect_type_2 or not coordinate_2:
|
|
68
|
-
raise ValueError("defect_type_2 and coordinate_2 must be provided.")
|
|
69
|
-
configuration_2 = create_defect_configuration(
|
|
70
|
-
material, defect_type_2, coordinate_2, element_2, placement_method_2, use_cartesian_coordinates
|
|
71
|
-
)
|
|
72
|
-
|
|
73
|
-
pair_config = PairDefectConfiguration.from_parameters(
|
|
74
|
-
crystal=material,
|
|
75
|
-
primary_defect_configuration=configuration_1,
|
|
76
|
-
secondary_defect_configuration=configuration_2,
|
|
77
|
-
)
|
|
78
|
-
|
|
79
|
-
builder = PairDefectBuilder()
|
|
80
|
-
return builder.get_material(pair_config)
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
from .atom_placement_method_enum import AtomPlacementMethodEnum
|
|
2
|
-
from .base.builder import PointDefectBuilder
|
|
3
|
-
from .base.configuration import PointDefectConfiguration
|
|
4
|
-
from .complex_defect_type_enum import ComplexDefectTypeEnum
|
|
5
|
-
from .factories import PointDefectConfigurationFactory, create_defect_configuration, resolve_coordinate
|
|
6
|
-
from .helpers import create_multiple_defects
|
|
7
|
-
from .interstitial.configuration import InterstitialDefectConfiguration
|
|
8
|
-
from .interstitial.helpers import create_defect_point_interstitial
|
|
9
|
-
from .interstitial.interstitial_placement_method_enum import InterstitialPlacementMethodEnum
|
|
10
|
-
from .point_defect_type_enum import PointDefectTypeEnum
|
|
11
|
-
from .substitutional.configuration import SubstitutionalDefectConfiguration
|
|
12
|
-
from .substitutional.helpers import create_defect_point_substitution
|
|
13
|
-
from .substitutional.substitution_placement_method_enum import SubstitutionPlacementMethodEnum
|
|
14
|
-
from .vacancy.configuration import VacancyDefectConfiguration
|
|
15
|
-
from .vacancy.helpers import create_defect_point_vacancy
|
|
16
|
-
from .vacancy.vacancy_placement_method_enum import VacancyPlacementMethodEnum
|
|
17
|
-
|
|
18
|
-
__all__ = [
|
|
19
|
-
# Enums
|
|
20
|
-
"AtomPlacementMethodEnum",
|
|
21
|
-
"ComplexDefectTypeEnum",
|
|
22
|
-
"InterstitialPlacementMethodEnum",
|
|
23
|
-
"PointDefectTypeEnum",
|
|
24
|
-
"SubstitutionPlacementMethodEnum",
|
|
25
|
-
"VacancyPlacementMethodEnum",
|
|
26
|
-
# Classes
|
|
27
|
-
"PointDefectBuilder",
|
|
28
|
-
"PointDefectConfiguration",
|
|
29
|
-
"PointDefectConfigurationFactory",
|
|
30
|
-
"InterstitialDefectConfiguration",
|
|
31
|
-
"SubstitutionalDefectConfiguration",
|
|
32
|
-
"VacancyDefectConfiguration",
|
|
33
|
-
# Functions
|
|
34
|
-
"create_defect_configuration",
|
|
35
|
-
"resolve_coordinate",
|
|
36
|
-
"create_multiple_defects",
|
|
37
|
-
"create_defect_point_interstitial",
|
|
38
|
-
"create_defect_point_substitution",
|
|
39
|
-
"create_defect_point_vacancy",
|
|
40
|
-
]
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
from enum import Enum
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
class AtomPlacementMethodEnum(str, Enum):
|
|
5
|
-
# Places the atom at the exact given coordinate.
|
|
6
|
-
EXACT_COORDINATE = "exact_coordinate"
|
|
7
|
-
# Among existing atoms, selects the closest one to the given coordinate.
|
|
8
|
-
CLOSEST_SITE = "closest_site"
|
|
9
|
-
# Places the atom at the equal distance from the closest atoms to the given coordinate.
|
|
10
|
-
EQUIDISTANT = "equidistant"
|
|
11
|
-
# Places the atom at the existing or extrapolated crystal site closest to the given coordinate.
|
|
12
|
-
NEW_CRYSTAL_SITE = "new_crystal_site"
|
|
13
|
-
# Places the atom at Voronoi site closest to the given coordinate.
|
|
14
|
-
VORONOI_SITE = "voronoi_site"
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
from typing import Type, Dict, Union
|
|
2
|
-
|
|
3
|
-
from mat3ra.made.material import Material
|
|
4
|
-
from .configuration import PointDefectConfiguration
|
|
5
|
-
from ..interstitial.configuration import InterstitialDefectConfiguration
|
|
6
|
-
from ..substitutional.configuration import SubstitutionalDefectConfiguration
|
|
7
|
-
from ..vacancy.configuration import VacancyDefectConfiguration
|
|
8
|
-
from ......build_components import MaterialWithBuildMetadata, TypeConfiguration
|
|
9
|
-
from ......build_components.entities.auxiliary.zero_dimensional.point_defect_site.builder import PointDefectSiteBuilder
|
|
10
|
-
from ......build_components.entities.auxiliary.zero_dimensional.point_defect_site.configuration import (
|
|
11
|
-
PointDefectSiteConfiguration,
|
|
12
|
-
)
|
|
13
|
-
from ......build_components.operations.core.combinations.merge.builder import MergeBuilder
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
class PointDefectBuilder(MergeBuilder):
|
|
17
|
-
_ConfigurationType: Type[PointDefectConfiguration] = PointDefectConfiguration
|
|
18
|
-
|
|
19
|
-
@property
|
|
20
|
-
def merge_component_types_conversion_map(self) -> Dict[Type, Type]:
|
|
21
|
-
return {
|
|
22
|
-
VacancyDefectConfiguration: PointDefectSiteBuilder,
|
|
23
|
-
SubstitutionalDefectConfiguration: PointDefectSiteBuilder,
|
|
24
|
-
InterstitialDefectConfiguration: PointDefectSiteBuilder,
|
|
25
|
-
PointDefectSiteConfiguration: PointDefectSiteBuilder,
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
def _update_material_name(
|
|
29
|
-
self, material: Union[Material, MaterialWithBuildMetadata], configuration: TypeConfiguration
|
|
30
|
-
) -> MaterialWithBuildMetadata:
|
|
31
|
-
host_material = None
|
|
32
|
-
for component in configuration.merge_components:
|
|
33
|
-
if isinstance(component, Material):
|
|
34
|
-
host_material = component
|
|
35
|
-
break
|
|
36
|
-
|
|
37
|
-
if host_material:
|
|
38
|
-
defect_type = configuration.__class__.__name__.lower()
|
|
39
|
-
defect_type = defect_type.replace("defectconfiguration", "").replace("configuration", "")
|
|
40
|
-
material.name = f"{host_material.name} with {defect_type} defect"
|
|
41
|
-
|
|
42
|
-
return material
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
from typing import Union, List
|
|
2
|
-
|
|
3
|
-
# fmt: off
|
|
4
|
-
from mat3ra.esse.models.materials_category.defective_structures.zero_dimensional.\
|
|
5
|
-
point_defect.base_configuration import (
|
|
6
|
-
PointDefectBaseConfigurationSchema,
|
|
7
|
-
)
|
|
8
|
-
# fmt: on
|
|
9
|
-
|
|
10
|
-
from mat3ra.made.material import Material
|
|
11
|
-
from mat3ra.made.tools.build_components.entities.auxiliary.zero_dimensional.point_defect_site.configuration import (
|
|
12
|
-
PointDefectSiteConfiguration,
|
|
13
|
-
)
|
|
14
|
-
from mat3ra.made.tools.build_components.operations.core.combinations.merge.configuration import MergeConfiguration
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
class PointDefectConfiguration(MergeConfiguration, PointDefectBaseConfigurationSchema):
|
|
18
|
-
"""
|
|
19
|
-
Configuration for building a point defect by merging materials.
|
|
20
|
-
|
|
21
|
-
Args:
|
|
22
|
-
merge_components: List of materials or configurations to merge.
|
|
23
|
-
merge_method: Method to use for merging.
|
|
24
|
-
"""
|
|
25
|
-
|
|
26
|
-
type: str = "PointDefectConfiguration"
|
|
27
|
-
merge_components: List[Union[Material, PointDefectSiteConfiguration]]
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
from typing import List, Dict, Union, Type, Optional
|
|
2
|
-
|
|
3
|
-
from mat3ra.made.material import Material
|
|
4
|
-
from .....analyze.crystal_site.crystal_site_analyzer import CrystalSiteAnalyzer
|
|
5
|
-
from .....analyze.crystal_site.voronoi_crystal_site_analyzer import VoronoiCrystalSiteAnalyzer
|
|
6
|
-
from .....build_components import MaterialWithBuildMetadata
|
|
7
|
-
from .atom_placement_method_enum import AtomPlacementMethodEnum
|
|
8
|
-
from .base.configuration import PointDefectConfiguration
|
|
9
|
-
from .interstitial.configuration import InterstitialDefectConfiguration
|
|
10
|
-
from .interstitial.interstitial_placement_method_enum import InterstitialPlacementMethodEnum
|
|
11
|
-
from .point_defect_type_enum import PointDefectTypeEnum
|
|
12
|
-
from .substitutional.configuration import SubstitutionalDefectConfiguration
|
|
13
|
-
from .substitutional.substitution_placement_method_enum import SubstitutionPlacementMethodEnum
|
|
14
|
-
from .vacancy.configuration import VacancyDefectConfiguration
|
|
15
|
-
from .vacancy.vacancy_placement_method_enum import VacancyPlacementMethodEnum
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
def resolve_coordinate(
|
|
19
|
-
material: Union[Material, MaterialWithBuildMetadata],
|
|
20
|
-
coordinate: List[float],
|
|
21
|
-
placement_method,
|
|
22
|
-
use_cartesian_coordinates: bool = False,
|
|
23
|
-
) -> List[float]:
|
|
24
|
-
if use_cartesian_coordinates:
|
|
25
|
-
coordinate = material.basis.cell.convert_point_to_crystal(coordinate)
|
|
26
|
-
|
|
27
|
-
if placement_method in [VacancyPlacementMethodEnum.CLOSEST_SITE, SubstitutionPlacementMethodEnum.CLOSEST_SITE]:
|
|
28
|
-
analyzer = CrystalSiteAnalyzer(material=material, coordinate=coordinate)
|
|
29
|
-
return analyzer.closest_site_coordinate
|
|
30
|
-
elif placement_method == InterstitialPlacementMethodEnum.VORONOI_SITE:
|
|
31
|
-
analyzer = VoronoiCrystalSiteAnalyzer(material=material, coordinate=coordinate)
|
|
32
|
-
return analyzer.voronoi_site_coordinate
|
|
33
|
-
else:
|
|
34
|
-
analyzer = CrystalSiteAnalyzer(material=material, coordinate=coordinate)
|
|
35
|
-
return analyzer.exact_coordinate
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
class PointDefectConfigurationFactory:
|
|
39
|
-
_type_to_configuration_map: Dict[PointDefectTypeEnum, Type[PointDefectConfiguration]] = {
|
|
40
|
-
PointDefectTypeEnum.VACANCY: VacancyDefectConfiguration,
|
|
41
|
-
PointDefectTypeEnum.SUBSTITUTION: SubstitutionalDefectConfiguration,
|
|
42
|
-
PointDefectTypeEnum.INTERSTITIAL: InterstitialDefectConfiguration,
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
@classmethod
|
|
46
|
-
def get_constructor(cls, defect_type: PointDefectTypeEnum) -> Type[PointDefectConfiguration]:
|
|
47
|
-
try:
|
|
48
|
-
return cls._type_to_configuration_map[defect_type]
|
|
49
|
-
except KeyError:
|
|
50
|
-
raise ValueError(f"Unsupported defect type: {defect_type}")
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
def create_defect_configuration(
|
|
54
|
-
material: Union[Material, MaterialWithBuildMetadata],
|
|
55
|
-
defect_type: PointDefectTypeEnum,
|
|
56
|
-
coordinate: List[float],
|
|
57
|
-
element: Optional[str] = None,
|
|
58
|
-
placement_method: Union[
|
|
59
|
-
VacancyPlacementMethodEnum,
|
|
60
|
-
SubstitutionPlacementMethodEnum,
|
|
61
|
-
InterstitialPlacementMethodEnum,
|
|
62
|
-
AtomPlacementMethodEnum,
|
|
63
|
-
] = AtomPlacementMethodEnum.EXACT_COORDINATE,
|
|
64
|
-
use_cartesian_coordinates: bool = False,
|
|
65
|
-
) -> PointDefectConfiguration:
|
|
66
|
-
resolved_coordinate = resolve_coordinate(material, coordinate, placement_method, use_cartesian_coordinates)
|
|
67
|
-
config_class = PointDefectConfigurationFactory.get_constructor(defect_type=defect_type)
|
|
68
|
-
|
|
69
|
-
return config_class.from_parameters(crystal=material, coordinate=resolved_coordinate, element=element)
|
package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/point_defect/helpers.py
DELETED
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
from typing import List, Union
|
|
2
|
-
|
|
3
|
-
from mat3ra.made.material import Material
|
|
4
|
-
from .interstitial.helpers import create_defect_point_interstitial
|
|
5
|
-
from .interstitial.interstitial_placement_method_enum import InterstitialPlacementMethodEnum
|
|
6
|
-
from .point_defect_type_enum import PointDefectTypeEnum
|
|
7
|
-
from .substitutional.helpers import create_defect_point_substitution
|
|
8
|
-
from .substitutional.substitution_placement_method_enum import SubstitutionPlacementMethodEnum
|
|
9
|
-
from .types import PointDefectDict
|
|
10
|
-
from .vacancy.helpers import create_defect_point_vacancy
|
|
11
|
-
from .vacancy.vacancy_placement_method_enum import VacancyPlacementMethodEnum
|
|
12
|
-
from .....build_components import MaterialWithBuildMetadata
|
|
13
|
-
|
|
14
|
-
DEFECT_TYPE_MAPPING = {
|
|
15
|
-
PointDefectTypeEnum.VACANCY: {
|
|
16
|
-
"create_func": "create_point_defect_vacancy",
|
|
17
|
-
"placement_enum": VacancyPlacementMethodEnum,
|
|
18
|
-
"default_method": VacancyPlacementMethodEnum.CLOSEST_SITE,
|
|
19
|
-
},
|
|
20
|
-
PointDefectTypeEnum.SUBSTITUTION: {
|
|
21
|
-
"create_func": "create_point_defect_substitution",
|
|
22
|
-
"placement_enum": SubstitutionPlacementMethodEnum,
|
|
23
|
-
"default_method": SubstitutionPlacementMethodEnum.CLOSEST_SITE,
|
|
24
|
-
},
|
|
25
|
-
PointDefectTypeEnum.INTERSTITIAL: {
|
|
26
|
-
"create_func": "create_point_defect_interstitial",
|
|
27
|
-
"placement_enum": InterstitialPlacementMethodEnum,
|
|
28
|
-
"default_method": InterstitialPlacementMethodEnum.EXACT_COORDINATE,
|
|
29
|
-
},
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
def create_multiple_defects(
|
|
34
|
-
material: Union[Material, MaterialWithBuildMetadata],
|
|
35
|
-
defect_dicts: List[PointDefectDict],
|
|
36
|
-
) -> Material:
|
|
37
|
-
"""
|
|
38
|
-
Create multiple point defects from a list of PointDefectDict.
|
|
39
|
-
|
|
40
|
-
Args:
|
|
41
|
-
material (Material): The host material.
|
|
42
|
-
defect_dicts (List[PointDefectDict]): List of defect dictionaries with keys:
|
|
43
|
-
- type: str ("vacancy", "substitution", "interstitial")
|
|
44
|
-
- coordinate: List[float]
|
|
45
|
-
- element: str (required for substitution and interstitial)
|
|
46
|
-
- placement_method: str or enum (optional)
|
|
47
|
-
- For vacancy/substitution: "CLOSEST_SITE"
|
|
48
|
-
- For interstitial: "EXACT_COORDINATE", "VORONOI_SITE"
|
|
49
|
-
Defaults to "closest_site" for vacancy/substitution and "exact_coordinate" for interstitial.
|
|
50
|
-
- use_cartesian_coordinates: bool (optional, defaults to False)
|
|
51
|
-
Whether the input coordinates are in Cartesian units.
|
|
52
|
-
|
|
53
|
-
Returns:
|
|
54
|
-
Material: A new material with all defects applied.
|
|
55
|
-
"""
|
|
56
|
-
current_material = material
|
|
57
|
-
|
|
58
|
-
for defect_dict in defect_dicts:
|
|
59
|
-
defect_type = defect_dict.type
|
|
60
|
-
|
|
61
|
-
if defect_type not in [e.value for e in PointDefectTypeEnum]:
|
|
62
|
-
raise ValueError(f"Unsupported defect type: {defect_dict.type}")
|
|
63
|
-
|
|
64
|
-
use_cartesian = getattr(defect_dict, "use_cartesian_coordinates", False)
|
|
65
|
-
|
|
66
|
-
if defect_type == "vacancy":
|
|
67
|
-
current_material = create_defect_point_vacancy(
|
|
68
|
-
current_material,
|
|
69
|
-
coordinate=defect_dict.coordinate,
|
|
70
|
-
placement_method=defect_dict.placement_method or VacancyPlacementMethodEnum.CLOSEST_SITE.value,
|
|
71
|
-
use_cartesian_coordinates=use_cartesian,
|
|
72
|
-
)
|
|
73
|
-
|
|
74
|
-
elif defect_type == "substitution":
|
|
75
|
-
current_material = create_defect_point_substitution(
|
|
76
|
-
current_material,
|
|
77
|
-
coordinate=defect_dict.coordinate,
|
|
78
|
-
element=defect_dict.element, # type: ignore # Pydantic validates this at creation
|
|
79
|
-
placement_method=defect_dict.placement_method or SubstitutionPlacementMethodEnum.CLOSEST_SITE.value,
|
|
80
|
-
use_cartesian_coordinates=use_cartesian,
|
|
81
|
-
)
|
|
82
|
-
|
|
83
|
-
elif defect_type == "interstitial":
|
|
84
|
-
current_material = create_defect_point_interstitial(
|
|
85
|
-
current_material,
|
|
86
|
-
coordinate=defect_dict.coordinate,
|
|
87
|
-
element=defect_dict.element, # type: ignore # Pydantic validates this at creation
|
|
88
|
-
placement_method=defect_dict.placement_method or InterstitialPlacementMethodEnum.EXACT_COORDINATE.value,
|
|
89
|
-
use_cartesian_coordinates=use_cartesian,
|
|
90
|
-
)
|
|
91
|
-
|
|
92
|
-
return current_material
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
from typing import List, Union
|
|
2
|
-
|
|
3
|
-
from mat3ra.esse.models.materials_category.defective_structures.zero_dimensional.point_defect.interstitial import (
|
|
4
|
-
InterstitialPointDefectSchema,
|
|
5
|
-
)
|
|
6
|
-
from mat3ra.esse.models.materials_category_components.entities.core.zero_dimensional.atom import AtomSchema
|
|
7
|
-
from mat3ra.esse.models.materials_category_components.operations.core.combinations.merge import MergeMethodsEnum
|
|
8
|
-
|
|
9
|
-
from mat3ra.made.material import Material
|
|
10
|
-
from ......build_components import MaterialWithBuildMetadata
|
|
11
|
-
from ..base.configuration import PointDefectConfiguration
|
|
12
|
-
from ......build_components.entities.auxiliary.zero_dimensional.point_defect_site.configuration import (
|
|
13
|
-
PointDefectSiteConfiguration,
|
|
14
|
-
)
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
class InterstitialDefectConfiguration(PointDefectConfiguration, InterstitialPointDefectSchema):
|
|
18
|
-
type: str = "InterstitialDefectConfiguration"
|
|
19
|
-
|
|
20
|
-
@classmethod
|
|
21
|
-
def from_parameters(
|
|
22
|
-
cls, crystal: Union[Material, MaterialWithBuildMetadata], coordinate: List[float], element: str, **kwargs
|
|
23
|
-
):
|
|
24
|
-
interstitial_site = PointDefectSiteConfiguration(
|
|
25
|
-
crystal=crystal,
|
|
26
|
-
element=AtomSchema(chemical_element=element),
|
|
27
|
-
coordinate=coordinate,
|
|
28
|
-
)
|
|
29
|
-
return cls(merge_components=[crystal, interstitial_site], merge_method=MergeMethodsEnum.ADD, **kwargs)
|