Skip to content

add_data.sh related Python scripts - flexible data loading #53

@drotheram

Description

@drotheram

Dynamically load raw model datasets which may have changes to the types of fields by reading and loading those fields. Implement tests on inputs with some reasonable constraints on what the stack will load

See also Issue #48

Major Priorities

PSRA:

  • PSRA_copyTables.py (Preview WIP flexible-csv-headers branch)
    • Shrink the list of expected_headers (though these should probably be removed altogether eventually)
    • pylint, flake8
    • Skip OpenQuake comment header (and deal with U+FEFF BOM). (Originally taken care off by sed `add_data.sh
    • Read CSV header from PostgreSQL dynamically, something like psql opendrr -c 'COPY (SELECT * FROM psra_BC.psra_BC_hcurves_pga WHERE FALSE ) TO STDOUT WITH CSV HEADER;'
    • Quote SQL identifiers when necessary for column names with upper-case letters, ., (), etc.
    • Restore reading config.ini and add error checking if file not found (POSTGRES_* variables not defined)
    • Write some kind of unit test?

DSRA:

Minor Priorities

Exposure:

Metadata

Metadata

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions