@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,66 +0,0 @@
|
|
|
1
|
-
import { Vector3DSchema } from "@mat3ra/esse/dist/js/types";
|
|
2
|
-
|
|
3
|
-
export type UnitCellProps = [
|
|
4
|
-
number,
|
|
5
|
-
number,
|
|
6
|
-
number,
|
|
7
|
-
number,
|
|
8
|
-
number,
|
|
9
|
-
number,
|
|
10
|
-
number,
|
|
11
|
-
number,
|
|
12
|
-
number,
|
|
13
|
-
string,
|
|
14
|
-
];
|
|
15
|
-
|
|
16
|
-
// TODO: refactor and remove the need for UnitCell
|
|
17
|
-
export class UnitCell {
|
|
18
|
-
ax: number;
|
|
19
|
-
|
|
20
|
-
ay: number;
|
|
21
|
-
|
|
22
|
-
az: number;
|
|
23
|
-
|
|
24
|
-
bx: number;
|
|
25
|
-
|
|
26
|
-
by: number;
|
|
27
|
-
|
|
28
|
-
bz: number;
|
|
29
|
-
|
|
30
|
-
cx: number;
|
|
31
|
-
|
|
32
|
-
cy: number;
|
|
33
|
-
|
|
34
|
-
cz: number;
|
|
35
|
-
|
|
36
|
-
units: string;
|
|
37
|
-
|
|
38
|
-
constructor([ax, ay, az, bx, by, bz, cx, cy, cz, units]: UnitCellProps) {
|
|
39
|
-
this.ax = ax;
|
|
40
|
-
this.ay = ay;
|
|
41
|
-
this.az = az;
|
|
42
|
-
this.bx = bx;
|
|
43
|
-
this.by = by;
|
|
44
|
-
this.bz = bz;
|
|
45
|
-
this.cx = cx;
|
|
46
|
-
this.cy = cy;
|
|
47
|
-
this.cz = cz;
|
|
48
|
-
this.units = units;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
vectorA(): Vector3DSchema {
|
|
52
|
-
return [this.ax, this.ay, this.az];
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
vectorB(): Vector3DSchema {
|
|
56
|
-
return [this.bx, this.by, this.bz];
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
vectorC(): Vector3DSchema {
|
|
60
|
-
return [this.cx, this.cy, this.cz];
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
axes(): [Vector3DSchema, Vector3DSchema, Vector3DSchema] {
|
|
64
|
-
return [this.vectorA(), this.vectorB(), this.vectorC()];
|
|
65
|
-
}
|
|
66
|
-
}
|
package/src/js/made.ts
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { Basis } from "./basis/basis";
|
|
2
|
-
import { Cell } from "./cell/cell";
|
|
3
|
-
import { ATOMIC_COORD_UNITS, coefficients, tolerance, units } from "./constants";
|
|
4
|
-
import { AtomicConstraints } from "./constraints/constraints";
|
|
5
|
-
import {
|
|
6
|
-
defaultNonPeriodicMinimumLatticeSize,
|
|
7
|
-
diatomicLatticePaddingFactor,
|
|
8
|
-
Lattice,
|
|
9
|
-
molecularLatticePaddingFactor,
|
|
10
|
-
} from "./lattice/lattice";
|
|
11
|
-
import { DEFAULT_LATTICE_UNITS, LATTICE_TYPE_CONFIGS } from "./lattice/lattice_types";
|
|
12
|
-
import { ReciprocalLattice } from "./lattice/reciprocal/lattice_reciprocal";
|
|
13
|
-
import { UnitCell } from "./lattice/unit_cell";
|
|
14
|
-
import { defaultMaterialConfig, Material } from "./material";
|
|
15
|
-
import parsers from "./parsers/parsers";
|
|
16
|
-
import tools from "./tools/index";
|
|
17
|
-
|
|
18
|
-
export const Made = {
|
|
19
|
-
coefficients,
|
|
20
|
-
tolerance,
|
|
21
|
-
units,
|
|
22
|
-
ATOMIC_COORD_UNITS,
|
|
23
|
-
|
|
24
|
-
Material,
|
|
25
|
-
defaultMaterialConfig,
|
|
26
|
-
Lattice,
|
|
27
|
-
Cell,
|
|
28
|
-
UnitCell,
|
|
29
|
-
defaultNonPeriodicMinimumLatticeSize,
|
|
30
|
-
diatomicLatticePaddingFactor,
|
|
31
|
-
molecularLatticePaddingFactor,
|
|
32
|
-
ReciprocalLattice,
|
|
33
|
-
Basis,
|
|
34
|
-
AtomicConstraints,
|
|
35
|
-
|
|
36
|
-
parsers,
|
|
37
|
-
tools,
|
|
38
|
-
LATTICE_TYPE_CONFIGS,
|
|
39
|
-
DEFAULT_LATTICE_UNITS,
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
export {
|
|
43
|
-
coefficients,
|
|
44
|
-
tolerance,
|
|
45
|
-
units,
|
|
46
|
-
ATOMIC_COORD_UNITS,
|
|
47
|
-
Material,
|
|
48
|
-
defaultMaterialConfig,
|
|
49
|
-
Lattice,
|
|
50
|
-
Cell,
|
|
51
|
-
UnitCell,
|
|
52
|
-
defaultNonPeriodicMinimumLatticeSize,
|
|
53
|
-
diatomicLatticePaddingFactor,
|
|
54
|
-
molecularLatticePaddingFactor,
|
|
55
|
-
ReciprocalLattice,
|
|
56
|
-
Basis,
|
|
57
|
-
AtomicConstraints,
|
|
58
|
-
parsers,
|
|
59
|
-
tools,
|
|
60
|
-
LATTICE_TYPE_CONFIGS,
|
|
61
|
-
DEFAULT_LATTICE_UNITS,
|
|
62
|
-
};
|
package/src/js/material.ts
DELETED
|
@@ -1,458 +0,0 @@
|
|
|
1
|
-
import { type DefaultableInMemoryEntity, InMemoryEntity } from "@mat3ra/code/dist/js/entity";
|
|
2
|
-
import { defaultableEntityMixin } from "@mat3ra/code/dist/js/entity/mixins/DefaultableMixin";
|
|
3
|
-
import {
|
|
4
|
-
type HasConsistencyChecks,
|
|
5
|
-
hasConsistencyChecksMixin,
|
|
6
|
-
} from "@mat3ra/code/dist/js/entity/mixins/HasConsistencyChecksMixin";
|
|
7
|
-
import {
|
|
8
|
-
type HasMetadata,
|
|
9
|
-
hasMetadataMixin,
|
|
10
|
-
} from "@mat3ra/code/dist/js/entity/mixins/HasMetadataMixin";
|
|
11
|
-
import type { AnyObject } from "@mat3ra/esse/dist/js/esse/types";
|
|
12
|
-
import type {
|
|
13
|
-
AtomicConstraintsSchema,
|
|
14
|
-
ConsistencyCheck,
|
|
15
|
-
DerivedPropertiesSchema,
|
|
16
|
-
FileSourceSchema,
|
|
17
|
-
InChIRepresentationSchema,
|
|
18
|
-
LatticeSchema,
|
|
19
|
-
MaterialSchema,
|
|
20
|
-
} from "@mat3ra/esse/dist/js/types";
|
|
21
|
-
import CryptoJS from "crypto-js";
|
|
22
|
-
|
|
23
|
-
import type { BasisConfig } from "./basis/basis";
|
|
24
|
-
import { type ConstrainedBasisConfig, ConstrainedBasis } from "./basis/constrained_basis";
|
|
25
|
-
import {
|
|
26
|
-
isConventionalCellSameAsPrimitiveForLatticeType,
|
|
27
|
-
PRIMITIVE_TO_CONVENTIONAL_CELL_LATTICE_TYPES,
|
|
28
|
-
PRIMITIVE_TO_CONVENTIONAL_CELL_MULTIPLIERS,
|
|
29
|
-
} from "./cell/conventional_cell";
|
|
30
|
-
import { Constraint } from "./constraints/constraints";
|
|
31
|
-
import { Lattice } from "./lattice/lattice";
|
|
32
|
-
import parsers from "./parsers/parsers";
|
|
33
|
-
import supercellTools from "./tools/supercell";
|
|
34
|
-
|
|
35
|
-
interface Material
|
|
36
|
-
extends HasConsistencyChecks,
|
|
37
|
-
DefaultableInMemoryEntity,
|
|
38
|
-
Required<HasMetadata<MaterialSchema["metadata"]>> {}
|
|
39
|
-
|
|
40
|
-
// TODO: remove in-line type creation
|
|
41
|
-
type MaterialSchemaWithConsistencyChecksAsString = Omit<MaterialSchema, "consistencyChecks"> & {
|
|
42
|
-
consistencyChecks?: ConsistencyCheck[];
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
type OptionallyConstrainedBasisConfig = BasisConfig &
|
|
46
|
-
Partial<Pick<ConstrainedBasisConfig, "constraints">>;
|
|
47
|
-
|
|
48
|
-
type Schema = MaterialSchemaWithConsistencyChecksAsString;
|
|
49
|
-
|
|
50
|
-
export const defaultMaterialConfig: MaterialSchema = {
|
|
51
|
-
name: "Silicon FCC",
|
|
52
|
-
basis: {
|
|
53
|
-
elements: [
|
|
54
|
-
{
|
|
55
|
-
id: 0,
|
|
56
|
-
value: "Si",
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
id: 1,
|
|
60
|
-
value: "Si",
|
|
61
|
-
},
|
|
62
|
-
],
|
|
63
|
-
coordinates: [
|
|
64
|
-
{
|
|
65
|
-
id: 0,
|
|
66
|
-
value: [0.0, 0.0, 0.0],
|
|
67
|
-
},
|
|
68
|
-
{
|
|
69
|
-
id: 1,
|
|
70
|
-
value: [0.25, 0.25, 0.25],
|
|
71
|
-
},
|
|
72
|
-
],
|
|
73
|
-
units: "crystal",
|
|
74
|
-
},
|
|
75
|
-
lattice: {
|
|
76
|
-
// Primitive cell for Diamond FCC Silicon at ambient conditions
|
|
77
|
-
type: "FCC",
|
|
78
|
-
a: 3.867,
|
|
79
|
-
b: 3.867,
|
|
80
|
-
c: 3.867,
|
|
81
|
-
alpha: 60,
|
|
82
|
-
beta: 60,
|
|
83
|
-
gamma: 60,
|
|
84
|
-
units: {
|
|
85
|
-
length: "angstrom",
|
|
86
|
-
angle: "degree",
|
|
87
|
-
},
|
|
88
|
-
},
|
|
89
|
-
metadata: {},
|
|
90
|
-
};
|
|
91
|
-
|
|
92
|
-
class Material extends InMemoryEntity implements Schema {
|
|
93
|
-
declare static createDefault: () => Material;
|
|
94
|
-
|
|
95
|
-
static get defaultConfig() {
|
|
96
|
-
return defaultMaterialConfig;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
static constructMaterialFileSource(
|
|
100
|
-
fileName: string,
|
|
101
|
-
fileContent: string,
|
|
102
|
-
fileExtension: string,
|
|
103
|
-
): FileSourceSchema {
|
|
104
|
-
return {
|
|
105
|
-
extension: fileExtension,
|
|
106
|
-
filename: fileName,
|
|
107
|
-
text: fileContent,
|
|
108
|
-
hash: CryptoJS.MD5(fileContent).toString(),
|
|
109
|
-
};
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
get name() {
|
|
113
|
-
return this.prop("name") ?? this.formula; // if name is not set, use formula, but keep empty string
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
set name(name: string) {
|
|
117
|
-
this.setProp("name", name);
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
get src() {
|
|
121
|
-
return this.prop("src");
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
set src(src: FileSourceSchema | undefined) {
|
|
125
|
-
this.setProp("src", src);
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
updateFormula() {
|
|
129
|
-
this.setProp("formula", this.Basis.formula);
|
|
130
|
-
this.setProp("unitCellFormula", this.Basis.unitCellFormula);
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
/**
|
|
134
|
-
* Gets Bolean value for whether or not a material is non-periodic vs periodic.
|
|
135
|
-
* False = periodic, True = non-periodic
|
|
136
|
-
*/
|
|
137
|
-
get isNonPeriodic(): boolean {
|
|
138
|
-
return this.prop("isNonPeriodic", false);
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
/**
|
|
142
|
-
* @summary Sets the value of isNonPeriodic based on Boolean value passed as an argument.
|
|
143
|
-
*/
|
|
144
|
-
set isNonPeriodic(bool: boolean) {
|
|
145
|
-
this.setProp("isNonPeriodic", bool);
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
/**
|
|
149
|
-
* @summary Returns the specific derived property (as specified by name) for a material.
|
|
150
|
-
*/
|
|
151
|
-
getDerivedPropertyByName(name: string) {
|
|
152
|
-
return this.getDerivedProperties().find((x) => x.name === name);
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
/**
|
|
156
|
-
* @summary Returns the derived properties array for a material.
|
|
157
|
-
*/
|
|
158
|
-
getDerivedProperties(): DerivedPropertiesSchema {
|
|
159
|
-
return this.prop("derivedProperties", []);
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
/**
|
|
163
|
-
* Gets material's formula
|
|
164
|
-
*/
|
|
165
|
-
get formula(): string {
|
|
166
|
-
return this.prop("formula") || this.Basis.formula;
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
get unitCellFormula(): string {
|
|
170
|
-
return this.prop("unitCellFormula") || this.Basis.unitCellFormula;
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
unsetFileProps() {
|
|
174
|
-
this.unsetProp("src");
|
|
175
|
-
this.unsetProp("icsdId");
|
|
176
|
-
this.unsetProp("external");
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
/**
|
|
180
|
-
* @param textOrObject Basis text or JSON object.
|
|
181
|
-
* @param format Format (xyz, etc.)
|
|
182
|
-
* @param unitz crystal/cartesian
|
|
183
|
-
*/
|
|
184
|
-
setBasis(textOrObject: string | BasisConfig, format?: string, unitz?: string) {
|
|
185
|
-
let basis: BasisConfig | undefined;
|
|
186
|
-
if (typeof textOrObject === "string" && format === "xyz") {
|
|
187
|
-
basis = parsers.xyz.toBasisConfig(textOrObject, unitz);
|
|
188
|
-
} else {
|
|
189
|
-
basis = textOrObject as BasisConfig;
|
|
190
|
-
}
|
|
191
|
-
this.setProp("basis", basis);
|
|
192
|
-
this.unsetFileProps();
|
|
193
|
-
this.updateFormula();
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
setBasisConstraints(constraints: Constraint[]) {
|
|
197
|
-
const basisWithConstraints = {
|
|
198
|
-
...this.basis,
|
|
199
|
-
constraints: constraints.map((c) => c.toJSON()),
|
|
200
|
-
};
|
|
201
|
-
this.setBasis(basisWithConstraints);
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
setBasisConstraintsFromArrayOfObjects(constraints: AtomicConstraintsSchema) {
|
|
205
|
-
const constraintsInstances = constraints.map((c) => {
|
|
206
|
-
return Constraint.fromValueAndId(c.value, c.id);
|
|
207
|
-
});
|
|
208
|
-
this.setBasisConstraints(constraintsInstances);
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
get basis() {
|
|
212
|
-
return this.requiredProp<OptionallyConstrainedBasisConfig>("basis");
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
// returns the instance of {ConstrainedBasis} class
|
|
216
|
-
get Basis() {
|
|
217
|
-
const basisData = this.basis;
|
|
218
|
-
|
|
219
|
-
return new ConstrainedBasis({
|
|
220
|
-
...basisData,
|
|
221
|
-
cell: this.Lattice.vectors,
|
|
222
|
-
constraints: basisData.constraints || [],
|
|
223
|
-
});
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
/**
|
|
227
|
-
* High-level access to unique elements from material instead of basis.
|
|
228
|
-
*/
|
|
229
|
-
get uniqueElements() {
|
|
230
|
-
return this.Basis.uniqueElements;
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
get lattice(): LatticeSchema {
|
|
234
|
-
return this.prop("lattice") as LatticeSchema;
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
set lattice(config: LatticeSchema) {
|
|
238
|
-
const originalIsInCrystalUnits = this.Basis.isInCrystalUnits;
|
|
239
|
-
const basis = this.Basis;
|
|
240
|
-
basis.toCartesian();
|
|
241
|
-
|
|
242
|
-
const newLattice = new Lattice(config);
|
|
243
|
-
basis.cell = newLattice.vectors;
|
|
244
|
-
if (originalIsInCrystalUnits) basis.toCrystal();
|
|
245
|
-
|
|
246
|
-
// Preserve all properties from the original basis to ensure constraints are included
|
|
247
|
-
const newBasisConfig = basis.toJSON();
|
|
248
|
-
this.setProp("basis", newBasisConfig);
|
|
249
|
-
this.setProp("lattice", config);
|
|
250
|
-
|
|
251
|
-
this.unsetFileProps();
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
get Lattice(): Lattice {
|
|
255
|
-
return new Lattice(this.lattice);
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
/**
|
|
259
|
-
* Returns the inchi string from the derivedProperties for a non-periodic material, or throws an error if the
|
|
260
|
-
* inchi cannot be found.
|
|
261
|
-
* @returns {String}
|
|
262
|
-
*/
|
|
263
|
-
getInchiStringForHash(): string {
|
|
264
|
-
const inchi = this.getDerivedPropertyByName("inchi");
|
|
265
|
-
if (inchi) {
|
|
266
|
-
return (inchi as InChIRepresentationSchema).value;
|
|
267
|
-
}
|
|
268
|
-
throw new Error("Hash cannot be created. Missing InChI string in derivedProperties");
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
/**
|
|
272
|
-
* Calculates hash from basis and lattice. Algorithm expects the following:
|
|
273
|
-
* - asserts lattice units to be angstrom
|
|
274
|
-
* - asserts basis units to be crystal
|
|
275
|
-
* - asserts basis coordinates and lattice measurements are rounded to hash precision
|
|
276
|
-
* - forms strings for lattice and basis
|
|
277
|
-
* - creates MD5 hash from basisStr + latticeStr + salt
|
|
278
|
-
* @param salt Salt for hashing, empty string by default.
|
|
279
|
-
* @param isScaled Whether to scale the lattice parameter 'a' to 1.
|
|
280
|
-
*/
|
|
281
|
-
calculateHash(salt = "", isScaled = false, bypassNonPeriodicCheck = false): string {
|
|
282
|
-
let message;
|
|
283
|
-
if (!this.isNonPeriodic || bypassNonPeriodicCheck) {
|
|
284
|
-
message =
|
|
285
|
-
this.Basis.hashString + "#" + this.Lattice.getHashString(isScaled) + "#" + salt;
|
|
286
|
-
} else {
|
|
287
|
-
message = this.getInchiStringForHash();
|
|
288
|
-
}
|
|
289
|
-
return CryptoJS.MD5(message).toString();
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
set hash(hash: string) {
|
|
293
|
-
this.setProp("hash", hash);
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
get hash(): string {
|
|
297
|
-
return this.prop("hash") as string;
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
/**
|
|
301
|
-
* Calculates hash from basis and lattice as above + scales lattice properties to make lattice.a = 1
|
|
302
|
-
*/
|
|
303
|
-
get scaledHash(): string {
|
|
304
|
-
return this.calculateHash("", true);
|
|
305
|
-
}
|
|
306
|
-
|
|
307
|
-
get external() {
|
|
308
|
-
return this.prop<MaterialSchema["external"]>("external");
|
|
309
|
-
}
|
|
310
|
-
|
|
311
|
-
set external(external: MaterialSchema["external"]) {
|
|
312
|
-
this.setProp("external", external);
|
|
313
|
-
}
|
|
314
|
-
|
|
315
|
-
/**
|
|
316
|
-
* Converts basis to crystal/fractional coordinates.
|
|
317
|
-
*/
|
|
318
|
-
toCrystal() {
|
|
319
|
-
const basis = this.Basis;
|
|
320
|
-
basis.toCrystal();
|
|
321
|
-
this.setProp("basis", basis.toJSON());
|
|
322
|
-
}
|
|
323
|
-
|
|
324
|
-
/**
|
|
325
|
-
* Converts current material's basis coordinates to cartesian.
|
|
326
|
-
* No changes if coordinates already cartesian.
|
|
327
|
-
*/
|
|
328
|
-
toCartesian() {
|
|
329
|
-
const basis = this.Basis;
|
|
330
|
-
basis.toCartesian();
|
|
331
|
-
this.setProp("basis", basis.toJSON());
|
|
332
|
-
}
|
|
333
|
-
|
|
334
|
-
/**
|
|
335
|
-
* Returns material's basis in XYZ format.
|
|
336
|
-
*/
|
|
337
|
-
getBasisAsXyz(fractional = false): string {
|
|
338
|
-
return parsers.xyz.fromMaterial(this.toJSON(), fractional);
|
|
339
|
-
}
|
|
340
|
-
|
|
341
|
-
/**
|
|
342
|
-
* Returns material in Quantum Espresso output format:
|
|
343
|
-
* ```
|
|
344
|
-
* CELL_PARAMETERS (angstroms)
|
|
345
|
-
* -0.543131284 -0.000000000 0.543131284
|
|
346
|
-
* -0.000000000 0.543131284 0.543131284
|
|
347
|
-
* -0.543131284 0.543131284 0.000000000
|
|
348
|
-
*
|
|
349
|
-
* ATOMIC_POSITIONS (crystal)
|
|
350
|
-
* Si 0.000000000 0.000000000 -0.000000000
|
|
351
|
-
* Si 0.250000000 0.250000000 0.250000000
|
|
352
|
-
* ```
|
|
353
|
-
*/
|
|
354
|
-
getAsQEFormat(): string {
|
|
355
|
-
return parsers.espresso.toEspressoFormat(this.toJSON());
|
|
356
|
-
}
|
|
357
|
-
|
|
358
|
-
/**
|
|
359
|
-
* Returns material in POSCAR format. Pass `true` to ignore original poscar source and re-serialize.
|
|
360
|
-
*/
|
|
361
|
-
getAsPOSCAR(ignoreOriginal = false, omitConstraints = false): string {
|
|
362
|
-
// By default return original source if exists
|
|
363
|
-
if (this.src?.extension === "poscar" && !ignoreOriginal) {
|
|
364
|
-
return this.src.text;
|
|
365
|
-
}
|
|
366
|
-
return parsers.poscar.toPoscar(this.toJSON(), omitConstraints);
|
|
367
|
-
}
|
|
368
|
-
|
|
369
|
-
/**
|
|
370
|
-
* Returns a copy of the material with conventional cell constructed instead of primitive.
|
|
371
|
-
*/
|
|
372
|
-
getACopyWithConventionalCell(): this {
|
|
373
|
-
const material = this.clone();
|
|
374
|
-
|
|
375
|
-
// if conventional and primitive cells are the same => return a copy.
|
|
376
|
-
if (isConventionalCellSameAsPrimitiveForLatticeType(this.Lattice.type)) {
|
|
377
|
-
return material;
|
|
378
|
-
}
|
|
379
|
-
|
|
380
|
-
const conventionalSupercellMatrix =
|
|
381
|
-
PRIMITIVE_TO_CONVENTIONAL_CELL_MULTIPLIERS[this.Lattice.type];
|
|
382
|
-
const conventionalLatticeType =
|
|
383
|
-
PRIMITIVE_TO_CONVENTIONAL_CELL_LATTICE_TYPES[this.Lattice.type];
|
|
384
|
-
const config = supercellTools.generateConfig(this, conventionalSupercellMatrix);
|
|
385
|
-
|
|
386
|
-
config.lattice.type = conventionalLatticeType;
|
|
387
|
-
config.name = `${this.name} - conventional cell`;
|
|
388
|
-
|
|
389
|
-
// @ts-expect-error
|
|
390
|
-
return new this.constructor(config) as this;
|
|
391
|
-
}
|
|
392
|
-
|
|
393
|
-
/**
|
|
394
|
-
* @summary a series of checks for the material and returns an array of results in ConsistencyChecks format.
|
|
395
|
-
* @returns Array of checks results
|
|
396
|
-
*/
|
|
397
|
-
getConsistencyChecks(): ConsistencyCheck[] {
|
|
398
|
-
const basisChecks = this.getBasisConsistencyChecks();
|
|
399
|
-
|
|
400
|
-
// any other Material checks can be added here
|
|
401
|
-
|
|
402
|
-
return basisChecks;
|
|
403
|
-
}
|
|
404
|
-
|
|
405
|
-
/**
|
|
406
|
-
* @summary a series of checks for the material's basis and returns an array of results in ConsistencyChecks format.
|
|
407
|
-
* @returns Array of checks results
|
|
408
|
-
*/
|
|
409
|
-
getBasisConsistencyChecks(): ConsistencyCheck[] {
|
|
410
|
-
const checks: ConsistencyCheck[] = [];
|
|
411
|
-
const limit = 1000;
|
|
412
|
-
const basis = this.Basis;
|
|
413
|
-
|
|
414
|
-
if (this.Basis.elements.length < limit) {
|
|
415
|
-
const overlappingAtomsGroups = basis.getOverlappingAtoms();
|
|
416
|
-
overlappingAtomsGroups.forEach(({ id1, id2, element1, element2 }) => {
|
|
417
|
-
checks.push(
|
|
418
|
-
{
|
|
419
|
-
key: `basis.coordinates.${id1}`,
|
|
420
|
-
name: "atomsOverlap",
|
|
421
|
-
severity: "warning",
|
|
422
|
-
message: `Atom ${element1} is too close to ${element2} at position ${
|
|
423
|
-
id2 + 1
|
|
424
|
-
}`,
|
|
425
|
-
},
|
|
426
|
-
{
|
|
427
|
-
key: `basis.coordinates.${id2}`,
|
|
428
|
-
name: "atomsOverlap",
|
|
429
|
-
severity: "warning",
|
|
430
|
-
message: `Atom ${element2} is too close to ${element1} at position ${
|
|
431
|
-
id1 + 1
|
|
432
|
-
}`,
|
|
433
|
-
},
|
|
434
|
-
);
|
|
435
|
-
});
|
|
436
|
-
}
|
|
437
|
-
|
|
438
|
-
return checks;
|
|
439
|
-
}
|
|
440
|
-
|
|
441
|
-
toJSON(): MaterialSchema & AnyObject {
|
|
442
|
-
// validation intoJSON() method will fail if name is not set in _json
|
|
443
|
-
this.name = this.name || this.formula;
|
|
444
|
-
|
|
445
|
-
return {
|
|
446
|
-
...(super.toJSON() as MaterialSchema & AnyObject),
|
|
447
|
-
lattice: this.Lattice.toJSON(),
|
|
448
|
-
basis: this.Basis.toJSON(),
|
|
449
|
-
isNonPeriodic: this.isNonPeriodic,
|
|
450
|
-
};
|
|
451
|
-
}
|
|
452
|
-
}
|
|
453
|
-
|
|
454
|
-
defaultableEntityMixin(Material);
|
|
455
|
-
hasConsistencyChecksMixin(Material.prototype);
|
|
456
|
-
hasMetadataMixin(Material.prototype);
|
|
457
|
-
|
|
458
|
-
export { Material };
|
package/src/js/parsers/cif.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
export interface Meta {
|
|
2
|
-
icsdId?: number;
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Extracts meta information from a CIF file
|
|
7
|
-
* @param txt - CIF file text.
|
|
8
|
-
*/
|
|
9
|
-
function parseMeta(txt: string): Meta {
|
|
10
|
-
const REGEX = {
|
|
11
|
-
ICSD_ID: /_database_code_ICSD\s+(\d+)/,
|
|
12
|
-
};
|
|
13
|
-
const meta: Meta = {};
|
|
14
|
-
const groups = txt.match(REGEX.ICSD_ID);
|
|
15
|
-
|
|
16
|
-
if (groups) {
|
|
17
|
-
meta.icsdId = Number(groups[1]);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
return meta;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export default {
|
|
24
|
-
parseMeta,
|
|
25
|
-
};
|
package/src/js/parsers/errors.ts
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { MaterialSchema } from "@mat3ra/esse/dist/js/types";
|
|
2
|
-
import { map } from "lodash";
|
|
3
|
-
import s from "underscore.string";
|
|
4
|
-
|
|
5
|
-
import { Lattice } from "../lattice/lattice";
|
|
6
|
-
import xyz from "./xyz";
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Construct textual representation of a materialOrConfig according to Quantum ESPRESSO pw.x input format.
|
|
10
|
-
* @param materialOrConfig - material class instance or its config object
|
|
11
|
-
*/
|
|
12
|
-
function toEspressoFormat(materialOrConfig: MaterialSchema): string {
|
|
13
|
-
const l = new Lattice(materialOrConfig.lattice);
|
|
14
|
-
const vectors = l.vectorArrays;
|
|
15
|
-
const vectorsAsString = map(vectors, (v) => {
|
|
16
|
-
return `${s.sprintf("%14.9f", v[0])}\t${s.sprintf("%14.9f", v[1])}\t${s.sprintf(
|
|
17
|
-
"%14.9f",
|
|
18
|
-
v[2],
|
|
19
|
-
)}`;
|
|
20
|
-
}).join("\n");
|
|
21
|
-
return s.sprintf(
|
|
22
|
-
"CELL_PARAMETERS (angstroms)\n%s\n\nATOMIC_POSITIONS (crystal)\n%s",
|
|
23
|
-
vectorsAsString,
|
|
24
|
-
xyz.fromMaterial(materialOrConfig),
|
|
25
|
-
);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export default {
|
|
29
|
-
toEspressoFormat,
|
|
30
|
-
};
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import Poscar from "./poscar";
|
|
2
|
-
|
|
3
|
-
const NATIVE_FORMAT = {
|
|
4
|
-
JSON: "json",
|
|
5
|
-
POSCAR: "poscar",
|
|
6
|
-
CIF: "cif",
|
|
7
|
-
PWX: "pwx",
|
|
8
|
-
XYZ: "xyz",
|
|
9
|
-
UNKNOWN: "unknown",
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* @summary Detects the format of the input string
|
|
14
|
-
* @throws {Error} - If the input string is unknown format
|
|
15
|
-
* @param {string} text - input string to detect format
|
|
16
|
-
* @returns {NATIVE_FORMAT} - Format of the input string
|
|
17
|
-
*/
|
|
18
|
-
function detectFormat(text: string) {
|
|
19
|
-
const jsonRegex = /^\s*\{/;
|
|
20
|
-
if (jsonRegex.test(text)) return NATIVE_FORMAT.JSON;
|
|
21
|
-
if (Poscar.isPoscar(text)) return NATIVE_FORMAT.POSCAR;
|
|
22
|
-
|
|
23
|
-
return NATIVE_FORMAT.UNKNOWN;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* @summary Function to handle conversion from native formats
|
|
28
|
-
* @param {String} text - input string to detect format and convert
|
|
29
|
-
* @throws {Error} - If the input string is of unknown format
|
|
30
|
-
* @return {Object} - Material config
|
|
31
|
-
*/
|
|
32
|
-
function convertFromNativeFormat(text: string) {
|
|
33
|
-
const format = detectFormat(text);
|
|
34
|
-
|
|
35
|
-
switch (format) {
|
|
36
|
-
case NATIVE_FORMAT.JSON:
|
|
37
|
-
return JSON.parse(text);
|
|
38
|
-
case NATIVE_FORMAT.POSCAR:
|
|
39
|
-
return Poscar.fromPoscar(text);
|
|
40
|
-
case NATIVE_FORMAT.UNKNOWN:
|
|
41
|
-
throw new Error(`Unknown format`);
|
|
42
|
-
// TODO: add more formats
|
|
43
|
-
default:
|
|
44
|
-
throw new Error(`Unsupported format: ${format}`);
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
export default {
|
|
49
|
-
detectFormat,
|
|
50
|
-
convertFromNativeFormat,
|
|
51
|
-
};
|