Skip to content

Support one-dimensional VTK output #6

Open

Description

@mdpiper

Dan Parsons (d.parsons@hull.ac.uk) found that setting VTK output for HydroTrend caused his WMT run to fail. Here's the stack trace:

Traceback (most recent call last): 
File "/home/csdms/wmt/bin/wmt-slave.py", line 430, in main env=env) 
File "/home/csdms/wmt/bin/wmt-slave.py", line 398, in launch task.execute() 
File "/home/csdms/wmt/bin/wmt-slave.py", line 311, in execute self.run() 
File "/home/csdms/wmt/bin/wmt-slave.py", line 380, in run model.go(file='model.yaml') 
File "/home/csdms/wmt/internal/coupling/cmt/component/model.py", line 45, in go self._components[self.driver].go(self.duration) 
File "/home/csdms/wmt/internal/coupling/cmt/component/component.py", line 157, in go self.run(stop_time) 
File "/home/csdms/wmt/internal/coupling/cmt/component/component.py", line 176, in run self._events.run(stop_time) 
File "/home/csdms/wmt/internal/coupling/cmt/events/manager.py", line 34, in run event.run(self._timeline.time) 
File "/home/csdms/wmt/internal/coupling/cmt/events/printer.py", line 18, in run self._printer.write() 
File "/home/csdms/wmt/internal/coupling/cmt/portprinter/port_printer.py", line 60, in write self._printer.write(self._field) 
File "/home/csdms/wmt/internal/coupling/cmt/printers/vtk/vtu.py", line 205, in write tofile (field, file_name, **kwargs) 
File "/home/csdms/wmt/internal/coupling/cmt/printers/vtk/vtu.py", line 174, in tofile elements = get_vtu_elements (field, format=format, encoding=encoding) 
File "/home/csdms/wmt/internal/coupling/cmt/printers/vtk/vtu.py", line 124, in get_vtu_elements types = get_vtk_types (field) 
File "/home/csdms/wmt/internal/coupling/cmt/printers/vtk/vtu.py", line 106, in get_vtk_types types = [int (edge_count_to_type.get (offsets[0], VtkPolygon))] IndexError: index out of bounds

This is error is thrown for 1D output because offsets is empty; 2D output is fine.

Dan was able to work around this issue by using netCDF output instead of VTK.

This is likely low priority, since we should just use netCDF.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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