Skip to content

typing

typing

This module defines type classes for the inversion_solution package.

ModelLogicTreeBranch

Bases: Protocol

A protocol class representing a branch in the model logic tree.

Attributes:

Name Type Description
values List[Any]

A list of values associated with the branch.

weight float

The weight of the branch in the logic tree.

onfault_nrml_id Optional[str]

An optional string identifier for the on-fault branch.

distributed_nrml_id Optional[str]

An optional string identifier for the distributed branch.

inversion_solution_id Optional[str]

An optional string identifier for the inversion solution.

inversion_solution_type Optional[str]

An optional string specifying the type of inversion solution.

Source code in solvis/solution/typing.py
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
class ModelLogicTreeBranch(Protocol):
    """A protocol class representing a branch in the model logic tree.

    Attributes:
        values: A list of values associated with the branch.
        weight: The weight of the branch in the logic tree.
        onfault_nrml_id: An optional string identifier for the on-fault branch.
        distributed_nrml_id: An optional string identifier for the distributed branch.
        inversion_solution_id: An optional string identifier for the inversion solution.
        inversion_solution_type: An optional string specifying the type of inversion solution.
    """

    values: List[Any]
    weight: float
    onfault_nrml_id: Optional[str] = ""
    distributed_nrml_id: Optional[str] = ""
    inversion_solution_id: Optional[str] = ""
    inversion_solution_type: Optional[str] = ""

distributed_nrml_id: Optional[str] = '' class-attribute instance-attribute

inversion_solution_id: Optional[str] = '' class-attribute instance-attribute

inversion_solution_type: Optional[str] = '' class-attribute instance-attribute

onfault_nrml_id: Optional[str] = '' class-attribute instance-attribute

values: List[Any] instance-attribute

weight: float instance-attribute

SetOperationEnum

Bases: Enum

Enumerated type for common set operations.

Attributes:

Name Type Description
UNION int

Represents the union operation.

INTERSECTION int

Represents the intersection operation.

DIFFERENCE int

Represents the difference operation.

SYMMETRIC_DIFFERENCE int

Represents the symmetric difference operation.

Source code in solvis/solution/typing.py
27
28
29
30
31
32
33
34
35
36
37
38
39
40
class SetOperationEnum(Enum):
    """Enumerated type for common set operations.

    Attributes:
        UNION (int): Represents the union operation.
        INTERSECTION (int): Represents the intersection operation.
        DIFFERENCE (int): Represents the difference operation.
        SYMMETRIC_DIFFERENCE (int): Represents the symmetric difference operation.
    """

    UNION = 1
    INTERSECTION = 2
    DIFFERENCE = 3
    SYMMETRIC_DIFFERENCE = 4

DIFFERENCE = 3 class-attribute instance-attribute

INTERSECTION = 2 class-attribute instance-attribute

SYMMETRIC_DIFFERENCE = 4 class-attribute instance-attribute

UNION = 1 class-attribute instance-attribute