Skip to content

Commit

Permalink
Review2 (#563)
Browse files Browse the repository at this point in the history
  • Loading branch information
dfguerrerom authored Dec 20, 2023
2 parents aced3de + aa370b1 commit 1d7e9b8
Show file tree
Hide file tree
Showing 82 changed files with 2,609 additions and 2,362 deletions.
28 changes: 8 additions & 20 deletions docs/source/_data/modules/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"bfast_explorer": {
"description": "Performs analysis of Landsat Surface Reflectance time series pixel data using the BFAST algorithm.",
"tag": ["time-series"],
"url": "https://raw.githubusercontent.com/sepal-contrib/bfast-explorer/master/md/tutorial.rst"
"url": "https://raw.githubusercontent.com/sepal-contrib/bfast-explorer/main/md/tutorial.rst"
},
"bfast_gpu": {
"description": "GPU implementation of the BFAST algorithm to analyse time series",
Expand All @@ -19,10 +19,7 @@
},
"bfast_r": {
"tag": ["time-series"],
"url": "https://raw.githubusercontent.com/sepal-contrib/bfastspatial/master/www/tutorial/tutorial.rst"
},
"bootstrap_sampling_simulator": {
"tag": ["inventories"]
"url": "https://raw.githubusercontent.com/sepal-contrib/bfastspatial/main/www/tutorial/tutorial.rst"
},
"clip-time-series": {
"description": "Generate a .pdf file containing time series clip on a given set of points",
Expand All @@ -46,7 +43,6 @@
"description": "Mapping all kind of canopy disturbances (natural or human induced) within (semi-)evergreen forests",
"url": "https://raw.githubusercontent.com/sepal-contrib/fcdm/release/doc/en.rst"
},
"geo_processing": {},
"gfc_wrapper_python": {
"description": "Combine the GFC layers to produce a forest change map",
"url": "https://raw.githubusercontent.com/sepal-contrib/gfc_wrapper_python/release/doc/en.rst"
Expand All @@ -59,7 +55,6 @@
"tag": ["restoration"],
"url": "https://raw.githubusercontent.com/sepal-contrib/gwb/release/doc/en.rst"
},
"gwl_analysis": {},
"vector_manager": {
"description": "Tool to manage vector files in SEPAL (upload, download, export to GEE and grid generation)",
"url": "https://raw.githubusercontent.com/sepal-contrib/vector_manager/release/doc/en.rst"
Expand All @@ -69,24 +64,18 @@
"tag": ["PlanetLab"],
"url": "https://raw.githubusercontent.com/sepal-contrib/planet-order/release/doc/en.rst"
},
"plot_generator": {
"tag": ["inventories"]
},
"sae_analysis": {
"url": "https://raw.githubusercontent.com/openforis/accuracy-assessment/master/aa_analysis/doc.rst"
},
"sae_design": {},
"sar_time_series": {
"tag": ["time-series"]
},
"sdg_indicator": {
"description": "Monitor SDG indicators at plot level",
"tag": ["restoration"],
"url": "https://raw.githubusercontent.com/sepal-contrib/sdg_15.3.1/release/doc/en.rst"
},
"sepafe": {
"tag": ["PlanetLab"],
"url": "https://raw.githubusercontent.com/sepal-contrib/planet_active_fires_explorer/master/doc/en.rst"
"description": "Display active and past fire events from the Fire Information for Resource Management System (FIRMS) using Planet Lab data.",
"url": "https://raw.githubusercontent.com/sepal-contrib/planet_active_fires_explorer/release/doc/en.rst"
},
"sepal_mgci": {
"description": "Calculates the SDG 15.4.2: Mountain Green Cover Index at national/sub-regional scale",
Expand All @@ -113,10 +102,9 @@
"tag": ["SMFM"]
},
"tmf": {
"description": "Wrapper for TMF"
},
"zonal-analysis": {
"url": "https://raw.githubusercontent.com/sepal-contrib/zonal-analysis/release/doc/en.rst"
"description": "Tropical Moist Forest by EC-JRC",
"tag": ["other"],
"url": "https://raw.githubusercontent.com/sepal-contrib/tmf_sepal/release/doc/en.rst"
},
"gee-source": {
"description": "Extract source code from any GEE app URL",
Expand All @@ -128,6 +116,6 @@
},
"basin-river": {
"description": "Get Forest Cover Change by upstream sub-catchment",
"url": "https://raw.githubusercontent.com/sepal-contrib/basin-rivers/master/doc/en.rst"
"url": "https://raw.githubusercontent.com/sepal-contrib/basin-rivers/release/doc/en.rst"
}
}
29 changes: 16 additions & 13 deletions docs/source/_data/python_lib.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@ scipy
shapely
shapely-geojson
tqdm
xarray-leaflet
GDAL==$GDAL_VERSION
bqplot
numpy==$NUMPY_VERSION
numpy
geopandas
matplotlib
pandas
Expand All @@ -20,36 +19,33 @@ geeadd
######## Google Earthengine ########
oauth2client
google-api-python-client==1.12.8
git+https://github.com/openforis/earthengine-api.git@v0.1.343#egg=earthengine-api&subdirectory=python
git+https://github.com/openforis/earthengine-api.git@v0.1.374#egg=earthengine-api&subdirectory=python
oeel

######## BFAST dependencies ########
wget
Sphinx==2.2.0
sphinx-bootstrap-theme==0.7.1
Sphinx
sphinx-bootstrap-theme
numpydoc
git+https://github.com/12rambau/bfast.git

######## sepal modules ########
geemap
Unidecode
pyperclip
python-dateutil
pytesmo
Wand
PyPDF2 # more recent version are available (PyPDF4)
PyPDF2 # more recent version are avaiable (PyPDF4)
rasterio
openpyxl
pre-commit
ipywidgets==7.7.2
ipyvuetify==1.8.2


######## web api ########
falcon
gunicorn
pyCrypto
awscli
awscli==1.11.18 # Pinned to prevent backtracking

######## other deps ########
xarray
Expand All @@ -58,8 +54,14 @@ dask-geopandas
nrt
seaborn
requests
llvmlite
coverage
geetools
geeadd
geeup
cogee
xee
torch
torchvision

######## OSK requirements ########
descartes
Expand All @@ -70,12 +72,13 @@ imageio
rtree
retrying
Cython
pyproj==2.6.1 # Require proj update before 3.0.0 can be installed
pyproj

######## Early Warning System for Canopy Disturbances in Ecuador (SATA) ########
nose
nosexcover
pylint
click
dateutils
boto3
boto3==1.4.3 # Pinned to prevent backtracking

17 changes: 7 additions & 10 deletions docs/source/_data/r_packages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@ export JAVA_LD_LIBRARY_PATH=${JAVA_HOME}/lib/server:${JAVA_HOME}/lib

R CMD javareconf

# Install CRAN packages via r-proxy

R -e "install.packages('rgdal', version = '1.3-9', dependencies = TRUE, repos = 'http://r-proxy:8180/', upgrade = 'never')"

R -e "install.packages(c(\
'abind',\
'askpass',\
Expand Down Expand Up @@ -201,7 +197,6 @@ R -e "install.packages(c(\
'reshape2',\
'reticulate',\
'rgbif',\
'rgeos',\
'rgexf',\
'RgoogleMaps',\
'rhandsontable',\
Expand Down Expand Up @@ -295,17 +290,19 @@ R -e "install.packages(c(\
'yaml',\
'zeallot',\
'zoo'
), repos='http://r-proxy:8180/', upgrade = 'never')"
), repos='http://r-proxy:8180/')"

# Install GitHub packages via r-proxy
# Install archived packages - this doesn't work through r-proxy
R -e "install.packages('https://cran.r-project.org/src/contrib/Archive/rgdal/rgdal_1.6-7.tar.gz')"
R -e "install.packages('https://cran.r-project.org/src/contrib/Archive/rgeos/rgeos_0.6-4.tar.gz')"

R -e "install.packages('remotes', dependencies=TRUE, repos='http://r-proxy:8180/', upgrade = 'never')"
R -e "install.packages('remotes', dependencies=TRUE, repos='http://r-proxy:8180/')"

R -e "remotes::install_url(c(\
'http://r-proxy:8180/github/r-barnes/dggridR/archive/refs/heads/master.tar.gz',\
'http://r-proxy:8180/github/bfast2/bfast/archive/refs/heads/master.tar.gz',\
'http://r-proxy:8180/github/azvoleff/gfcanalysis/archive/refs/heads/master.tar.gz',\
'http://r-proxy:8180/github/loicdtx/bfastSpatial/archive/refs/heads/master.tar.gz',\
'http://r-proxy:8180/github/jreiche/bayts/archive/refs/heads/master.tar.gz',\
'http://r-proxy:8180/github/cran/gdalUtils/archive/refs/heads/master.tar.gz'
), repos='http://r-proxy:8180/', build = FALSE, upgrade = 'never')"
'http://r-proxy:8180/github/cran/gdalUtils/archive/refs/heads/master.tar.gz'\
), repos='http://r-proxy:8180/', build = FALSE)"
45 changes: 45 additions & 0 deletions docs/source/_script/lint_trailing.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import os
import sys

from docutils import ApplicationError


def process_file(file_path):
"""Process a single .rst file, checking for validity and fixing whitespace."""
try:
with open(file_path, "r") as f:
content = f.read()
# publish_string(source=content, writer_name="null") # Validate RST
with open(file_path, "w") as f:
f.writelines([line.rstrip() + "\n" for line in content.splitlines()])
print("done")
except (IOError, ApplicationError) as e:
print(f"Skipping file {file_path}: {e}")


def process_directory(path):
"""Process all .rst files in a directory."""
for root, dirs, files in os.walk(path):
for file in files:
if file.endswith(".rst"):
process_file(os.path.join(root, file))


def main():
"""Main function for the script."""
if len(sys.argv) != 2:
print(f"Usage: {sys.argv[0]} path_or_file")
sys.exit(1)

path_or_file = sys.argv[1]
if os.path.exists(path_or_file):
if os.path.isdir(path_or_file):
process_directory(path_or_file)
else:
process_file(path_or_file)
else:
print(f"The path {path_or_file} does not exist.")


if __name__ == "__main__":
main()
10 changes: 4 additions & 6 deletions docs/source/_script/modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ def get_modules():
module_list = json.loads(module_json.read_text())

for name in module_list:

dst = dwn_dir / f"{name}.rst"

file = module_list[name].get("url", no_module_url)
Expand All @@ -60,9 +59,10 @@ def get_modules():
if file == no_module_url:
txt = txt.replace("Module_name", name).replace("=", "=" * len(name))

# add the custom edit directive to the file to ensure the "edit this page"
# point to the correct file.
txt += f"\n.. custom-edit:: {file}\n"
if file != no_module_url:
# add the custom edit directive to the file to ensure the "edit this page"
# point to the correct file.
txt += f"\n\n.. custom-edit:: {file}\n"

dst.write_text(txt)

Expand All @@ -83,7 +83,6 @@ def get_tags():
tags = list(dict.fromkeys(tags))

for tag in tags:

# create a stub file
tag_file = module_dir / f"{tag}.rst"
copy(tag_template, tag_file)
Expand Down Expand Up @@ -130,7 +129,6 @@ def get_translation():

# loop in the modules
for name in module_list:

locale_folder = module_list[name].get("locale")
doc_url = module_list[name].get("url")

Expand Down
37 changes: 0 additions & 37 deletions docs/source/_static/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -94,43 +94,6 @@ html[data-theme="dark"] img:not(.only-dark):not(.dark-light) {
filter: none;
}

/*******************************************************************************
* characteristic of the map
*
**/
#map,
#map-overlay {
position: fixed;
top: 0;
left: 0;
margin: 0;
padding: 0;
height: 100vh;
width: 100vw;
}

#map {
z-index: -2;
}
#map-overlay {
z-index: -1;
}
html[data-theme="light"] #map-overlay {
background-color: rgba(255, 255, 255, 0.8);
}
html[data-theme="dark"] #map-overlay {
background-color: rgba(18, 18, 18, 0.3);
}
.leaflet-container {
background: var(--pst-color-background) !important;
}
.lb-outerContainer {
background-color: var(--pst-color-background);
}
footer {
background-color: var(--pst-color-background);
}

/*******************************************************************************
* custom article footer rendering
*/
Expand Down
4 changes: 3 additions & 1 deletion docs/source/_templates/community.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<div class="community">
<a href="https://groups.google.com/g/sepal-users">
<span class="mr-1">ask the community</span>
<span class="mr-1"
>For general support, ask the Google Group community</span
>
<i class="fa-solid fa-comments"></i>
</a>
</div>
4 changes: 2 additions & 2 deletions docs/source/_templates/disclaimer.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
.. danger::
.. attention::

This section is intended for the Sepal team members only. If you ended up here there is no need to read this documentation, You'll not have access to the referred tools
The **SEPAL team documentation** section was developed for SEPAL team members only. While contributors and collaborators are encouraged to review these articles, they are not mandatory for general SEPAL users.
2 changes: 1 addition & 1 deletion docs/source/_templates/e-learning.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div class="e-learning">
<a href="https://www.fao.org/in-action/sepal/resources/certified-course/en">
<span class="mr-1">Register for the e-learning course</span>
<span class="mr-1">For training, register for the e-learning course</span>
<i class="fa-solid fa-book-open"></i>
</a>
</div>
Loading

0 comments on commit 1d7e9b8

Please sign in to comment.