error 'fields'

8 views
Skip to first unread message

ischoc...@gmail.com

unread,
Sep 21, 2023, 9:06:03 AM9/21/23
to liam2-users
Hi everyone,
While importing the "model-parts", I receive the message "ERROR:'fields' ". I don't have a clue of what LiamII is trying to tell me, and hence, where I should start looking for my blunder

Any suggestion is welcome

Ingrid

############

LIAM2 0.12 (64bit)

Using simulation file: 'C:\Liam_2022\SV\s_basic_model.yml'
importing: 'C:\Liam_2022\SV\s_to_other30_11.yml'
importing: 'C:\Liam_2022\SV\s_go_home_2023_poging2.yml'
importing: 'C:\Liam_2022\SV\s_internal migration_2023_v2.yml'
importing: 'C:\Liam_2022\SV\s_huishoudens_2023.yml'
importing: 'C:\Liam_2022\SV\regionale_migratie_2023_immi.yml'
importing: 'C:\Liam_2022\SV\s_flanders_imm_emi_2023.yml'
importing: 'C:\Liam_2022\SV\s_flanders_mort_vrucht2023.yml'

ERROR: 'fields'

the technical error log can be found at C:\Liam_2022\editor\App\Notepad++\error.log
================ READY ================

error log:
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 139, in simulate
  File "simulation.py", line 478, in from_yaml
  File "simulation.py", line 252, in from_str
KeyError: 'fields'

Gijs Dekkers

unread,
Oct 10, 2023, 4:44:05 AM10/10/23
to liam2-users
Hi Ingrid,

It would seem that the structure of one of the files is not recognized as a LIAM2 file. 

the normal structure is 

entities:
    person:
        fields:
...            
        macros:
 ...
        processes:

etc. It would seem that LIAM2 does not recognize  this structure in one file. 

Hope this helps

Gijs

Op donderdag 21 september 2023 om 15:06:03 UTC+2 schreef ischoc...@gmail.com:

ischoc...@gmail.com

unread,
Oct 30, 2023, 9:03:15 AM10/30/23
to liam2-users
Thanks for you answer. I also looked for the mistake in the structure, but it had little to do with it...I just forgot to define the variable type of one of the globals (type: int). The error-message was rather misleading...

But I have a new question.

I have 4 logit_scores defined by a regression, one for each cluster of municipalities. I named the logit_scores (cluster1, cluster2, cluster3, cluster4). Now I want to refere to these logit_scores in the alignment-routine that runs in a loop:
- int_immigrant_target: align_abs(cluster, needlft, filter= new_mun==-1 and int_migrant, link=persons,..)

To refere to the correct logit_score, I wanted to make a stingvariable:
- i: loopnumber
- cluster: 'cluster{i}'  
     ==> this would give me the variable 'cluster' to integrate in the align_abs routine above, that would refere to the correct logit_score (cluster1, cluster2, cluster3, cluster4).

But 'cluster{i}' does not seem to be the correct code....
What code should I use to construct the word "cluster1"?

thanks in advance!
Ingrid
Reply all
Reply to author
Forward
0 new messages