Skip to content

Commit

Permalink
add deprecation warnings for various functions
Browse files Browse the repository at this point in the history
* sst_core_config_include_file_get_value_int()
* sst_core_config_include_file_get_value_str()
* sst_elements_config_include_file_get_value_int()
* sst_elements_config_include_file_get_value_str()
* sstsimulator_conf_get_value_int()
* sstsimulator_conf_get_value_str()
* _get_sst_config_include_file_value()
  • Loading branch information
jmlapre committed Oct 1, 2024
1 parent 13b3e18 commit 1f7df79
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/sst/core/testingframework/sst_unittest_support.py
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,8 @@ def sst_core_config_include_file_get_value_int(define, default=None, disable_war
SSTTestCaseException: if type is incorrect OR no data AND default
is not provided
"""
warn("sst_core_config_include_file_get_value_int() is deprecated and will be removed in future versions of SST.",
DeprecationWarning, stacklevel=2)
return _get_sst_config_include_file_value(test_engine_globals.TESTENGINE_CORE_CONFINCLUDE_DICT,
"sst_config.h", define, default, int, disable_warning)

Expand All @@ -446,6 +448,8 @@ def sst_core_config_include_file_get_value_str(define, default=None, disable_war
SSTTestCaseException: if type is incorrect OR no data AND default
is not provided
"""
warn("sst_core_config_include_file_get_value_str() is deprecated and will be removed in future versions of SST.",
DeprecationWarning, stacklevel=2)
return _get_sst_config_include_file_value(test_engine_globals.TESTENGINE_CORE_CONFINCLUDE_DICT,
"sst_config.h", define, default, str, disable_warning)

Expand All @@ -468,6 +472,8 @@ def sst_elements_config_include_file_get_value_int(define, default=None, disable
SSTTestCaseException: if type is incorrect OR no data AND default
is not provided
"""
warn("sst_elements_config_include_file_get_value_int() is deprecated and will be removed in future versions of SST.",
DeprecationWarning, stacklevel=2)
return _get_sst_config_include_file_value(test_engine_globals.TESTENGINE_ELEM_CONFINCLUDE_DICT,
"sst_element_config.h", define, default, int, disable_warning)

Expand All @@ -488,6 +494,8 @@ def sst_elements_config_include_file_get_value_str(define, default=None, disable
SSTTestCaseException: if type is incorrect OR no data AND default
is not provided
"""
warn("sst_elements_config_include_file_get_value_str() is deprecated and will be removed in future versions of SST.",
DeprecationWarning, stacklevel=2)
return _get_sst_config_include_file_value(test_engine_globals.TESTENGINE_ELEM_CONFINCLUDE_DICT,
"sst_element_config.h", define, default, str, disable_warning)

Expand All @@ -509,6 +517,8 @@ def sstsimulator_conf_get_value_str(section, key, default=None):
Raises:
SSTTestCaseException: if no data AND default is not provided
"""
warn("sstsimulator_conf_get_value_str() is deprecated and will be removed in future versions of SST.",
DeprecationWarning, stacklevel=2)
return _get_sstsimulator_conf_value(section, key, default, str)

###
Expand All @@ -527,6 +537,8 @@ def sstsimulator_conf_get_value_int(section, key, default=None):
Raises:
SSTTestCaseException: if no data AND default is not provided
"""
warn("sstsimulator_conf_get_value_int() is deprecated and will be removed in future versions of SST.",
DeprecationWarning, stacklevel=2)
return _get_sstsimulator_conf_value(section, key, default, int)

###
Expand Down Expand Up @@ -1794,6 +1806,9 @@ def _get_sst_config_include_file_value(include_dict, include_source, define, def
This will raise a SSTTestCaseException if a default is not provided or type
is incorrect
"""
warn("_get_sst_config_include_file_value() is deprecated and will be removed in future versions of SST. \
Prefer <include_dict>.get() instead.",
DeprecationWarning, stacklevel=2)
if data_type not in (int, str):
raise SSTTestCaseException("Illegal datatype {0}".format(data_type))
check_param_type("include_source", include_source, str)
Expand Down

0 comments on commit 1f7df79

Please sign in to comment.