Skip to content

Commit

Permalink
DOCS: Added code tabs (#59)
Browse files Browse the repository at this point in the history
  • Loading branch information
davemlz authored Mar 2, 2022
1 parent 7b71297 commit ce4a6ab
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"sphinx.ext.autosectionlabel",
"sphinx_copybutton",
"nbsphinx",
"sphinx_tabs.tabs",
]

autodoc_default_flags = ["members"]
Expand Down
1 change: 1 addition & 0 deletions docs/docs-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ sphinx>=1.4, !=1.5.4
recommonmark
sphinxcontrib-autoprogram
sphinx-copybutton
sphinx-tabs
pydata-sphinx-theme
google-auth<2.0dev
protobuf<3.18.0,>=3.12.0
Expand Down
23 changes: 23 additions & 0 deletions eemont/imagecollection.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,29 @@ def closest(self, date, tolerance=1, unit="month"):
>>> import ee, eemont
>>> ee.Initialize()
>>> S2 = ee.ImageCollection('COPERNICUS/S2_SR').closest('2020-10-15')
.. tabs::
.. code-tab:: py
import ee, eemont
ee.Initialize()
S2 = ee.ImageCollection('COPERNICUS/S2_SR').closest('2020-10-15')
.. code-tab:: r
library(rgee)
library(reticulate)
ee_Initialize()
eemont <- import("eemont")
S2 <- ee$ImageCollection('COPERNICUS/S2_SR')$closest('2020-10-15')
.. code-tab:: julia
using EarthEngine, PyCall
Initialize()
eemont = pyimport("eemont");
S2 = EE.ImageCollection('COPERNICUS/S2_SR') |> x -> closest(x,'2020-10-15');
"""
return ee_extra.ImageCollection.core.closest(self, date, tolerance, unit)

Expand Down

0 comments on commit ce4a6ab

Please sign in to comment.