Skip to content

Commit 867c3e6

Browse files
committed
Deploying to gh-pages from @ 6df40f5 🚀
1 parent 532322c commit 867c3e6

66 files changed

Lines changed: 959 additions & 774 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.buildinfo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# Sphinx build info version 1
22
# This file records the configuration used when building these files. When it is not found, a full rebuild will be done.
3-
config: c850b07e0a05ddc36a3e77f1757040c7
3+
config: 7f50325000384c2c85c426df4585c07d
44
tags: 645f666f9bcd5a90fca523b33c5a78b7
-115 Bytes
Loading
-188 Bytes
Loading

_modules/dataretrieval/nadp.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
<head>
66
<meta charset="utf-8" />
77
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
8-
<title>dataretrieval.nadp &mdash; dataretrieval 0.1.dev1+gdd70cfa85 documentation</title>
8+
<title>dataretrieval.nadp &mdash; dataretrieval 0.1.dev1+g6df40f588 documentation</title>
99
<link rel="stylesheet" type="text/css" href="../../_static/pygments.css?v=b86133f3" />
1010
<link rel="stylesheet" type="text/css" href="../../_static/css/theme.css?v=9edc463e" />
1111

1212

1313
<script src="../../_static/jquery.js?v=5d32c60e"></script>
1414
<script src="../../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
15-
<script src="../../_static/documentation_options.js?v=2628358d"></script>
15+
<script src="../../_static/documentation_options.js?v=1b61cc4b"></script>
1616
<script src="../../_static/doctools.js?v=fd6eb6e6"></script>
1717
<script src="../../_static/sphinx_highlight.js?v=6ffebe34"></script>
1818
<script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script>

_modules/dataretrieval/nldi.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
<head>
66
<meta charset="utf-8" />
77
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
8-
<title>dataretrieval.nldi &mdash; dataretrieval 0.1.dev1+gdd70cfa85 documentation</title>
8+
<title>dataretrieval.nldi &mdash; dataretrieval 0.1.dev1+g6df40f588 documentation</title>
99
<link rel="stylesheet" type="text/css" href="../../_static/pygments.css?v=b86133f3" />
1010
<link rel="stylesheet" type="text/css" href="../../_static/css/theme.css?v=9edc463e" />
1111

1212

1313
<script src="../../_static/jquery.js?v=5d32c60e"></script>
1414
<script src="../../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
15-
<script src="../../_static/documentation_options.js?v=2628358d"></script>
15+
<script src="../../_static/documentation_options.js?v=1b61cc4b"></script>
1616
<script src="../../_static/doctools.js?v=fd6eb6e6"></script>
1717
<script src="../../_static/sphinx_highlight.js?v=6ffebe34"></script>
1818
<script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script>

_modules/dataretrieval/nwis.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
<head>
66
<meta charset="utf-8" />
77
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
8-
<title>dataretrieval.nwis &mdash; dataretrieval 0.1.dev1+gdd70cfa85 documentation</title>
8+
<title>dataretrieval.nwis &mdash; dataretrieval 0.1.dev1+g6df40f588 documentation</title>
99
<link rel="stylesheet" type="text/css" href="../../_static/pygments.css?v=b86133f3" />
1010
<link rel="stylesheet" type="text/css" href="../../_static/css/theme.css?v=9edc463e" />
1111

1212

1313
<script src="../../_static/jquery.js?v=5d32c60e"></script>
1414
<script src="../../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
15-
<script src="../../_static/documentation_options.js?v=2628358d"></script>
15+
<script src="../../_static/documentation_options.js?v=1b61cc4b"></script>
1616
<script src="../../_static/doctools.js?v=fd6eb6e6"></script>
1717
<script src="../../_static/sphinx_highlight.js?v=6ffebe34"></script>
1818
<script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script>

_modules/dataretrieval/streamstats.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
<head>
66
<meta charset="utf-8" />
77
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
8-
<title>dataretrieval.streamstats &mdash; dataretrieval 0.1.dev1+gdd70cfa85 documentation</title>
8+
<title>dataretrieval.streamstats &mdash; dataretrieval 0.1.dev1+g6df40f588 documentation</title>
99
<link rel="stylesheet" type="text/css" href="../../_static/pygments.css?v=b86133f3" />
1010
<link rel="stylesheet" type="text/css" href="../../_static/css/theme.css?v=9edc463e" />
1111

