Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix iterating a queryresult #24

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
language: python
python:
- "2.7"
- "3.5"
- "3.6"
- "3.7"
- "3.8"
- "3.9"
- "3.9-dev"
- "3.10"
- "3.11"
- "pypy3"
# command to install dependencies
install:
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ An `online BUFR decoder <http://aws-bufr-webapp.s3-website-ap-southeast-2.amazon

Installation
------------
PyBufrKit is compatible with Python 2.7, 3.5+, and `PyPy <https://pypy.org/>`_.
PyBufrKit is compatible with Python 3.7+ and `PyPy <https://pypy.org/>`_.
To install from PyPi::

pip install pybufrkit
Expand Down
2 changes: 1 addition & 1 deletion pybufrkit/dataquery.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ def all_values(self, flat=False):
return list(self.results.values())

def __iter__(self):
return iter(self.results.viewitems())
return iter(self.results.items())


NODE_NOT_MATCH = 0
Expand Down
7 changes: 4 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,11 @@ def get_requirements():
"Intended Audience :: Science/Research",
"Operating System :: OS Independent",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Topic :: Utilities",
],
keywords=['BUFR', 'WMO'],
Expand Down
10 changes: 10 additions & 0 deletions tests/test_dataquery.py
Original file line number Diff line number Diff line change
Expand Up @@ -553,3 +553,13 @@ def test_contrived(self):
[[[[12], [10], [8]]], [[[6], [4]]]]
]
]

def test_iterate_query_result(self):
s = read_bufr_file('jaso_214.bufr')
bufr_message = self.decoder.process(s)

r1 = self.querent.query(bufr_message, '/301011/004001')
it = iter(r1)
next(it)
next(it)
next(it)