Basic export framework and command line interface
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenQuake (deprecated) |
Fix Released
|
Medium
|
Lars Butler |
Bug Description
[et=16h]
[at=9h]
The actual export action itself (for a particular artifact type) will need to be custom written for each type. The scope of this bug just includes the basic interface and initial framework bits.
-------
Command line interface
-------
A few new command line options will be added:
--list-
List completed calculations for the current user
This command prints a table of calculation ids and descriptions
--list-outputs <calculation id>:
List outputs/output types available for the given calculation id
--export <result id> <output dir>:
Export a given set of out puts to the specified output dir
-------
Example usage
-------
$ openquake --list-calculations
7: Disaggregation for Zürich
18: Classical PSHA for my garden
1283: Uniform Hazard Spectra for the state of Iowa
$ openquake --list-outputs 1283
686: uh_spectra
$ openquake --export 686 /home/lars/
# print some message about which files where created and where
----------
Export API
----------
The following basic API functions are required for the above CLI options.
def get_calculation
"""Get pairs of (oq_calculation_id, description) for the specified user."""
def get_outputs(
"""Get pairs (output_id, output_type) for the specified calculation."""
def export(output_id, target_dir): # see --export
"""Export the specified output to the specified location."""
def print_result(data):
"""Utility method for printing the results of `get_calculation` or
`get_outputs` in a nice way."""
description: | updated |
description: | updated |
Changed in openquake: | |
status: | New → Confirmed |
importance: | Undecided → Medium |
assignee: | nobody → Lars Butler (lars-butler) |
milestone: | none → 0.6.0 |
Changed in openquake: | |
status: | Confirmed → In Progress |
description: | updated |
description: | updated |
description: | updated |
tags: | added: export |
description: | updated |
Changed in openquake: | |
status: | Fix Committed → Fix Released |
Pull requests: /github. com/gem/ openquake/ pull/691 /github. com/gem/ openquake/ pull/692
https:/
https:/