Skip to content

itzi should fail early when overwriting STDS with different temporal type #49

Description

@lrntct

When overwriting a STDS with a different temporal type, the simulation fails when it tries to register:

#!sh

Gathering map information...
ERROR: Unable to update raster map <Mexico_Hondon_wse_0000@MexicoDF>. The
temporal types are different.
Traceback (most recent call last):
  File "/home/jrodriguezri/.local/bin/itzi", line 11, in <module>
    sys.exit(main())
  File "/home/jrodriguezri/.local/lib/python2.7/site-packages/itzi/itzi.py", line 53, in main
    args.func(args)
  File "/home/jrodriguezri/.local/lib/python2.7/site-packages/itzi/itzi.py", line 94, in itzi_run
    sim.run()
  File "/home/jrodriguezri/.local/lib/python2.7/site-packages/itzi/simulation.py", line 145, in run
    self.report.end(self.sim_time)
  File "/home/jrodriguezri/.local/lib/python2.7/site-packages/itzi/simulation.py", line 234, in end
    self.register_results_in_gis()
  File "/home/jrodriguezri/.local/lib/python2.7/site-packages/itzi/simulation.py", line 304, in register_results_in_gis
    self.temporal_type)
  File "/home/jrodriguezri/.local/lib/python2.7/site-packages/itzi/gis.py", line 348, in register_maps_in_strds
    unit=r_unit)
  File "/usr/lib/grass70/etc/python/grass/temporal/register.py", line 497, in register_map_object_list
    file=filename, dbif=dbif)
  File "/usr/lib/grass70/etc/python/grass/temporal/register.py", line 279, in register_maps_in_space_time_dataset
    'id': map.get_map_id()})
  File "/usr/lib/grass70/etc/python/grass/pygrass/messages/__init__.py", line 269, in fatal
    raise FatalError(message)
grass.exceptions.FatalError: Unable to update raster map <Mexico_Hondon_wse_0000@MexicoDF>. The temporal types are different.

itzi should check the temporal type at the beginning of the simulation to fail early and prevent unpleasant surprise at the end.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels
    No fields configured for Feature.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions