Skip to content

Commit dea55ae

Browse files
committed
wip: make Sphinx docs build
1 parent a929bf9 commit dea55ae

8 files changed

+231
-222
lines changed

README.md

+8-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,19 @@
1-
# Delphi Epidata Python Client `epidatpy`
1+
# `epidatpy`
22

33
[![License: MIT][mit-image]][mit-url] [![Github Actions][github-actions-image]][github-actions-url] [![PyPi][pypi-image]][pypi-url] [![Read the Docs][docs-image]][docs-url]
44

5+
A Python client for the [Delphi Epidata API](https://cmu-delphi.github.io/delphi-epidata/).
6+
57
## Install
68

7-
Install latest version:
9+
Install with the following commands:
810

911
```sh
12+
# Latest dev version
1013
pip install -e "git+https://github.com/cmu-delphi/epidatpy.git#egg=epidatpy"
14+
15+
# PyPI version
16+
pip install epidatpy
1117
```
1218

1319
## Usage

docs/Makefile

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Minimal makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line, and also
5+
# from the environment for the first two.
6+
SPHINXOPTS ?=
7+
SPHINXBUILD ?= sphinx-build
8+
SOURCEDIR = .
9+
BUILDDIR = _build
10+
11+
# Put it first so that "make" without argument is like "make help".
12+
help:
13+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14+
15+
.PHONY: help Makefile
16+
17+
# Catch-all target: route all unknown targets to Sphinx using the new
18+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19+
%: Makefile
20+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

docs/conf.py

+14-5
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@
1818

1919
# -- Project information -----------------------------------------------------
2020

21-
project = "Delphi Epidata API client"
22-
copyright = "2021, Delphi research group" # pylint: disable=redefined-builtin
23-
author = "Delphi research group"
21+
project = "epidatpy"
22+
copyright = "2024, Delphi Research Group" # pylint: disable=redefined-builtin
23+
author = "Delphi Research Group"
2424

2525
# The full version, including alpha/beta/rc tags
2626
release = "1.0.0"
@@ -43,7 +43,16 @@
4343
# List of patterns, relative to source directory, that match files and
4444
# directories to ignore when looking for source files.
4545
# This pattern also affects html_static_path and html_extra_path.
46-
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
46+
exclude_patterns = [
47+
"_build",
48+
"Thumbs.db",
49+
".DS_Store",
50+
"smoke_covid_test",
51+
"smoke_test_async",
52+
"smoke_test",
53+
"tasks",
54+
"test_pydantic",
55+
]
4756

4857
add_module_names = False
4958
autoclass_content = "class"
@@ -63,7 +72,7 @@
6372

6473
html_theme_options = {
6574
"extra_nav_links": {
66-
"Delphi group": "https://delphi.cmu.edu/",
75+
"Delphi Research Group": "https://delphi.cmu.edu/",
6776
"Delphi Epidata API": "https://cmu-delphi.github.io/delphi-epidata",
6877
}
6978
}

docs/covidcast_examples.rst

+7-9
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,18 @@ distributed through Facebook (`fb-survey`), for every county in the United State
1414
2020-05-01 and 2020-05-07:
1515

1616
>>> from delphi_epidata.request import EpiRange
17-
>>> apicall = epidata[("fb-survey", "smoothed_cli")].call(
17+
>>> apicall = epidata[("fb-survey", "smoothed_cli")].call(
1818
... 'county', "*", EpiRange(20200501, 20200507),
1919
... )
2020
EpiDataCall(endpoint=covidcast, params={'data_source': 'fb-survey', 'signals': 'smoothed_cli', 'time_type': 'day', 'time_values': '20200501-20200507', 'geo_type': 'county', 'geo_values': '*'})
2121
>>> data = apicall.df()
2222
>>> data.head()
2323
source signal geo_type geo_value time_type time_value issue lag value stderr sample_size direction missing_value missing_stderr missing_sample_size
2424
0 fb-survey smoothed_cli county 01000 day 2020-05-01 2020-09-03 125 0.825410 0.136003 1722 NaN 0 0 0
25-
1 fb-survey smoothed_cli county 01001 day 2020-05-01 2020-09-03 125 1.299425 0.967136 115 NaN 0 0 0
26-
2 fb-survey smoothed_cli county 01003 day 2020-05-01 2020-09-03 125 0.696597 0.324753 584 NaN 0 0 0
27-
3 fb-survey smoothed_cli county 01015 day 2020-05-01 2020-09-03 125 0.428271 0.548566 122 NaN 0 0 0
28-
4 fb-survey smoothed_cli county 01031 day 2020-05-01 2020-09-03 125 0.025579 0.360827 114 NaN 0 0 0
29-
25+
1 fb-survey smoothed_cli county 01001 day 2020-05-01 2020-09-03 125 1.299425 0.967136 115 NaN 0 0 0
26+
2 fb-survey smoothed_cli county 01003 day 2020-05-01 2020-09-03 125 0.696597 0.324753 584 NaN 0 0 0
27+
3 fb-survey smoothed_cli county 01015 day 2020-05-01 2020-09-03 125 0.428271 0.548566 122 NaN 0 0 0
28+
4 fb-survey smoothed_cli county 01031 day 2020-05-01 2020-09-03 125 0.025579 0.360827 114 NaN 0 0 0
3029

3130
Each row represents one observation in one county on one day. The county FIPS
3231
code is given in the ``geo_value`` column, the date in the ``time_value``
@@ -47,7 +46,7 @@ and describes the mathematical derivation of the estimates.
4746
Using the ``geo_values`` argument, we can request data for a specific geography,
4847
such as the state of Pennsylvania for the month of September 2021:
4948

50-
>>> pa_data = epidata[("fb-survey", "smoothed_cli")].call(
49+
>>> pa_data = epidata[("fb-survey", "smoothed_cli")].call(
5150
... 'state', "pa", EpiRange(20210901, 20210930)
5251
... ).df()
5352
>>> pa_data.head()
@@ -58,5 +57,4 @@ such as the state of Pennsylvania for the month of September 2021:
5857
3 fb-survey smoothed_cli state pa day 2021-09-04 2021-09-09 5 0.984799 0.092566 9069 NaN 0 0 0
5958
4 fb-survey smoothed_cli state pa day 2021-09-05 2021-09-10 5 1.010306 0.093357 9016 NaN 0 0 0
6059

61-
We can request multiple states by providing a list, such as ``["pa", "ny",
62-
"mo"]``.
60+
We can request multiple states by providing a list, such as ``["pa", "ny", "mo"]``.

docs/epidatpy.rst

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
epidatpy Reference
2+
================
3+
4+
.. toctree::
5+
:maxdepth: 4
6+
7+
Submodules
8+
----------
9+
10+
Module contents
11+
---------------
12+
13+
.. automodule:: epidatpy
14+
:members:
15+
:undoc-members:
16+
:show-inheritance:
17+
18+
epidatpy.request module
19+
-----------------------
20+
21+
.. automodule:: epidatpy.request
22+
:members:
23+
:undoc-members:
24+
:show-inheritance:
25+
26+
epidatpy.async\_request module
27+
------------------------------
28+
29+
.. automodule:: epidatpy.async_request
30+
:members:
31+
:undoc-members:
32+
:show-inheritance:
33+

0 commit comments

Comments
 (0)