Skip to content

Commit

Permalink
Update and simplify documentation build
Browse files Browse the repository at this point in the history
  • Loading branch information
LourensVeen committed Mar 31, 2024
1 parent 834f2a1 commit 1b27a09
Show file tree
Hide file tree
Showing 11 changed files with 81 additions and 229 deletions.
17 changes: 17 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
version: 2

build:
os: ubuntu-22.04
tools:
python: "3.12"

python:
install:
- requirements: docs/requirements.txt
# install the package so that we have the dependencies and can import the files
- method: pip
path: .

sphinx:
configuration: docs/source/conf.py
builder: html
4 changes: 2 additions & 2 deletions docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
SPHINXOPTS =
SPHINXBUILD = sphinx-build
SPHINXPROJ = cerulean
SOURCEDIR = .
BUILDDIR = _build
SOURCEDIR = source
BUILDDIR = build

# Put it first so that "make" without argument is like "make help".
help:
Expand Down
Empty file removed docs/_static/.gitignore
Empty file.
Empty file removed docs/_templates/.gitignore
Empty file.
211 changes: 0 additions & 211 deletions docs/conf.py

This file was deleted.

5 changes: 5 additions & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
docutils
sphinx
sphinx-rtd-theme
recommonmark

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


.. automodule:: cerulean
:members:
38 changes: 38 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Configuration file for the Sphinx documentation builder.
#
# For the full list of built-in configuration values, see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

from os import path
import sys

# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information

project = 'Cerulean'
copyright = '2018-2019, 2024, The Netherlands eScience Center and VU University Amsterdam'
author = 'Lourens Veen'

release = '0.3.8.dev0'

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration

# apidoc needs to be able to import cerulean
here = path.dirname(__file__)
sys.path.insert(0, path.abspath(path.join(here, '..', '..')))

extensions = ['sphinx.ext.autodoc', 'sphinx.ext.napoleon']

templates_path = ['_templates']
exclude_patterns = []

root_doc = 'index'


# -- Options for HTML output -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output

html_theme = 'sphinx_rtd_theme'
html_static_path = ['_static']

12 changes: 5 additions & 7 deletions docs/index.rst → docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,17 @@
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
====================================
Welcome to Cerulean's documentation!
==========================================================
====================================

Cerulean is a Python 3 library for connecting to HPC compute resources, such as
compute clusters and supercomputers. It lets you copy files between local and
SFTP filesystems using a ``pathlib``-like API, it lets you start processes
locally and remotely via SSH, and it lets you submit jobs to schedulers such as
Slurm and Torque/PBS.

Cerulean supports Python 3.4 and later.
Cerulean supports Python 3.7 and later.

.. toctree::
:maxdepth: 2
Expand All @@ -21,13 +22,10 @@ Cerulean supports Python 3.4 and later.
tutorial


API Reference
=============

.. toctree::
:maxdepth: 1
:maxdepth: 1

API reference <apidocs/cerulean.rst>
api


Indices and tables
Expand Down
15 changes: 7 additions & 8 deletions docs/tutorial.rst → docs/source/tutorial.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
========
Tutorial
========

Expand All @@ -18,7 +17,7 @@ dependencies.


Accessing files
===============
---------------

The file access functions of Cerulean use a ``pathlib``-like API, but unlike in
``pathlib``, Cerulean supports remote file systems. That means that there is no
Expand Down Expand Up @@ -66,7 +65,7 @@ You can use the ``/`` operator to build paths from components as with
documentation for :class:`cerulean.Path` for details.

Remote filesystems
------------------
``````````````````

Cerulean supports remote file systems through the SFTP protocol. (It uses the
Paramiko library internally for this.) Accessing a remote file system through
Expand Down Expand Up @@ -105,7 +104,7 @@ from there it works just like a local file system. Just like
another ``with``-statement.

Copying files
-------------
`````````````

When running jobs on HPC machines, you often start with copying the input files
from the local system to the HPC machine, and finish with copying the results
Expand All @@ -132,7 +131,7 @@ you would expect:
cerulean.copy(job_dir / 'output.txt', output_file)
Running commands
================
----------------

If you have read the above, then the secret is already out: running commands
using Cerulean is done using a :class:`Terminal`. For example, you can run a
Expand Down Expand Up @@ -173,7 +172,7 @@ except you use an :class:`SshTerminal`, as above:
Submitting jobs
===============
---------------

On High Performance Computing machines, you don't run commands directly.
Instead, you submit batch jobs to a scheduler, which will place them in a queue,
Expand Down Expand Up @@ -215,7 +214,7 @@ the scheduler is local, and you want to use a :class:`LocalTerminal` with your


More information
================
----------------

To find all the details of what Cerulean can do and how to do it, please refer
to the :doc:`API documentation<apidocs/cerulean>`.
to the :doc:`API documentation<api>`.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ deps =
sphinx
sphinx-rtd-theme
recommonmark
commands = sphinx-build docs/ docs/_build/html -bhtml
commands = sphinx-build -M html docs/source docs/build
"""

Expand Down

0 comments on commit 1b27a09

Please sign in to comment.