Skip to content

Commit

Permalink
Merge pull request #791 from scap3yvt/790-add-an-option-for-backwards…
Browse files Browse the repository at this point in the history
…-compatibility-for-parseconfig

Added an option for backwards compatibility for parseconfig
  • Loading branch information
sarthakpati authored Feb 8, 2024
2 parents 9f41cf7 + 3b1dd4b commit 46e9924
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
18 changes: 18 additions & 0 deletions GANDLF/parseConfig.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
from .config_manager import ConfigManager


def parseConfig(config_file_path, version_check_flag=True) -> None:
"""
This function parses the configuration file and returns a dictionary of parameters.
Args:
config_file_path (Union[str, dict]): The filename of the configuration file.
version_check_flag (bool, optional): Whether to check the version in configuration file. Defaults to True.
Returns:
dict: The parameter dictionary.
"""
print(
"WARNING: `GANDLF.parseConfig` will be deprecated in favor of `GANDLF.config_manager` in a future version."
)
return ConfigManager(config_file_path, version_check_flag)
3 changes: 2 additions & 1 deletion testing/test_full.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
convert_to_tiff,
)
from GANDLF.config_manager import ConfigManager
from GANDLF.parseConfig import parseConfig
from GANDLF.training_manager import TrainingManager
from GANDLF.inference_manager import InferenceManager
from GANDLF.cli import (
Expand Down Expand Up @@ -237,7 +238,7 @@ def write_temp_config_path(parameters_to_write):
def test_train_segmentation_rad_2d(device):
print("03: Starting 2D Rad segmentation tests")
# read and parse csv
parameters = ConfigManager(
parameters = parseConfig(
testingDir + "/config_segmentation.yaml", version_check_flag=False
)
training_data, parameters["headers"] = parseTrainingCSV(
Expand Down

0 comments on commit 46e9924

Please sign in to comment.