Inspection is the process by which an ADRIO fetches data and analyzes its quality. The simplest way to use an InspectionResult is to print it!
The result encapsulates the source data, the processed result data, and any outstanding data issues. ADRIOs will provide methods for correcting these issues as is appropriate for the task, but often these will be optional. A result which contains unresolved data issues will be represented as a masked numpy array. Values which are not impacted by any of the data issues will be unmasked. Individual issues are tracked along with masks specific to the issue.
For example: if data is not available for every geo node requested, some values will be represented as missing. Missing values will be masked in the result, and an issue will be included (likely called “missing”) with a boolean mask indicating the missing values. The ADRIO will likely provide a fill method option which allows users the option of filling missing values, for instance by filling them with zeros. Providing a fill method and inspecting the ADRIO a second time should resolve the “missing” issue and, assuming no other issues remain, produce a non-masked numpy array as a result.
InspectResult is a frozen dataclass, and is generic on the result and value type (ResultT and ValueT) of the ADRIO.
The set of issues in the data along with a mask which indicates which values are impacted by the issue. The keys of this mapping are specific to the ADRIO, as ADRIOs tend to deal with unique data challenges.
The set of issues in the data along with a mask which indicates which values are impacted by the issue. The keys of this mapping are specific to the ADRIO, as ADRIOs tend to deal with unique data challenges.
Quantifies properties of the data: what percentage of the values are impacted by each data issue (if any), how many are zero, and how many are “unmasked” (that is, not affected by any issues). Returns a sequence of tuples which are the name of the quality and the percentage of values.