Skip to content

Avoid decoding some objects that now should come as strings from the OQ-Engine #743

@ptormene

Description

@ptormene

In most cases the engine is already producing strings and we have to fix the plugin. We need to identify the cases in which the engine is still producing bytes instead.

Some examples to check:

  • while loading gsims: self.gsims = [branch_path.decode('utf8').strip(""") for branch_path in self.rlzs_npz['array']['branch_path']]. When extracting realizations from the oq-engine, branches are still returned as bytes
  • in the loader for avg_damages-rlzs taxonomies are still decoded. When downloading asset_tags from the OQ-Engine, all items (taxonomies and tags like NAME_X) are returned as arrays of bytes
  • in avg_losses_rlzs_aggr['tags'] are still decoded
  • in load ruptures we are decoding boundaries (to be fixed engine-side)
  • in some exporters to csv (probably untested) some tags are decoded
  • also exporting data from a plot, the measurement unit is decoded (the engine is still giving them as bytes, when extracting agg_curves for 'Stochastic Event-Based Demo (Nepal)'
  • extracting losses_by_asset, taxonomies are still provided as bytes from the OQ-Engine

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions