Basic export framework and command line interface

Bug #934166 reported by Lars Butler
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenQuake (deprecated)
Fix Released
Lars Butler

Bug Description


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 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/uhs_data/iowa_uhs/
# 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_calculations(user_name): # see --list-calculations
  """Get pairs of (oq_calculation_id, description) for the specified user."""

def get_outputs(oq_calculation_id): # see --list-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."""

Tags: export
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
Revision history for this message
Lars Butler (lars-butler) wrote :
Changed in openquake:
status: In Progress → Fix Committed
Changed in openquake:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Related blueprints

Remote bug watches

Bug watches keep track of this bug in other bug trackers.