Posted by Billy Lamberta, TensorFlow Team
Posted by Billy Lamberta, TensorFlow Team
When we published our first notebook on . This setup allows you to run—and experiment with—our guides and tutorials right in the browser, without installing any software on your machine. This , has buttons that link to both its notebook .
Software documentation is a team effort, and notebooks are an expressive, education-focused format that allows engineers and writers to build up an interactive demonstration. Jupyter notebooks are JSON-formatted files that contain text cells and code cells, typically executed in sequential order from top-to-bottom. They are an excellent way to communicate programming ideas, and, with some discipline, a way to share reproducible results.
Jupyter notebook support in GitLocalize not only benefits TensorFlow, but is now available for all open source translation projects that use notebooks with GitHub.
Incorporating Jupyter notebooks into our docs infrastructure allows us to run and test all the published to ensure everything on the site works for a new TensorFlow release—using stable or nightly packages.
Benefits aside, there are challenges with managing Jupyter notebooks as source code. To make pull requests and reviews easier for contributors and project maintainers, we created the GitHub repository:
$ python3 -m pip install -U git+https://github.com/tensorflow/docsWhile the Jupyter notebook format is straightforward, notebook authoring environments are often inconsistent with JSON formatting or embed their own metadata in the file. These unnecessary changes can cause diff churn in pull requests that make content reviews difficult. The solution is to use an auto-formatter that outputs consistent notebook JSON.
nbfmt is a notebook formatter with a preference for the . And with some further bot integration, formatting patches can be automatically applied to the contributor's pull request.
The easiest way to scale reviews is to let the machine do it. Every project has recurring issues that pop up in reviews, and style questions are often best settled with a style guide (TensorFlow likes the . nblint tests the google and tensorflow styles by default, and other style modules can be loaded at the command-line. Some styles require arguments that are also passed at the command-line, for example, setting a different repo when linting the TensorFlow translation notebooks:
$ python3 -m tensorflow_docs.tools.nblint \
--styles=tensorflow,tensorflow_docs_l10n \
--arg=repo:tensorflow/docs-1l0n \
notebook.ipynbLint tests can have an associated fix that makes it easy to update notebooks to pass style checks automatically. Use the --fix argument to apply lint fixes that overwrite the notebook, for example:
$ python3 -m tensorflow_docs.tools.nblint --fix \
--arg=repo:tensorflow/docs notebook.ipynbTensorFlow is a big fan of and then or a translation review to our GitLocalize project.
Special thanks to Mark Daoust, Wolff Dobson, Yash Katariya, the TensorFlow docs team, and all TensorFlow docs authors, reviewers, contributors, and supporters.
Ähnliche Beiträge
Thematisch verwandte Begriffe: TensorFlow, docs, uses, Jupyter · 6 Treffer
Videos werden geladen ...
Beiträge werden geladen ...
Videos werden geladen ...
Beiträge werden geladen ...
Videos werden geladen ...
Beiträge werden geladen ...
Videos werden geladen ...
Beiträge werden geladen ...
Videos werden geladen ...
Installiere tsecurity.de direkt auf deinen Home-Bildschirm für das ultimative Vollbild-Magazinerlebnis ohne Browser-Leisten.
Reiche interessante Links, Zero-Days oder Debatten ein. Die Community entscheidet per Upvote über die Veröffentlichung.
SOCIAL SHARE CARD GENERATOR