1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169
|
<!DOCTYPE html>
<html lang="en" data-content_root="./">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Installation — pygrib documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=b76e3c8a" />
<link rel="stylesheet" type="text/css" href="_static/nature.css?v=601dbdee" />
<link rel="stylesheet" type="text/css" href="_static/css/nature2.css?v=9a3bd955" />
<script src="_static/documentation_options.js?v=5929fcd5"></script>
<script src="_static/doctools.js?v=888ff710"></script>
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="API" href="api.html" />
<link rel="prev" title="pygrib" href="index.html" />
</head><body>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="api.html" title="API"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="index.html" title="pygrib"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="index.html">pygrib documentation</a> »</li>
<li class="nav-item nav-item-this"><a href="">Installation</a></li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<section id="installation">
<h1>Installation<a class="headerlink" href="#installation" title="Link to this heading">¶</a></h1>
<section id="dependencies">
<h2>Dependencies<a class="headerlink" href="#dependencies" title="Link to this heading">¶</a></h2>
<ul class="simple">
<li><p><a class="reference external" href="https://confluence.ecmwf.int/display/ECC/">ECCODES</a> C library.</p></li>
<li><p><a class="reference external" href="http://www.numpy.org/">numpy</a></p></li>
<li><p><a class="reference external" href="https://pyproj4.github.io/pyproj/stable">pyproj</a></p></li>
<li><p><a class="reference external" href="https://cython.org">cython</a> (only needed at build-time)</p></li>
</ul>
</section>
<section id="instructions">
<h2>Instructions<a class="headerlink" href="#instructions" title="Link to this heading">¶</a></h2>
<p>The easiest way to get everything installed (on macosx and linux) is to use <a class="reference external" href="http://pip.pypa.io/">pip</a>:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">>>> </span><span class="n">pip</span> <span class="n">install</span> <span class="n">pygrib</span>
</pre></div>
</div>
<p>This will install all the dependencies for you (including the <a class="reference external" href="https://confluence.ecmwf.int/display/ECC/">ECCODES</a> C lib).</p>
<p>If you’re using Anaconda python (recommended for Windows), use <a class="reference external" href="http://conda.io/">conda</a>:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">>>> </span><span class="n">conda</span> <span class="n">install</span> <span class="o">-</span><span class="n">c</span> <span class="n">conda</span><span class="o">-</span><span class="n">forge</span> <span class="n">pygrib</span>
</pre></div>
</div>
<p>If using conda on windows, you may also need to set the <code class="docutils literal notranslate"><span class="pre">ECCODES_DEFINITION_PATH</span></code>
environment variable to <code class="docutils literal notranslate"><span class="pre">$CONDA_PREFIX/Library/share/eccodes/definitions</span></code> if you see
an error saying <code class="docutils literal notranslate"><span class="pre">boot.def</span></code> cannot be found.</p>
</section>
<section id="developing">
<h2>Developing<a class="headerlink" href="#developing" title="Link to this heading">¶</a></h2>
<p>To build from source, clone the github repository and install:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">>>> </span><span class="n">git</span> <span class="n">clone</span> <span class="n">https</span><span class="p">:</span><span class="o">//</span><span class="n">github</span><span class="o">.</span><span class="n">com</span><span class="o">/</span><span class="n">jswhit</span><span class="o">/</span><span class="n">pygrib</span>
<span class="gp">>>> </span><span class="n">cd</span> <span class="n">pygrib</span>
<span class="gp">>>> </span><span class="n">ECCODES_DIR</span><span class="o">=</span><span class="n">path</span><span class="o">/</span><span class="n">to</span><span class="o">/</span><span class="n">eccodes</span> <span class="n">pip</span> <span class="n">install</span> <span class="o">-</span><span class="n">e</span> <span class="o">.</span>
</pre></div>
</div>
<p>where <code class="docutils literal notranslate"><span class="pre">$ECCODES_DIR</span></code> is the path to the directory containing <code class="docutils literal notranslate"><span class="pre">include/grib_api.h</span></code>
and <code class="docutils literal notranslate"><span class="pre">lib/libeccodes.so</span></code>. If <code class="docutils literal notranslate"><span class="pre">ECCODES_DIR</span></code> is not specified, a few common locations
such as <code class="docutils literal notranslate"><span class="pre">$CONDA_PREFIX,/usr,/usr/local,/opt/local</span></code> will be searched..
Then run the simple test script to check if things are working
<code class="docutils literal notranslate"><span class="pre">cd</span> <span class="pre">test;</span> <span class="pre">python</span> <span class="pre">test.py</span></code>.</p>
<p>To be able to run all the tests, install <a class="reference external" href="http://pytest.org">pytest</a> and run</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">>>> </span><span class="n">export</span> <span class="n">MPLBACKEND</span><span class="o">=</span><span class="n">agg</span>
<span class="gp">>>> </span><span class="n">cd</span> <span class="n">test</span>
<span class="gp">>>> </span><span class="n">pytest</span> <span class="n">test</span><span class="o">*</span><span class="n">py</span> <span class="o">--</span><span class="n">mpl</span> <span class="o">--</span><span class="n">mpl</span><span class="o">-</span><span class="n">baseline</span><span class="o">-</span><span class="n">path</span><span class="o">=</span><span class="n">baseline_images</span>
</pre></div>
</div>
<p>Many tests require <a class="reference external" href="https://matplotlib.org">matplotlib</a>, <a class="reference external" href="https://pypi.org/project/pytest-mpl/">pytest-mpl</a> and <a class="reference external" href="https://scitools.org.uk/cartopy/docs/latest/">cartopy</a>. If you don’t want to install
those, just run <code class="docutils literal notranslate"><span class="pre">test.py</span></code> and <code class="docutils literal notranslate"><span class="pre">test_latlons.py</span></code>.</p>
</section>
</section>
<div class="clearer"></div>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<div>
<h3><a href="index.html">Table of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">Installation</a><ul>
<li><a class="reference internal" href="#dependencies">Dependencies</a></li>
<li><a class="reference internal" href="#instructions">Instructions</a></li>
<li><a class="reference internal" href="#developing">Developing</a></li>
</ul>
</li>
</ul>
</div>
<div>
<h4>Previous topic</h4>
<p class="topless"><a href="index.html"
title="previous chapter">pygrib</a></p>
</div>
<div>
<h4>Next topic</h4>
<p class="topless"><a href="api.html"
title="next chapter">API</a></p>
</div>
<div role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="_sources/installing.rst.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
<h3 id="searchlabel">Quick search</h3>
<div class="searchformwrapper">
<form class="search" action="search.html" method="get">
<input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
<input type="submit" value="Go" />
</form>
</div>
</div>
<script>document.getElementById('searchbox').style.display = "block"</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="api.html" title="API"
>next</a> |</li>
<li class="right" >
<a href="index.html" title="pygrib"
>previous</a> |</li>
<li class="nav-item nav-item-0"><a href="index.html">pygrib documentation</a> »</li>
<li class="nav-item nav-item-this"><a href="">Installation</a></li>
</ul>
</div>
<div class="footer" role="contentinfo">
© Copyright 2018, Jeff Whitaker.
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 7.2.6.
</div>
</body>
</html>
|