prepare derives most.
SCHEMA (version ppa/1.2) lists the tables of a PPA book, their keys and
their core columns: facts with one meaning each, typed and empty unless
supplied. A rater derives the rest, such as age, points or a carrier’s vehicle
symbol. A book needs only submissions, drivers and
vehicles; policies is built from the submissions’ policy_id unless
you pass it. Every other column is yours. relativities.Book(tables, schema=ppa.SCHEMA) is a PPA
book, a relativities.Study builds versions of it for what-if analysis, and
a relativities.Program rates it with one carrier’s rater: its prepare turns
the book into that rater’s input. years_at_effective and coverage
derive two common facts, aligned with the book’s rows, for a prepare to use.
ppa.vin decodes VINs into vehicle facts and fills them into a book.
ppa.ca derives what California law decides from a book, such as Good Driver.
SCHEMA
ppa/1.2 (ppa.SCHEMA.version): policies, submissions, drivers, vehicles, incidents, coverages and other policies, with their keys and core columns. Pass it as Book(tables, schema=ppa.SCHEMA). print(ppa.SCHEMA) lists every column, and the PPA book schema page shows the same tables.
ca
California law every CA personal auto carrier applies, derived from a PPA book. Seerelativities.ppa.ca.
coverage
book.vehicles: one row per vehicle.
Columns are selected (whether the vehicle carries the coverage),
deductible, limit, limit_per_person and limit_per_accident;
each is <NA> where selected is False. So
coverage(book, "collision")["deductible"].fillna(0) is each vehicle’s
collision deductible, with 0 for a vehicle that skips collision, and
coverage(book, "bodily_injury")["limit_per_person"] each vehicle’s
bodily injury split limit. coverage_id is one of the schema’s coverages.
vin
Decode vehicle identification numbers into make, model, year and build facts. Seerelativities.ppa.vin.
years_at_effective
column to its submission’s effective date.
years_at_effective(book, "birth_date") is each driver’s age on the
effective date, and "first_licensed_date" is each driver’s years
licensed. The result is aligned with book.drivers (or table), so
book.drivers.assign(age=...) keeps every row. A blank date gives a
missing value (<NA>).