Models - Docs

Skip to content

# Models

Models for the PreFab library.

## `Fab`

Bases: `BaseModel`

Represents a fabrication process in the PreFab model library.

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`foundry` | `str` | The name of the foundry where the fabrication process takes place. | required
`process` | `str` | The specific process used in the fabrication. | required
`material` | `str` | The material used in the fabrication process. | required
`technology` | `str` | The technology used in the fabrication process. | required
`thickness` | `int` | The thickness of the material used, measured in nanometers. | required
`has_sidewall` | `bool` | Indicates whether the fabrication has angled sidewalls. | required

Source code in `prefab/models.py`

     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
    class Fab(BaseModel):
        """
        Represents a fabrication process in the PreFab model library.

        Parameters
        ----------
        foundry : str
            The name of the foundry where the fabrication process takes place.
        process : str
            The specific process used in the fabrication.
        material : str
            The material used in the fabrication process.
        technology : str
            The technology used in the fabrication process.
        thickness : int
            The thickness of the material used, measured in nanometers.
        has_sidewall : bool
            Indicates whether the fabrication has angled sidewalls.
        """

        foundry: str
        process: str
        material: str
        technology: str
        thickness: int
        has_sidewall: bool

## `Model`

Bases: `BaseModel`

Represents a model of a fabrication process including versioning and dataset detail.

Attributes:

Name | Type | Description
--- | --- | ---
`fab` | `Fab` | An instance of the Fab class representing the fabrication details.
`version` | `str` | The version identifier of the model.
`version_date` | `date` | The release date of this version of the model.
`dataset` | `str` | The identifier for the dataset used in this model.
`dataset_date` | `date` | The date when the dataset was last updated or released.
`tag` | `str` | An optional tag for additional categorization or notes.

Methods:

Name | Description
--- | ---
`to_json` | Serializes the model instance to a JSON formatted string.

Source code in `prefab/models.py`

    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    class Model(BaseModel):
        """
        Represents a model of a fabrication process including versioning and dataset detail.

        Attributes
        ----------
        fab : Fab
            An instance of the Fab class representing the fabrication details.
        version : str
            The version identifier of the model.
        version_date : date
            The release date of this version of the model.
        dataset : str
            The identifier for the dataset used in this model.
        dataset_date : date
            The date when the dataset was last updated or released.
        tag : str
            An optional tag for additional categorization or notes.

        Methods
        -------
        to_json()
            Serializes the model instance to a JSON formatted string.
        """

        fab: Fab
        version: str
        version_date: date
        dataset: str
        dataset_date: date
        tag: str

        def to_json(self):
            return json.dumps(self.dict(), default=str)