You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
.uff files of time histories with number of points that is not a multiple of 6, have a last line with 1 to 5 values only for each dataset. When trying to read such a file an error is raised at line 1367 of pyuff.py. It is caused by "float" trying to convert an empty string to float.
A quick (but potentially ugly, I'm far from a Python expert) fix is to replace line 1367 by:
foriinrange(len(line) //13):
if (line[13*i:13* (i+1)] !=' '):
values.extend([float(line[13*i:13* (i+1)])])
The text was updated successfully, but these errors were encountered:
Dear Janko,
Please find below a .uff file that can be used to reproduce the issue. I took a better look to the file and it seems that the issue comes from the fact that the software used to generate the .uff filled the last non-full data line with white spaces.
Best regards,
Martin
Dear Martin! I implemented a slightly numerically better implementation:
for line in split_data[:-1]: # '6E13.5'
values.extend([float(line[13 * i:13 * (i + 1)]) for i in range(len(line) // 13)])
else:
line = split_data[-1]
values.extend([float(line[13 * i:13 * (i + 1)]) for i in range(len(line) // 13) if line[13 * i:13 * (i + 1)]!=' '])
.uff files of time histories with number of points that is not a multiple of 6, have a last line with 1 to 5 values only for each dataset. When trying to read such a file an error is raised at line 1367 of pyuff.py. It is caused by "float" trying to convert an empty string to float.
A quick (but potentially ugly, I'm far from a Python expert) fix is to replace line 1367 by:
The text was updated successfully, but these errors were encountered: