Skip to content

Commit 9303a7a

Browse files
committed
add docs
1 parent a336476 commit 9303a7a

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
# The theme to use for HTML and HTML Help pages. See the documentation for
4444
# a list of builtin themes.
4545
#
46-
html_theme = 'alabaster'
46+
html_theme = 'sphinx_rtd_theme'
4747

4848
# Add any paths that contain custom static files (such as style sheets) here,
4949
# relative to this directory. They are copied after the builtin static files,

ipython2cwl/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
1+
"""
2+
Compile IPython Jupyter Notebooks as CWL CommandLineTools
3+
"""
14
__version__ = "0.0.4"

ipython2cwl/cwltoolextractor.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@
3030

3131

3232
class AnnotatedVariablesExtractor(ast.NodeTransformer):
33+
"""AnnotatedVariablesExtractor removes the typing annotations
34+
from relative to ipython2cwl and identifies all the variables
35+
relative to an ipython2cwl typing annotation."""
3336
input_type_mapper = {
3437
(CWLFilePathInput.__name__,): (
3538
'File',
@@ -67,11 +70,15 @@ class AnnotatedVariablesExtractor(ast.NodeTransformer):
6770
}
6871

6972
def __init__(self, *args, **kwargs):
73+
"""Create an AnnotatedVariablesExtractor"""
7074
super().__init__(*args, **kwargs)
7175
self.extracted_variables: List = []
7276
self.to_dump: List = []
7377

7478
def __get_annotation__(self, type_annotation):
79+
"""Parses the annotation and returns it in a canonical format.
80+
If the annotation was a string 'CWLStringInput' the function
81+
will return you the object."""
7582
annotation = None
7683
if isinstance(type_annotation, ast.Name):
7784
annotation = (type_annotation.id,)
@@ -164,7 +171,8 @@ def visit_AnnAssign(self, node):
164171
pass
165172
return node
166173

167-
def visit_Import(self, node: ast.Import):
174+
def visit_Import(self, node: ast.Import) -> Any:
175+
"""Remove ipython2cwl imports """
168176
names = []
169177
for name in node.names: # type: ast.alias
170178
if name.name == 'ipython2cwl' or name.name.startswith('ipython2cwl.'):
@@ -177,6 +185,7 @@ def visit_Import(self, node: ast.Import):
177185
return None
178186

179187
def visit_ImportFrom(self, node: ast.ImportFrom) -> Any:
188+
"""Remove ipython2cwl imports """
180189
if node.module == 'ipython2cwl' or node.module.startswith('ipython2cwl.'):
181190
return None
182191
return node

0 commit comments

Comments
 (0)