API reference · grader/inspection.py · 176 lines
grader.inspection
Host-side reasoning over the probe payload.
Students do not use the solution's variable names, so grading works by finding objects that look like the expected result and reporting how sure we are (design.md §21 and §25).
Summary
| Name | Kind | Description |
|---|---|---|
confidence_for_candidates() | function | |
dataframes() | function | |
scalars() | function | |
collections() | function | |
hidden_test() | function | |
match_column() | function | Best column in profile matching any of hints (substring, case-insensitive). |
has_datelike_column() | function | A date role can be satisfied by a column name hint or a datetime dtype. |
numeric_columns() | function | |
zips_in_profile() | function | All ZIP-looking values visible in a dataframe profile. |
zips_in_collection() | function | |
find_dataframe_candidates() | function | Return profiles satisfying predicate, best first. |
find_scalar_close_to() | function | Scalars in the namespace within tolerance of the expected answer. |
describe_dataframe() | function | Compact, TA-readable description used as rubric evidence (design.md §12). |
Constants
| Name | Value | Notes |
|---|---|---|
CONFIDENCE_UNIQUE | 0.98 | Confidence ladder from design.md §25. |
CONFIDENCE_TWO | 0.75 | |
CONFIDENCE_MANY | 0.4 | |
CONFIDENCE_NONE | 0.0 |
Functions
- match_column(profile: dict[str, Any], hints: Iterable[str]) -> str | None #[source]
Best column in
profilematching any ofhints(substring, case-insensitive).
- has_datelike_column(profile: dict[str, Any], hints: Iterable[str]) -> str | None #[source]
A date role can be satisfied by a column name hint or a datetime dtype.
- zips_in_profile(profile: dict[str, Any], id_hints: Iterable[str] = ()) -> set[str] #[source]
All ZIP-looking values visible in a dataframe profile.
- find_dataframe_candidates(probe: dict[str, Any] | None, predicate: Callable[[dict[str, Any]], bool], score: Callable[[dict[str, Any]], float] | None = None) -> list[dict[str, Any]] #[source]
Return profiles satisfying
predicate, best first.This is the generic form of design.md §21's
find_dataframe_with_columns: matching may use columns, row counts, value ranges or expected geography.