remove(.) causes mayhem

9 views
Skip to first unread message

Gijs Dekkers

unread,
Dec 8, 2020, 4:21:05 AM12/8/20
to liam2-users
Hi all,

I get an error message caused by the remove(dead) procedure. The underlying cause must be somewhere else because I have not been near that routine at all. However, I have no clue where to start searching.

Does anybody know what might be the issue?

ERROR: index 12 is out of bounds for axis 1 with size 12

when evaluating: removeindividuals(person.dead)

 the technical error log can be found at C:\usr\midas\output\midas_awg20BASE_MI\error.log. This results in

Traceback (most recent call last):
  File "Console.py", line 27, in <module>
  File "main.py", line 375, in <module>
  File "main.py", line 365, in main
  File "main.py", line 141, in simulate
  File "simulation.py", line 689, in run
  File "simulation.py", line 636, in run_single
  File "simulation.py", line 573, in simulate_period
  File "utils.py", line 201, in gettime
  File "process.py", line 361, in run_guarded
  File "process.py", line 166, in run_guarded
  File "utils.py", line 206, in timed
  File "utils.py", line 201, in gettime
  File "process.py", line 34, in run_guarded
  File "process.py", line 70, in run
  File "expr.py", line 218, in expr_eval
  File "expr.py", line 888, in evaluate
  File "actions.py", line 99, in compute
  File "data.py", line 176, in keep
  File "utils.py", line 438, in __getitem__
IndexError: index 12 is out of bounds for axis 1 with size 12
when evaluating: removeindividuals(person.dead)


================ READY ================

Mahdi Ben Jelloul

unread,
Dec 8, 2020, 4:32:28 AM12/8/20
to liam2-users
Hi Gijs,

Did you check if you are not killing the person twice ?
Or killing it before creating it ?



Mahdi Ben Jelloul


--
You received this message because you are subscribed to the Google Groups "liam2-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to liam2-users...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/liam2-users/a70c90fe-e5c8-427a-936e-1a2da8183328n%40googlegroups.com.

Gijs Dekkers

unread,
Dec 8, 2020, 4:49:39 AM12/8/20
to liam2-users
Well, there are about 25K persons who have "dead=True" and then a lot of stuff is done (produce output, break links, ..) and only then are they removed. So there is only one removal and hence I would say that killing the same person twice is impossible. Also, the base version of the model works fine,  and I have only added some work on the unemployment module. I know unemployment is not good for your health, but this is too much ;-)

But I will check - thanks Mahdi!

G

Op dinsdag 8 december 2020 om 10:32:28 UTC+1 schreef mahdi.be...@gmail.com:

Gaëtan de Menten

unread,
Dec 8, 2020, 4:51:22 AM12/8/20
to liam2...@googlegroups.com

Hi Gijs,

 

The “axis 1” seems odd to me. I think the “id” axis should be axis 0.

 

I thus suspect the problem is related to a multi-dimensional array (created using either a groupby or by taking a subset of an “array” global) lying somewhere in your temporary variables. Normally that should not cause a problem, but that part of the code is a very brittle in version 0.12 and it does not tolerate anything odd.

 

Now, we need to find out where the problem really is. First, add a breakpoint just before the remove instruction and see if you can see any odd variable in there. Pay special attention to multi-dimensional ones.

 

Alternatively, inspect the functions preceding (in the order of execution!) the “remove” instruction for something you added recently involving multiple dimensions. You could also comment the functions before the “remove” function one at a time, until the “remove” function “works” again, so you will know in what function the problematic stuff is.

 

Sorry, this is kinda vague but it’s the best I can do without seeing the code.

 

I hope it helps anyway,

-Gaëtan.

--

You received this message because you are subscribed to the Google Groups "liam2-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to liam2-users...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/liam2-users/a70c90fe-e5c8-427a-936e-1a2da8183328n%40googlegroups.com.



Disclaimer: This e-mail may contain confidential information which is intended only for the use of the recipient(s) named above.
If you have received this communication in error, please notify the sender immediately and delete this e-mail from your system.
Please note that e-mail messages cannot be considered as official information from the Federal Planning Bureau.

Gijs Dekkers

unread,
Dec 8, 2020, 5:54:40 AM12/8/20
to liam2-users
Hi Gaetan,

Yeah, I have found the problem by backtracking what I did. I added a completely unrelated procedure that creates a number of multidimensional arrays and keeps them as "globals".

Now I know what to do, which is write the output of this procedure to various csv files in a temporary directory, so that I do not require them in the memory.

Thanks!

Gijs

Op dinsdag 8 december 2020 om 10:51:22 UTC+1 schreef Gaëtan de Menten:
Reply all
Reply to author
Forward
0 new messages