Skip to content

Commit 23730b9

Browse files
authored
Merge pull request #169 from jswhit/v2.1.2rel
prepare for v2.1.2rel
2 parents b03b0d6 + 6427725 commit 23730b9

31 files changed

+300
-10824
lines changed

.github/workflows/build.yml

+12-6
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
PROJ_LIB: /usr/share/proj
1010
strategy:
1111
matrix:
12-
python-version: ["3.7", "3.8"]
12+
python-version: ["3.6", "3.7", "3.8", "3.9"]
1313
steps:
1414

1515
- uses: actions/checkout@v2
@@ -31,9 +31,11 @@ jobs:
3131
3232
- name: Install pygrib dependencies via pip
3333
run: |
34-
python -m pip install "numpy>1.10"
34+
python -m pip install numpy
3535
python -m pip install cython
36-
python -m pip install "pyproj<3.0.0"
36+
python -m pip install pyproj
37+
python -m pip install pytest
38+
python -m pip install pytest-mpl
3739
python -m pip install wheel
3840
python -m pip install pyshp
3941
python -m pip install six
@@ -42,15 +44,19 @@ jobs:
4244
python -m pip install cartopy
4345
python -m pip install scipy
4446
python -m pip install pyspharm
45-
python -m pip install pytest pytest-mpl
4647
4748
- name: Install pygrib
4849
run: |
4950
python setup.py install
5051
5152
- name: Test
5253
run: |
53-
python test.py
54-
cd test
54+
#cd test
55+
#python test.py
56+
#python test_latlons.py
57+
cp -r test/ /tmp
58+
cp -r sampledata/ /tmp
59+
cp conftest.py /tmp
60+
cd /tmp/test
5561
export MPLBACKEND=agg
5662
pytest test*py --mpl --mpl-baseline-path=baseline_images

.travis.yml

-44
This file was deleted.

Changelog

+9-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,17 @@
1-
version 2.1.2 (not yet released)
1+
version 2.1.2 (git tag v2.1.2rel)
22
================================
33
* use pytest-mpl for image comparison tests.
44
* change license to MIT.
55
* changes gribmessage.projparams['proj'] from 'cyl' to 'longlat'
66
for non-projection projections (e.g. 'regular_ll'). Issue #167.
7+
* reorganize to include eccodes definitions inside package
8+
when wheels are build (PYGRIB_WHEEL env var is set).
9+
Add set_definitions_path/get_defintions_path module functions
10+
to get/reset ECCODES_DEFINITION_PATH.
11+
* include binary wheels for linux in pypi release.
12+
* add grid template definition for RAP grib files in binary wheels (issue #134).
13+
Not fully implemented, but at least file can be read (gridType=unknown, latlons
14+
method doesn't yet work)..
715

816
version 2.1.1 (git tag v2.1.1rel)
917
=================================

MANIFEST.in

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
include MANIFEST.in
22
include LICENSE
33
include pyproject.toml
4-
include pygrib.pyx
5-
include redtoreg.pyx
64
include setup.py
7-
include .travis.yml
85
include test.py
96
include README.md
7+
include pygrib/__init__.py
8+
include pygrib/_pygrib.pyx
109
include utils/*grib*
1110
recursive-include docs *
1211
include sampledata/*.grb

README.md

+5-8
Original file line numberDiff line numberDiff line change
@@ -10,26 +10,23 @@ There are limited capabilities for writing GRIB files (you can modify the conten
1010
Quickstart
1111
==========
1212

13-
The easiest way to get everything installed is to use the [conda](https://conda.io):
13+
The easiest way to get everything installed is to use [pip](https://py.pypa.io):
1414

1515
```
16-
conda install -c conda-forge pygrib
16+
pip install pygrib
1717
```
1818

19-
If you don't use conda, be sure you have the ECCODES library installed first.
20-
Then you can install pygrib with pip:
19+
You can also use [conda](https://docs.conda.io/en/latest/):
2120

2221
```
23-
ECCODES_DIR=path/to/eccodes pip install pygrib
22+
conda install -c conda-forge pygrib
2423
```
2524

25+
Alternately, clone the github repo and run `python setup.py install` (after setting `$ECCCODES_DIR`)
2626
where `$ECCODES_DIR` is the path to the directory containing `include/grib_api.h`
2727
and `lib/libeccodes.so`. If `ECCODES_DIR` is not specified, a few common locations
2828
such as `$CONDA_PREFIX,/usr,/usr/local,/opt/local` will be searched.
2929

30-
Alternately, clone the github repo and run `python setup.py install` (after setting `$ECCCODES_DIR`).
31-
Run `python test.py` from the source directory to test your pygrib installation.
32-
3330
For full installation instructions and API documentation, see https://jswhit.github.io/pygrib.
3431

3532
Sample [iPython](http://ipython.org/) notebooks illustrating pygrib usage:

docs/_build/doctrees/api.doctree

6.92 KB
Binary file not shown.
764 Bytes
Binary file not shown.

docs/_build/doctrees/index.doctree

-24 Bytes
Binary file not shown.
358 Bytes
Binary file not shown.

docs/_build/html/.buildinfo

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# Sphinx build info version 1
22
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
3-
config: 65f4399708de4ec123415b7aaea1b846
3+
config: 8dd736fc547b45a6a09dfaf65e8e237b
44
tags: 645f666f9bcd5a90fca523b33c5a78b7

docs/_build/html/_sources/api.rst.txt

+19-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ find the first grib message with a matching name:
3939

4040
>>> grb = grbs.select(name='Maximum temperature')[0]
4141

42-
extract the data values using the 'values' key grb.keys() will return a list of the available keys):
42+
extract the data values using the ``values`` key (``grb.keys()`` will return a list of the available keys):
4343

4444
>>> maxt = grb.values # same as grb['values']
4545
# The data is returned as a numpy array, or if missing values or a bitmap
@@ -68,6 +68,24 @@ extract data and get lat/lon values for a subset over North America:
6868
>>> data.shape, lats.min(), lats.max(), lons.min(), lons.max()
6969
(26, 53) 21.904439458 69.5216630593 221.25 318.75
7070

71+
modify the values associated with existing keys:
72+
73+
>>> grb['forecastTime'] = 240
74+
>>> grb.dataDate = 20100101
75+
76+
get the binary string associated with the coded message:
77+
78+
>>> msg = grb.tostring()
79+
>>> grbs.close() # close the grib file.
80+
81+
write the modified message to a new GRIB file:
82+
83+
>>> grbout = open('test.grb','wb')
84+
>>> grbout.write(msg)
85+
>>> grbout.close()
86+
>>> pygrib.open('test.grb').readline()
87+
1:Surface pressure:Pa (instant):regular_gg:surface:level 0:fcst time 240 hrs:from 201001011200
88+
7189
Module docstrings
7290
-----------------
7391

docs/_build/html/_sources/index.rst.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ pygrib
33

44
High-level python interface to
55
`ECCODES <https://confluence.ecmwf.int/display/ECC>`__ library for
6-
reading `GRIB <https://weather.gc.ca/grib/what_is_GRIB_e.html>`__ files.
6+
`GRIB <https://weather.gc.ca/grib/what_is_GRIB_e.html>`__ file IO.
77

88
Contents
99
--------
+22-19
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,43 @@
11
Installation
22
============
33

4-
Required dependencies
5-
---------------------
4+
Dependencies
5+
------------
66

7-
- Python >= 2.7
8-
- `ECCODES <https://confluence.ecmwf.int/display/ECC>`__ C library version 2.19.1 or higher.
7+
- ECCODES_ C library.
98
- `numpy <http://www.numpy.org/>`__
109
- `pyproj <https://pyproj4.github.io/pyproj/stable>`__
10+
- `cython <https://cython.org>`__ (only needed at build-time)
1111

1212

1313
Instructions
1414
------------
1515

16-
The easiest way to get everything installed is to use conda_ command line tool::
17-
18-
$ conda install -c conda-forge pygrib
16+
The easiest way to get everything installed is to use pip_:
1917

20-
.. _conda: http://conda.io/
18+
>>> pip install pygrib
2119

22-
If you don't use conda, be sure you have the required dependencies
23-
installed first. Then, install cftime with pip::
20+
This will install all the dependencies for you (including the ECCODES_ C lib).
2421

25-
$ ECCODES_DIR=path/to/eccodes pip install pygrib
22+
If you're using Anaconda python, use conda_:
2623

27-
where ``$ECCODES_DIR`` is the path to the directory containing ``include/grib_api.h``
28-
and ``lib/libeccodes.so``. If ``ECCODES_DIR`` is not specified, a few common locations
29-
such as ``$CONDA_PREFIX,/usr,/usr/local,/opt/local`` will be searched..
24+
>>> conda install -c conda-forge pygrib
3025

26+
.. _pip: http://pip.pypa.io/
27+
.. _conda: http://conda.io/
28+
.. _ECCODES: https://confluence.ecmwf.int/display/ECC/
3129

3230
Developing
3331
----------
3432

35-
When developing we recommend cloning the GitHub repository,
36-
building the extension in-place with `cython <http://cython.org/>`__ 0.19 or later
37-
``python setup.py build_ext --inplace``
33+
To build from source, clone the github repository and run setup.py:
34+
35+
>>> git clone https://github.com/jswhit/pygrib
36+
>>> cd pygrib
37+
>>> ECCODES_DIR=path/to/eccodes python setup.py install
3838

39-
and running the test script to check if the changes are passing the tests
40-
``python test.py``
39+
where ``$ECCODES_DIR`` is the path to the directory containing ``include/grib_api.h``
40+
and ``lib/libeccodes.so``. If ``ECCODES_DIR`` is not specified, a few common locations
41+
such as ``$CONDA_PREFIX,/usr,/usr/local,/opt/local`` will be searched..
42+
Then run a test script to check if things are working
43+
``cd test; python test.py``

0 commit comments

Comments
 (0)