AttributeError with oq plot (on 2.4.0)

30 views
Skip to first unread message

Lukas Heiniger

unread,
May 26, 2017, 8:07:58 AM5/26/17
to OpenQuake Users
Hi all

Just upgraded to 2.4.0 using apt.
Trying to plot a freshly computed hazard calculation with oq plot <calc_id> results in the following error:

Found 79 site(s); plotting 1 of them
Traceback (most recent call last):
  File "/usr/bin/oq", line 35, in <module>
    main.oq()
  File "/opt/openquake/lib/python2.7/site-packages/openquake/commands/__main__.py", line 49, in oq
    parser.callfunc()
  File "/opt/openquake/lib/python2.7/site-packages/openquake/baselib/sap.py", line 186, in callfunc
    return self.func(**vars(namespace))
  File "/opt/openquake/lib/python2.7/site-packages/openquake/baselib/sap.py", line 245, in main
    return func(**kw)
  File "/opt/openquake/lib/python2.7/site-packages/openquake/commands/plot.py", line 84, in plot
    mean_curves, pmaps = get_pmaps(haz, indices)
  File "/opt/openquake/lib/python2.7/site-packages/openquake/commands/plot.py", line 62, in get_pmaps
    weights = [rlz.weight for rlz in getter.rlzs]
AttributeError: 'PmapGetter' object has no attribute 'rlzs'


I'll be sending the hdf file to the support email since it's too big to attach.

Michele Simionato

unread,
May 26, 2017, 8:24:58 AM5/26/17
to OpenQuake Users
Thanks for the bug report, I will fix it in the next release. However notice that `oq plot` is a debugging command that is poorly supported and may even disappear in the future: the official way to plot the hazard curves is via the QGIS plugin.

Lukas Heiniger

unread,
May 26, 2017, 8:31:23 AM5/26/17
to OpenQuake Users
Poorly supported? Well, I can say that support here is better than in most places :). But I was in fact using the command for debugging purposes only.

Thanks
Lukas 

Lukas Heiniger

unread,
May 26, 2017, 11:16:20 AM5/26/17
to OpenQuake Users
Ok, I realize that this is probably related to the fact, that the new version does not generate individual hazard curves by default. It's not entirely clear to me why this was changed, since there already was a individual_curves option before. 

Since we run the engine over its REST API, I was wondering if there is still a way to receive individual curves for all realizations over the API?



Am Freitag, 26. Mai 2017 14:24:58 UTC+2 schrieb Michele Simionato:

Michele Simionato

unread,
May 26, 2017, 2:18:42 PM5/26/17
to OpenQuake Users


On Friday, May 26, 2017 at 5:16:20 PM UTC+2, Lukas Heiniger wrote:
Ok, I realize that this is probably related to the fact, that the new version does not generate individual hazard curves by default. It's not entirely clear to me why this was changed, since there already was a individual_curves option before. 

 
Since we run the engine over its REST API, I was wondering if there is still a way to receive individual curves for all realizations over the API?

Not yet. There is a plan to add a REST API to extract one realization at the time. Rigth now it is possible to extract all the realizations from the command-line but not from the API.

Michele Simionato

unread,
May 29, 2017, 8:00:34 AM5/29/17
to OpenQuake Users
This bug has been fixed in master.
Reply all
Reply to author
Forward
0 new messages