@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.
- package/dist/js/Material.d.ts +219 -0
- package/dist/js/Material.js +457 -0
- package/dist/js/basis/basis.d.ts +14 -9
- package/dist/js/basis/basis.js +15 -13
- package/dist/js/basis/constrained_basis.d.ts +9 -7
- package/dist/js/basis/constrained_basis.js +4 -4
- package/dist/js/generated/MaterialSchemaMixin.d.ts +5 -0
- package/dist/js/generated/MaterialSchemaMixin.js +69 -0
- package/dist/js/lattice/lattice.d.ts +4 -3
- package/dist/js/lattice/lattice.js +1 -2
- package/dist/js/made.d.ts +12 -12
- package/dist/js/made.js +38 -5
- package/dist/js/parsers/espresso.d.ts +2 -3
- package/dist/js/parsers/espresso.js +0 -1
- package/dist/js/parsers/native_format_parsers.d.ts +9 -8
- package/dist/js/parsers/native_format_parsers.js +6 -6
- package/dist/js/parsers/parsers.d.ts +6 -6
- package/dist/js/parsers/poscar.d.ts +5 -4
- package/dist/js/parsers/poscar.js +3 -2
- package/dist/js/parsers/xyz.d.ts +3 -5
- package/dist/js/parsers/xyz.js +3 -4
- package/dist/js/parsers/xyz_combinatorial_basis.js +3 -1
- package/dist/js/tools/basis.d.ts +1 -1
- package/dist/js/tools/index.d.ts +7 -7
- package/dist/js/tools/material.d.ts +1 -1
- package/dist/js/tools/material.js +8 -7
- package/dist/js/tools/supercell.d.ts +4 -5
- package/dist/js/tools/supercell.js +2 -4
- package/dist/js/tools/surface.d.ts +4 -4
- package/dist/js/tools/surface.js +2 -7
- package/package.json +12 -8
- 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/dist/js/material.d.ts +0 -169
- package/dist/js/material.js +0 -362
- 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/src/__init__.py +0 -0
- package/src/js/basis/basis.ts +0 -621
- package/src/js/basis/constrained_basis.ts +0 -114
- package/src/js/basis/coordinates.ts +0 -93
- 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 -150
- 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/lattice/lattice.ts +0 -306
- package/src/js/lattice/lattice_types.ts +0 -134
- package/src/js/lattice/reciprocal/lattice_reciprocal.ts +0 -193
- 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/material.ts +0 -458
- package/src/js/parsers/cif.ts +0 -25
- package/src/js/parsers/errors.ts +0 -6
- package/src/js/parsers/espresso.ts +0 -30
- package/src/js/parsers/native_format_parsers.ts +0 -51
- package/src/js/parsers/parsers.ts +0 -13
- package/src/js/parsers/poscar.ts +0 -212
- package/src/js/parsers/xyz.ts +0 -187
- package/src/js/parsers/xyz_combinatorial_basis.ts +0 -265
- package/src/js/tools/basis.ts +0 -132
- package/src/js/tools/cell.ts +0 -41
- package/src/js/tools/index.ts +0 -11
- package/src/js/tools/material.ts +0 -62
- package/src/js/tools/supercell.ts +0 -88
- package/src/js/tools/surface.ts +0 -223
- 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 -134
- 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 -120
- package/tests/js/lattice/lattice.ts +0 -43
- package/tests/js/lattice/lattice_reciprocal.ts +0 -104
- package/tests/js/material.test.ts +0 -42
- package/tests/js/parsers/espresso.ts +0 -15
- 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/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 -115
- 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,174 +0,0 @@
|
|
|
1
|
-
import numpy as np
|
|
2
|
-
import pytest
|
|
3
|
-
from ase import Atoms
|
|
4
|
-
from ase.build import molecule
|
|
5
|
-
from mat3ra.code.array_with_ids import ArrayWithIds
|
|
6
|
-
from mat3ra.made.material import Material
|
|
7
|
-
from mat3ra.made.tools.convert import from_ase, from_poscar, from_pymatgen, to_ase, to_poscar, to_pymatgen
|
|
8
|
-
from mat3ra.made.tools.convert.utils import DEFAULT_NON_PERIODIC_MIN_LATTICE_SIZE, calculate_padded_cell_simple_cubic
|
|
9
|
-
from mat3ra.utils import assertion as assertion_utils
|
|
10
|
-
from pymatgen.core.structure import Element, Lattice, Structure
|
|
11
|
-
|
|
12
|
-
from .fixtures.monolayer import GRAPHENE
|
|
13
|
-
from .fixtures.thrid_party.ase_atoms import (
|
|
14
|
-
ASE_MOLECULE_H2O,
|
|
15
|
-
BULK_SI_LABELS,
|
|
16
|
-
BULK_SI_LATTICE_A,
|
|
17
|
-
BULK_SI_LATTICE_ALPHA,
|
|
18
|
-
ASE_BULK_Si,
|
|
19
|
-
)
|
|
20
|
-
|
|
21
|
-
PYMATGEN_LATTICE = Lattice.from_parameters(a=3.84, b=3.84, c=3.84, alpha=120, beta=90, gamma=60)
|
|
22
|
-
PYMATGEN_STRUCTURE = Structure(PYMATGEN_LATTICE, ["Si", "Si"], [[0, 0, 0], [0.75, 0.5, 0.75]])
|
|
23
|
-
|
|
24
|
-
POSCAR_CONTENT = """Si2
|
|
25
|
-
1.0
|
|
26
|
-
3.3489202364344242 0.0000000000000000 1.9335000000000004
|
|
27
|
-
1.1163067454781415 3.1573922784475164 1.9335000000000004
|
|
28
|
-
0.0000000000000000 0.0000000000000000 3.8670000000000000
|
|
29
|
-
Si
|
|
30
|
-
2
|
|
31
|
-
direct
|
|
32
|
-
0.0000000000000000 0.0000000000000000 0.0000000000000000 Si
|
|
33
|
-
0.2500000000000000 0.2500000000000000 0.2500000000000000 Si
|
|
34
|
-
"""
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
@pytest.mark.parametrize(
|
|
38
|
-
"material_config, expected_lattice_params, expected_species, expected_frac_coords",
|
|
39
|
-
[
|
|
40
|
-
(
|
|
41
|
-
Material.__default_config__,
|
|
42
|
-
{"a": 3.867, "b": 3.867, "c": 3.867, "alpha": 60, "beta": 60, "gamma": 60},
|
|
43
|
-
[Element("Si"), Element("Si")],
|
|
44
|
-
[[0.0, 0.0, 0.0], [0.25, 0.25, 0.25]],
|
|
45
|
-
),
|
|
46
|
-
(
|
|
47
|
-
GRAPHENE,
|
|
48
|
-
{"a": 2.467291, "b": 2.467291, "c": 20.0, "alpha": 90, "beta": 90, "gamma": 120},
|
|
49
|
-
[Element("C"), Element("C")],
|
|
50
|
-
[[0.0, 0.0, 0.0], [0.333333, 0.666667, 0.0]],
|
|
51
|
-
),
|
|
52
|
-
],
|
|
53
|
-
)
|
|
54
|
-
def test_to_pymatgen(material_config, expected_lattice_params, expected_species, expected_frac_coords):
|
|
55
|
-
material = Material.create(material_config)
|
|
56
|
-
structure = to_pymatgen(material)
|
|
57
|
-
assert isinstance(structure, Structure)
|
|
58
|
-
assert np.allclose(structure.lattice.parameters, tuple(expected_lattice_params.values()), atol=1e-6)
|
|
59
|
-
assert structure.species == expected_species
|
|
60
|
-
assert np.allclose(structure.frac_coords, expected_frac_coords, atol=1e-6)
|
|
61
|
-
|
|
62
|
-
structure_to_poscar_str = structure.to(fmt="poscar")
|
|
63
|
-
material_to_poscar_str = to_poscar(material)
|
|
64
|
-
assert structure_to_poscar_str == material_to_poscar_str
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
def test_from_pymatgen():
|
|
68
|
-
material_data = from_pymatgen(PYMATGEN_STRUCTURE)
|
|
69
|
-
assert material_data["lattice"]["a"] == 3.84
|
|
70
|
-
assert material_data["lattice"]["alpha"] == 120
|
|
71
|
-
assert material_data["basis"]["elements"] == [{"id": 0, "value": "Si"}, {"id": 1, "value": "Si"}]
|
|
72
|
-
|
|
73
|
-
converted_material = Material.create(material_data)
|
|
74
|
-
default_material = Material.create_default()
|
|
75
|
-
assertion_utils.assert_deep_almost_equal(converted_material, default_material)
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
def test_to_poscar():
|
|
79
|
-
material = Material.create_default()
|
|
80
|
-
poscar = to_poscar(material)
|
|
81
|
-
assert poscar == POSCAR_CONTENT
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
def test_from_poscar():
|
|
85
|
-
material_data = from_poscar(POSCAR_CONTENT)
|
|
86
|
-
assert material_data["lattice"]["a"] == 3.867
|
|
87
|
-
assert material_data["lattice"]["alpha"] == 60
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
def test_to_ase():
|
|
91
|
-
material = Material.create_default()
|
|
92
|
-
labels_array = [{"id": 0, "value": 0}, {"id": 1, "value": 1}]
|
|
93
|
-
material.basis.labels = ArrayWithIds.from_list_of_dicts(labels_array)
|
|
94
|
-
ase_atoms = to_ase(material)
|
|
95
|
-
assert isinstance(ase_atoms, Atoms)
|
|
96
|
-
assert np.allclose(
|
|
97
|
-
ase_atoms.get_cell().tolist(),
|
|
98
|
-
[
|
|
99
|
-
[3.3489202364344242, 0.0, 1.9335000000000004],
|
|
100
|
-
[1.1163067454781415, 3.1573922784475164, 1.9335000000000004],
|
|
101
|
-
[0.0, 0.0, 3.8670000000000000],
|
|
102
|
-
],
|
|
103
|
-
)
|
|
104
|
-
assert ase_atoms.get_chemical_symbols() == ["Si", "Si"]
|
|
105
|
-
assert np.allclose(ase_atoms.get_scaled_positions().tolist(), [[0.0, 0.0, 0.0], [0.25, 0.25, 0.25]])
|
|
106
|
-
assert ase_atoms.get_tags().tolist() == [0, 1]
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
@pytest.mark.parametrize(
|
|
110
|
-
"ase_atoms, expected_lattice_a, expected_lattice_alpha, expected_labels,"
|
|
111
|
-
+ " expected_is_non_periodic, expected_lattice_type",
|
|
112
|
-
[
|
|
113
|
-
(
|
|
114
|
-
ASE_BULK_Si,
|
|
115
|
-
BULK_SI_LATTICE_A,
|
|
116
|
-
BULK_SI_LATTICE_ALPHA,
|
|
117
|
-
BULK_SI_LABELS,
|
|
118
|
-
False,
|
|
119
|
-
None,
|
|
120
|
-
),
|
|
121
|
-
(
|
|
122
|
-
ASE_MOLECULE_H2O,
|
|
123
|
-
None,
|
|
124
|
-
None,
|
|
125
|
-
[],
|
|
126
|
-
True,
|
|
127
|
-
"CUB",
|
|
128
|
-
),
|
|
129
|
-
],
|
|
130
|
-
)
|
|
131
|
-
def test_from_ase(
|
|
132
|
-
ase_atoms,
|
|
133
|
-
expected_lattice_a,
|
|
134
|
-
expected_lattice_alpha,
|
|
135
|
-
expected_labels,
|
|
136
|
-
expected_is_non_periodic,
|
|
137
|
-
expected_lattice_type,
|
|
138
|
-
):
|
|
139
|
-
material_data = from_ase(ase_atoms)
|
|
140
|
-
if expected_lattice_a is not None:
|
|
141
|
-
assertion_utils.assert_almost_equal_numbers(material_data["lattice"]["a"], expected_lattice_a, atol=1e-4)
|
|
142
|
-
if expected_lattice_alpha is not None:
|
|
143
|
-
assert material_data["lattice"]["alpha"] == expected_lattice_alpha
|
|
144
|
-
assert material_data["basis"]["labels"] == expected_labels
|
|
145
|
-
assert material_data["isNonPeriodic"] == expected_is_non_periodic
|
|
146
|
-
if expected_lattice_type is not None:
|
|
147
|
-
assert material_data["lattice"]["type"] == expected_lattice_type
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
TOLERANCE = 1e-4
|
|
151
|
-
|
|
152
|
-
H2_EXPECTED_LATTICE_A = DEFAULT_NON_PERIODIC_MIN_LATTICE_SIZE
|
|
153
|
-
O2_EXPECTED_LATTICE_A = 3.7379
|
|
154
|
-
H2O_EXPECTED_LATTICE_A = 3.0530
|
|
155
|
-
C2H4_EXPECTED_LATTICE_A = 6.1754
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
@pytest.mark.parametrize(
|
|
159
|
-
"molecule_name, expected_lattice_a",
|
|
160
|
-
[
|
|
161
|
-
("H2", H2_EXPECTED_LATTICE_A),
|
|
162
|
-
("O2", O2_EXPECTED_LATTICE_A),
|
|
163
|
-
("H2O", H2O_EXPECTED_LATTICE_A),
|
|
164
|
-
("C2H4", C2H4_EXPECTED_LATTICE_A),
|
|
165
|
-
],
|
|
166
|
-
)
|
|
167
|
-
def test_calculate_padded_cell_simple_cubic(molecule_name, expected_lattice_a):
|
|
168
|
-
atoms = molecule(molecule_name)
|
|
169
|
-
cell_vectors = calculate_padded_cell_simple_cubic(atoms.get_positions().tolist())
|
|
170
|
-
lattice_a = cell_vectors[0][0]
|
|
171
|
-
assert np.isclose(lattice_a, expected_lattice_a, atol=TOLERANCE)
|
|
172
|
-
assert lattice_a >= DEFAULT_NON_PERIODIC_MIN_LATTICE_SIZE
|
|
173
|
-
assert np.isclose(cell_vectors[0][0], cell_vectors[1][1], atol=TOLERANCE)
|
|
174
|
-
assert np.isclose(cell_vectors[0][0], cell_vectors[2][2], atol=TOLERANCE)
|
|
@@ -1,248 +0,0 @@
|
|
|
1
|
-
import pytest
|
|
2
|
-
from ase.build import bulk
|
|
3
|
-
from mat3ra.made.material import Material
|
|
4
|
-
from mat3ra.made.tools.build.compound_pristine_structures.two_dimensional.interface import get_optimal_film_displacement
|
|
5
|
-
from mat3ra.made.tools.build_components.metadata import MaterialWithBuildMetadata
|
|
6
|
-
from mat3ra.made.tools.calculate.calculators import InterfaceMaterialCalculator
|
|
7
|
-
from mat3ra.made.tools.convert import from_ase
|
|
8
|
-
from mat3ra.made.tools.convert.interface_parts_enum import InterfacePartsEnum
|
|
9
|
-
from mat3ra.made.tools.modify import (
|
|
10
|
-
add_vacuum,
|
|
11
|
-
filter_by_circle_projection,
|
|
12
|
-
filter_by_ids,
|
|
13
|
-
filter_by_label,
|
|
14
|
-
filter_by_layers,
|
|
15
|
-
filter_by_rectangle_projection,
|
|
16
|
-
filter_by_sphere,
|
|
17
|
-
filter_by_triangle_projection,
|
|
18
|
-
interface_displace_part,
|
|
19
|
-
remove_vacuum,
|
|
20
|
-
translate_to_z_level,
|
|
21
|
-
)
|
|
22
|
-
from mat3ra.made.tools.operations.core.unary import rotate
|
|
23
|
-
from mat3ra.utils import assertion as assertion_utils
|
|
24
|
-
|
|
25
|
-
from .fixtures.bulk import BULK_Si_CONVENTIONAL, BULK_Si_CONVENTIONAL_FILTERED
|
|
26
|
-
from .fixtures.interface.zsl import GRAPHENE_NICKEL_INTERFACE
|
|
27
|
-
from .fixtures.slab import SI_SLAB_001_2_ATOMS, SI_SLAB_001_WITH_VACUUM
|
|
28
|
-
from .utils import assert_two_entities_deep_almost_equal
|
|
29
|
-
|
|
30
|
-
COMMON_PART = {
|
|
31
|
-
"units": "crystal",
|
|
32
|
-
"labels": [],
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
expected_basis_layers_section = {
|
|
36
|
-
"elements": [
|
|
37
|
-
{"id": 0, "value": "Si"},
|
|
38
|
-
{"id": 3, "value": "Si"},
|
|
39
|
-
{"id": 5, "value": "Si"},
|
|
40
|
-
{"id": 6, "value": "Si"},
|
|
41
|
-
],
|
|
42
|
-
"coordinates": [
|
|
43
|
-
{"id": 0, "value": [0.5, 0.0, 0.0]},
|
|
44
|
-
{"id": 3, "value": [0.25, 0.75, 0.25]},
|
|
45
|
-
{"id": 5, "value": [0.75, 0.25, 0.25]},
|
|
46
|
-
{"id": 6, "value": [0.0, 0.5, 0.0]},
|
|
47
|
-
],
|
|
48
|
-
**COMMON_PART,
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
expected_basis_layers_cavity = {
|
|
52
|
-
"elements": [
|
|
53
|
-
{"id": 1, "value": "Si"},
|
|
54
|
-
{"id": 2, "value": "Si"},
|
|
55
|
-
{"id": 4, "value": "Si"},
|
|
56
|
-
{"id": 7, "value": "Si"},
|
|
57
|
-
],
|
|
58
|
-
"coordinates": [
|
|
59
|
-
{"id": 1, "value": [0.25, 0.25, 0.75]},
|
|
60
|
-
{"id": 2, "value": [0.5, 0.5, 0.5]},
|
|
61
|
-
{"id": 4, "value": [0.0, 0.0, 0.5]},
|
|
62
|
-
{"id": 7, "value": [0.75, 0.75, 0.75]},
|
|
63
|
-
],
|
|
64
|
-
**COMMON_PART,
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
expected_basis_sphere_cluster = {
|
|
69
|
-
"elements": [{"id": 2, "value": "Si"}],
|
|
70
|
-
"coordinates": [{"id": 2, "value": [0.5, 0.5, 0.5]}],
|
|
71
|
-
**COMMON_PART,
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
expected_basis_sphere_cavity = {
|
|
75
|
-
"elements": [
|
|
76
|
-
{"id": 0, "value": "Si"},
|
|
77
|
-
{"id": 1, "value": "Si"},
|
|
78
|
-
{"id": 3, "value": "Si"},
|
|
79
|
-
{"id": 4, "value": "Si"},
|
|
80
|
-
{"id": 5, "value": "Si"},
|
|
81
|
-
{"id": 6, "value": "Si"},
|
|
82
|
-
{"id": 7, "value": "Si"},
|
|
83
|
-
],
|
|
84
|
-
"coordinates": [
|
|
85
|
-
{"id": 0, "value": [0.5, 0.0, 0.0]},
|
|
86
|
-
{"id": 1, "value": [0.25, 0.25, 0.75]},
|
|
87
|
-
{"id": 3, "value": [0.25, 0.75, 0.25]},
|
|
88
|
-
{"id": 4, "value": [0.0, 0.0, 0.5]},
|
|
89
|
-
{"id": 5, "value": [0.75, 0.25, 0.25]},
|
|
90
|
-
{"id": 6, "value": [0.0, 0.5, 0.0]},
|
|
91
|
-
{"id": 7, "value": [0.75, 0.75, 0.75]},
|
|
92
|
-
],
|
|
93
|
-
**COMMON_PART,
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
CRYSTAL_RADIUS = 0.25 # in crystal coordinates
|
|
97
|
-
CRYSTAL_CENTER_3D = [0.5, 0.5, 0.5] # in crystal coordinates
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
def test_filter_by_ids():
|
|
101
|
-
material = Material.create(BULK_Si_CONVENTIONAL)
|
|
102
|
-
material_filtered = filter_by_ids(material, [0, 2])
|
|
103
|
-
# Move to fixtures
|
|
104
|
-
expected_material = Material.create(BULK_Si_CONVENTIONAL_FILTERED)
|
|
105
|
-
assert_two_entities_deep_almost_equal(material_filtered.basis, expected_material.basis)
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
def test_filter_by_label():
|
|
109
|
-
# TODO: create in fixtures
|
|
110
|
-
substrate = bulk("Si", cubic=True)
|
|
111
|
-
film = bulk("Cu", cubic=True)
|
|
112
|
-
interface_atoms = substrate + film
|
|
113
|
-
interface_atoms.set_tags([1] * len(substrate) + [2] * len(film))
|
|
114
|
-
material_interface = Material.create(from_ase(interface_atoms))
|
|
115
|
-
film_extracted = filter_by_label(material_interface, 2)
|
|
116
|
-
film_material = Material.create(from_ase(film))
|
|
117
|
-
|
|
118
|
-
# Ids of filtered elements will be missing, comparing the resulting values
|
|
119
|
-
assert [el for el in film_material.basis.elements.values] == [el for el in film_extracted.basis.elements.values]
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
def test_filter_by_layers():
|
|
123
|
-
material = Material.create(BULK_Si_CONVENTIONAL)
|
|
124
|
-
section = filter_by_layers(material=material, central_atom_id=0, layer_thickness=3.0)
|
|
125
|
-
cavity = filter_by_layers(material=material, central_atom_id=0, layer_thickness=3.0, invert_selection=True)
|
|
126
|
-
assert_two_entities_deep_almost_equal(section.basis, expected_basis_layers_section)
|
|
127
|
-
assert_two_entities_deep_almost_equal(cavity.basis, expected_basis_layers_cavity)
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
def test_filter_by_sphere():
|
|
131
|
-
material = Material.create(BULK_Si_CONVENTIONAL)
|
|
132
|
-
cluster = filter_by_sphere(material, center_coordinate=CRYSTAL_CENTER_3D, radius=CRYSTAL_RADIUS)
|
|
133
|
-
cavity = filter_by_sphere(material, center_coordinate=CRYSTAL_CENTER_3D, radius=CRYSTAL_RADIUS, invert=True)
|
|
134
|
-
assert_two_entities_deep_almost_equal(cluster.basis, expected_basis_sphere_cluster)
|
|
135
|
-
assert_two_entities_deep_almost_equal(cavity.basis, expected_basis_sphere_cavity)
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
def test_filter_by_circle_projection():
|
|
139
|
-
material = Material.create(BULK_Si_CONVENTIONAL)
|
|
140
|
-
# Small cylinder in the middle of the cell containing the central atom will be removed -- the same as with sphere
|
|
141
|
-
section = filter_by_circle_projection(material, 0.5, 0.5, CRYSTAL_RADIUS)
|
|
142
|
-
cavity = filter_by_circle_projection(material, 0.5, 0.5, CRYSTAL_RADIUS, invert_selection=True)
|
|
143
|
-
assert_two_entities_deep_almost_equal(section.basis, expected_basis_sphere_cluster)
|
|
144
|
-
assert_two_entities_deep_almost_equal(cavity.basis, expected_basis_sphere_cavity)
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
def test_filter_by_rectangle_projection():
|
|
148
|
-
material = Material.create(BULK_Si_CONVENTIONAL)
|
|
149
|
-
# Default will contain all the atoms
|
|
150
|
-
section = filter_by_rectangle_projection(material)
|
|
151
|
-
assert_two_entities_deep_almost_equal(material.basis, section.basis)
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
def test_filter_by_triangle_projection():
|
|
155
|
-
# Small prism in the middle of the cell containing the central atom will be removed -- the same as with sphere
|
|
156
|
-
material = Material.create(BULK_Si_CONVENTIONAL)
|
|
157
|
-
section = filter_by_triangle_projection(material, [0.4, 0.4], [0.4, 0.5], [0.5, 0.5])
|
|
158
|
-
cavity = filter_by_triangle_projection(material, [0.4, 0.4], [0.4, 0.5], [0.5, 0.5], invert_selection=True)
|
|
159
|
-
assert_two_entities_deep_almost_equal(section.basis, expected_basis_sphere_cluster)
|
|
160
|
-
assert_two_entities_deep_almost_equal(cavity.basis, expected_basis_sphere_cavity)
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
def test_add_vacuum():
|
|
164
|
-
material = Material.create(SI_SLAB_001_2_ATOMS)
|
|
165
|
-
material_with_vacuum = add_vacuum(material, 5.0)
|
|
166
|
-
assert_two_entities_deep_almost_equal(material_with_vacuum, SI_SLAB_001_WITH_VACUUM)
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
def test_remove_vacuum():
|
|
170
|
-
material_with_vacuum = Material.create(SI_SLAB_001_WITH_VACUUM)
|
|
171
|
-
vacuum = 7.368
|
|
172
|
-
material_with_no_vacuum = remove_vacuum(material_with_vacuum, from_top=True, from_bottom=True, fixed_padding=0)
|
|
173
|
-
expected_material = add_vacuum(material_with_no_vacuum, vacuum)
|
|
174
|
-
# to compare correctly, we need to translate the expected material to the bottom
|
|
175
|
-
# as it is effectively moved down when vacuum is removed (set to 0), use atol=1e-3 to account for the translation
|
|
176
|
-
reference_material = Material.create(SI_SLAB_001_2_ATOMS)
|
|
177
|
-
reference_material_translated_down = translate_to_z_level(reference_material, z_level="bottom")
|
|
178
|
-
# compare absolute coordinates
|
|
179
|
-
|
|
180
|
-
assert_two_entities_deep_almost_equal(expected_material, reference_material_translated_down, atol=1e-3)
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
@pytest.mark.parametrize(
|
|
184
|
-
"material_config, rotations",
|
|
185
|
-
[
|
|
186
|
-
(
|
|
187
|
-
SI_SLAB_001_2_ATOMS,
|
|
188
|
-
[([0, 0, 1], 180), ([1, 0, 0], 180)],
|
|
189
|
-
),
|
|
190
|
-
(
|
|
191
|
-
SI_SLAB_001_WITH_VACUUM,
|
|
192
|
-
[([1, 0, 0], 10)],
|
|
193
|
-
),
|
|
194
|
-
],
|
|
195
|
-
)
|
|
196
|
-
def test_rotate(material_config, rotations):
|
|
197
|
-
material = Material.create(material_config)
|
|
198
|
-
rotated_material = material
|
|
199
|
-
for axis, angle in rotations:
|
|
200
|
-
rotated_material = rotate(rotated_material, axis, angle)
|
|
201
|
-
assertion_utils.assert_deep_almost_equal(
|
|
202
|
-
material.basis.coordinates.values.sort(), rotated_material.basis.coordinates.values.sort()
|
|
203
|
-
)
|
|
204
|
-
assertion_utils.assert_deep_almost_equal(material.lattice, rotated_material.lattice)
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
def test_displace_interface():
|
|
208
|
-
material = Material.create(GRAPHENE_NICKEL_INTERFACE)
|
|
209
|
-
expected_coordinates = [
|
|
210
|
-
{"id": 0, "value": [0.999999, 0.999999, 0]},
|
|
211
|
-
{"id": 1, "value": [0.666665667, 0.666665667, 0.100960811]},
|
|
212
|
-
{"id": 2, "value": [0.333332333, 0.333332333, 0.201921319]},
|
|
213
|
-
{"id": 3, "value": [0.993759493, 0.093159552, 0.366525839]},
|
|
214
|
-
{"id": 4, "value": [0.660425493, 0.759826552, 0.366525839]},
|
|
215
|
-
]
|
|
216
|
-
|
|
217
|
-
expected_labels = GRAPHENE_NICKEL_INTERFACE["basis"]["labels"]
|
|
218
|
-
displaced_material = interface_displace_part(
|
|
219
|
-
material, [0.1, 0.2, 0.3], InterfacePartsEnum.FILM, use_cartesian_coordinates=True
|
|
220
|
-
)
|
|
221
|
-
assertion_utils.assert_deep_almost_equal(
|
|
222
|
-
expected_coordinates, displaced_material.basis.coordinates.to_dict(), atol=1e-6
|
|
223
|
-
)
|
|
224
|
-
assertion_utils.assert_deep_almost_equal(expected_labels, displaced_material.basis.labels.to_dict())
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
def test_displace_interface_optimized():
|
|
228
|
-
material = MaterialWithBuildMetadata.create(GRAPHENE_NICKEL_INTERFACE)
|
|
229
|
-
expected_coordinates = [
|
|
230
|
-
{"id": 0, "value": [0.999999, 0.999999, 3.03e-7]},
|
|
231
|
-
{"id": 1, "value": [0.666665667, 0.666665667, 0.100960811]},
|
|
232
|
-
{"id": 2, "value": [0.333332333, 0.333332333, 0.201921319]},
|
|
233
|
-
{"id": 3, "value": [0.11112456, 0.181143574, 0.351561882]},
|
|
234
|
-
{"id": 4, "value": [0.77779056, 0.847810574, 0.351561882]},
|
|
235
|
-
]
|
|
236
|
-
expected_labels = GRAPHENE_NICKEL_INTERFACE["basis"]["labels"]
|
|
237
|
-
|
|
238
|
-
optimal_displacement = get_optimal_film_displacement(
|
|
239
|
-
material,
|
|
240
|
-
calculator=InterfaceMaterialCalculator(),
|
|
241
|
-
grid_size_xy=(10, 10),
|
|
242
|
-
grid_range_x=(-0.5, 0.5),
|
|
243
|
-
grid_range_y=(-0.5, 0.5),
|
|
244
|
-
use_cartesian_coordinates=True,
|
|
245
|
-
)
|
|
246
|
-
displaced_material = interface_displace_part(material, optimal_displacement, use_cartesian_coordinates=True)
|
|
247
|
-
assertion_utils.assert_deep_almost_equal(expected_coordinates, displaced_material.basis.coordinates.to_dict())
|
|
248
|
-
assertion_utils.assert_deep_almost_equal(expected_labels, displaced_material.basis.labels.to_dict())
|
package/tests/py/unit/utils.py
DELETED
|
@@ -1,142 +0,0 @@
|
|
|
1
|
-
import copy
|
|
2
|
-
import difflib
|
|
3
|
-
import json
|
|
4
|
-
import sys
|
|
5
|
-
from enum import Enum
|
|
6
|
-
from typing import Any, Dict
|
|
7
|
-
|
|
8
|
-
from mat3ra.made.tools.convert import to_pymatgen
|
|
9
|
-
from mat3ra.made.tools.third_party import PymatgenAseAtomsAdaptor
|
|
10
|
-
from mat3ra.made.tools.utils import unwrap
|
|
11
|
-
from mat3ra.utils import assertion as assertion_utils
|
|
12
|
-
from pymatgen.analysis.structure_matcher import StructureMatcher
|
|
13
|
-
from pymatgen.core.structure import Structure
|
|
14
|
-
|
|
15
|
-
UPDATED_COORDINATE_TOLERANCE = 1e-6
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
class OSPlatform(Enum):
|
|
19
|
-
"""Platform enum for architecture-specific test handling."""
|
|
20
|
-
|
|
21
|
-
DARWIN = "darwin"
|
|
22
|
-
OTHER = "other"
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
def get_current_platform() -> OSPlatform:
|
|
26
|
-
return OSPlatform.DARWIN if sys.platform == "darwin" else OSPlatform.OTHER
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
def get_platform_specific_value(platform_values: Any) -> Any:
|
|
30
|
-
"""
|
|
31
|
-
Get platform-specific value for the test cases that are architecture-specific.
|
|
32
|
-
|
|
33
|
-
Args:
|
|
34
|
-
platform_values: Either a dictionary mapping TestPlatform to values, or any other value
|
|
35
|
-
|
|
36
|
-
Returns:
|
|
37
|
-
Platform-specific value if input is a platform dictionary, otherwise returns input unchanged
|
|
38
|
-
"""
|
|
39
|
-
if isinstance(platform_values, dict) and OSPlatform.DARWIN in platform_values:
|
|
40
|
-
current_platform = get_current_platform()
|
|
41
|
-
return platform_values[current_platform]
|
|
42
|
-
return platform_values
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
ATOMS_TAGS_TO_INTERFACE_STRUCTURE_LABELS: Dict = {1: "substrate", 2: "film"}
|
|
46
|
-
INTERFACE_STRUCTURE_LABELS_TO_ATOMS_TAGS: Dict = {v: k for k, v in ATOMS_TAGS_TO_INTERFACE_STRUCTURE_LABELS.items()}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
def atoms_to_interface_structure(atoms) -> Structure:
|
|
50
|
-
"""
|
|
51
|
-
Converts ASE Atoms object to pymatgen Interface object.
|
|
52
|
-
Args:
|
|
53
|
-
atoms (Atoms): The ASE Atoms object.
|
|
54
|
-
Returns:
|
|
55
|
-
Interface: The pymatgen Interface object.
|
|
56
|
-
"""
|
|
57
|
-
|
|
58
|
-
adaptor = PymatgenAseAtomsAdaptor()
|
|
59
|
-
interface_structure = adaptor.get_structure(atoms)
|
|
60
|
-
interface_structure.add_site_property(
|
|
61
|
-
"interface_label",
|
|
62
|
-
[ATOMS_TAGS_TO_INTERFACE_STRUCTURE_LABELS[tag] for tag in interface_structure.site_properties["tags"]],
|
|
63
|
-
)
|
|
64
|
-
return interface_structure
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
def prune_extra_keys(data: Any, reference: Any) -> Any:
|
|
68
|
-
if isinstance(data, dict) and isinstance(reference, dict):
|
|
69
|
-
return {key: prune_extra_keys(data[key], reference[key]) for key in data if key in reference}
|
|
70
|
-
elif isinstance(data, list) and isinstance(reference, list):
|
|
71
|
-
return [prune_extra_keys(d_item, r_item) for d_item, r_item in zip(data, reference)]
|
|
72
|
-
else:
|
|
73
|
-
return data
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
def sort_dict_recursively(d):
|
|
77
|
-
"""Sort dictionary keys recursively."""
|
|
78
|
-
if isinstance(d, dict):
|
|
79
|
-
return {k: sort_dict_recursively(v) for k, v in sorted(d.items())}
|
|
80
|
-
elif isinstance(d, list):
|
|
81
|
-
return [sort_dict_recursively(x) for x in d]
|
|
82
|
-
else:
|
|
83
|
-
return d
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
def show_difference(expected_data, actual_data):
|
|
87
|
-
diff = difflib.ndiff(
|
|
88
|
-
json.dumps(expected_data, indent=4).splitlines(),
|
|
89
|
-
json.dumps(actual_data, indent=4).splitlines(),
|
|
90
|
-
)
|
|
91
|
-
diff_str = "\n".join(diff)
|
|
92
|
-
# Filter out the lines that are the same
|
|
93
|
-
diff_str = "\n".join(line for line in diff_str.splitlines() if not line.startswith(" "))
|
|
94
|
-
if diff_str:
|
|
95
|
-
raise AssertionError(f"Entities differ:\n{diff_str}")
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
def assert_two_entities_deep_almost_equal(entity1, entity2, rtol=1e-5, atol=1e-9):
|
|
99
|
-
# First unwrap any nested schema objects
|
|
100
|
-
entity1 = unwrap(entity1)
|
|
101
|
-
entity2 = unwrap(entity2)
|
|
102
|
-
|
|
103
|
-
dict_1 = entity1 if isinstance(entity1, (dict, list)) else json.loads(entity1.to_json())
|
|
104
|
-
dict_2 = entity2 if isinstance(entity2, (dict, list)) else json.loads(entity2.to_json())
|
|
105
|
-
|
|
106
|
-
cleaned_dict_1 = prune_extra_keys(dict_1, dict_2)
|
|
107
|
-
|
|
108
|
-
sorted_dict_1 = sort_dict_recursively(cleaned_dict_1)
|
|
109
|
-
sorted_dict_2 = sort_dict_recursively(dict_2)
|
|
110
|
-
|
|
111
|
-
actual_data = json.loads(json.dumps(sorted_dict_1))
|
|
112
|
-
expected_data = json.loads(json.dumps(sorted_dict_2))
|
|
113
|
-
|
|
114
|
-
try:
|
|
115
|
-
assertion_utils.assert_deep_almost_equal(expected_data, actual_data, rtol=rtol, atol=atol)
|
|
116
|
-
except AssertionError as e:
|
|
117
|
-
show_difference(expected_data, actual_data)
|
|
118
|
-
raise e
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
def assert_interfaces_almost_equal(interface1: Any, interface2: Any) -> None:
|
|
122
|
-
"""
|
|
123
|
-
Assert that two interface structures are almost equal, checking bases permutation-invariantly.
|
|
124
|
-
"""
|
|
125
|
-
obj1 = unwrap(interface1)
|
|
126
|
-
obj2 = unwrap(interface2)
|
|
127
|
-
s1 = to_pymatgen(obj1)
|
|
128
|
-
s2 = to_pymatgen(obj2)
|
|
129
|
-
matcher = StructureMatcher(ltol=1e-3, stol=1e-3, angle_tol=0.1, primitive_cell=False, scale=False)
|
|
130
|
-
if not matcher.fit(s1, s2):
|
|
131
|
-
print("\n=== STRUCTURE MATCHER FAILED ===")
|
|
132
|
-
print("s1 (actual):\n", s1)
|
|
133
|
-
print("s2 (expected):\n", s2)
|
|
134
|
-
assert False, "Bases are not structurally equivalent"
|
|
135
|
-
dict_1 = copy.deepcopy(json.loads(obj1.to_json()))
|
|
136
|
-
dict_2 = copy.deepcopy(obj2 if isinstance(obj2, dict) else json.loads(obj2.to_json()))
|
|
137
|
-
# Remove name, basis, and coordinate hashes (fragile under translations, rotation, or wrapping)
|
|
138
|
-
for d in [dict_1, dict_2]:
|
|
139
|
-
for key in ["basis", "name", "hash", "scaledHash"]:
|
|
140
|
-
if key in d:
|
|
141
|
-
del d[key]
|
|
142
|
-
assert_two_entities_deep_almost_equal(dict_1, dict_2, atol=UPDATED_COORDINATE_TOLERANCE)
|
package/tsconfig-transpile.json
DELETED
package/tsconfig.json
DELETED