Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion data/NX simulation output.uff
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ NX: Correlation
-1
-1
2400
13 7 +1 0
13 7 -1 0
Fem1

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Expand Down
11 changes: 10 additions & 1 deletion pyuff/pyuff.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,16 @@ def refresh(self):
ind = data.find(b' -1', ind + 1)
if ind == -1:
break
block_ind.append(ind)
if ind+6 == data_len:
block_ind.append(ind)
# Check if the block is valid and ends with LF or CR
elif ind+6 < data_len and data[ind+6] in [10, 13]:
block_ind.append(ind)
# Check the line continues with blanks up to character 80
elif ind+80 < data_len and data[ind+6:ind+80] == \
b' ':
block_ind.append(ind)

block_ind = np.asarray(block_ind, dtype='int64')

# Constructs block indices of start and end values; each pair
Expand Down
3 changes: 1 addition & 2 deletions tests/test_58.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,8 +288,7 @@ def test_write_read_func_type_0():


if __name__ == '__main__':
test_read_write_read_given_data()
test_write_read_func_type_0()
test_fix_58b()

if __name__ == '__mains__':
np.testing.run_module_suite()