Load vtk
Summary
I tried to load unstructured points saved in the vkt format. Python complains that the scale I am setting cannot be adjusted to the dimensions of the grid because dim is used before being assigned.
Steps to reproduce
Take an unstructured data set saved as vtk and set a scale. Then try to load it.
What is the current bug behavior?
Error message (see below)
What is the expected correct behavior?
That the scale is applied to all dimensions and that the unstructured points are interpolated into structured ones.
Relevant logs and/or screenshots
~/Documents/Programme/empyre_develop/empyre/src/empyre/io/field_plugins/vtk.py in reader(filename, scale, vector, **kwargs)
88 raise ValueError('For the interpolation of unstructured grids, the `scale` parameter is required!')
89 elif isinstance(scale, Number): # Scale is the same for each dimension!
---> 90 scale = (scale,) * len(dim)
91 elif isinstance(scale, tuple):
92 assert len(scale) == len(dim), f'Each of the {len(dim)} dimensions needs a scale, but {scale} was given!'
UnboundLocalError: local variable 'dim' referenced before assignment