Skip to content

Commit 59ac007

Browse files
author
Ignacio Quintero
committed
Remove unused validation functions
isint() isbool() etc are no longer used.
1 parent 5649310 commit 59ac007

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

src/sagemaker/amazon/linear_learner.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
from sagemaker.amazon.amazon_estimator import AmazonAlgorithmEstimatorBase, registry
1414
from sagemaker.amazon.common import numpy_to_record_serializer, record_deserializer
1515
from sagemaker.amazon.hyperparameter import Hyperparameter as hp # noqa
16-
from sagemaker.amazon.validation import isin, gt, lt, isbool
16+
from sagemaker.amazon.validation import isin, gt, lt
1717
from sagemaker.predictor import RealTimePredictor
1818
from sagemaker.model import Model
1919
from sagemaker.session import Session
@@ -35,7 +35,7 @@ class LinearLearner(AmazonAlgorithmEstimatorBase):
3535
epochs = hp('epochs', gt(0), "An integer greater-than 0", int)
3636
predictor_type = hp('predictor_type', isin('binary_classifier', 'regressor'),
3737
'One of "binary_classifier" or "regressor"', str)
38-
use_bias = hp('use_bias', isbool, "Either True or False", bool)
38+
use_bias = hp('use_bias', (), "Either True or False", bool)
3939
num_models = hp('num_models', gt(0), "An integer greater-than 0", int)
4040
num_calibration_samples = hp('num_calibration_samples', gt(0), "An integer greater-than 0", int)
4141
init_method = hp('init_method', isin('uniform', 'normal'), 'One of "uniform" or "normal"', str)

src/sagemaker/amazon/validation.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
1111
# ANY KIND, either express or implied. See the License for the specific
1212
# language governing permissions and limitations under the License.
13-
import numbers
1413

1514

1615
def gt(minimum):
@@ -41,8 +40,3 @@ def istype(expected):
4140
def validate(value):
4241
return isinstance(value, expected)
4342
return validate
44-
45-
46-
isint = istype(int)
47-
isbool = istype(bool)
48-
isnumber = istype(numbers.Number) # noqa

0 commit comments

Comments
 (0)