Skip to content

Commit

Permalink
fix file reading error for windows
Browse files Browse the repository at this point in the history
  • Loading branch information
JiaxiangYi96 committed Dec 5, 2023
1 parent ecf8e07 commit ea31752
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 161 deletions.
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"[python]": {
"editor.defaultFormatter": "ms-python.python"
"editor.defaultFormatter": "ms-python.autopep8"
},
"python.formatting.provider": "none"
}
4 changes: 2 additions & 2 deletions src/rvesimulator/abaqus2py/abaqus_simulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import time
from math import inf
from pathlib import Path
from pickle import UnpicklingError

# local
from .simulator_interface import AssertInputs, Simulator
Expand Down Expand Up @@ -42,7 +43,6 @@ class AbaqusSimulator(Simulator, AssertInputs):
>>> simulator.read_back_results()
"""


def __init__(self, sim_info: dict, folder_info: dict) -> None:
"""initialization of abaqus simulator class
Expand Down Expand Up @@ -178,7 +178,7 @@ def read_back_results(self, file_name: str = "results.p") -> dict:
try:
with open(file_name, "rb") as fd:
results = pickle.load(fd, fix_imports=True, encoding="latin1")
except ValueError:
except UnpicklingError:
# fix issue of windows system
content = ''
outsize = 0
Expand Down
192 changes: 34 additions & 158 deletions tutorials/hollow_plate_problems.ipynb

Large diffs are not rendered by default.

0 comments on commit ea31752

Please sign in to comment.