Skip to content

Commit a89071b

Browse files
committed
Update documentation
1 parent 30f8970 commit a89071b

3 files changed

Lines changed: 76 additions & 84 deletions

File tree

docs/conf.py

Lines changed: 14 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
# Configuration file for the Sphinx documentation builder.
2-
#
3-
# For the full list of built-in configuration values, see the documentation:
4-
# https://www.sphinx-doc.org/en/master/usage/configuration.html
52

63
import importlib
74
import os
@@ -14,21 +11,15 @@
1411
except Exception:
1512
package_version = "0.2.0"
1613

17-
# -- Project information -----------------------------------------------------
18-
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
19-
2014
project = "varunayan"
21-
copyright = "2025, Atharva Jagtap and Saket Choudhary"
15+
copyright = "2026, Atharva Jagtap and Saket Choudhary"
2216
author = "Atharva Jagtap and Saket Choudhary"
2317
release = package_version
2418
version = os.environ.get("SMV_CURRENT_VERSION") or os.environ.get(
2519
"READTHEDOCS_VERSION_NAME",
2620
release,
2721
)
2822

29-
# -- General configuration ---------------------------------------------------
30-
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
31-
3223
extensions = [
3324
"sphinx.ext.autodoc",
3425
"sphinx.ext.viewcode",
@@ -38,14 +29,15 @@
3829
"myst_nb",
3930
"sphinx_multiversion",
4031
"sphinx_copybutton",
32+
"sphinxext.opengraph",
33+
"sphinx_sitemap",
4134
]
4235

