Skip to content

Status

This part of the project documentation focuses on an information-oriented approach. Use it as a reference for the technical implementation of the pact_methodology project code.

ProductFootprintStatus

Represents the status information of a product footprint, including the status and an optional comment.

Attributes:

Name Type Description
status Status

The status of the product footprint.

comment str | None

An optional comment describing the status.

Examples:

>>> status_info = ProductFootprintStatus(status=Status.ACTIVE, comment="Active comment")
>>> status_info.status
<Status.ACTIVE: 'Active'>
>>> status_info.comment
'Active comment'
Source code in pact_methodology/product_footprint/status.py
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
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
class ProductFootprintStatus:
    """
    Represents the status information of a product footprint, including the status and an optional comment.

    Attributes:
        status (Status): The status of the product footprint.
        comment (str | None): An optional comment describing the status.

    Examples:
        >>> status_info = ProductFootprintStatus(status=Status.ACTIVE, comment="Active comment")
        >>> status_info.status
        <Status.ACTIVE: 'Active'>
        >>> status_info.comment
        'Active comment'
    """

    def __init__(self, status: Status, comment: str | None = None):
        """
        Initializes a new ProductFootprintStatus instance.

        Args:
            status (Status): The status of the product footprint.
            comment (str | None): An optional comment describing the status.

        Raises:
            ValueError: If status is not an instance of Status or comment is not a string or None.
        """
        self.status = status
        self.comment = comment

    @property
    def status(self):
        """Gets the status of the product footprint."""
        return self._status

    @status.setter
    def status(self, value):
        """Sets the status of the product footprint.

        Args:
            value (Status): The status to set.

        Raises:
            ValueError: If value is not an instance of Status.

        Examples:
            >>> status_info = ProductFootprintStatus(status=Status.ACTIVE)
            >>> status_info.status = Status.DEPRECATED
            >>> status_info.status
            <Status.DEPRECATED: 'Deprecated'>
        """
        if not isinstance(value, Status):
            raise ValueError("status must be an instance of Status")
        self._status = value

    @property
    def comment(self):
        """Gets the comment describing the status of the product footprint."""
        return self._comment

    @comment.setter
    def comment(self, value):
        """Sets the comment describing the status of the product footprint.

        Args:
            value (str | None): The status comment to set.

        Raises:
            ValueError: If value is not a string or None.

        Examples:
            >>> status_info = ProductFootprintStatus(status=Status.ACTIVE)
            >>> status_info.comment = "New comment"
            >>> status_info.comment
            'New comment'
        """
        if value is not None and not isinstance(value, str):
            raise ValueError("comment must be a string or None")
        self._comment = value

comment property writable

Gets the comment describing the status of the product footprint.

status property writable

Gets the status of the product footprint.

__init__(status, comment=None)

Initializes a new ProductFootprintStatus instance.

Parameters:

Name Type Description Default
status Status

The status of the product footprint.

required
comment str | None

An optional comment describing the status.

None

Raises:

Type Description
ValueError

If status is not an instance of Status or comment is not a string or None.

Source code in pact_methodology/product_footprint/status.py
36
37
38
39
40
41
42
43
44
45
46
47
48
def __init__(self, status: Status, comment: str | None = None):
    """
    Initializes a new ProductFootprintStatus instance.

    Args:
        status (Status): The status of the product footprint.
        comment (str | None): An optional comment describing the status.

    Raises:
        ValueError: If status is not an instance of Status or comment is not a string or None.
    """
    self.status = status
    self.comment = comment

Status

Bases: Enum

Enumeration of possible statuses for a product footprint.

Attributes:

Name Type Description
ACTIVE str

The product footprint is active and can be used by data recipients.

DEPRECATED str

The product footprint is deprecated and should not be used.

Examples:

>>> Status.ACTIVE.value
'Active'
>>> Status.DEPRECATED.value
'Deprecated'
Source code in pact_methodology/product_footprint/status.py
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
class Status(Enum):
    """
    Enumeration of possible statuses for a product footprint.

    Attributes:
        ACTIVE (str): The product footprint is active and can be used by data recipients.
        DEPRECATED (str): The product footprint is deprecated and should not be used.

    Examples:
        >>> Status.ACTIVE.value
        'Active'
        >>> Status.DEPRECATED.value
        'Deprecated'
    """
    ACTIVE = "Active"
    DEPRECATED = "Deprecated"