Skip to content

Commit

Permalink
Documentation setup (#179)
Browse files Browse the repository at this point in the history
  • Loading branch information
andersy005 authored May 12, 2022
1 parent 5dc9a32 commit 84b81ec
Show file tree
Hide file tree
Showing 13 changed files with 92 additions and 52 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -129,3 +129,7 @@ dmypy.json

# Pyre type checker
.pyre/

node_modules/
.next/
generated/
38 changes: 38 additions & 0 deletions docs/api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# API

```{eval-rst}
.. currentmodule:: cmip6_downscaling
```

## Data

```{eval-rst}
.. autosummary::
:toctree: generated/
data.cmip.postprocess
data.cmip.load_cmip
data.cmip.get_gcm
data.observations.open_era5
data.utils.to_standard_calendar
data.utils.lon_to_180
```

## Downscaling Methods

```{eval-rst}
.. currentmodule:: cmip6_downscaling.methods
```

### BCSD

```{eval-rst}
.. autosummary::
:toctree: generated/
bcsd.tasks.spatial_anomalies
bcsd.tasks.fit_and_predict
bcsd.tasks.postprocess_bcsd
```
32 changes: 0 additions & 32 deletions docs/api.rst

This file was deleted.

3 changes: 2 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"numpydoc",
"IPython.sphinxext.ipython_directive",
"IPython.sphinxext.ipython_console_highlighting",
"myst_parser",
]

autosummary_generate = True
Expand Down Expand Up @@ -67,7 +68,7 @@

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
exclude_patterns = ["_build"]
exclude_patterns = ["_build", "node_modules"]

# The name of the Pygments (syntax highlighting) style to use.
pygments_style = "sphinx"
Expand Down
9 changes: 2 additions & 7 deletions docs/deploy.sh → docs/create-mamba-env.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

set -x
set -xe

# install mamba
yum install -y wget bzip2
Expand All @@ -10,9 +10,4 @@ source ~/.bashrc

# install python deps
micromamba create -y -f ./environment.yml
micromamba activate docs
pip install ..

# build json content
make json
ls _build/json/*
micromamba activate cmip6-downscaling-docs
24 changes: 23 additions & 1 deletion docs/environment.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: docs
name: cmip6-downscaling-docs
channels:
- conda-forge
- nodefaults
Expand All @@ -10,7 +10,29 @@ dependencies:
- setuptools
- sphinx
- numpydoc
- myst-nb
# this project's dependencies
- adlfs
- dask
- dask-kubernetes
- donfig
- fsspec
- gcsfs
- intake-esm
- intake-xarray
- numpy
- pandas
- prefect
- regionmask
- scikit-downscale
- scikit-learn
- scipy
- xclim
- xpersist
- zarr
- universal_pathlib
- ndpyramid
- pip:
- git+https://github.com/carbonplan/xarray-schema
- carbonplan-data
- -e ..
11 changes: 11 additions & 0 deletions docs/make-sphinx-json.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

set -xe

source ~/.bashrc

micromamba activate cmip6-downscaling-docs

# build json content
make json
ls _build/json/*
2 changes: 1 addition & 1 deletion docs/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@
"description": "",
"main": "index.js",
"scripts": {
"create-mamba-env": "bash create-mamba-env.sh",
"make-sphinx-json": "bash make-sphinx-json.sh",
"dev": " NODE_ENV=development next",
"start": "next start",
"build": "bash deploy.sh && next build"
"build": "npm run create-mamba-env && npm run make-sphinx-json && next build",
"devbuild": "next build"
},
"author": "",
"license": "MIT",
Expand All @@ -18,7 +21,7 @@
"@mdx-js/loader": "^1.6.22",
"@mdx-js/react": "^1.6.22",
"@next/mdx": "^12.0.7",
"html-to-react": "^1.4.7",
"html-to-react": "^1.4.8",
"next": "^12.0.7",
"react": "^17.0.2",
"react-dom": "^17.0.2",
Expand Down
5 changes: 1 addition & 4 deletions docs/pages/cmip6-downscaling/how-to-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,4 @@ import Section from '../../components/section'

Text here...

export default ({ children }) => (

<Section name='How-to Guide'>{children}</Section>
)
export default ({ children }) => <Section name='How-to Guide'>{children}</Section>
5 changes: 1 addition & 4 deletions docs/pages/cmip6-downscaling/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,4 @@ The `cmip6-downscaling` package provides a number of downscaling implementations
import cmip6_downscaling
```

export default ({ children }) => (

<Section name='Quick Start'>{children}</Section>
)
export default ({ children }) => <Section name='Quick Start'>{children}</Section>
4 changes: 4 additions & 0 deletions docs/pages/cmip6-downscaling/running-flows.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import Section from '../../components/section'

# Running Prefect Flows

## Why Prefect
Expand Down Expand Up @@ -157,3 +159,5 @@ Note: This url is specific to username, jupyter-hub name and port.
ex:

`https://prod.azure.carbonplan.2i2c.cloud/user/norlandrhagen/bcsd/proxy/8787/status`

export default ({ children }) => <Section name='Running Prefect Flows'>{children}</Section>
Empty file added docs/public/dummy.txt
Empty file.

1 comment on commit 84b81ec

@vercel
Copy link

@vercel vercel bot commented on 84b81ec May 12, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.