{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Validators\n", "\n", "ObsPlus provides a simple method for declaring and enforcing assumptions about data. You can think of it much like [pytest](https://docs.pytest.org/en/latest/) for data validation (i.e. it is enforced at runtime rather than in a test suite). The implementation is specifically geared towards nested tree structures (like obspy's `Catalog` object), but does work for any type of object. \n", "\n", "
\n", " | validator | \n", "object | \n", "message | \n", "passed | \n", "
---|---|---|---|---|
0 | \n", "ensure_events_have_four_picks | \n", "[resource_id, event_type, event_type_certainty... | \n", "validator ensure_events_have_four_picks failed... | \n", "False | \n", "
1 | \n", "ensure_events_have_four_picks | \n", "[resource_id, event_type, event_type_certainty... | \n", "validator ensure_events_have_four_picks failed... | \n", "False | \n", "
2 | \n", "ensure_events_have_four_picks | \n", "[resource_id, event_type, event_type_certainty... | \n", "validator ensure_events_have_four_picks failed... | \n", "False | \n", "
3 | \n", "ensure_origin_have_lat_lon | \n", "[resource_id, time, time_errors, longitude, lo... | \n", "validator ensure_origin_have_lat_lon failed ob... | \n", "False | \n", "
4 | \n", "ensure_origin_have_lat_lon | \n", "[resource_id, time, time_errors, longitude, lo... | \n", "\n", " | True | \n", "
5 | \n", "ensure_origin_have_lat_lon | \n", "[resource_id, time, time_errors, longitude, lo... | \n", "\n", " | True | \n", "