Skip to content

Commit

Permalink
Readthedocs (#37)
Browse files Browse the repository at this point in the history
* Update primary info

* Build docs only from main
  • Loading branch information
daniel-sol authored Feb 20, 2024
1 parent 37c5ab6 commit 4b2df28
Show file tree
Hide file tree
Showing 15 changed files with 424 additions and 79 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/build_docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# build and test some end points
name: Build and deploy docs for fmu-sumo

on:
pull_request:
branches: [main]
push:
branches: [main]

jobs:
build_pywheels:
name: Build docs with Python ${{ matrix.python-version }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ["3.10"]
os: [ubuntu-latest]

steps:
- uses: actions/checkout@v1

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install and build docs
run: |
pip install pip -U && pip install wheel -U
pip install .[docs]
pip list
sphinx-build docs build/sphinx/html
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ instance/

# Sphinx documentation
docs/_build/
docs/Make*
docs/make*

# PyBuilder
.pybuilder/
Expand Down
16 changes: 16 additions & 0 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
version: 2

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

python:
install:
- method: pip
path: .
extra_requirements:
- docs

sphinx:
configuration: docs/conf.py
Binary file added docs/_static/equinor-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_static/equinor-logo2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_static/equinor_logo.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_static/equinor_logo_only.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions docs/_templates/layout.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{% extends "!layout.html" %}
{% block footer %} {{ super() }}

<style>
/* Sidebar header (and topbar for mobile) */
.wy-side-nav-search, .wy-nav-top {
background: #ff1243;
}
/* Sidebar */
.wy-nav-side {
background: #474747;
}
.wy-side-nav-search > div.version {
color: white;
}
</style>
{% endblock %}
8 changes: 8 additions & 0 deletions docs/api.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
API
===
If you are a developer and want to understand the details going on under the proverbial hood, this section is for you.

.. automodule:: fmu.sumo.sim2sumo.sim2sumo
:members:
:undoc-members:
:show-inheritance:
57 changes: 57 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

# -- Path setup --------------------------------------------------------------

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
import os
import sys

sys.path.insert(0, os.path.abspath("../src/"))


# -- Project information -----------------------------------------------------

project = "fmu-sumo-sim2sumo"
copyright = "2023, Sudo Team @ Equinor"
author = "Sudo Team @ Equinor"


# -- General configuration ---------------------------------------------------

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
"sphinx.ext.napoleon",
"sphinx.ext.autodoc",
]

# Add any paths that contain templates here, relative to this directory.
templates_path = ["_templates"]

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]


# -- Options for HTML output -------------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = "sphinx_rtd_theme"
html_logo = "_static/equinor-logo2.jpg"


# 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"]
17 changes: 17 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
.. fmu-sumo-sim2sumo documentation master file, created by
sphinx-quickstart on Wed Jan 31 10:50:22 2024.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Welcome to fmu-sumo-sim2sumo's documentation!
=============================================
``fmu.sumo.sim2sumo`` is a python package for uploading results to Sumo.
The package facilitates upload of results from reservoir simulators such as **eclipse**, **IX**, and **OPM flow** as arrow files.

.. toctree::
:maxdepth: 2
:caption: Contents:

self
sim2sumo
api
Loading

0 comments on commit 4b2df28

Please sign in to comment.