eccodes 2.41.0__tar.gz → 2.42.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. {eccodes-2.41.0 → eccodes-2.42.0}/CHANGELOG.rst +8 -0
  2. {eccodes-2.41.0 → eccodes-2.42.0}/Makefile +1 -1
  3. {eccodes-2.41.0 → eccodes-2.42.0}/PKG-INFO +9 -2
  4. {eccodes-2.41.0 → eccodes-2.42.0}/ci/requirements-docs.txt +2 -2
  5. {eccodes-2.41.0 → eccodes-2.42.0}/eccodes/highlevel/message.py +1 -1
  6. {eccodes-2.41.0 → eccodes-2.42.0}/eccodes.egg-info/PKG-INFO +9 -2
  7. {eccodes-2.41.0 → eccodes-2.42.0}/gribapi/bindings.py +1 -1
  8. {eccodes-2.41.0 → eccodes-2.42.0}/gribapi/gribapi.py +10 -2
  9. {eccodes-2.41.0 → eccodes-2.42.0}/setup.py +0 -1
  10. {eccodes-2.41.0 → eccodes-2.42.0}/tests/test_eccodes.py +17 -0
  11. {eccodes-2.41.0 → eccodes-2.42.0}/tests/test_highlevel.py +3 -0
  12. {eccodes-2.41.0 → eccodes-2.42.0}/tox.ini +1 -1
  13. {eccodes-2.41.0 → eccodes-2.42.0}/.dockerignore +0 -0
  14. {eccodes-2.41.0 → eccodes-2.42.0}/CONTRIBUTING.rst +0 -0
  15. {eccodes-2.41.0 → eccodes-2.42.0}/Dockerfile +0 -0
  16. {eccodes-2.41.0 → eccodes-2.42.0}/LICENSE +0 -0
  17. {eccodes-2.41.0 → eccodes-2.42.0}/MANIFEST.in +0 -0
  18. {eccodes-2.41.0 → eccodes-2.42.0}/README.rst +0 -0
  19. {eccodes-2.41.0 → eccodes-2.42.0}/builder.py +0 -0
  20. {eccodes-2.41.0 → eccodes-2.42.0}/ci/requirements-dev.txt +0 -0
  21. {eccodes-2.41.0 → eccodes-2.42.0}/ci/requirements-docs.in +0 -0
  22. {eccodes-2.41.0 → eccodes-2.42.0}/ci/requirements-tests.in +0 -0
  23. {eccodes-2.41.0 → eccodes-2.42.0}/ci/requirements-tests.txt +0 -0
  24. {eccodes-2.41.0 → eccodes-2.42.0}/docs/_static/.gitkeep +0 -0
  25. {eccodes-2.41.0 → eccodes-2.42.0}/docs/conf.py +0 -0
  26. {eccodes-2.41.0 → eccodes-2.42.0}/docs/index.rst +0 -0
  27. {eccodes-2.41.0 → eccodes-2.42.0}/eccodes/__init__.py +0 -0
  28. {eccodes-2.41.0 → eccodes-2.42.0}/eccodes/__main__.py +0 -0
  29. {eccodes-2.41.0 → eccodes-2.42.0}/eccodes/eccodes.py +0 -0
  30. {eccodes-2.41.0 → eccodes-2.42.0}/eccodes/highlevel/__init__.py +0 -0
  31. {eccodes-2.41.0 → eccodes-2.42.0}/eccodes/highlevel/reader.py +0 -0
  32. {eccodes-2.41.0 → eccodes-2.42.0}/eccodes.egg-info/SOURCES.txt +0 -0
  33. {eccodes-2.41.0 → eccodes-2.42.0}/eccodes.egg-info/dependency_links.txt +0 -0
  34. {eccodes-2.41.0 → eccodes-2.42.0}/eccodes.egg-info/requires.txt +0 -0
  35. {eccodes-2.41.0 → eccodes-2.42.0}/eccodes.egg-info/top_level.txt +0 -0
  36. {eccodes-2.41.0 → eccodes-2.42.0}/eccodes.egg-info/zip-safe +0 -0
  37. {eccodes-2.41.0 → eccodes-2.42.0}/gribapi/__init__.py +0 -0
  38. {eccodes-2.41.0 → eccodes-2.42.0}/gribapi/eccodes.h +0 -0
  39. {eccodes-2.41.0 → eccodes-2.42.0}/gribapi/errors.py +0 -0
  40. {eccodes-2.41.0 → eccodes-2.42.0}/gribapi/grib_api.h +0 -0
  41. {eccodes-2.41.0 → eccodes-2.42.0}/setup.cfg +0 -0
  42. {eccodes-2.41.0 → eccodes-2.42.0}/tests/sample-data/era5-levels-members.grib +0 -0
  43. {eccodes-2.41.0 → eccodes-2.42.0}/tests/sample-data/tiggelam_cnmc_sfc.grib2 +0 -0
  44. {eccodes-2.41.0 → eccodes-2.42.0}/tests/test_20_main.py +0 -0
  45. {eccodes-2.41.0 → eccodes-2.42.0}/tests/test_20_messages.py +0 -0
@@ -2,6 +2,14 @@
2
2
  Changelog for eccodes-python
3
3
  ============================
4
4
 
5
+ 2.42.0 (2025-06-25)
6
+ --------------------
7
+
8
+ - ECC-2081: Allow memoryview as input to codes_new_from_message
9
+ - ECC-2086: GRIB: getting the bitmap using up all the memory
10
+ - ECC-2072: high-level 'get' function should return default value if key is not implemented
11
+
12
+
5
13
  2.41.0 (2025-04-10)
6
14
  --------------------
7
15
 
@@ -2,7 +2,7 @@
2
2
  PACKAGE := eccodes-python
3
3
  IMAGE := $(PACKAGE)-image
4
4
  MODULE := eccodes
5
- PYTHONS := python3.9 python3.8 pypy3
5
+ PYTHONS := python3.9 pypy3
6
6
  PYTHON := python
7
7
 
8
8
  PYTESTFLAGS_TEST := -v --flakes --doctest-glob '*.rst' --cov=$(MODULE) --cov-report=html --cache-clear
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: eccodes
3
- Version: 2.41.0
3
+ Version: 2.42.0
4
4
  Summary: Python interface to the ecCodes GRIB and BUFR decoder/encoder
5
5
  Home-page: https://github.com/ecmwf/eccodes-python
6
6
  Author: European Centre for Medium-Range Weather Forecasts (ECMWF)
@@ -10,7 +10,6 @@ Keywords: ecCodes GRIB BUFR
10
10
  Classifier: Development Status :: 4 - Beta
11
11
  Classifier: Intended Audience :: Developers
12
12
  Classifier: License :: OSI Approved :: Apache Software License
13
- Classifier: Programming Language :: Python :: 3.8
14
13
  Classifier: Programming Language :: Python :: 3.9
15
14
  Classifier: Programming Language :: Python :: 3.10
16
15
  Classifier: Programming Language :: Python :: 3.11
@@ -211,6 +210,14 @@ does it submit to any jurisdiction.
211
210
  Changelog for eccodes-python
212
211
  ============================
213
212
 
213
+ 2.42.0 (2025-06-25)
214
+ --------------------
215
+
216
+ - ECC-2081: Allow memoryview as input to codes_new_from_message
217
+ - ECC-2086: GRIB: getting the bitmap using up all the memory
218
+ - ECC-2072: high-level 'get' function should return default value if key is not implemented
219
+
220
+
214
221
  2.41.0 (2025-04-10)
215
222
  --------------------
216
223
 
@@ -32,7 +32,7 @@ pytest-runner==4.4
32
32
  # via -r requirements-docs.in
33
33
  pytz==2018.9
34
34
  # via babel
35
- requests==2.32.2
35
+ requests==2.32.4
36
36
  # via sphinx
37
37
  six==1.12.0
38
38
  # via
@@ -44,5 +44,5 @@ sphinx==1.8.5
44
44
  # via -r requirements-docs.in
45
45
  sphinxcontrib-websupport==1.1.0
46
46
  # via sphinx
47
- urllib3==1.26.19
47
+ urllib3==2.4.0
48
48
  # via requests
@@ -17,7 +17,7 @@ def raise_keyerror(name):
17
17
  """Make operations on a key raise a KeyError if not found"""
18
18
  try:
19
19
  yield
20
- except eccodes.KeyValueNotFoundError:
20
+ except (eccodes.KeyValueNotFoundError, eccodes.FunctionNotImplementedError):
21
21
  raise KeyError(name)
22
22
 
23
23
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: eccodes
3
- Version: 2.41.0
3
+ Version: 2.42.0
4
4
  Summary: Python interface to the ecCodes GRIB and BUFR decoder/encoder
5
5
  Home-page: https://github.com/ecmwf/eccodes-python
6
6
  Author: European Centre for Medium-Range Weather Forecasts (ECMWF)
@@ -10,7 +10,6 @@ Keywords: ecCodes GRIB BUFR
10
10
  Classifier: Development Status :: 4 - Beta
11
11
  Classifier: Intended Audience :: Developers
12
12
  Classifier: License :: OSI Approved :: Apache Software License
13
- Classifier: Programming Language :: Python :: 3.8
14
13
  Classifier: Programming Language :: Python :: 3.9
15
14
  Classifier: Programming Language :: Python :: 3.10
16
15
  Classifier: Programming Language :: Python :: 3.11
@@ -211,6 +210,14 @@ does it submit to any jurisdiction.
211
210
  Changelog for eccodes-python
212
211
  ============================
213
212
 
213
+ 2.42.0 (2025-06-25)
214
+ --------------------
215
+
216
+ - ECC-2081: Allow memoryview as input to codes_new_from_message
217
+ - ECC-2086: GRIB: getting the bitmap using up all the memory
218
+ - ECC-2072: high-level 'get' function should return default value if key is not implemented
219
+
220
+
214
221
  2.41.0 (2025-04-10)
215
222
  --------------------
216
223
 
@@ -23,7 +23,7 @@ import sys
23
23
 
24
24
  import cffi
25
25
 
26
- __version__ = "2.41.0"
26
+ __version__ = "2.42.0"
27
27
 
28
28
  LOG = logging.getLogger(__name__)
29
29
 
@@ -20,7 +20,7 @@ Numpy is a package used for scientific computing in Python and an efficient cont
20
20
 
21
21
  @em Requirements:
22
22
 
23
- - Python 3.8 or higher
23
+ - Python 3.9 or higher
24
24
  - NumPy
25
25
 
26
26
  """
@@ -2044,6 +2044,10 @@ def grib_get_array(msgid, key, ktype=None):
2044
2044
  if ktype is None:
2045
2045
  ktype = grib_get_native_type(msgid, key)
2046
2046
 
2047
+ # ECC-2086
2048
+ if ktype is bytes and key == "bitmap":
2049
+ return grib_get_long_array(msgid, key)
2050
+
2047
2051
  result = None
2048
2052
  if ktype is int:
2049
2053
  result = grib_get_long_array(msgid, key)
@@ -2389,7 +2393,7 @@ def grib_get_message(msgid):
2389
2393
  return fixed_length_buffer[:]
2390
2394
 
2391
2395
 
2392
- @require(message=(bytes, str))
2396
+ @require(message=(bytes, str, memoryview))
2393
2397
  def grib_new_from_message(message):
2394
2398
  """
2395
2399
  @brief Create a handle from a message in memory.
@@ -2402,8 +2406,12 @@ def grib_new_from_message(message):
2402
2406
  @return msgid of the newly created message
2403
2407
  @exception CodesInternalError
2404
2408
  """
2409
+ if isinstance(message, memoryview):
2410
+ message = ffi.from_buffer(message)
2411
+
2405
2412
  if isinstance(message, str):
2406
2413
  message = message.encode(ENC)
2414
+
2407
2415
  h = lib.grib_handle_new_from_message_copy(ffi.NULL, message, len(message))
2408
2416
  if h == ffi.NULL:
2409
2417
  raise errors.MessageInvalidError("new_from_message failed")
@@ -113,7 +113,6 @@ setuptools.setup(
113
113
  "Development Status :: 4 - Beta",
114
114
  "Intended Audience :: Developers",
115
115
  "License :: OSI Approved :: Apache Software License",
116
- "Programming Language :: Python :: 3.8",
117
116
  "Programming Language :: Python :: 3.9",
118
117
  "Programming Language :: Python :: 3.10",
119
118
  "Programming Language :: Python :: 3.11",
@@ -187,6 +187,22 @@ def test_new_from_message():
187
187
  # eccodes.codes_release(newgid)
188
188
 
189
189
 
190
+ def test_new_from_message_memoryview():
191
+ # ECC-2081
192
+ fpath = get_sample_fullpath("gg_sfc_grib1.tmpl")
193
+ if fpath is None:
194
+ return
195
+ with open(fpath, "rb") as f:
196
+ data = f.read()
197
+ mv = memoryview(data)
198
+ assert len(mv) == 26860
199
+ newgid = eccodes.codes_new_from_message(mv)
200
+ assert eccodes.codes_get(newgid, "packingType") == "grid_simple"
201
+ assert eccodes.codes_get(newgid, "gridType") == "reduced_gg"
202
+ assert eccodes.codes_get(newgid, "totalLength") == 26860
203
+ eccodes.codes_release(newgid)
204
+
205
+
190
206
  def test_gts_header():
191
207
  eccodes.codes_gts_header(True)
192
208
  eccodes.codes_gts_header(False)
@@ -623,6 +639,7 @@ def test_grib_set_bitmap():
623
639
  assert eccodes.codes_get(gid, "numberOfDataPoints") == 100
624
640
  assert eccodes.codes_get(gid, "numberOfCodedValues") == 98
625
641
  assert eccodes.codes_get(gid, "numberOfMissing") == 2
642
+ eccodes.codes_get_array(gid, "bitmap")
626
643
  eccodes.codes_release(gid)
627
644
 
628
645
 
@@ -44,6 +44,9 @@ def test_message_get():
44
44
  assert message["gridType:int"] == 0
45
45
  with pytest.raises(KeyError):
46
46
  message["invalid"]
47
+ with pytest.raises(KeyError):
48
+ message["gridSpec"]
49
+ assert message.get("gridSpec", dummy_default) is dummy_default
47
50
  # keys set as MISSING
48
51
  assert message.is_missing(known_missing)
49
52
  assert message.get(known_missing) is None
@@ -12,7 +12,7 @@ deps = -r{toxinidir}/ci/requirements-docs.txt
12
12
  commands = sphinx-build -W -b html docs build/sphinx/html
13
13
 
14
14
  [testenv:qc]
15
- basepython = python3.8
15
+ basepython = python3.9
16
16
  # needed for pytest-cov
17
17
  usedevelop = true
18
18
  commands = pytest -v --flakes --pep8 --mccabe --cov=eccodes --doctest-glob="*.rst" --cov-report=html --cache-clear --basetemp={envtmpdir} {posargs}
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes