Skip to content

Commit fa25746

Browse files
authored
Merge pull request #138 from MiraGeoscience/GEOPY-1029B
GEOPY-1029: Revert datetime stamp to simpeg.log and simpeg.out file names
2 parents 831c9c7 + 9d0a0be commit fa25746

1 file changed

Lines changed: 5 additions & 10 deletions

File tree

simpeg/directives/_save_geoh5.py

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -387,24 +387,19 @@ class SaveLogFilesGeoH5(BaseSaveGeoH5):
387387
def __init__(
388388
self,
389389
h5_object,
390-
start_date_time: str,
391390
**kwargs,
392391
):
393-
394-
self.time_stamp = start_date_time
395392
super().__init__(h5_object, **kwargs)
396393

397394
def write(self, iteration: int, **_):
398395
dirpath = Path(self._workspace.h5file).parent
399-
filepath = dirpath / f"SimPEG_{self.time_stamp}.out"
396+
filepath = dirpath / "SimPEG.out"
400397

401398
if iteration == 0:
402399
with open(filepath, "w", encoding="utf-8") as f:
403400
f.write("iteration beta phi_d phi_m time\n")
404401
log = []
405-
with open(
406-
dirpath / f"SimPEG_{self.time_stamp}.log", "r", encoding="utf-8"
407-
) as file:
402+
with open(dirpath / "SimPEG.log", "r", encoding="utf-8") as file:
408403
iteration = 0
409404
for line in file:
410405
val = re.findall(r"[+-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+-]?\d+)", line)
@@ -432,9 +427,9 @@ def save_log(self):
432427
h5_object = w_s.get_entity(self.h5_object)[0]
433428

434429
for file in [
435-
f"SimPEG_{self.time_stamp}.out",
436-
f"SimPEG_{self.time_stamp}.log",
437-
f"ChiFactors_{self.time_stamp}.log",
430+
"SimPEG.out",
431+
"SimPEG.log",
432+
"ChiFactors.log",
438433
]:
439434
filepath = dirpath / file
440435

0 commit comments

Comments
 (0)