Data Quality Rating
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.
Data Quality Ratings (DQRs) are used to assess the quality of data used in Pathfinder Framework calculations. These ratings are applied to different aspects of data quality, such as technological representativeness, temporal representativeness, geographical representativeness, completeness, and reliability.
Each DQR is represented as an integer value between 1 and 3 (inclusive), following the Pathfinder Framework guidelines. A higher DQR indicates higher data quality.
This module provides the DataQualityRating
class to encapsulate and validate DQR values.
DataQualityRating
dataclass
Represents a data quality rating for a specific aspect of data quality.
Attributes:
Name | Type | Description |
---|---|---|
rating |
int
|
The data quality rating, an integer between 1 and 3 (inclusive). |
Examples:
>>> dqr = DataQualityRating(3)
>>> dqr.rating
3
>>> str(dqr)
'3'
Source code in pact_methodology/data_quality_indicators/data_quality_rating.py
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 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 |
|
__post_init__()
Validates the data quality rating upon initialization.
Raises:
Type | Description |
---|---|
TypeError
|
If the rating is not an integer. |
ValueError
|
If the rating is not between 1 and 3 (inclusive). |
Examples:
>>> DataQualityRating(2)
DataQualityRating(2)
>>> DataQualityRating(4)
Traceback (most recent call last):
...
ValueError: Data quality rating must be between 1 and 3 (inclusive)
Source code in pact_methodology/data_quality_indicators/data_quality_rating.py
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
|
__repr__()
Returns the official string representation of the data quality rating.
Returns:
Name | Type | Description |
---|---|---|
str |
The official string representation of the rating. |
Examples:
>>> dqr = DataQualityRating(2)
>>> repr(dqr)
'DataQualityRating(2)'
Source code in pact_methodology/data_quality_indicators/data_quality_rating.py
68 69 70 71 72 73 74 75 76 77 78 79 80 |
|
__str__()
Returns the string representation of the data quality rating.
Returns:
Name | Type | Description |
---|---|---|
str |
The string representation of the rating. |
Examples:
>>> dqr = DataQualityRating(1)
>>> str(dqr)
'1'
Source code in pact_methodology/data_quality_indicators/data_quality_rating.py
54 55 56 57 58 59 60 61 62 63 64 65 66 |
|