Skip to content

Apply same linting and code style used in the package to the code examples in the docs #1606

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

Open
metrizable opened this issue Jun 18, 2020 · 0 comments

Comments

@metrizable
Copy link
Contributor

What did you find confusing? Please describe.

In the docs, the various code blocks do not have a consistent code style and the code examples do not adhere to a standard Python code style in the same way the code in the package itself does. The documentation code blocks would benefit from the same linting and style standards that the package code adheres to.

Describe how documentation can be improved

Example code block in the documentation before linting and code style:

tf_estimator = TensorFlow(entry_point='tf-train.py', role='SageMakerRole',
                          train_instance_count=1, train_instance_type='ml.p2.xlarge',
                          framework_version='1.12', py_version='py3')
tf_estimator.fit('s3://bucket/path/to/training/data')

Code block after linting and code style applied (pylint, black, and flake8):

tf_estimator = TensorFlow(
    entry_point="tf-train.py",
    role="SageMakerRole",
    train_instance_count=1,
    train_instance_type="ml.p2.xlarge",
    framework_version="1.12",
    py_version="py3"
)
tf_estimator.fit("s3://bucket/path/to/training/data")

These changes, applied across the documentation, would lead to a more consistent user experience between documentation and package code. The code blocks would then provide examples that adhere to commonly accepted best practices and coding standards for Python.

Additional context

n/a

pintaoz-aws pushed a commit that referenced this issue Dec 4, 2024
pintaoz-aws pushed a commit that referenced this issue Dec 4, 2024
@nargokul nargokul self-assigned this Feb 4, 2025
@nargokul nargokul added the component: pysdk-team Related to SageMaker Python SDK Core Issues label Apr 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants