Skip to content

Commit 4edc82a

Browse files
log minor
1 parent 9ade13b commit 4edc82a

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

mesostat/metric/dim3d/partialcorr.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,11 @@ def partial_corr(x, y, covar, eta=1.0E-6):
3737
if np.isnan(rez):
3838
raise ValueError("Sth Went wrong")
3939

40-
return np.clip(rez, eta, None) # Crop very small values
40+
# Crop very small values, but allow for negative partial correlation
41+
if np.abs(rez) > eta:
42+
return rez
43+
else:
44+
return eta
4145

4246

4347
def partial_corr_3D(dataRPS: np.array, settings: dict):

mesostat/utils/decorators.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def inner(*args, **kwargs):
5757

5858
orig_stdout = sys.stdout
5959
fname = 'log_' + str(procId) + '.txt'
60-
with open(fname, 'w+') as f:
60+
with open(fname, 'a') as f:
6161
#print("Redirecting STDOUT to", fname, flush=True)
6262
sys.stdout = f
6363
rez = func(*args, **kwargs)
@@ -80,4 +80,4 @@ def inner(*args, **kwargs):
8080
print(time_now_as_str(), "proc:", procId, "mem:", mem_now_as_str(), "arg:", args[0], "finished")
8181
return rez
8282

83-
return inner
83+
return inner

0 commit comments

Comments
 (0)