nismod / simim

Spatial Interaction Models of Internal Migration
MIT License
7 stars 3 forks source link

TypeError when running latest version of SIMIM #17

Closed tg137 closed 5 years ago

tg137 commented 5 years ago

Package versions

Error

When running python scripts/run.py -c config/production2.json, the following error is produced:

Traceback (most recent call last):
  File "/code/simim/scripts/run.py", line 34, in <module>
    main(params)
  File "/code/simim/scripts/run.py", line 24, in main
    simim.simim(params)
  File "/opt/conda/envs/simim/lib/python3.6/site-packages/simim-1.0.0-py3.6.egg/simim/simim.py", line 106, in simim
  File "/opt/conda/envs/simim/lib/python3.6/site-packages/simim-1.0.0-py3.6.egg/simim/data_apis.py", line 89, in get_people
TypeError: '<' not supported between instances of 'int' and 'str'

Potential Fix

Change https://github.com/nismod/simim/blob/73a97f96db81d3418899ad66e9f5aa4b1c6cc977/simim/data_apis.py#L89 to be: if year < int(self.snpp.min_year(country)):

and also https://github.com/nismod/simim/blob/73a97f96db81d3418899ad66e9f5aa4b1c6cc977/simim/data_apis.py#L91 to be: elif year <= int(self.snpp.max_year(country))

This fix works for my installation.

virgesmith commented 5 years ago

caused by using an old version of ukpopulation. 1.1.3 is the minimum (as specified in requirements.txt)