Skip to content

Remove __all__ and add noqa in __init__ #186

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jun 3, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ CHANGELOG
1.3.dev1
========

* bug-fix: Remove __all__ and add noqa in __init__
* bug-fix: Estimators: Change max_iterations hyperparameter key for KMeans

1.3.0
Expand Down
44 changes: 18 additions & 26 deletions src/sagemaker/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,31 +12,23 @@
# language governing permissions and limitations under the License.
from __future__ import absolute_import

from sagemaker import estimator
from sagemaker.amazon.kmeans import KMeans, KMeansModel, KMeansPredictor
from sagemaker.amazon.pca import PCA, PCAModel, PCAPredictor
from sagemaker.amazon.lda import LDA, LDAModel, LDAPredictor
from sagemaker.amazon.linear_learner import LinearLearner, LinearLearnerModel, LinearLearnerPredictor
from sagemaker.amazon.factorization_machines import FactorizationMachines, FactorizationMachinesModel
from sagemaker.amazon.factorization_machines import FactorizationMachinesPredictor
from sagemaker.amazon.ntm import NTM, NTMModel, NTMPredictor
from sagemaker.amazon.randomcutforest import RandomCutForest, RandomCutForestModel, RandomCutForestPredictor
from sagemaker import estimator # noqa: F401
from sagemaker.amazon.kmeans import KMeans, KMeansModel, KMeansPredictor # noqa: F401
from sagemaker.amazon.pca import PCA, PCAModel, PCAPredictor # noqa: F401
from sagemaker.amazon.lda import LDA, LDAModel, LDAPredictor # noqa: F401
from sagemaker.amazon.linear_learner import LinearLearner, LinearLearnerModel, LinearLearnerPredictor # noqa: F401
from sagemaker.amazon.factorization_machines import FactorizationMachines, FactorizationMachinesModel # noqa: F401
from sagemaker.amazon.factorization_machines import FactorizationMachinesPredictor # noqa: F401
from sagemaker.amazon.ntm import NTM, NTMModel, NTMPredictor # noqa: F401
from sagemaker.amazon.randomcutforest import (RandomCutForest, RandomCutForestModel, # noqa: F401
RandomCutForestPredictor)

from sagemaker.local.local_session import LocalSession
from sagemaker.local.local_session import LocalSession # noqa: F401

from sagemaker.model import Model
from sagemaker.predictor import RealTimePredictor
from sagemaker.session import Session
from sagemaker.session import container_def
from sagemaker.session import production_variant
from sagemaker.session import s3_input
from sagemaker.session import get_execution_role


__all__ = ['estimator', 'KMeans', 'KMeansModel', 'KMeansPredictor', 'PCA', 'PCAModel', 'PCAPredictor', 'LinearLearner',
'LinearLearnerModel', 'LinearLearnerPredictor',
'LDA', 'LDAModel', 'LDAPredictor',
'FactorizationMachines', 'FactorizationMachinesModel', 'FactorizationMachinesPredictor',
'RandomCutForest', 'RandomCutForestModel', 'RandomCutForestPredictor',
'Model', 'NTM', 'NTMModel', 'NTMPredictor', 'RealTimePredictor', 'Session', 'LocalSession',
'container_def', 's3_input', 'production_variant', 'get_execution_role']
from sagemaker.model import Model # noqa: F401
from sagemaker.predictor import RealTimePredictor # noqa: F401
from sagemaker.session import Session # noqa: F401
from sagemaker.session import container_def # noqa: F401
from sagemaker.session import production_variant # noqa: F401
from sagemaker.session import s3_input # noqa: F401
from sagemaker.session import get_execution_role # noqa: F401
8 changes: 3 additions & 5 deletions src/sagemaker/mxnet/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
# ANY KIND, either express or implied. See the License for the specific
# language governing permissions and limitations under the License.
from __future__ import absolute_import
from __future__ import absolute_import # noqa: F401

from sagemaker.mxnet.estimator import MXNet
from sagemaker.mxnet.model import MXNetModel, MXNetPredictor

__all__ = ['MXNet', 'MXNetModel', 'MXNetPredictor']
from sagemaker.mxnet.estimator import MXNet # noqa: F401
from sagemaker.mxnet.model import MXNetModel, MXNetPredictor # noqa: F401
10 changes: 4 additions & 6 deletions src/sagemaker/tensorflow/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,12 @@
# classes for tensorflow serving. Currently tensorflow_serving_api can only be pip-installed for python 2.
sys.path.append(os.path.dirname(__file__))

from distutils.version import LooseVersion # noqa: E402
import tensorflow # noqa: E402
from distutils.version import LooseVersion # noqa: E402, F401
import tensorflow # noqa: E402, F401

if LooseVersion(tensorflow.__version__) < LooseVersion("1.3.0"):
message = 'Tensorflow version must be >= 1.3.0. Current version: {}'.format(tensorflow.__version__)
raise AssertionError(message)

from sagemaker.tensorflow.estimator import TensorFlow # noqa: E402
from sagemaker.tensorflow.model import TensorFlowModel, TensorFlowPredictor # noqa: E402

__all__ = ['TensorFlow', 'TensorFlowModel', 'TensorFlowPredictor']
from sagemaker.tensorflow.estimator import TensorFlow # noqa: E402, F401
from sagemaker.tensorflow.model import TensorFlowModel, TensorFlowPredictor # noqa: E402, F401