Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion data/migrate/Errors-Backfilling.csv
Original file line number Diff line number Diff line change
Expand Up @@ -125,4 +125,4 @@ Error Code,Error Type,Message Template,Notes
408,Warning,New station name added
409,Warning,New contribution added
410,Error,Data file failed to validate
1000,Error,Unassigned error message
1000,Error,Unassigned error message
8 changes: 4 additions & 4 deletions woudc_data_registry/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@

from woudc_data_registry.generate_metadata import (
update_extents,
update_data_submission_ranges)
update_date_submission_ranges)
from woudc_data_registry.models import Contributor, DataRecord
from woudc_data_registry.report import OperatorReport, RunReport, EmailSummary
from woudc_data_registry.search import SearchIndex
Expand Down Expand Up @@ -240,6 +240,7 @@ def ingest(ctx, source, reports_dir, lax, bypass, verbosity):

orchestrate(source, reports_dir, metadata_only=lax, bypass=bypass)
update_extents()
update_date_submission_ranges()


@click.command()
Expand Down Expand Up @@ -389,12 +390,11 @@ def gather(ctx, path, verbosity):
def update_date_ranges(cntx, models, verbosity):
""" update the start and end dates of the contributors, instruments,
stations, and deployments table from all data submissions"""
registry = Registry()
if models is not None: # update the specified tables
tables = [model.strip() for model in models.split(',')]
update_data_submission_ranges(registry, tables)
update_date_submission_ranges(tables)
else:
update_data_submission_ranges(registry)
update_date_submission_ranges()


data.add_command(ingest)
Expand Down
3 changes: 2 additions & 1 deletion woudc_data_registry/generate_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -521,13 +521,14 @@ def update_extents():
return True


def update_data_submission_ranges(registry, tables=None):
def update_date_submission_ranges(tables=None):
"""
Update date ranges for each station, instrument, contributor, and
deployment of the data submission

:returns: void
"""
registry = Registry()

[
Contributor, Deployment, Station, DataRecord, Instrument
Expand Down
121 changes: 0 additions & 121 deletions woudc_data_registry/tests/config/all_errors.csv

This file was deleted.

121 changes: 0 additions & 121 deletions woudc_data_registry/tests/config/all_warnings.csv

This file was deleted.

2 changes: 2 additions & 0 deletions woudc_data_registry/tests/config/errors.csv
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ Error Code,Error Type,Message Template,Notes
249,Warning,#TIMESTAMP table after #{table} is missing\, deriving based on requirements,Reserved for Umkehr data tables
250,Warning,Excess field {field} does not belong in table {table}
251,Warning,Duplicate observations found in #{table} for Date={date},Reserved for Umkehr data tables
252,Error,Trailing commas found in #{table} header
253,Warning,Number of columns in {table} content row does not match with the number of column headers
301,Error,Failed to parse #{table}.Time {component}: contains invalid characters
302,Error,Failed to parse #{table}.Date {component}: contains invalid characters
303,Error,#{table}.Date {component} is not within allowable range [{lower}]-[{upper}],Reserved for year and month components
Expand Down
Loading