4336
templates_path = ["_templates"]
4437
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store", "tutorials/*.ipynb"]
4538

4639
language = "en"
4740

48-
# -- Autodoc configuration --------------------------------------------------
4941
autodoc_default_options = {
5042
"members": True,
5143
"member-order": "bysource",
@@ -54,8 +46,6 @@
5446
"exclude-members": "__weakref__",
5547
}
5648

57-
# Mock heavy optional dependencies if they are unavailable so autodoc can
58-
# import varunayan modules without requiring compiled geospatial stacks.
5949
_OPTIONAL_LIBS = [
6050
"geopandas",
6151
"geopy",
@@ -73,7 +63,6 @@
7363
except Exception:
7464
autodoc_mock_imports.append(_module) # type:ignore
7565

76-
# -- Napoleon settings -------------------------------------------------------
7766
napoleon_google_docstring = True
7867
napoleon_numpy_docstring = True
7968
napoleon_include_init_with_doc = False
@@ -86,24 +75,19 @@
8675
napoleon_use_param = True
8776
napoleon_use_rtype = True
8877

89-
# -- Intersphinx mapping ----------------------------------------------------
9078
intersphinx_mapping = {
9179
"python": ("https://docs.python.org/3", None),
9280
"pandas": ("https://pandas.pydata.org/docs/", None),
9381
"requests": ("https://requests.readthedocs.io/en/latest/", None),
9482
}
9583

96-
# -- Options for HTML output -------------------------------------------------
97-
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
98-
9984
html_theme = "furo"
10085
html_static_path = ["_static"]
10186
html_css_files = ["css/custom.css"]
10287

103-
# Documentation title without version
104-
html_title = f"{project} Documentation"
88+
html_title = "varunayan — Climate Data Toolkit"
89+
html_baseurl = "https://varunayan.saketlab.org/"
10590

106-
# Logo configuration
10791
html_logo = "assets/varunayan.png"
10892

10993
html_sidebars = {
@@ -117,10 +101,9 @@
117101
]
118102
}
119103

120-
# -- Theme options -----------------------------------------------------------
121104
html_theme_options = {
122105
"navigation_with_keys": True,
123-
"sidebar_hide_name": False, # Show name alongside logo
106+
"sidebar_hide_name": False,
124107
"light_css_variables": {
125108
"color-brand-primary": "#1b1b1f",
126109
"color-brand-content": "#1b1b1f",
@@ -135,26 +118,21 @@
135118
},
136119
}
137120

138-
# Set default color scheme to dark
139121
html_css_files = ["css/custom.css"]
140122

141-
# MyST-NB configuration
142123
nb_execution_mode = "off"
143124
nb_render_plugin = "default"
144125
nb_merge_streams = True
145126

146-
# Enable copy button for code cells
147127
nb_code_prompt_show = "Show code cell {type}"
148128
nb_code_prompt_hide = "Hide code cell {type}"
149129

150-
# Sphinx copybutton configuration
151130
copybutton_prompt_text = r">>> |\.\.\. |\$ |In \[\d*\]: | {2,5}\.\.\.: | {5,8}: "
152131
copybutton_prompt_is_regexp = True
153132
copybutton_only_copy_prompt_lines = True
154133
copybutton_remove_prompts = True
155134
copybutton_copy_empty_lines = False
156135

157-
# Sphinx multiversion settings
158136
smv_branch_whitelist = os.environ.get(
159137
"SMV_BRANCH_WHITELIST",
160138
r"^(master|main|develop)$",
@@ -165,5 +143,12 @@
165143
smv_latest_version = os.environ.get("SMV_LATEST_VERSION", "main")
166144
smv_rename_latest_version = "latest"
167145

168-
# Prefer tags over branches for version selection
169146
smv_prefer_remote_refs = True
147+
148+
html_extra_path = ["robots.txt", "llms.txt"]
149+
150+
ogp_site_url = "https://varunayan.saketlab.org/"
151+
ogp_site_name = "varunayan"
152+
ogp_image = "https://varunayan.saketlab.org/_static/varunayan_og.png"
153+
ogp_description_length = 200
154+
ogp_type = "website"

docs/index.rst

Lines changed: 52 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
varunayan: Download and Process ERA5 Climate Data
2-
==================================================
1+
varunayan: Climate Data Toolkit
2+
================================
33

4-
A Python package for downloading and processing ERA5 climate data with support for custom geographical regions:
4+
Download and process climate reanalysis and observational data from ERA5, IMD, HadEX3, and CRU TS. Compute heat stress indices (UTCI, WBGT, Heat Index, Humidex). Aggregate country-level temperature series. Built with a focus on India, but works globally wherever the underlying datasets have coverage.
55

66
.. image:: https://img.shields.io/pypi/v/varunayan.svg
77
:target: https://pypi.org/project/varunayan/
@@ -15,73 +15,74 @@ A Python package for downloading and processing ERA5 climate data with support f
1515
:target: https://github.com/saketlab/varunayan/blob/main/LICENSE
1616
:alt: License
1717

18-
Overview
19-
--------
20-
21-
varunayan provides a simple and powerful interface to download and process ERA5 climate data from the Copernicus Climate Data Store. It supports:
22-
2318
.. note::
2419

25-
**R users**: Check out `varunayanR <https://saketlab.github.io/varunayanR>`_, the R companion package for varunayan.
26-
27-
- **Custom geographical regions**: Use GeoJSON files, bounding boxes, or point coordinates
28-
- **Multiple variables**: Download any ERA5 variable (temperature, precipitation, wind, etc.)
29-
- **Flexible time periods**: From hourly to yearly data aggregation
30-
- **Automatic processing**: Spatial filtering, temporal aggregation, and CSV output
31-
- **Chunking support**: Handle large requests efficiently with automatic time-based chunking
20+
**R users**: See `varunayanR <https://varunayanr.saketlab.org>`_, the R companion package.
21+
22+
Data Sources
23+
------------
24+
25+
.. list-table::
26+
:header-rows: 1
27+
:widths: 20 50 30
28+
29+
* - Source
30+
- Coverage
31+
- Access
32+
* - **ERA5**
33+
- Global reanalysis, 0.25° grid, 1940-present
34+
- CDS API (bbox, point, GeoJSON)
35+
* - **IMD**
36+
- India gridded rainfall (0.25°) and temperature (1°), 1901-present
37+
- Direct download
38+
* - **HadEX3**
39+
- Global ETCCDI climate extremes indices, 1.875° grid
40+
- Direct download
41+
* - **CRU TS**
42+
- Global monthly climate grids (0.5°), 1901-present
43+
- Direct download
3244

3345
Quick Start
3446
-----------
3547

36-
Installation
37-
~~~~~~~~~~~~
38-
3948
.. code-block:: bash
4049
4150
pip install varunayan
4251
43-
Basic Usage
44-
~~~~~~~~~~~
45-
4652
.. code-block:: python
4753
48-
from varunayan import era5ify_geojson, era5ify_bbox, era5ify_point
54+
import varunayan
4955
50-
# Download data for a GeoJSON region
51-
era5ify_geojson(
52-
request_id="my_request",
53-
variables=["2m_temperature", "total_precipitation"],
54-
start_date="2020-01-01",
55-
end_date="2020-01-31",
56-
json_file="my_region.geojson"
56+
# ERA5 temperature for a bounding box
57+
varunayan.era5ify_bbox(
58+
request_id="demo",
59+
variables=["2m_temperature"],
60+
start_date="2023-06-01",
61+
end_date="2023-06-30",
62+
north=28.7, south=28.5, east=77.3, west=77.0,
5763
)
5864
59-
# Download data for a bounding box
60-
era5ify_bbox(
61-
request_id="bbox_request",
62-
variables=["2m_temperature"],
63-
start_date="2020-01-01",
64-
end_date="2020-01-02",
65-
north=40.0, south=35.0, east=-120.0, west=-125.0
65+
# IMD gridded rainfall
66+
varunayan.imd_rainfall_bbox(
67+
"mumbai", start_year=2020, end_year=2020,
68+
north=19.2, south=18.9, east=72.9, west=72.8,
6669
)
6770
68-
Command Line Interface
69-
~~~~~~~~~~~~~~~~~~~~~~
71+
# HadEX3 climate extremes
72+
varunayan.hadex3_bbox("TXx", start_year=2000, end_year=2018,
73+
north=35, south=8, east=90, west=68)
7074
71-
.. code-block:: bash
75+
# UTCI heat stress index
76+
varunayan.utci(temp_c=35.0, rh=60.0, wind_ms=2.0, mrt_c=50.0)
7277
73-
# Process with GeoJSON file
74-
varunayan geojson --request-id "my_request" --variables "2m_temperature,total_precipitation" \
75-
--start "2020-01-01" --end "2020-01-31" --geojson "region.geojson"
78+
CLI
79+
~~~
7680

77-
# Process with bounding box
78-
varunayan bbox --request-id "bbox_request" --variables "2m_temperature" \
79-
--start "2020-01-01" --end "2020-01-02" \
80-
--north 40.0 --south 35.0 --east -120.0 --west -125.0
81+
.. code-block:: bash
8182
82-
# Process for a single point
83-
varunayan point --request-id "point_request" --variables "2m_temperature" \
84-
--start "2020-01-01" --end "2020-01-02" --lat 37.7749 --lon -122.4194
83+
varunayan bbox --request-id demo --variables 2m_temperature \
84+
--start 2023-06-01 --end 2023-06-30 \
85+
--north 28.7 --south 28.5 --east 77.3 --west 77.0
8586
8687
.. toctree::
8788
:maxdepth: 2
@@ -94,9 +95,7 @@ Command Line Interface
9495
contributing
9596

9697
Jupyter Notebooks
97-
==================
98-
99-
Interactive notebooks with hands-on examples:
98+
=================
10099

101100
.. toctree::
102101
:maxdepth: 1
@@ -134,4 +133,4 @@ Indices and tables
134133

135134
* :ref:`genindex`
136135
* :ref:`modindex`
137-
* :ref:`search`
136+
* :ref:`search`

pyproject.toml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
44

55
[project]
66
name = "varunayan"
7-
version = "0.2.0"
7+
version = "0.3.0"
88
description = "Analysis-ready climate data downloader and processor for custom regions"
99
readme = "README.md"
1010
requires-python = ">=3.10"
@@ -80,7 +80,9 @@ docs = [
8080

8181
# Enhanced search and navigation
8282
"sphinx-tabs>=3.0.0",
83-
83+
"sphinxext-opengraph>=0.9.0",
84+
"sphinx-sitemap>=2.5.0",
85+
8486
# Documentation testing and validation
8587
"linkify-it-py>=2.0",
8688
"markdown-it-py>=2.0",
@@ -108,6 +110,8 @@ docs-build = [
108110
"sphinx-design>=0.3.0",
109111
"sphinx-togglebutton>=0.3.0",
110112
"sphinx-tabs>=3.0.0",
113+
"sphinxext-opengraph>=0.9.0",
114+
"sphinx-sitemap>=2.5.0",
111115
"linkify-it-py>=2.0",
112116
"markdown-it-py>=2.0",
113117
"mdit-py-plugins>=0.3.0",
@@ -237,6 +241,10 @@ module = [
237241
]
238242
ignore_missing_imports = true
239243

244+
[[tool.mypy.overrides]]
245+
module = ["numpy", "numpy.*"]
246+
follow_imports = "skip"
247+
240248
[tool.flake8]
241249
max-line-length = 120
242250
extend-ignore = ["E203", "W503", "E501"]

0 commit comments

Comments
 (0)