Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add documentation and tests #34

Merged
merged 28 commits into from
Aug 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
d493136
add python tests
Nour-Cheour10 Aug 2, 2024
9638197
added doc
Nour-Cheour10 Aug 6, 2024
1a202d0
added notebooks
Nour-Cheour10 Aug 9, 2024
5ac64a9
jupyter lite in progresss
Nour-Cheour10 Aug 13, 2024
feec595
added test notebooks
Nour-Cheour10 Aug 14, 2024
85f90ef
change notebooks
Nour-Cheour10 Aug 14, 2024
cc6b78f
notebooks
Nour-Cheour10 Aug 14, 2024
2a95c1e
Heatmap notebooks
Nour-Cheour10 Aug 14, 2024
2c2c7c6
change te title in docs
Nour-Cheour10 Aug 14, 2024
d3f3071
added notebooks examples for github
Nour-Cheour10 Aug 16, 2024
1c2555d
jupyter lite + python block for geotiff
Nour-Cheour10 Aug 16, 2024
5e9e6a8
Delete jupyter lite files
Nour-Cheour10 Aug 20, 2024
06ba4d6
remove jupyter lite file
Nour-Cheour10 Aug 20, 2024
a8269c3
deteled extra file
Nour-Cheour10 Aug 20, 2024
9d98b51
fixed doc
Nour-Cheour10 Aug 21, 2024
ca61bc1
documentation improved
Nour-Cheour10 Aug 21, 2024
9b15fcc
Update Playwright Snapshots
github-actions[bot] Aug 22, 2024
52e87b4
Iterate on the docs and the jupyterlite build
martinRenou Aug 23, 2024
755f6d9
Iterate
martinRenou Aug 23, 2024
43f0e1d
Rework docs
martinRenou Aug 23, 2024
e1127bd
Iterate
martinRenou Aug 23, 2024
3075b62
Iterate
martinRenou Aug 23, 2024
a7cb320
Pin Python
martinRenou Aug 23, 2024
61fd483
Update Playwright Snapshots
github-actions[bot] Aug 23, 2024
6c3d9c8
More gentle test
martinRenou Aug 26, 2024
ccceb4a
Add action to build the docs
martinRenou Aug 26, 2024
7c3269d
Fix package name
martinRenou Aug 26, 2024
876d4f5
Fix default shell + deps
martinRenou Aug 26, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ on:
pull_request:
branches: '*'

defaults:
run:
shell: bash -l {0}

jobs:
build:
runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -40,6 +44,20 @@ jobs:
name: dist ${{ github.run_number }}
path: ./dist

build-docs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- uses: mamba-org/setup-micromamba@v1
with:
environment-file: docs/build-environment.yml

- name: Build
run: sphinx-build . output
working-directory: docs

visual-regression-tests:
runs-on: ubuntu-latest
needs: [build]
Expand Down
17 changes: 13 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,13 @@ instance/

# Sphinx documentation
docs/_build/
docs/source/_static/
docs/source/_static/embed-bundle.js
docs/source/_static/embed-bundle.js.map
docs/_static/
docs/_static/embed-bundle.js
docs/_static/embed-bundle.js.map
docs/build
docs/output
docs/jupyter_execute


# PyBuilder
target/
Expand Down Expand Up @@ -159,8 +163,13 @@ package-lock.json
# Packed lab extensions
ipyopenlayers/labextension
ipyopenlayers/nbextension

!ipyopenlayers/nbextension/extension.js


.yarn
.vscode/

#jupyter lite
.jupyterlite.doit.db
lite_build_output/dist
lite_build_output/.jupyterlite.doit.db
20 changes: 0 additions & 20 deletions docs/Makefile

This file was deleted.

5 changes: 5 additions & 0 deletions docs/api_reference/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
API Reference
=============

.. automodule:: ipyopenlayers.openlayers
:members:
22 changes: 22 additions & 0 deletions docs/build-environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: ipyopenlayers-docs

channels:
- conda-forge

dependencies:
- yarn~=3.0
- jupyterlab~=4.0
- jupyter-packaging~=0.12
- sphinx
- jupyter-sphinx
- nbsphinx
- nbsphinx-link
- python-build
- branca
- requests
- hatch
- pydata-sphinx-theme
- jupyterlite-sphinx
- jupyterlite-xeus
- pip:
- ..
20 changes: 12 additions & 8 deletions docs/source/conf.py → docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
'nbsphinx',
'jupyter_sphinx',
'nbsphinx_link',
'jupyterlite_sphinx',
]

# Set the nbsphinx JS path to empty to avoid showing twice of the widgets
Expand Down Expand Up @@ -72,7 +73,7 @@
# get version from python package:
import os
here = os.path.dirname(__file__)
repo = os.path.join(here, '..', '..')
repo = os.path.join(here, '..')
_version_py = os.path.join(repo, 'ipyopenlayers', '_version.py')
version_ns = {}
with open(_version_py) as f:
Expand Down Expand Up @@ -114,7 +115,7 @@
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
html_static_path = []


# -- Options for HTMLHelp output ------------------------------------------
Expand Down Expand Up @@ -181,18 +182,13 @@


# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {'https://docs.python.org/': None}
intersphinx_mapping = {'python': ('https://docs.python.org/3/', None)}

# Read The Docs
# on_rtd is whether we are on readthedocs.org, this line of code grabbed from
# docs.readthedocs.org
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'

if not on_rtd: # only import and set the theme if we're building docs locally
import sphinx_rtd_theme
html_theme = 'sphinx_rtd_theme'
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]

# otherwise, readthedocs.org uses their theme by default, so no need to specify it


Expand All @@ -211,3 +207,11 @@ def add_scripts(app):
logger.warning('missing javascript file: %s' % fname)
app.add_js_file(fname)
app.connect('builder-inited', add_scripts)

jupyterlite_dir = "."
jupyterlite_contents = "../examples/"
jupyterlite_silence = False
jupyterlite_bind_ipynb_suffix = False

html_theme = "pydata_sphinx_theme"
htmlhelp_basename = "ipyopenlayersdoc"
43 changes: 43 additions & 0 deletions docs/controls/fullscreen_control.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
Fullscreen Control
==================


The Fullscreen Control in `ipyopenlayers` allows users to toggle the map view between fullscreen and windowed modes. This control enhances the user experience by providing an easy way to expand the map to occupy the entire screen.


Example
-------


.. jupyter-execute::


from ipyopenlayers import Map, FullScreen, RasterTileLayer


# Create a map with initial zoom level and center coordinates
m = Map(center=[0, 0], zoom=2)

# Add layer
layer=RasterTileLayer()
m.add_layer(layer)

# Add a FullscreenControl to the map
fullscreen_control = FullScreen()
m.add_control(fullscreen_control)


# Display the map
m




Attributes
----------


.. autoclass:: ipyopenlayers.openlayers.FullScreen
:members:


11 changes: 11 additions & 0 deletions docs/controls/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Controls
===================
Controls provide interactive elements on a map that allow users to manipulate the map view or access additional functionalities. These controls can include zoom buttons, layer switches, and other user interface elements that enhance the usability and functionality of the map.

.. toctree::
:maxdepth: 1

zoomslider_control
scaleline_control
fullscreen_control
mouseposition_control
42 changes: 42 additions & 0 deletions docs/controls/mouseposition_control.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
Mouse Position Control
======================


The Mouse Position Control in `ipyopenlayers` shows the geographical coordinates of the mouse pointer on the map. This control is useful for users who need to know the precise location of their cursor within the map view.


Example
-------


.. jupyter-execute::


from ipyopenlayers import Map, MousePosition, RasterTileLayer


# Create a map with initial zoom level and center coordinates
m = Map(center=[0, 0], zoom=2)

# Add layer
layer=RasterTileLayer()
m.add_layer(layer)


# Add a MousePositionControl to the map
mouseposition_control = MousePosition()
m.add_control(mouseposition_control)


# Display the map
m




Attributes
----------


.. autoclass:: ipyopenlayers.openlayers.MousePosition
:members:
42 changes: 42 additions & 0 deletions docs/controls/scaleline_control.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
Scaleline Control
=================


The Scaleline Control in `ipyopenlayers` displays a scale line on the map, providing users with a visual reference for the map's scale. This helps users to understand the distances represented on the map at the current zoom level.


Example
-------


.. jupyter-execute::


from ipyopenlayers import Map, ScaleLine, RasterTileLayer


# Create a map with initial zoom level and center coordinates
m = Map(center=[0, 0], zoom=2)

# Add layer
layer=RasterTileLayer()
m.add_layer(layer)


# Add a ScalelineControl to the map
scaleline_control = ScaleLine()
m.add_control(scaleline_control)


# Display the map
m




Attributes
----------


.. autoclass:: ipyopenlayers.openlayers.ScaleLine
:members:
43 changes: 43 additions & 0 deletions docs/controls/zoomslider_control.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
Zoom Slider Control
===================


The Zoom Slider Control in `ipyopenlayers` provides a convenient slider interface for users to control the zoom level of the map.
This control enhances the user experience by allowing a more intuitive and precise adjustment of the zoom level.


Example
-------


.. jupyter-execute::


from ipyopenlayers import Map, ZoomSlider, RasterTileLayer


# Create a map with initial zoom level and center coordinates
m = Map(center=[0, 0], zoom=2)

# Add layer
layer=RasterTileLayer()
m.add_layer(layer)


# Add a ZoomSlider control to the map
zoom_slider = ZoomSlider()
m.add_control(zoom_slider)


# Display the map
m




Attributes
----------


.. autoclass:: ipyopenlayers.openlayers.ZoomSlider
:members:
File renamed without changes.
16 changes: 8 additions & 8 deletions docs/environment.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: ipyopenlayers_docs
name: xeus-python-kernel
channels:
- https://repo.mamba.pm/emscripten-forge
- conda-forge
dependencies:
- python=3.*
- nodejs
- jupyter_sphinx
- sphinx
- sphinx_rtd_theme
- nbsphinx
- nbsphinx-link
- python=3.11
- xeus-python
- ipywidgets
- traitlets
- pip:
- ..
1 change: 1 addition & 0 deletions docs/europe_110.geo.json

Large diffs are not rendered by default.

Loading
Loading