Skip to content

Commit

Permalink
remove debug statements and change method of getting filename
Browse files Browse the repository at this point in the history
  • Loading branch information
MialLewis committed Dec 20, 2023
1 parent cfbe0cc commit 05f4a5a
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions EVSVesuvio/vesuvio_analysis/ICHelpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from pathlib import Path
from EVSVesuvio.scripts import handle_config
from mantid.kernel import logger
from os import path

experimentsPath = (
Path(handle_config.read_config_var("caching.location")) / "experiments"
Expand Down Expand Up @@ -140,30 +141,25 @@ def setOutputDirsForSample(IC, sampleName):

def wsHistoryMatchesInputs(runs, mode, ipfile, localPath):
if not (localPath.is_file()):
logger.notice("FILE NOT FOUND")
logger.notice("IP FILE NOT FOUND")
return False
logger.notice("FILE FOUND")
local_ws = Load(Filename=str(localPath))
ws_history = local_ws.getHistory()
metadata = ws_history.getAlgorithmHistory(0)

saved_runs = metadata.getPropertyValue("Filename")
logger.notice(f"{saved_runs} v {runs}")
if saved_runs != runs:
logger.notice(
f"Filename in saved workspace did not match: {saved_runs} and {runs}"
)
return False

saved_mode = metadata.getPropertyValue("Mode")
logger.notice(f"{saved_mode} v {mode}")
if saved_mode != mode:
logger.notice(f"Mode in saved workspace did not match: {saved_mode} and {mode}")
return False

saved_ipfile_name = Path(metadata.getPropertyValue("InstrumentParFile")).name
logger.notice(f"{metadata.getPropertyValue('InstrumentParFile')}")
logger.notice(f"{saved_ipfile_name} v {ipfile.name}")
_, saved_ipfile_name = path.split(metadata.getPropertyValue("InstrumentParFile"))
if saved_ipfile_name != ipfile.name:
logger.notice(
f"IP files in saved workspace did not match: {saved_ipfile_name} and {ipfile.name}"
Expand Down

0 comments on commit 05f4a5a

Please sign in to comment.