File: similarity.py

package info (click to toggle)
python-emmet-core 0.84.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 77,220 kB
  • sloc: python: 16,355; makefile: 30
file content (45 lines) | stat: -rw-r--r-- 1,177 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
from typing import List, Optional

from pydantic import BaseModel, Field


class SimilarityEntry(BaseModel):
    """
    Find similar materials to a specified material based on crystal geometry.
    """

    task_id: Optional[str] = Field(
        None,
        description="The Materials Project ID for the matched material. This comes in the form: mp-******.",
    )

    nelements: Optional[int] = Field(
        None,
        description="Number of elements in the matched material.",
    )

    dissimilarity: Optional[float] = Field(
        None,
        description="Dissimilarity measure for the matched material in %.",
    )

    formula: Optional[str] = Field(
        None,
        description="Formula of the matched material.",
    )


class SimilarityDoc(BaseModel):
    """
    Model for a document containing structure similarity data
    """

    sim: Optional[List[SimilarityEntry]] = Field(
        None,
        description="List containing similar structure data for a given material.",
    )

    material_id: Optional[str] = Field(
        None,
        description="The Materials Project ID for the material. This comes in the form: mp-******",
    )