Skip to content

Commit

Permalink
chore: add QuickOverview section (#171)
Browse files Browse the repository at this point in the history
Co-authored-by: renaudjester <[email protected]>
Adding an overview notebook for users to have something to start on to code with the toolbox.
  • Loading branch information
uriii3 authored and renaudjester committed Oct 28, 2024
1 parent 7184848 commit a77cece
Show file tree
Hide file tree
Showing 17 changed files with 1,899 additions and 18 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,6 @@ dist/

# Sphinx documentation html build
doc/_build/

# Jupyter notebook checkpoints
**/.ipynb_checkpoints/
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ repos:
args: [--pytest-test-first]
exclude: ^tests/resources/
- id: pretty-format-json
exclude: ^doc/usage/quickoverview.ipynb
- repo: https://github.com/pre-commit/mirrors-isort
rev: v5.10.1
hooks:
Expand Down
3 changes: 3 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,6 @@ python:
install:
- method: pip
path: .

#TODO: add environment variables if we want to build the notebook when building the documentation
# https://docs.readthedocs.io/en/stable/environment-variables.html
2 changes: 1 addition & 1 deletion CONTRIBUTION.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ We use sphinx and read the docs to respectively build and distribute the documen

We use:

- autodoc: to create the documentation from the docstrings of the python interface or the comments in the models
- autodoc: to create the documentation from the docstrings of the Python interface or the comments in the models
- numpydoc: to convert numpydoc documentation to restructuresText
- sphinx-click: to generate the documentation from the click CLI
- furo: as a base template
Expand Down
5 changes: 5 additions & 0 deletions conda_environment_sphinx.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
name: conda-environment-sphinx
dependencies:
- python==3.9.18
- pip
Expand All @@ -7,3 +8,7 @@ dependencies:
- numpydoc==1.8.0
- sphinx-copybutton==0.5.2
- furo==2024.8.6
- myst_parser==3.0.1
- notebook==7.1.2
- ipywidgets==8.1.5
- matplotlib==3.9.2
7 changes: 4 additions & 3 deletions doc/command-line-interface.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
Command line interface
===================================================

.. _cli-intro:
.. click:: copernicusmarine.command_line_interface.copernicus_marine:base_command_line_interface
:prog: copernicusmarine
:nested: short
Expand All @@ -14,19 +15,19 @@ Command line interface
:nested: short
:commands: describe


.. _cli-subset:
.. click:: copernicusmarine.command_line_interface.group_subset:subset
:prog: subset
:nested: short
:commands: subset


.. _cli-get:
.. click:: copernicusmarine.command_line_interface.group_get:get
:prog: get
:nested: short
:commands: get


.. _cli-login:
.. click:: copernicusmarine.command_line_interface.group_login:login
:prog: login
:nested: short
Expand Down
8 changes: 7 additions & 1 deletion doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information

project = "Copernicus Marine Toolbox"
project = "Copernicus Marine toolbox"
copyright = "2024, Mercator Ocean International"
author = "Mercator Ocean International"

Expand All @@ -20,6 +20,7 @@
"sphinx_click",
"numpydoc",
"sphinx_copybutton",
"myst_nb",
]
numpydoc_show_class_members = False

Expand Down Expand Up @@ -67,3 +68,8 @@
"image/png",
"image/jpeg",
]

# -- Options for myst_nb --------------------------------------------------
# https://myst-nb.readthedocs.io/en/latest/configuration.html#config-intro

nb_execution_mode = "off"
4 changes: 2 additions & 2 deletions doc/index.rst
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
.. Copernicus Marine Toolbox documentation master file, created by
.. Copernicus Marine toolbox documentation master file, created by
sphinx-quickstart on Wed Aug 21 14:04:51 2024.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Copernicus Marine toolbox documentation
=======================================

The ``copernicusmarine`` Python library offers capabilities through both **Command Line Interface (CLI)** and **Python API**:
The ``copernicusmarine`` Python library offers capabilities through both **command line interface (CLI)** and **Python API**:

- **Metadata Information**: List and retrieve metadata information on all variables, datasets and products.
- **Subset Datasets**: Subset datasets to extract only the parts of interest, in preferred format, such as Analysis-Ready Cloud-Optimized (ARCO) Zarr or NetCDF file format.
Expand Down
4 changes: 3 additions & 1 deletion doc/installation.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
.. _installation-page:

===================================================
Installing Copernicus Marine toolbox
===================================================

There are several ways to install or use the Copernicus Marine Toolbox:
There are several ways to install or use the Copernicus Marine toolbox:

* via pip (see `PyPI repository <https://pypi.org/project/copernicusmarine/>`_)
* via mamba | conda (see `conda-forge channel <https://anaconda.org/conda-forge/copernicusmarine>`_)
Expand Down
3 changes: 3 additions & 0 deletions doc/usage/describe-usage.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
.. _describe-page:

=====================
Command ``describe``
=====================

Expand Down
3 changes: 3 additions & 0 deletions doc/usage/get-usage.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
.. _get-page:

===============
Command ``get``
===============

Expand Down
3 changes: 3 additions & 0 deletions doc/usage/login-usage.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
.. _login-page:

==================
Command ``login``
==================

Expand Down
2 changes: 1 addition & 1 deletion doc/usage/network-configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ to globally disable the usage of SSL in the toolbox:
``trust_env`` for Python libraries
------------------------------------

To do HTTP calls, the Copernicus Marine Toolbox uses the ``requests`` library.
To do HTTP calls, the Copernicus Marine toolbox uses the ``requests`` library.
By default, this library will have ``trust_env`` values set to ``True``.

If you want to deactivate this, you can set ``COPERNICUSMARINE_TRUST_ENV=False`` (default ``True``).
Expand Down
1,856 changes: 1,856 additions & 0 deletions doc/usage/quickoverview.ipynb

Large diffs are not rendered by default.

8 changes: 0 additions & 8 deletions doc/usage/quickstart.rst

This file was deleted.

3 changes: 3 additions & 0 deletions doc/usage/subset-usage.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
.. _subset-page:

===================
Command ``subset``
===================

Expand Down
2 changes: 1 addition & 1 deletion doc/usage/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Usage and technical details

.. toctree::

quickstart
quickoverview
login-usage
describe-usage
subset-usage
Expand Down

0 comments on commit a77cece

Please sign in to comment.