1212

1313
<script src="../../_static/jquery.js?v=5d32c60e"></script>
1414
<script src="../../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
15-
<script src="../../_static/documentation_options.js?v=2628358d"></script>
15+
<script src="../../_static/documentation_options.js?v=1b61cc4b"></script>
1616
<script src="../../_static/doctools.js?v=fd6eb6e6"></script>
1717
<script src="../../_static/sphinx_highlight.js?v=6ffebe34"></script>
1818
<script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script>

_modules/dataretrieval/utils.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
<head>
66
<meta charset="utf-8" />
77
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
8-
<title>dataretrieval.utils &mdash; dataretrieval 0.1.dev1+gdd70cfa85 documentation</title>
8+
<title>dataretrieval.utils &mdash; dataretrieval 0.1.dev1+g6df40f588 documentation</title>
99
<link rel="stylesheet" type="text/css" href="../../_static/pygments.css?v=b86133f3" />
1010
<link rel="stylesheet" type="text/css" href="../../_static/css/theme.css?v=9edc463e" />
1111

1212

1313
<script src="../../_static/jquery.js?v=5d32c60e"></script>
1414
<script src="../../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
15-
<script src="../../_static/documentation_options.js?v=2628358d"></script>
15+
<script src="../../_static/documentation_options.js?v=1b61cc4b"></script>
1616
<script src="../../_static/doctools.js?v=fd6eb6e6"></script>
1717
<script src="../../_static/sphinx_highlight.js?v=6ffebe34"></script>
1818
<script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script>

_modules/dataretrieval/waterdata/api.html

Lines changed: 77 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
<head>
66
<meta charset="utf-8" />
77
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
8-
<title>dataretrieval.waterdata.api &mdash; dataretrieval 0.1.dev1+gdd70cfa85 documentation</title>
8+
<title>dataretrieval.waterdata.api &mdash; dataretrieval 0.1.dev1+g6df40f588 documentation</title>
99
<link rel="stylesheet" type="text/css" href="../../../_static/pygments.css?v=b86133f3" />
1010
<link rel="stylesheet" type="text/css" href="../../../_static/css/theme.css?v=9edc463e" />
1111

1212

1313
<script src="../../../_static/jquery.js?v=5d32c60e"></script>
1414
<script src="../../../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
15-
<script src="../../../_static/documentation_options.js?v=2628358d"></script>
15+
<script src="../../../_static/documentation_options.js?v=1b61cc4b"></script>
1616
<script src="../../../_static/doctools.js?v=fd6eb6e6"></script>
1717
<script src="../../../_static/sphinx_highlight.js?v=6ffebe34"></script>
1818
<script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script>
@@ -86,6 +86,7 @@ <h1>Source code for dataretrieval.waterdata.api</h1><div class="highlight"><pre>
8686
<span class="kn">import</span><span class="w"> </span><span class="nn">logging</span>
8787
<span class="kn">from</span><span class="w"> </span><span class="nn">io</span><span class="w"> </span><span class="kn">import</span> <span class="n">StringIO</span>
8888
<span class="kn">from</span><span class="w"> </span><span class="nn">typing</span><span class="w"> </span><span class="kn">import</span> <span class="n">get_args</span>
89+
<span class="kn">from</span><span class="w"> </span><span class="nn">urllib.parse</span><span class="w"> </span><span class="kn">import</span> <span class="n">quote</span>
8990

9091
<span class="kn">import</span><span class="w"> </span><span class="nn">pandas</span><span class="w"> </span><span class="k">as</span><span class="w"> </span><span class="nn">pd</span>
9192
<span class="kn">import</span><span class="w"> </span><span class="nn">requests</span>
@@ -1906,6 +1907,80 @@ <h1>Source code for dataretrieval.waterdata.api</h1><div class="highlight"><pre>
19061907

19071908

19081909

