From 55b6f7b70e03143295009a8f403dd9e07c08c3d1 Mon Sep 17 00:00:00 2001 From: Dylan McDowell Date: Thu, 30 Mar 2023 09:35:54 -0600 Subject: [PATCH 1/2] Remove Assertion SyntaxWarning for IES Workshop --- ravenframework/SupervisedLearning/FeatureSelection/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ravenframework/SupervisedLearning/FeatureSelection/utils.py b/ravenframework/SupervisedLearning/FeatureSelection/utils.py index 714b8d24ef..6f40c2ccc5 100644 --- a/ravenframework/SupervisedLearning/FeatureSelection/utils.py +++ b/ravenframework/SupervisedLearning/FeatureSelection/utils.py @@ -64,8 +64,8 @@ def screenAndTrainEstimator(Xreduced, yreduced, estimator, support, params, incl @ In, addOnKeys, list, optional, list of additional keys to remove @ Out, None """ - assert (not issubclass(estimator.__class__, SupervisedLearning.SupervisedLearning), - f"estimator class str(estimator.__class__) is not a SupervisedLearning derived class") + assert not issubclass(estimator.__class__, SupervisedLearning.SupervisedLearning), \ + f"estimator class str(estimator.__class__) is not a SupervisedLearning derived class" vals = screenInputParams(support, params, includedParams, addOnKeys = addOnKeys) if vals: estimator.paramInput.findNodesAndSetValues(vals) From f7d3c96c753e35f5955e3ca0d497d328fdabac65 Mon Sep 17 00:00:00 2001 From: Dylan McDowell Date: Thu, 30 Mar 2023 13:17:06 -0600 Subject: [PATCH 2/2] Remove negation of condtional --- ravenframework/SupervisedLearning/FeatureSelection/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ravenframework/SupervisedLearning/FeatureSelection/utils.py b/ravenframework/SupervisedLearning/FeatureSelection/utils.py index 6f40c2ccc5..7abcba65d9 100644 --- a/ravenframework/SupervisedLearning/FeatureSelection/utils.py +++ b/ravenframework/SupervisedLearning/FeatureSelection/utils.py @@ -64,7 +64,7 @@ def screenAndTrainEstimator(Xreduced, yreduced, estimator, support, params, incl @ In, addOnKeys, list, optional, list of additional keys to remove @ Out, None """ - assert not issubclass(estimator.__class__, SupervisedLearning.SupervisedLearning), \ + assert issubclass(estimator.__class__, SupervisedLearning.SupervisedLearning), \ f"estimator class str(estimator.__class__) is not a SupervisedLearning derived class" vals = screenInputParams(support, params, includedParams, addOnKeys = addOnKeys) if vals: