Skip to content

Commit

Permalink
Create a documentation page with a list of all eo tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
tomislijepcevic committed Jul 13, 2018
1 parent d848979 commit 9e2eae6
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -106,5 +106,6 @@ ENV/
# IDE config
.idea/

# Directory where examples are copied for Sphinx to process them
# Files that Sphinx generates
/docs/source/examples
/docs/source/eotasks.rst
1 change: 1 addition & 0 deletions docs/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ dependencies:
- python>=3.5
- rasterio
- opencv
- graphviz
- pip:
- Sphinx==1.7.5
- sphinx-rtd-theme==0.4.0
Expand Down
33 changes: 33 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
'sphinx.ext.autodoc',
'sphinx.ext.doctest',
'sphinx.ext.intersphinx',
'sphinx.ext.inheritance_diagram',
'nbsphinx',
'IPython.sphinxext.ipython_console_highlighting'
]
Expand Down Expand Up @@ -201,3 +202,35 @@
shutil.copytree('../../examples', './examples')
except FileExistsError:
pass

# Create a list of all EOTasks

def get_eotasks():
import eolearn.core
import eolearn.coregistration
import eolearn.features
# import eolearn.geometry
# import eolearn.io
# import eolearn.mask
import eolearn.ml_tools

return eolearn.core.EOTask.__subclasses__()


eotasks_str = " ".join([
eotask.__module__ + "." + eotask.__name__
for eotask in get_eotasks()
])

eotasks_file_content = '''
********
EO Tasks
********
.. inheritance-diagram:: %s
:top-classes: eolearn.core.EOTask
:parts: 3
'''

with open("eotasks.rst", "w") as f:
f.write(eotasks_file_content % eotasks_str)
1 change: 1 addition & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Documentation for eo-learn Python packages
:caption: Contents:

install
eotasks
examples
eolearn

Expand Down

0 comments on commit 9e2eae6

Please sign in to comment.