Skip to content

Commit

Permalink
Updated read_bufr to include return_method [df,lf,gt] and set URLs in…
Browse files Browse the repository at this point in the history
… tests and examples to original ECMWF ones.
  • Loading branch information
Juri Hubrig committed May 26, 2024
1 parent 193273d commit 4b7cae2
Show file tree
Hide file tree
Showing 45 changed files with 1,892 additions and 284 deletions.
43 changes: 16 additions & 27 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,40 +1,29 @@

environment := PDBUFR

setup:
pre-commit install

default:
@echo No default

code-quality:
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
mypy --strict .

code-style:
black .
isort .
qa:
pre-commit run --all-files

tests:
unit-tests:
pytest -v --cov=. --cov-report=html README.rst tests

deploy:
check-manifest .
python setup.py sdist bdist_wheel

env-create:
conda env create -n $(environment) -f environment.in.yml
conda install -n $(environment) -y pytest pytest-cov black flake8 mypy isort wheel
conda install -n $(environment) -c conda-forge -y check-manifest

env-update:
conda env update -n $(environment) -f environment.in.yml

testclean:
$(RM) -r */__pycache__ .coverage .cache tests/.ipynb_checkpoints *.lprof
conda-env-update:
$(CONDA) env update $(CONDAFLAGS) -f environment.yml

clean: testclean
$(RM) -r */*.pyc htmlcov dist build .eggs
docker-build:
docker build -t $(PROJECT) .

distclean: clean
$(RM) -r *.egg-info
docker-run:
docker run --rm -ti -v $(PWD):/srv $(PROJECT)

template-update:
pre-commit run --all-files cruft -c .pre-commit-config-weekly.yaml

.PHONY: code-quality code-style tests env-create env-update
docs-build:
cd docs && rm -fr _api && make clean && make html
7 changes: 4 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
plbufr
======

TODO (these links do not exist yet!)
.. image:: https://img.shields.io/pypi/v/plbufr.svg
TODO (the pypi link does not exist yet!)
.. image:: https://img.shields.io/pypi/v/pdbufr.svg
:target: https://pypi.python.org/pypi/plbufr/


*plbufr* is a Python package implementing a `Polars <https://github.com/pola-rs/polars>`_ reader (instead of plbufr's Pandas) for the BUFR format using `ecCodes <https://confluence.ecmwf.int/display/ECC>`_. Its goal is to be faster and more versatile than `plbufr <https://github.com/ecmwf/plbufr>`_. Therefore, it will implement more features like filtering of missing data which is currently not supported by plbufr. It supports BUFR edition 3 and 4 files with uncompressed and compressed subsets. It works on Linux, MacOS and Windows, the ecCodes C-library is the only binary dependency. All modern versions of Python (>=3.6) and PyPy3 are supported.
*plbufr* is a Python package implementing a `Polars <https://github.com/pola-rs/polars>`_ reader (instead of plbufr's Pandas) for the BUFR format using `ecCodes <https://confluence.ecmwf.int/display/ECC>`_. Its goal is to be faster and more versatile than `pdbufr <https://github.com/ecmwf/plbufr>`_. Therefore, it will implement more features like filtering of missing data which is currently not supported by plbufr. It supports BUFR edition 3 and 4 files with uncompressed and compressed subsets. It works on Linux, MacOS and Windows, the ecCodes C-library is the only binary dependency. All modern versions of Python (>=3.10) and PyPy3 are supported. Even though python 3.10 is still supported, Python 3.11 is highly recommended because it runs significantly faster with the latest versions of ECCODES.

TODO
The documentation will be found at https://plbufr.readthedocs.io/.
Expand All @@ -16,6 +16,7 @@ License
=======

Copyright 2019- European Centre for Medium-Range Weather Forecasts (ECMWF).
Copyright 2023- Juri Hubrig

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion docs/_static/flat_dump_output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
0 1 71 907 NaN NaN NaN NaN
1 1 71 823 221.5 191.5 NaN NaN

[2 rows x 197 columns]
[2 rows x 197 columns]
2 changes: 1 addition & 1 deletion docs/_static/h_dump_output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
47 53.75 -73.67 23200.0 223.1
48 53.75 -73.67 20500.0 221.5

[48 rows x 4 columns]
[48 rows x 4 columns]
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
Try this notebook in |Binder|.
.. |Binder| image:: https://mybinder.org/badge.svg
:target: https://mybinder.org/v2/gh/ecmwf/plbufr/master?filepath=docs/{{ docname }}
:target: https://mybinder.org/v2/gh/sferics/plbufr/master?filepath=docs/{{ docname }}
:alt: Binder
:class: badge
Expand Down
4 changes: 2 additions & 2 deletions docs/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Contributing
The main repository is hosted on GitHub,
testing, bug reports and contributions are highly welcomed and appreciated:

https://github.com/ecmwf/plbufr
https://github.com/ecmwf/pdbufr

Main contributors:

Expand All @@ -15,4 +15,4 @@ Main contributors:
Also:
- Daniel Lee - DWD, who contributed the code in the high_level_bufr directory, originally part of eccodes-python

See also the list of `contributors <https://github.com/ecmwf/plbufr/contributors>`_ who participated in this project.
See also the list of `contributors <https://github.com/ecmwf/pdbufr/contributors>`_ who participated in this project.
1 change: 0 additions & 1 deletion docs/examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,3 @@ Here is a list of example notebooks to illustrate how to extract BUFR data using
examples/synop
examples/tropical_cyclone
examples/flat_dump

2 changes: 1 addition & 1 deletion docs/examples/aircraft.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"metadata": {},
"outputs": [],
"source": [
"!test -f aircraft_small.bufr || wget https://github.com/ecmwf/plbufr/raw/master/tests/sample-data/aircraft_small.bufr"
"!test -f aircraft_small.bufr || wget https://github.com/ecmwf/pdbufr/raw/master/tests/sample-data/aircraft_small.bufr"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/ens.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"metadata": {},
"outputs": [],
"source": [
"!test -f ens_multi_subset_uncompressed.bufr || wget https://github.com/ecmwf/plbufr/raw/master/tests/sample-data/ens_multi_subset_uncompressed.bufr"
"!test -f ens_multi_subset_uncompressed.bufr || wget https://github.com/ecmwf/pdbufr/raw/master/tests/sample-data/ens_multi_subset_uncompressed.bufr"
]
},
{
Expand Down
4 changes: 2 additions & 2 deletions docs/examples/flat_dump.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"metadata": {},
"outputs": [],
"source": [
"!test -f aircraft_small.bufr || wget https://github.com/ecmwf/plbufr/raw/master/tests/sample-data/aircraft_small.bufr\n",
"!test -f temp.bufr || wget https://github.com/ecmwf/plbufr/raw/master/tests/sample-data/temp.bufr"
"!test -f aircraft_small.bufr || wget https://github.com/ecmwf/pdbufr/raw/master/tests/sample-data/aircraft_small.bufr\n",
"!test -f temp.bufr || wget https://github.com/ecmwf/pdbufr/raw/master/tests/sample-data/temp.bufr"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/radiosonde.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"metadata": {},
"outputs": [],
"source": [
"!test -f temp.bufr || wget https://github.com/ecmwf/plbufr/raw/master/tests/sample-data/temp.bufr"
"!test -f temp.bufr || wget https://github.com/ecmwf/pdbufr/raw/master/tests/sample-data/temp.bufr"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/sat.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"metadata": {},
"outputs": [],
"source": [
"!test -f hirs.bufr || wget https://github.com/ecmwf/plbufr/raw/master/tests/sample-data/M02-HIRS-HIRxxx1B-NA-1.0-20181122114854.000000000Z-20181122132602-1304602.bufr --output-document=hirs.bufr"
"!test -f hirs.bufr || wget https://github.com/ecmwf/pdbufr/raw/master/tests/sample-data/M02-HIRS-HIRxxx1B-NA-1.0-20181122114854.000000000Z-20181122132602-1304602.bufr --output-document=hirs.bufr"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/synop.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"metadata": {},
"outputs": [],
"source": [
"!test -f syn_new.bufr || wget https://github.com/ecmwf/plbufr/raw/master/tests/sample-data/syn_new.bufr"
"!test -f syn_new.bufr || wget https://github.com/ecmwf/pdbufr/raw/master/tests/sample-data/syn_new.bufr"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/tropical_cyclone.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"metadata": {},
"outputs": [],
"source": [
"!test -f tropical_cyclone.bufr || wget https://github.com/ecmwf/plbufr/raw/master/tests/sample-data/tropical_cyclone.bufr"
"!test -f tropical_cyclone.bufr || wget https://github.com/ecmwf/pdbufr/raw/master/tests/sample-data/tropical_cyclone.bufr"
]
},
{
Expand Down
4 changes: 2 additions & 2 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Welcome to plbufr's documentation
:caption: Examples
:titlesonly:

examples
examples

.. toctree::
:maxdepth: 1
Expand All @@ -38,6 +38,6 @@ Indices and tables
==================

* :ref:`genindex`

.. * :ref:`modindex`
.. * :ref:`search`
2 changes: 1 addition & 1 deletion docs/licence.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
limitations under the License.
Loading

0 comments on commit 4b7cae2

Please sign in to comment.