Skip to content

Commit

Permalink
Typo in layer docs
Browse files Browse the repository at this point in the history
  • Loading branch information
dsblank committed Aug 7, 2017
1 parent c46e774 commit b3a064a
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions conx/layers.py
Original file line number Diff line number Diff line change
Expand Up @@ -343,11 +343,9 @@ def process_class_docstring(docstring):
docstring = re.sub(r'\n # (.*)\n',
r'\n __\1__\n\n',
docstring)

docstring = re.sub(r' ([^\s\\\(]+):(.*)\n',
r' - __\1__:\2\n',
docstring)

docstring = docstring.replace(' ' * 5, '\t\t')
docstring = docstring.replace(' ' * 3, '\t')
docstring = docstring.replace(' ', '')
Expand All @@ -358,13 +356,12 @@ def process_class_docstring(docstring):
keras_module = sys.modules["keras.layers"]
for (name, obj) in inspect.getmembers(keras_module):
if type(obj) == type and issubclass(obj, (keras.engine.Layer, )):
new_name = "%sLayer" % name
try:
docstring_md = ' **' + obj.__name__ + '**\n\n'
docstring_md += ' ' + obj.__doc__
docstring_md = ' **%sLayer**\n\n' % (new_name,)
docstring = pypandoc.convert(process_class_docstring(docstring_md), "rst", "markdown_github")
except:
docstring = obj.__doc__
new_name = "%sLayer" % name
locals()[new_name] = type(new_name, (BaseLayer,),
{"CLASS": obj,
"__doc__": docstring})
Expand Down

0 comments on commit b3a064a

Please sign in to comment.