Skip to content

Commit

Permalink
minor regex fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Sandip117 committed Aug 27, 2024
1 parent a58b4cc commit de7157e
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 4 deletions.
2 changes: 1 addition & 1 deletion cmd.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/bin/bash
docker run --rm ghcr.io/fnndsc/pl-lld_chxr:1.0.2 chris_plugin_info
docker run --rm ghcr.io/fnndsc/pl-lld_chxr:1.0.3 chris_plugin_info
8 changes: 5 additions & 3 deletions lld_chxr.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
logger.opt(colors = True)
logger.add(sys.stderr, format=logger_format)

__version__ = '1.0.8'
__version__ = '1.1.0'

DISPLAY_TITLE = r"""
_ _ _ _ _
Expand Down Expand Up @@ -182,8 +182,9 @@ def analyze_measurements(data, tagStruct, unit, diff):
status['exitCode'] = 4
status['flag'] = False
LOG(f"{ex} not available for match.")
#return status
match = re.search(r'\d+\.\d+ \w+', measurements['Difference']).group()

# check if the difference info contains measurements in the desired units.
match = re.search(r'\d+ \w+', measurements['Difference']).group()
m_unit = match.split()[1]
if m_unit != unit:
status['error'].append(f"Measurement units do not match: Expected {unit}, actual {m_unit}")
Expand All @@ -192,6 +193,7 @@ def analyze_measurements(data, tagStruct, unit, diff):
LOG(f"Measurement units do not match: Expected {unit}, actual {m_unit}")
#return status

# check if the difference info contains a float % representing limb difference.
match = re.search(r'\d+\.\d+%',measurements['Difference']).group()
difference = match.replace('%','')

Expand Down
41 changes: 41 additions & 0 deletions run-MainThread.log
Original file line number Diff line number Diff line change
Expand Up @@ -100,3 +100,44 @@
}
}
2024-08-15T13:38:30.188185-04:00 END
2024-08-15T13:57:54.596903-04:00 START
2024-08-15T13:58:05.116494-04:00
{
"status": true,
"obj": {
"run": {
"status": true,
"stdout": {
"id": 96,
"creation_date": "2024-08-15T13:58:05.027305-04:00",
"name": "pl-lld_chxr",
"version": "1.0.3",
"dock_image": "ghcr.io/fnndsc/pl-lld_chxr:1.0.3",
"public_repo": "https://github.com/FNNDSC/pl-lld_chxr",
"icon": "",
"type": "ds",
"stars": 0,
"authors": "FNNDSC <dev@babyMRI.org>",
"title": "A ChRIS plugin to analyze the result produced by an LLD analysis",
"category": "",
"description": "A ChRIS plugin to analyze the result produced by an LLD analysis",
"documentation": "https://github.com/FNNDSC/pl-lld_",
"license": "MIT",
"execshell": "/usr/local/bin/python",
"selfpath": "/usr/local/bin",
"selfexec": "lld_chxr",
"min_number_of_workers": 1,
"max_number_of_workers": 1,
"min_cpu_limit": 1000,
"max_cpu_limit": 2147483647,
"min_memory_limit": 100,
"max_memory_limit": 2147483647,
"min_gpu_limit": 0,
"max_gpu_limit": 0
},
"stderr": "",
"returncode": 0
}
}
}
2024-08-15T13:58:05.116702-04:00 END

0 comments on commit de7157e

Please sign in to comment.