scipeds.data.queries¶
TaxonomyRollup
pydantic-model
¶
Defining values within a taxonomy to include in an aggregation
Config:
extra:forbid
Fields:
-
taxonomy_name(FieldTaxonomy) -
taxonomy_values(List[Any])
Validators:
-
values_valid_list→taxonomy_values
QueryFilters
pydantic-model
¶
A pydantic model with options for how to filter the baseline data prior to any aggregation.
The model will handle data validation for the input values by ensuring:
- The years are in range and the range is nonzero
- The race/ethnicity and degree values provided are valid
- Things that ought to be lists are lists
Config:
extra:forbid
Fields:
-
start_year(int) -
end_year(int) -
race_ethns(List[RaceEthn]) -
award_levels(List[AwardLevel]) -
majornums(List[int])
Validators:
-
race_ethn_valid→race_ethns -
award_valid→award_levels -
majornum_valid→majornums -
check_year_range
start_year: Annotated[int, Field(ge=(constants.START_YEAR), le=(constants.END_YEAR))] = constants.START_YEAR
pydantic-field
¶
The start year of the time window to aggregate over, inclusive
end_year: Annotated[int, Field(ge=(constants.START_YEAR), le=(constants.END_YEAR))] = constants.END_YEAR
pydantic-field
¶
The end year of the time window to aggregate over, inclusive
race_ethns: List[RaceEthn]
pydantic-field
¶
Which race/ethnicity groups to include (default: all)
award_levels: List[AwardLevel]
pydantic-field
¶
Which degrees / award levels to include (default: all)
majornums: List[Annotated[int, Field(ge=1, le=2)]] = [1, 2]
pydantic-field
¶
Which major numbers to include (default: both first and second majors)
check_year_range()
pydantic-validator
¶
Validate year values
Warns:
| Type | Description |
|---|---|
UserWarning
|
If time range overlaps significant changes in IPEDS schema or values |
Raises:
| Type | Description |
|---|---|
ValueError
|
If provided start_year is after end_year |