Skip to content

scipeds.data.queries

TaxonomyRollup pydantic-model

Defining values within a taxonomy to include in an aggregation

Config:

  • extra: 'forbid'

Fields:

Validators:

taxonomy_name: FieldTaxonomy pydantic-field

The taxonomy within which to aggregate over values

taxonomy_values: List[Any] pydantic-field

The values in the taxonomy to include in aggregation

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:

Validators:

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