Skip to content

Commit

Permalink
Merge branch 'develop' into feature_1953_seeps_config
Browse files Browse the repository at this point in the history
  • Loading branch information
georgemccabe committed Nov 16, 2022
2 parents e71310a + 8c0aa74 commit acb35ca
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 39 deletions.
19 changes: 1 addition & 18 deletions metplus/util/config_util.py
Original file line number Diff line number Diff line change
@@ -1,28 +1,11 @@
import os
import re

from .constants import LOWER_TO_WRAPPER_NAME
from .string_manip import getlist
from .string_manip import getlist, get_wrapper_name
from .string_template_substitution import do_string_sub
from .system_util import mkdir_p


def get_wrapper_name(process_name):
"""! Determine name of wrapper from string that may not contain the correct
capitalization, i.e. Pcp-Combine translates to PCPCombine
@param process_name string that was listed in the PROCESS_LIST
@returns name of wrapper (without 'Wrapper' at the end) and None if
name cannot be determined
"""
lower_process = (process_name.replace('-', '').replace('_', '')
.replace(' ', '').lower())
if lower_process in LOWER_TO_WRAPPER_NAME.keys():
return LOWER_TO_WRAPPER_NAME[lower_process]

return None


def get_process_list(config):
"""!Read process list, Extract instance string if specified inside
parenthesis. Remove dashes/underscores and change to lower case,
Expand Down
22 changes: 2 additions & 20 deletions metplus/util/doc_util.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,10 @@
import os

try:
from .config_util import get_wrapper_name
from .string_manip import get_wrapper_name
except ImportError:
sys.path.insert(0, os.path.abspath(os.path.dirname(__file__)))
from config_util import get_wrapper_name


def get_wrapper_name(process_name):
"""! Determine name of wrapper from string that may not contain the correct
capitalization, i.e. Pcp-Combine translates to PCPCombine
@param process_name string that was listed in the PROCESS_LIST
@returns name of wrapper (without 'Wrapper' at the end) and None if
name cannot be determined
"""
lower_process = (process_name.replace('-', '')
.replace('_', '')
.replace(' ', '')
.lower())
if lower_process in LOWER_TO_WRAPPER_NAME.keys():
return LOWER_TO_WRAPPER_NAME[lower_process]

return None
from string_manip import get_wrapper_name


def print_doc_text(tool_name, input_dict):
Expand Down
24 changes: 23 additions & 1 deletion metplus/util/string_manip.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,34 @@
Description: METplus utility to handle string manipulation
"""

import sys
import os
import re
from csv import reader
import random
import string

from .constants import VALID_COMPARISONS
try:
from .constants import VALID_COMPARISONS, LOWER_TO_WRAPPER_NAME
except ImportError:
sys.path.insert(0, os.path.abspath(os.path.dirname(__file__)))
from constants import VALID_COMPARISONS, LOWER_TO_WRAPPER_NAME


def get_wrapper_name(process_name):
"""! Determine name of wrapper from string that may not contain the correct
capitalization, i.e. Pcp-Combine translates to PCPCombine
@param process_name string that was listed in the PROCESS_LIST
@returns name of wrapper (without 'Wrapper' at the end) and None if
name cannot be determined
"""
lower_process = (process_name.replace('-', '').replace('_', '')
.replace(' ', '').lower())
if lower_process in LOWER_TO_WRAPPER_NAME.keys():
return LOWER_TO_WRAPPER_NAME[lower_process]

return None


def remove_quotes(input_string):
Expand Down

0 comments on commit acb35ca

Please sign in to comment.