Skip to content
This repository was archived by the owner on Apr 9, 2019. It is now read-only.

Error with Freigné for 2018/01/01 export attempt #64

@remifroger

Description

@remifroger

I'm trying to generate a version of the French communes for 2018 with this tool. I added new files "France2018" and "historiq2018" from Insee + the file "2018.csv" for EPCI in the sources folder. Also, I redirected filenames to the 2018 files in the loaders functions.

And I get an error (of course ahah). I don't understand how it happens after reading of the functions.
This is the error :

C:\Users\rfr\Documents_py\geohisto-master>python -m geohisto
Loading towns
Loading history
Loading populations
Loading counties
Computing history from actions
Record(depcom='44225', mod=331, eff=datetime.datetime(2018, 1, 1, 0, 0), nccoff='Freigné', nccanc='', comech='44180', dep='44', com='225', depanc='', last=None, effdate=datetime.date(2018, 1, 1))
Traceback (most recent call last):
File "C:\Python37\lib\runpy.py", line 193, in run_module_as_main
"main", mod_spec)
File "C:\Python37\lib\runpy.py", line 85, in run_code
exec(code, run_globals)
File "C:\Users\rfr\Documents_py\geohisto-master\geohisto_main
.py", line 6
6, in
main()
File "C:\Python37\lib\site-packages\click\core.py", line 716, in call
return self.main(*args, **kwargs)
File "C:\Python37\lib\site-packages\click\core.py", line 696, in main
rv = self.invoke(ctx)
File "C:\Python37\lib\site-packages\click\core.py", line 889, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "C:\Python37\lib\site-packages\click\core.py", line 534, in invoke
return callback(*args, **kwargs)
File "C:\Python37\lib\site-packages\click_log\core.py", line 94, in wrapper
return f(*args, **kwargs)
File "C:\Users\rfr\Documents_py\geohisto-master\geohisto_main
.py", line 3
4, in main
compute(towns, history_list)
File "C:\Users\rfr\Documents_py\geohisto-master\geohisto\actions.py", line 39
7, in compute
raise e
File "C:\Users\rfr\Documents_py\geohisto-master\geohisto\actions.py", line 39
4, in compute
ACTIONS.get(record.mod, lambda a, b: a)(towns, record)
File "C:\Users\rfr\Documents_py\geohisto-master\geohisto\actions.py", line 19
6, in deletion
modification=record.mod
File "C:\Users\rfr\Documents_py\geohisto-master\geohisto\models.py", line 216
, in generate
raise Exception(msg)
Exception: You cannot set 2018-01-01 00:00:00 as a start date and 2017-12-31 23:59:59.999999 as an end date for Town <Town (fr:commune:44225@2018-01-01): Freigné from 2018-01-01 to 2018-01-01 with successors and mod 0>.

I found the modification that poses problem on the historical file (Freigné, mod 331) but I don't understand what is happening (from a technical and territorial point of view), if you can enlighten me?

Thks for help and the tool!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions