cefast 0.2.0__tar.gz → 0.2.1__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 (119) hide show
  1. {cefast-0.2.0 → cefast-0.2.1}/PKG-INFO +1 -1
  2. {cefast-0.2.0 → cefast-0.2.1}/docs/cpp.rst +1 -1
  3. {cefast-0.2.0 → cefast-0.2.1}/docs/history.rst +7 -0
  4. {cefast-0.2.0 → cefast-0.2.1}/meson.build +1 -1
  5. {cefast-0.2.0 → cefast-0.2.1}/pycefast/_cefast.cpp +14 -8
  6. {cefast-0.2.0 → cefast-0.2.1}/tests/python/test_cefast.py +13 -0
  7. {cefast-0.2.0 → cefast-0.2.1}/.clang-format +0 -0
  8. {cefast-0.2.0 → cefast-0.2.1}/.github/dependabot.yml +0 -0
  9. {cefast-0.2.0 → cefast-0.2.1}/.github/workflows/tests.yml +0 -0
  10. {cefast-0.2.0 → cefast-0.2.1}/.github/workflows/wheels.yml +0 -0
  11. {cefast-0.2.0 → cefast-0.2.1}/.gitignore +0 -0
  12. {cefast-0.2.0 → cefast-0.2.1}/.readthedocs.yaml +0 -0
  13. {cefast-0.2.0 → cefast-0.2.1}/COPYING +0 -0
  14. {cefast-0.2.0 → cefast-0.2.1}/README.md +0 -0
  15. {cefast-0.2.0 → cefast-0.2.1}/cefast/__init__.py +0 -0
  16. {cefast-0.2.0 → cefast-0.2.1}/cefast/_repr.py +0 -0
  17. {cefast-0.2.0 → cefast-0.2.1}/cefast/_version.py.in +0 -0
  18. {cefast-0.2.0 → cefast-0.2.1}/cefast/meson.build +0 -0
  19. {cefast-0.2.0 → cefast-0.2.1}/docs/_static/playground.css +0 -0
  20. {cefast-0.2.0 → cefast-0.2.1}/docs/_static/playground.js +0 -0
  21. {cefast-0.2.0 → cefast-0.2.1}/docs/accepted-deviations.md +0 -0
  22. {cefast-0.2.0 → cefast-0.2.1}/docs/api.rst +0 -0
  23. {cefast-0.2.0 → cefast-0.2.1}/docs/cef.rst +0 -0
  24. {cefast-0.2.0 → cefast-0.2.1}/docs/check_examples.py +0 -0
  25. {cefast-0.2.0 → cefast-0.2.1}/docs/conf.py +0 -0
  26. {cefast-0.2.0 → cefast-0.2.1}/docs/contributing.rst +0 -0
  27. {cefast-0.2.0 → cefast-0.2.1}/docs/cookbook.rst +0 -0
  28. {cefast-0.2.0 → cefast-0.2.1}/docs/deviations.rst +0 -0
  29. {cefast-0.2.0 → cefast-0.2.1}/docs/faq.rst +0 -0
  30. {cefast-0.2.0 → cefast-0.2.1}/docs/images/cefast_logo.png +0 -0
  31. {cefast-0.2.0 → cefast-0.2.1}/docs/index.rst +0 -0
  32. {cefast-0.2.0 → cefast-0.2.1}/docs/installation.rst +0 -0
  33. {cefast-0.2.0 → cefast-0.2.1}/docs/perf/2026-11-round1-profile.md +0 -0
  34. {cefast-0.2.0 → cefast-0.2.1}/docs/perf/2026-11-round5-parallel.md +0 -0
  35. {cefast-0.2.0 → cefast-0.2.1}/docs/perf/2026-11-round6-small-files.md +0 -0
  36. {cefast-0.2.0 → cefast-0.2.1}/docs/perf/2026-11-round7.md +0 -0
  37. {cefast-0.2.0 → cefast-0.2.1}/docs/performance.rst +0 -0
  38. {cefast-0.2.0 → cefast-0.2.1}/docs/quickstart.rst +0 -0
  39. {cefast-0.2.0 → cefast-0.2.1}/docs/reading.rst +0 -0
  40. {cefast-0.2.0 → cefast-0.2.1}/docs/requirements.txt +0 -0
  41. {cefast-0.2.0 → cefast-0.2.1}/docs/superpowers/plans/2026-11-05-cefast-reader.md +0 -0
  42. {cefast-0.2.0 → cefast-0.2.1}/docs/superpowers/plans/2026-11-05-cefast-speed-round2.md +0 -0
  43. {cefast-0.2.0 → cefast-0.2.1}/docs/superpowers/plans/2026-11-05-cefast-speed-round3.md +0 -0
  44. {cefast-0.2.0 → cefast-0.2.1}/docs/superpowers/plans/2026-11-05-cefast-speed.md +0 -0
  45. {cefast-0.2.0 → cefast-0.2.1}/docs/superpowers/plans/2026-11-05-cpp-utils-python.md +0 -0
  46. {cefast-0.2.0 → cefast-0.2.1}/docs/superpowers/plans/2026-11-05-plan-review-opencode.md +0 -0
  47. {cefast-0.2.0 → cefast-0.2.1}/docs/superpowers/plans/2026-11-06-cefast-speed-round4.md +0 -0
  48. {cefast-0.2.0 → cefast-0.2.1}/docs/superpowers/plans/2026-11-06-cefast-speed-round5.md +0 -0
  49. {cefast-0.2.0 → cefast-0.2.1}/docs/superpowers/plans/2026-11-06-cefast-speed-round6.md +0 -0
  50. {cefast-0.2.0 → cefast-0.2.1}/docs/superpowers/plans/2026-11-06-cefast-speed-round7.md +0 -0
  51. {cefast-0.2.0 → cefast-0.2.1}/docs/superpowers/specs/2026-11-05-cef-facts.md +0 -0
  52. {cefast-0.2.0 → cefast-0.2.1}/docs/superpowers/specs/2026-11-05-cefast-design.md +0 -0
  53. {cefast-0.2.0 → cefast-0.2.1}/docs/superpowers/specs/2026-11-05-csa-cef-probe.md +0 -0
  54. {cefast-0.2.0 → cefast-0.2.1}/include/cefast/cefast.hpp +0 -0
  55. {cefast-0.2.0 → cefast-0.2.1}/include/cefast/data/parallel.hpp +0 -0
  56. {cefast-0.2.0 → cefast-0.2.1}/include/cefast/data/records.hpp +0 -0
  57. {cefast-0.2.0 → cefast-0.2.1}/include/cefast/data/structural.hpp +0 -0
  58. {cefast-0.2.0 → cefast-0.2.1}/include/cefast/data/workers.hpp +0 -0
  59. {cefast-0.2.0 → cefast-0.2.1}/include/cefast/errors.hpp +0 -0
  60. {cefast-0.2.0 → cefast-0.2.1}/include/cefast/gzip.hpp +0 -0
  61. {cefast-0.2.0 → cefast-0.2.1}/include/cefast/header/attributes.hpp +0 -0
  62. {cefast-0.2.0 → cefast-0.2.1}/include/cefast/header/lexer.hpp +0 -0
  63. {cefast-0.2.0 → cefast-0.2.1}/include/cefast/header/parser.hpp +0 -0
  64. {cefast-0.2.0 → cefast-0.2.1}/include/cefast/input.hpp +0 -0
  65. {cefast-0.2.0 → cefast-0.2.1}/include/cefast/model.hpp +0 -0
  66. {cefast-0.2.0 → cefast-0.2.1}/include/cefast/time.hpp +0 -0
  67. {cefast-0.2.0 → cefast-0.2.1}/include/cefast/values.hpp +0 -0
  68. {cefast-0.2.0 → cefast-0.2.1}/meson_options.txt +0 -0
  69. {cefast-0.2.0 → cefast-0.2.1}/pycefast/meson.build +0 -0
  70. {cefast-0.2.0 → cefast-0.2.1}/pyproject.toml +0 -0
  71. {cefast-0.2.0 → cefast-0.2.1}/subprojects/catch2.wrap +0 -0
  72. {cefast-0.2.0 → cefast-0.2.1}/subprojects/cpp_utils.wrap +0 -0
  73. {cefast-0.2.0 → cefast-0.2.1}/subprojects/fast_float.wrap +0 -0
  74. {cefast-0.2.0 → cefast-0.2.1}/subprojects/hedley.wrap +0 -0
  75. {cefast-0.2.0 → cefast-0.2.1}/subprojects/pybind11.wrap +0 -0
  76. {cefast-0.2.0 → cefast-0.2.1}/subprojects/zlib.wrap +0 -0
  77. {cefast-0.2.0 → cefast-0.2.1}/tests/cpp/test_corpus.cpp +0 -0
  78. {cefast-0.2.0 → cefast-0.2.1}/tests/cpp/test_header.cpp +0 -0
  79. {cefast-0.2.0 → cefast-0.2.1}/tests/cpp/test_input.cpp +0 -0
  80. {cefast-0.2.0 → cefast-0.2.1}/tests/cpp/test_lexer.cpp +0 -0
  81. {cefast-0.2.0 → cefast-0.2.1}/tests/cpp/test_records.cpp +0 -0
  82. {cefast-0.2.0 → cefast-0.2.1}/tests/cpp/test_time.cpp +0 -0
  83. {cefast-0.2.0 → cefast-0.2.1}/tests/cpp/test_values.cpp +0 -0
  84. {cefast-0.2.0 → cefast-0.2.1}/tests/meson.build +0 -0
  85. {cefast-0.2.0 → cefast-0.2.1}/tests/python/test_vs_ceflib.py +0 -0
  86. {cefast-0.2.0 → cefast-0.2.1}/tests/resources/csa_manifest.json +0 -0
  87. {cefast-0.2.0 → cefast-0.2.1}/tests/resources/fixtures/codif-header.cef +0 -0
  88. {cefast-0.2.0 → cefast-0.2.1}/tests/resources/fixtures/hello.cef +0 -0
  89. {cefast-0.2.0 → cefast-0.2.1}/tests/resources/fixtures/hello.cef.gz +0 -0
  90. {cefast-0.2.0 → cefast-0.2.1}/tests/resources/fixtures/include/broken.cef +0 -0
  91. {cefast-0.2.0 → cefast-0.2.1}/tests/resources/fixtures/include/broken.ceh +0 -0
  92. {cefast-0.2.0 → cefast-0.2.1}/tests/resources/fixtures/include/common.ceh +0 -0
  93. {cefast-0.2.0 → cefast-0.2.1}/tests/resources/fixtures/include/cycle-a.cef +0 -0
  94. {cefast-0.2.0 → cefast-0.2.1}/tests/resources/fixtures/include/cycle-b.ceh +0 -0
  95. {cefast-0.2.0 → cefast-0.2.1}/tests/resources/fixtures/include/main.cef +0 -0
  96. {cefast-0.2.0 → cefast-0.2.1}/tests/resources/fixtures/include/nested.ceh +0 -0
  97. {cefast-0.2.0 → cefast-0.2.1}/tests/resources/fixtures/trailing_zeros.cef.gz +0 -0
  98. {cefast-0.2.0 → cefast-0.2.1}/tests/resources/fixtures/truncated.cef.gz +0 -0
  99. {cefast-0.2.0 → cefast-0.2.1}/tests/resources/fixtures/two_members.cef.gz +0 -0
  100. {cefast-0.2.0 → cefast-0.2.1}/tests/resources/fixtures/whi-header.cef +0 -0
  101. {cefast-0.2.0 → cefast-0.2.1}/tests/resources/make_gz.py +0 -0
  102. {cefast-0.2.0 → cefast-0.2.1}/tests/wheel/test_wheel.py +0 -0
  103. {cefast-0.2.0 → cefast-0.2.1}/tools/bench/bench_load.cpp +0 -0
  104. {cefast-0.2.0 → cefast-0.2.1}/tools/bench/meson.build +0 -0
  105. {cefast-0.2.0 → cefast-0.2.1}/tools/ceflib/benchmark.py +0 -0
  106. {cefast-0.2.0 → cefast-0.2.1}/tools/ceflib/build_ceflib.sh +0 -0
  107. {cefast-0.2.0 → cefast-0.2.1}/tools/fetch_csa_corpus.py +0 -0
  108. {cefast-0.2.0 → cefast-0.2.1}/tools/fuzz/cef.dict +0 -0
  109. {cefast-0.2.0 → cefast-0.2.1}/tools/fuzz/compare.hpp +0 -0
  110. {cefast-0.2.0 → cefast-0.2.1}/tools/fuzz/fuzz_float.cpp +0 -0
  111. {cefast-0.2.0 → cefast-0.2.1}/tools/fuzz/fuzz_lexer.cpp +0 -0
  112. {cefast-0.2.0 → cefast-0.2.1}/tools/fuzz/fuzz_lexer_diff.cpp +0 -0
  113. {cefast-0.2.0 → cefast-0.2.1}/tools/fuzz/fuzz_load.cpp +0 -0
  114. {cefast-0.2.0 → cefast-0.2.1}/tools/fuzz/fuzz_records_diff.cpp +0 -0
  115. {cefast-0.2.0 → cefast-0.2.1}/tools/fuzz/fuzz_time.cpp +0 -0
  116. {cefast-0.2.0 → cefast-0.2.1}/tools/fuzz/make_corpus.py +0 -0
  117. {cefast-0.2.0 → cefast-0.2.1}/tools/fuzz/meson.build +0 -0
  118. {cefast-0.2.0 → cefast-0.2.1}/tools/fuzz/reference_lexer.hpp +0 -0
  119. {cefast-0.2.0 → cefast-0.2.1}/tools/fuzz/reference_records.hpp +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: cefast
3
- Version: 0.2.0
3
+ Version: 0.2.1
4
4
  Summary: Fast reader for ESA's Cluster Exchange Format (CEF 2.0)
5
5
  Author-Email: Alexis Jeandet <alexis.jeandet@member.fsf.org>
6
6
  License: MIT License
@@ -16,7 +16,7 @@ Put this wrap file in your ``subprojects/`` directory, as ``subprojects/cefast.w
16
16
 
17
17
  [wrap-git]
18
18
  url = https://github.com/SciQLop/CEFast.git
19
- revision = v0.2.0
19
+ revision = v0.2.1
20
20
  depth = 1
21
21
 
22
22
  [provide]
@@ -2,6 +2,13 @@
2
2
  History
3
3
  =======
4
4
 
5
+ 0.2.1 (2026-11-08)
6
+ ==================
7
+
8
+ - A key that is not text is missing, as in a :class:`dict`: ``None in f`` is false,
9
+ ``f.get(None)`` returns the default and ``f[None]`` raises :class:`KeyError`. They used to
10
+ raise :class:`TypeError`.
11
+
5
12
  0.2.0 (2026-11-08)
6
13
  ==================
7
14
 
@@ -2,7 +2,7 @@ project(
2
2
  'cefast',
3
3
  'cpp',
4
4
  meson_version : '>= 1.2.0',
5
- version : '0.2.0',
5
+ version : '0.2.1',
6
6
  default_options : ['cpp_std=c++20', 'buildtype=release']
7
7
  )
8
8
 
@@ -193,22 +193,28 @@ struct py_cef
193
193
  {
194
194
  std::shared_ptr<cefast::cef_file> file;
195
195
 
196
- [[nodiscard]] py_variable getitem(const std::string& name) const
196
+ // Keys of any type, like a dict: a key that is not text is simply not there.
197
+ [[nodiscard]] std::optional<std::size_t> find(const py::handle& key) const
197
198
  {
199
+ if (!py::isinstance<py::str>(key))
200
+ return std::nullopt;
201
+ const auto name = key.cast<std::string>();
198
202
  for (std::size_t index = 0; index < file->variables.size(); ++index)
199
203
  if (file->variables[index].name == name)
200
- return py_variable { file, index };
201
- throw py::key_error(name);
204
+ return index;
205
+ return std::nullopt;
202
206
  }
203
207
 
204
- [[nodiscard]] bool contains(const std::string& name) const
208
+ [[nodiscard]] py_variable getitem(const py::object& key) const
205
209
  {
206
- for (const auto& var : file->variables)
207
- if (var.name == name)
208
- return true;
209
- return false;
210
+ if (const auto index = find(key))
211
+ return py_variable { file, *index };
212
+ PyErr_SetObject(PyExc_KeyError, key.ptr());
213
+ throw py::error_already_set();
210
214
  }
211
215
 
216
+ [[nodiscard]] bool contains(const py::object& key) const { return find(key).has_value(); }
217
+
212
218
  [[nodiscard]] std::size_t len() const { return file->variables.size(); }
213
219
  [[nodiscard]] py::dict attributes() const { return attributes_of(file->globals); }
214
220
 
@@ -340,6 +340,19 @@ class TestMapping(unittest.TestCase):
340
340
  def test_dict_conversion(self):
341
341
  self.assertEqual(list(dict(self.f)), ["time_tags", "B_vec", "label"])
342
342
 
343
+ def test_keys_that_are_not_text_are_missing_like_in_a_dict(self):
344
+ for key in (None, 1, b"B_vec"):
345
+ self.assertNotIn(key, self.f)
346
+ self.assertIsNone(self.f.get(key))
347
+ self.assertEqual(self.f.get(key, 42), 42)
348
+ with self.assertRaises(KeyError):
349
+ self.f[key]
350
+
351
+ def test_missing_key_error_holds_the_key(self):
352
+ with self.assertRaises(KeyError) as caught:
353
+ self.f["missing"]
354
+ self.assertEqual(caught.exception.args, ("missing",))
355
+
343
356
  def test_still_read_only(self):
344
357
  with self.assertRaises(TypeError):
345
358
  self.f["x"] = None
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
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
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