1910+
<div class="viewcode-block" id="get_samples_summary">
1911+
<a class="viewcode-back" href="../../../reference/waterdata.html#dataretrieval.waterdata.get_samples_summary">[docs]</a>
1912+
<span class="k">def</span><span class="w"> </span><span class="nf">get_samples_summary</span><span class="p">(</span>
1913+
<span class="n">monitoringLocationIdentifier</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span>
1914+
<span class="n">ssl_check</span><span class="p">:</span> <span class="nb">bool</span> <span class="o">=</span> <span class="kc">True</span><span class="p">,</span>
1915+
<span class="p">)</span> <span class="o">-&gt;</span> <span class="nb">tuple</span><span class="p">[</span><span class="n">pd</span><span class="o">.</span><span class="n">DataFrame</span><span class="p">,</span> <span class="n">BaseMetadata</span><span class="p">]:</span>
1916+
<span class="w"> </span><span class="sd">&quot;&quot;&quot;Get a summary of discrete water-quality samples at a single monitoring location.</span>
1917+
1918+
<span class="sd"> Wraps the Samples database summary service described at</span>
1919+
<span class="sd"> https://api.waterdata.usgs.gov/samples-data/docs. The service returns one</span>
1920+
<span class="sd"> row per (characteristic group, characteristic, user-supplied characteristic)</span>
1921+
<span class="sd"> combination with result and activity counts and the first / most recent</span>
1922+
<span class="sd"> activity dates — useful for taking inventory of what discrete-sample data</span>
1923+
<span class="sd"> exists at a site before pulling the underlying observations with</span>
1924+
<span class="sd"> :func:`get_samples`.</span>
1925+
1926+
<span class="sd"> The summary service is single-site only: it accepts exactly one monitoring</span>
1927+
<span class="sd"> location per request.</span>
1928+
1929+
<span class="sd"> Parameters</span>
1930+
<span class="sd"> ----------</span>
1931+
<span class="sd"> monitoringLocationIdentifier : string</span>
1932+
<span class="sd"> A monitoring location identifier has two parts, separated by a dash</span>
1933+
<span class="sd"> (``-``): the agency code and the location number. Examples:</span>
1934+
<span class="sd"> ``&quot;USGS-040851385&quot;``, ``&quot;AZ014-320821110580701&quot;``,</span>
1935+
<span class="sd"> ``&quot;CAX01-15304600&quot;``. Bare location numbers without an agency prefix</span>
1936+
<span class="sd"> are accepted by the service but return an empty result, so a prefix</span>
1937+
<span class="sd"> is effectively required.</span>
1938+
<span class="sd"> ssl_check : bool, optional</span>
1939+
<span class="sd"> Check the SSL certificate. Default is True.</span>
1940+
1941+
<span class="sd"> Returns</span>
1942+
<span class="sd"> -------</span>
1943+
<span class="sd"> df : ``pandas.DataFrame``</span>
1944+
<span class="sd"> Formatted data returned from the API query.</span>
1945+
<span class="sd"> md : :obj:`dataretrieval.utils.Metadata`</span>
1946+
<span class="sd"> Custom ``dataretrieval`` metadata object pertaining to the query.</span>
1947+
1948+
<span class="sd"> Examples</span>
1949+
<span class="sd"> --------</span>
1950+
<span class="sd"> .. code::</span>
1951+
1952+
<span class="sd"> &gt;&gt;&gt; # What discrete-sample data is available at this site?</span>
1953+
<span class="sd"> &gt;&gt;&gt; df, md = dataretrieval.waterdata.get_samples_summary(</span>
1954+
<span class="sd"> ... monitoringLocationIdentifier=&quot;USGS-04074950&quot;</span>
1955+
<span class="sd"> ... )</span>
1956+
1957+
<span class="sd"> &quot;&quot;&quot;</span>
1958+
<span class="k">if</span> <span class="ow">not</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">monitoringLocationIdentifier</span><span class="p">,</span> <span class="nb">str</span><span class="p">):</span>
1959+
<span class="k">raise</span> <span class="ne">TypeError</span><span class="p">(</span>
1960+
<span class="s2">&quot;monitoringLocationIdentifier must be a string; the Samples &quot;</span>
1961+
<span class="s2">&quot;summary service accepts exactly one monitoring location per &quot;</span>
1962+
<span class="sa">f</span><span class="s2">&quot;request, got </span><span class="si">{</span><span class="nb">type</span><span class="p">(</span><span class="n">monitoringLocationIdentifier</span><span class="p">)</span><span class="o">.</span><span class="vm">__name__</span><span class="si">}</span><span class="s2">.&quot;</span>
1963+
<span class="p">)</span>
1964+
1965+
<span class="n">url</span> <span class="o">=</span> <span class="sa">f</span><span class="s2">&quot;</span><span class="si">{</span><span class="n">SAMPLES_URL</span><span class="si">}</span><span class="s2">/summary/</span><span class="si">{</span><span class="n">quote</span><span class="p">(</span><span class="n">monitoringLocationIdentifier</span><span class="p">,</span><span class="w"> </span><span class="n">safe</span><span class="o">=</span><span class="s1">&#39;&#39;</span><span class="p">)</span><span class="si">}</span><span class="s2">&quot;</span>
1966+
<span class="n">params</span> <span class="o">=</span> <span class="p">{</span><span class="s2">&quot;mimeType&quot;</span><span class="p">:</span> <span class="s2">&quot;text/csv&quot;</span><span class="p">}</span>
1967+
1968+
<span class="n">req</span> <span class="o">=</span> <span class="n">PreparedRequest</span><span class="p">()</span>
1969+
<span class="n">req</span><span class="o">.</span><span class="n">prepare_url</span><span class="p">(</span><span class="n">url</span><span class="p">,</span> <span class="n">params</span><span class="o">=</span><span class="n">params</span><span class="p">)</span>
1970+
<span class="n">logger</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s2">&quot;Request: </span><span class="si">%s</span><span class="s2">&quot;</span><span class="p">,</span> <span class="n">req</span><span class="o">.</span><span class="n">url</span><span class="p">)</span>
1971+
1972+
<span class="n">response</span> <span class="o">=</span> <span class="n">requests</span><span class="o">.</span><span class="n">get</span><span class="p">(</span>
1973+
<span class="n">url</span><span class="p">,</span> <span class="n">params</span><span class="o">=</span><span class="n">params</span><span class="p">,</span> <span class="n">verify</span><span class="o">=</span><span class="n">ssl_check</span><span class="p">,</span> <span class="n">headers</span><span class="o">=</span><span class="n">_default_headers</span><span class="p">()</span>
1974+
<span class="p">)</span>
1975+
1976+
<span class="n">response</span><span class="o">.</span><span class="n">raise_for_status</span><span class="p">()</span>
1977+
1978+
<span class="n">df</span> <span class="o">=</span> <span class="n">pd</span><span class="o">.</span><span class="n">read_csv</span><span class="p">(</span><span class="n">StringIO</span><span class="p">(</span><span class="n">response</span><span class="o">.</span><span class="n">text</span><span class="p">),</span> <span class="n">delimiter</span><span class="o">=</span><span class="s2">&quot;,&quot;</span><span class="p">)</span>
1979+
1980+
<span class="k">return</span> <span class="n">df</span><span class="p">,</span> <span class="n">BaseMetadata</span><span class="p">(</span><span class="n">response</span><span class="p">)</span></div>
1981+
1982+
1983+
19091984
<div class="viewcode-block" id="get_stats_por">
19101985
<a class="viewcode-back" href="../../../reference/waterdata.html#dataretrieval.waterdata.get_stats_por">[docs]</a>
19111986
<span class="k">def</span><span class="w"> </span><span class="nf">get_stats_por</span><span class="p">(</span>

_modules/dataretrieval/waterdata/nearest.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
<head>
66
<meta charset="utf-8" />
77
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
8-
<title>dataretrieval.waterdata.nearest &mdash; dataretrieval 0.1.dev1+gdd70cfa85 documentation</title>
8+
<title>dataretrieval.waterdata.nearest &mdash; dataretrieval 0.1.dev1+g6df40f588 documentation</title>
99
<link rel="stylesheet" type="text/css" href="../../../_static/pygments.css?v=b86133f3" />
1010
<link rel="stylesheet" type="text/css" href="../../../_static/css/theme.css?v=9edc463e" />
1111

1212

1313
<script src="../../../_static/jquery.js?v=5d32c60e"></script>
1414
<script src="../../../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
15-
<script src="../../../_static/documentation_options.js?v=2628358d"></script>
15+
<script src="../../../_static/documentation_options.js?v=1b61cc4b"></script>
1616
<script src="../../../_static/doctools.js?v=fd6eb6e6"></script>
1717
<script src="../../../_static/sphinx_highlight.js?v=6ffebe34"></script>
1818
<script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script>

0 commit comments

Comments
 (0)