Error: KeyError: (0, 46)

136 views
Skip to first unread message

Amy-Adeline West

unread,
Oct 20, 2022, 8:49:56 PM10/20/22
to OpenQuake Users
Hi all, 

I'm very new to openquake. I've have had luck fixing many many errors so far, but this one has just stumped me. Can anyone offer advise on how to fix/ where to even look/ what is the problem?

2022-10-20T22:39:37.37,INFO,SpawnProcess-5/8640,Modeller running C:\Users\Modeller\AppData\Local\Temp\tmplt0x4toc\Users\Modeller\Documents\OpenQuake\Clients\XXX Properties\Input Files\job.ini [--hc=None]

2022-10-20T22:39:37.38,INFO,SpawnProcess-5/8640,Using engine version 3.11.5

2022-10-20T22:39:39.78,WARNING,SpawnProcess-5/8640,Using 12 cores on MSI

2022-10-20T22:39:39.93,INFO,SpawnProcess-5/8640,Validated source_model_logic_tree.xml in 0.13 seconds

2022-10-20T22:39:39.97,INFO,SpawnProcess-5/8640,Checksum of the input files: 3292336631

2022-10-20T22:39:39.98,INFO,SpawnProcess-5/8640,Reading the risk model if present

2022-10-20T22:39:40.07,INFO,SpawnProcess-5/8640,Reading C:\Users\Modeller\AppData\Local\Temp\tmplt0x4toc\Users\Modeller\Documents\OpenQuake\Clients\Mackersey Properties\Input Files\exposure_model_v2.xml

2022-10-20T22:39:40.10,INFO,SpawnProcess-5/8640,Extracting the hazard sites from the site model

2022-10-20T22:39:40.13,INFO,SpawnProcess-5/8640,Associated 167 assets to 167 sites

2022-10-20T22:39:40.15,INFO,SpawnProcess-5/8640,Reducing risk model from 128 to 9 taxonomies

2022-10-20T22:39:40.18,INFO,SpawnProcess-5/8640,minimum_asset_loss={'structural': 0}

2022-10-20T22:39:40.19,INFO,SpawnProcess-5/8640,Storing 2338 aggregation keys

2022-10-20T22:39:40.25,CRITICAL,SpawnProcess-5/8640,

2022-10-20T22:39:40.27,CRITICAL,SpawnProcess-5/8640,

2022-10-20T22:39:40.28,CRITICAL,SpawnProcess-5/8640,Traceback (most recent call last):

File "C:\Program Files\OpenQuake Engine\python3.6\lib\site-packages\openquake\engine\engine.py", line 261, in run_calc

calc.run(exports=exports, **kw)

File "C:\Program Files\OpenQuake Engine\python3.6\lib\site-packages\openquake\calculators\base.py", line 247, in run

self.pre_execute()

File "C:\Program Files\OpenQuake Engine\python3.6\lib\site-packages\openquake\calculators\scenario_risk.py", line 118, in pre_execute

super().pre_execute()

File "C:\Program Files\OpenQuake Engine\python3.6\lib\site-packages\openquake\calculators\base.py", line 581, in pre_execute

calc.run(remove=False)

File "C:\Program Files\OpenQuake Engine\python3.6\lib\site-packages\openquake\calculators\base.py", line 247, in run

self.pre_execute()

File "C:\Program Files\OpenQuake Engine\python3.6\lib\site-packages\openquake\calculators\base.py", line 588, in pre_execute

self.read_inputs()

File "C:\Program Files\OpenQuake Engine\python3.6\lib\site-packages\openquake\calculators\base.py", line 457, in read_inputs

self._read_risk_data()

File "C:\Program Files\OpenQuake Engine\python3.6\lib\site-packages\openquake\calculators\base.py", line 856, in _read_risk_data

self.datastore, self.assetcol, oq.loss_names, oq.aggregate_by)

File "C:\Program Files\OpenQuake Engine\python3.6\lib\site-packages\openquake\calculators\base.py", line 1193, in save_agg_values

dstore['agg_values'] = assetcol.get_agg_values(lossnames, tagnames)

File "C:\Program Files\OpenQuake Engine\python3.6\lib\site-packages\openquake\risklib\asset.py", line 521, in get_agg_values

agg_values[aggkey[key], :] = numpy.array(grp.sum())

KeyError: (0, 46)


Many thanks,

Amy

Peter Pažák

unread,
Oct 21, 2022, 4:20:28 AM10/21/22
to OpenQuake Users
Hi, if possible, could you please share your input? In these cases it is often only clear what is the problem after looking at the inputs,
it looks like there might be a problem with your exposure file...

Peter

Dátum: štvrtok 20. októbra 2022, čas: 20:49:56 UTC-4, odosielateľ: Amy-Adeline West

Amy-Adeline West

unread,
Oct 25, 2022, 4:04:31 PM10/25/22
to OpenQuake Users
Hi Peter,

Thanks so much for your response. I really appreciate you taking a look - sorry for the lag time in replying to you.

Here are the input files:


I've included the CSV exposure file I used to make the XML.

If there is a better way to share/upload the input files to you, please let me know :)

Cheers,
Amy

Message has been deleted

Peter Pažák

unread,
Oct 26, 2022, 2:56:21 AM10/26/22
to OpenQuake Users
Hi, I can see you have empty region tag in the line:

s132,172.59584,-43.30103,1,0,W2L_PC,,FI

After correcting this to say Canterbury however there is another problem:

  File "C:\Users\ppazak\OpenQuake\oq-engine-engine-3.15\openquake\calculators\event_based_risk.py", line 383, in post_execute
    assert size <= upper_limit, (size, upper_limit)
AssertionError: (2640981, -1844263673)

(I am using OQ v3.15). Because the upper_limit is negative (upper_limit = self.E * (K + 1) * len(oq.ext_loss_types) in event_based_risk.py), it is an overflow,
so you probably need to reduce the ses_per_logic_tree_path from 100k to say 10k to make the calculation manageable.

Hope this helps
Peter

Dátum: streda 26. októbra 2022, čas: 1:34:55 UTC+2, odosielateľ: amyadel...@gmail.com
Found a better way to share the input files!

Cheers,
Amy

Amy-Adeline West

unread,
Oct 27, 2022, 3:20:21 PM10/27/22
to OpenQuake Users
Awesome - thanks so much for your input Peter! Much appreciated :) 
Reply all
Reply to author
Forward
0 new messages