Skip to content
Snippets Groups Projects
Commit fc1f8ba1 authored by Valentin Bruch's avatar Valentin Bruch
Browse files

workaround for bug in data management; improved coding style

parent c0fb4819
No related branches found
No related tags found
No related merge requests found
......@@ -301,7 +301,6 @@ class KondoExport:
If overwrite is False and a file would be overwritten, append a random
string to the end of the filename.
"""
os.sync()
while True:
try:
pathlib.Path(filename + '.lock').touch(exist_ok=False)
......@@ -316,13 +315,13 @@ class KondoExport:
break
answer = input('Save with filename extended by random string? (Yn): ')
if answer.lower()[0] != "n":
return self.save_h5(filename + random_string(8) + ".h5", include, overwrite)
return self.save_h5(filename.removesuffix(".h5") + random_string(8) + ".h5", include, overwrite)
try:
file_exists = os.path.exists(filename)
h5file = None
while h5file is None:
try:
h5file = tb.open_file(filename, "a")
h5file = tb.open_file(filename, "a", MAX_NUMEXPR_THREADS=1, MAX_BLOSC_THREADS=1)
except tb.exceptions.HDF5ExtError:
settings.logger.warning('Error opening file %s, waiting 0.5s'%filename)
sleep(0.5)
......
This diff is collapsed.
......@@ -3,7 +3,8 @@
Benchmarks for Kondo FRTRG solver
"""
import numpy as np
import cProfile, pstats
import cProfile
import pstats
from pstats import SortKey
import settings
from kondo import Kondo
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment