Comments (5)
I like to extend the scope of this issue to setup something that can actually do some sort of static type checking. Until we can use Python 3, it seems PEP 484 has a suggestion for Python 2.7 that we can use:
Suggested syntax for Python 2.7 and straddling code
I have tried this annotation and PyCharm understands/validates it but I have only used it in IDE. We should setup an automated tool that understands and validates these hints and add it as part of our presubmit checks.
from gcp-variant-transforms.
I also checked with python-users@ and it seems the comment style suggestion or PEP-484 conforms to the style guide. It is also concise and makes the eventual move to Python 3 type annotation easy, so I am going to send PRs to update the code with this and setup a presubmit check.
from gcp-variant-transforms.
Thanks, Bashir! I also really like the comment style type definitions!
I now wonder if it makes sense to just use PEP-484 and remove types from our Args completely. Do you know if there is a doc generator that understands the comment style docs? I'm thinking of having API docs similar to Beam where you can click on types in the comments, but I find the sphinx style confusing (e.g. the :class:
operators) and very easy to get wrong (e.g. most of the links in the Beam doc don't work).
P.S. I came across the "Google style" args checker (it was kinda noisy when I tried it though). It also doesn't enforce types.
from gcp-variant-transforms.
Asha has created separate issues for type checking, namely Issue #189, #190, so I am unassigning myself since type checking was the main part I was planning to do. I may pick #190 later on in the quarter if I find any free cycles.
from gcp-variant-transforms.
I managed to create the docs using Sphinx (similar to what Beam does), but I actually don't think that it's super useful at this point and we'd need to somehow have an automatic way of updating the docs as well. So, lowering the priority for now.
If anyone wants to generate the docs themselves, they can just run the following from the root of gcp-variant-transforms
directory. The docs will be under docs/api/_build/index.html
.
pip install sphinx sphinx_rtd_theme
python $(type -p sphinx-apidoc) -fMeT -o docs/api gcp_variant_transforms
cat > docs/api/conf.py <<'EOF'
import os
import sys
import sphinx_rtd_theme
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.doctest',
'sphinx.ext.intersphinx',
'sphinx.ext.napoleon',
'sphinx.ext.viewcode',
]
master_doc = 'index'
html_theme = 'sphinx_rtd_theme'
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
project = 'GCP Variant Transforms'
autoclass_content = 'both'
autodoc_member_order = 'bysource'
EOF
cat > docs/api/index.rst <<'EOF'
.. include:: ./gcp_variant_transforms.rst
:start-line: 2
EOF
python $(type -p sphinx-build) -v -a -E -j 8 -q docs/api docs/api/_build -c docs/api
from gcp-variant-transforms.
Related Issues (20)
- Add a flag to specify the "pipeline mode" (SMALL, MEDIUM, or LARGE) HOT 7
- Add a flag to preserve the call.name field HOT 9
- Add a flag to omit homozygous reference calls on vcf_to_bq import
- Document how to use Dataflow Flexible Resource Scheduling to save on Cloud cost
- Update the VEP release used for annotations HOT 1
- Fix deploy_and_run_tests.sh to be locally runnable.
- Enabling --save_main_session pipeline option in our pipelines. HOT 1
- Add an option to disable sharding
- off by 1 error? HOT 3
- move_hom_ref_calls python error HOT 1
- Network parameter not being read HOT 27
- VCF to BQ Timeout Issue HOT 4
- The MISSING_GENOTYPE_VALUE value of -1 can conflict with genotype values that are in a VCF (scalar vs. list)
- pyYAML 6.0 incompatability HOT 1
- unable to pull from pypi.org when running under VPC SC
- flatten null repeated column
- AnnotateShards not producing **vep_output.vcf HOT 3
- VCF to BQ via docker keeps failing HOT 1
- support for newer version than python 3.7
- subnetwork flag to use network/subnet outside the project where dataflow runs in
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gcp-variant-transforms.