sedpack 0.1.3__tar.gz → 0.2.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 (69) hide show
  1. {sedpack-0.1.3 → sedpack-0.2.0}/PKG-INFO +29 -17
  2. {sedpack-0.1.3 → sedpack-0.2.0}/README.md +11 -6
  3. {sedpack-0.1.3 → sedpack-0.2.0}/pyproject.toml +17 -9
  4. sedpack-0.2.0/rust/Cargo.lock +1436 -0
  5. {sedpack-0.1.3 → sedpack-0.2.0}/rust/Cargo.toml +17 -12
  6. {sedpack-0.1.3 → sedpack-0.2.0}/rust/benches/my_benchmark.rs +40 -13
  7. sedpack-0.2.0/rust/src/batch_iteration.rs +371 -0
  8. {sedpack-0.1.3 → sedpack-0.2.0}/rust/src/example_iteration.rs +46 -6
  9. sedpack-0.2.0/rust/src/lib.rs +356 -0
  10. {sedpack-0.1.3 → sedpack-0.2.0}/rust/src/shard_generated.rs +14 -12
  11. sedpack-0.2.0/src/sedpack/__init__.py +33 -0
  12. {sedpack-0.1.3 → sedpack-0.2.0}/src/sedpack/io/dataset.py +2 -0
  13. {sedpack-0.1.3 → sedpack-0.2.0}/src/sedpack/io/dataset_base.py +11 -24
  14. {sedpack-0.1.3 → sedpack-0.2.0}/src/sedpack/io/dataset_filler.py +94 -30
  15. {sedpack-0.1.3 → sedpack-0.2.0}/src/sedpack/io/dataset_iteration.py +139 -422
  16. sedpack-0.2.0/src/sedpack/io/dataset_iteration_tf.py +242 -0
  17. {sedpack-0.1.3 → sedpack-0.2.0}/src/sedpack/io/dataset_writing.py +18 -5
  18. sedpack-0.2.0/src/sedpack/io/file_info.py +197 -0
  19. {sedpack-0.1.3 → sedpack-0.2.0}/src/sedpack/io/flatbuffer/iterate.py +79 -17
  20. {sedpack-0.1.3 → sedpack-0.2.0}/src/sedpack/io/flatbuffer/shardfile/Attribute.py +1 -1
  21. {sedpack-0.1.3 → sedpack-0.2.0}/src/sedpack/io/flatbuffer/shardfile/Example.py +2 -2
  22. {sedpack-0.1.3 → sedpack-0.2.0}/src/sedpack/io/flatbuffer/shardfile/Shard.py +2 -2
  23. sedpack-0.2.0/src/sedpack/io/iteration/__init__.py +22 -0
  24. sedpack-0.2.0/src/sedpack/io/iteration/rust_batched_generator.py +190 -0
  25. sedpack-0.2.0/src/sedpack/io/iteration/rust_generator.py +217 -0
  26. {sedpack-0.1.3 → sedpack-0.2.0}/src/sedpack/io/itertools/itertools.py +6 -3
  27. {sedpack-0.1.3 → sedpack-0.2.0}/src/sedpack/io/merge_shard_infos.py +2 -2
  28. {sedpack-0.1.3 → sedpack-0.2.0}/src/sedpack/io/metadata.py +21 -3
  29. sedpack-0.2.0/src/sedpack/io/npz/iterate_npz.py +195 -0
  30. {sedpack-0.1.3 → sedpack-0.2.0}/src/sedpack/io/shard/shard.py +5 -19
  31. {sedpack-0.1.3 → sedpack-0.2.0}/src/sedpack/io/shard/shard_writer_base.py +10 -2
  32. {sedpack-0.1.3 → sedpack-0.2.0}/src/sedpack/io/shard/shard_writer_flatbuffer.py +119 -47
  33. sedpack-0.2.0/src/sedpack/io/shard/shard_writer_np.py +169 -0
  34. {sedpack-0.1.3 → sedpack-0.2.0}/src/sedpack/io/shard/shard_writer_tfrec.py +6 -4
  35. sedpack-0.2.0/src/sedpack/io/shard_info_iterator/__init__.py +22 -0
  36. sedpack-0.2.0/src/sedpack/io/shard_info_iterator/balanced_iterator.py +280 -0
  37. sedpack-0.2.0/src/sedpack/io/shard_info_iterator/cached_shard_info_iterator.py +166 -0
  38. sedpack-0.2.0/src/sedpack/io/shard_info_iterator/shard_info_iterator.py +109 -0
  39. {sedpack-0.1.3 → sedpack-0.2.0}/src/sedpack/io/tfrec/read.py +3 -2
  40. {sedpack-0.1.3 → sedpack-0.2.0}/src/sedpack/io/tfrec/tfdata.py +28 -9
  41. {sedpack-0.1.3 → sedpack-0.2.0}/src/sedpack/io/types.py +19 -1
  42. {sedpack-0.1.3 → sedpack-0.2.0}/src/sedpack/io/utils.py +49 -2
  43. sedpack-0.1.3/rust/Cargo.lock +0 -1118
  44. sedpack-0.1.3/rust/src/lib.rs +0 -158
  45. sedpack-0.1.3/src/sedpack/__init__.py +0 -21
  46. sedpack-0.1.3/src/sedpack/io/file_info.py +0 -54
  47. sedpack-0.1.3/src/sedpack/io/npz/iterate_npz.py +0 -79
  48. sedpack-0.1.3/src/sedpack/io/shard/shard_writer_np.py +0 -99
  49. {sedpack-0.1.3 → sedpack-0.2.0}/rust/benches/setup.sh +0 -0
  50. {sedpack-0.1.3 → sedpack-0.2.0}/rust/rustfmt.toml +0 -0
  51. {sedpack-0.1.3 → sedpack-0.2.0}/rust/src/parallel_map.rs +0 -0
  52. {sedpack-0.1.3 → sedpack-0.2.0}/src/sedpack/io/__init__.py +0 -0
  53. {sedpack-0.1.3 → sedpack-0.2.0}/src/sedpack/io/compress.py +0 -0
  54. {sedpack-0.1.3 → sedpack-0.2.0}/src/sedpack/io/errors.py +0 -0
  55. {sedpack-0.1.3 → sedpack-0.2.0}/src/sedpack/io/flatbuffer/__init__.py +0 -0
  56. {sedpack-0.1.3 → sedpack-0.2.0}/src/sedpack/io/flatbuffer/shard.fbs +0 -0
  57. {sedpack-0.1.3 → sedpack-0.2.0}/src/sedpack/io/flatbuffer/shardfile/__init__.py +0 -0
  58. {sedpack-0.1.3 → sedpack-0.2.0}/src/sedpack/io/flatbuffer/unit_tests/shard_writer_flatbuffer_test_schema/NumPyVectorTest.py +0 -0
  59. {sedpack-0.1.3 → sedpack-0.2.0}/src/sedpack/io/flatbuffer/unit_tests/shard_writer_flatbuffer_test_schema/__init__.py +0 -0
  60. {sedpack-0.1.3 → sedpack-0.2.0}/src/sedpack/io/flatbuffer/unit_tests/shard_writer_flatbuffer_test_schema.fbs +0 -0
  61. {sedpack-0.1.3 → sedpack-0.2.0}/src/sedpack/io/itertools/__init__.py +0 -0
  62. {sedpack-0.1.3 → sedpack-0.2.0}/src/sedpack/io/itertools/lazy_pool.py +0 -0
  63. {sedpack-0.1.3 → sedpack-0.2.0}/src/sedpack/io/npz/__init__.py +0 -0
  64. {sedpack-0.1.3 → sedpack-0.2.0}/src/sedpack/io/shard/__init__.py +0 -0
  65. {sedpack-0.1.3 → sedpack-0.2.0}/src/sedpack/io/shard/get_shard_writer.py +0 -0
  66. {sedpack-0.1.3 → sedpack-0.2.0}/src/sedpack/io/shard/iterate_shard_base.py +0 -0
  67. {sedpack-0.1.3 → sedpack-0.2.0}/src/sedpack/io/shard_file_metadata.py +0 -0
  68. {sedpack-0.1.3 → sedpack-0.2.0}/src/sedpack/io/tfrec/__init__.py +0 -0
  69. {sedpack-0.1.3 → sedpack-0.2.0}/src/sedpack/py.typed +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sedpack
3
- Version: 0.1.3
3
+ Version: 0.2.0
4
4
  Classifier: Development Status :: 5 - Production/Stable
5
5
  Classifier: Environment :: Console
6
6
  Classifier: Framework :: Jupyter
@@ -13,29 +13,36 @@ Requires-Dist: asyncstdlib
13
13
  Requires-Dist: flatbuffers
14
14
  Requires-Dist: lz4
15
15
  Requires-Dist: numpy
16
- Requires-Dist: perfcounters
17
16
  Requires-Dist: pydantic
18
- Requires-Dist: pytest
19
- Requires-Dist: pytest-asyncio
20
- Requires-Dist: schema
21
17
  Requires-Dist: semver
22
- Requires-Dist: tabulate
23
- Requires-Dist: tensorflow
24
- Requires-Dist: termcolor
18
+ Requires-Dist: tenacity
25
19
  Requires-Dist: tqdm
26
20
  Requires-Dist: xxhash
27
21
  Requires-Dist: zstandard
28
- Requires-Dist: maturin[patchelf,zig] ; extra == 'dev'
22
+ Requires-Dist: maturin[patchelf,zig] ; platform_system != 'Windows' and extra == 'dev'
23
+ Requires-Dist: maturin[zig] ; platform_system == 'Windows' and extra == 'dev'
24
+ Requires-Dist: mypy ; extra == 'dev'
25
+ Requires-Dist: pylint ; extra == 'dev'
26
+ Requires-Dist: pytest ; extra == 'dev'
27
+ Requires-Dist: pytest-asyncio ; extra == 'dev'
28
+ Requires-Dist: pytest-cov ; extra == 'dev'
29
+ Requires-Dist: types-aiofiles ; extra == 'dev'
30
+ Requires-Dist: types-tensorflow ; extra == 'dev'
31
+ Requires-Dist: types-tqdm ; extra == 'dev'
32
+ Requires-Dist: yapf ; extra == 'dev'
33
+ Requires-Dist: tensorflow ; extra == 'tf'
34
+ Requires-Dist: types-tensorflow ; extra == 'tf'
29
35
  Provides-Extra: dev
36
+ Provides-Extra: tf
30
37
  License-File: LICENSE
31
38
  Summary: General ML dataset package
32
39
  Keywords: machine learning,dataset
33
40
  Author: Elie Bursztein, Karel Král, Jean-Michel Picod
34
41
  License: Apache License 2.0
35
- Requires-Python: >=3.10
42
+ Requires-Python: >=3.11
36
43
  Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
37
- Project-URL: Homepage, https://github.com/google/sedpack
38
44
  Project-URL: Bug Tracker, https://github.com/google/sedpack
45
+ Project-URL: Homepage, https://github.com/google/sedpack
39
46
 
40
47
  # Sedpack - Scalable and efficient data packing
41
48
 
@@ -54,8 +61,9 @@ See the documentation website:
54
61
 
55
62
  ### Dependencies
56
63
 
57
- To use this library you need to have a working version of [TensorFlow
58
- 2.x](https://www.tensorflow.org/install).
64
+ [TensorFlow 2.x](https://www.tensorflow.org/install) is an optional dependency
65
+ required only when using the `"tfrec"` shard format or `Dataset.as_tfdataset`.
66
+ It can be installed via `pip install "sedpack[tf]"`.
59
67
 
60
68
  Development dependencies:
61
69
 
@@ -67,8 +75,10 @@ Development dependencies:
67
75
 
68
76
  1. Clone the repository: `git clone https://github.com/google/sedpack`
69
77
  2. Install dependencies: `python3 -m pip install --require-hashes -r requirements.txt`
70
- 3. Install the package in development mode: `python3 -m pip install --editable
71
- .` (short `pip install -e .` or legacy `python setup.py develop`)
78
+ 3. Install the package in development mode:
79
+ `python3 -m pip install --editable ".[dev]"` (or
80
+ `python3 -m pip install --editable .` for a minimal installation without
81
+ TensorFlow and development tools)
72
82
 
73
83
  #### Rust install
74
84
 
@@ -76,7 +86,8 @@ Development dependencies:
76
86
  - [Install Rust](https://www.rust-lang.org/tools/install)
77
87
  - Run `maturin develop --release`
78
88
  - Run `python -m pytest` from the project root directory -- no tests should
79
- be skipped
89
+ be skipped when TensorFlow is installed (e.g., via
90
+ `pip install -e ".[dev]"`)
80
91
 
81
92
  ### Update dependencies
82
93
 
@@ -89,7 +100,8 @@ Update: `pip-compile pyproject.toml --generate-hashes --upgrade` and commit requ
89
100
 
90
101
  #### Package install
91
102
 
92
- `pip install sedpack`
103
+ `pip install sedpack` (or `pip install "sedpack[tf]"` to include optional
104
+ TensorFlow support)
93
105
 
94
106
  ### Tutorial
95
107
 
@@ -15,8 +15,9 @@ See the documentation website:
15
15
 
16
16
  ### Dependencies
17
17
 
18
- To use this library you need to have a working version of [TensorFlow
19
- 2.x](https://www.tensorflow.org/install).
18
+ [TensorFlow 2.x](https://www.tensorflow.org/install) is an optional dependency
19
+ required only when using the `"tfrec"` shard format or `Dataset.as_tfdataset`.
20
+ It can be installed via `pip install "sedpack[tf]"`.
20
21
 
21
22
  Development dependencies:
22
23
 
@@ -28,8 +29,10 @@ Development dependencies:
28
29
 
29
30
  1. Clone the repository: `git clone https://github.com/google/sedpack`
30
31
  2. Install dependencies: `python3 -m pip install --require-hashes -r requirements.txt`
31
- 3. Install the package in development mode: `python3 -m pip install --editable
32
- .` (short `pip install -e .` or legacy `python setup.py develop`)
32
+ 3. Install the package in development mode:
33
+ `python3 -m pip install --editable ".[dev]"` (or
34
+ `python3 -m pip install --editable .` for a minimal installation without
35
+ TensorFlow and development tools)
33
36
 
34
37
  #### Rust install
35
38
 
@@ -37,7 +40,8 @@ Development dependencies:
37
40
  - [Install Rust](https://www.rust-lang.org/tools/install)
38
41
  - Run `maturin develop --release`
39
42
  - Run `python -m pytest` from the project root directory -- no tests should
40
- be skipped
43
+ be skipped when TensorFlow is installed (e.g., via
44
+ `pip install -e ".[dev]"`)
41
45
 
42
46
  ### Update dependencies
43
47
 
@@ -50,7 +54,8 @@ Update: `pip-compile pyproject.toml --generate-hashes --upgrade` and commit requ
50
54
 
51
55
  #### Package install
52
56
 
53
- `pip install sedpack`
57
+ `pip install sedpack` (or `pip install "sedpack[tf]"` to include optional
58
+ TensorFlow support)
54
59
 
55
60
  ### Tutorial
56
61
 
@@ -18,7 +18,7 @@ authors = [
18
18
  ]
19
19
  description = "General ML dataset package"
20
20
  readme = "README.md"
21
- requires-python = ">=3.10"
21
+ requires-python = ">=3.11"
22
22
  keywords = ["machine learning", "dataset"]
23
23
  license = {text = "Apache License 2.0"}
24
24
  classifiers = [
@@ -37,15 +37,9 @@ dependencies = [
37
37
  "flatbuffers",
38
38
  "lz4",
39
39
  "numpy",
40
- "perfcounters",
41
40
  "pydantic",
42
- "pytest",
43
- "pytest-asyncio",
44
- "schema",
45
41
  "semver",
46
- "tabulate",
47
- "tensorflow",
48
- "termcolor",
42
+ "tenacity",
49
43
  "tqdm",
50
44
  "xxhash",
51
45
  "zstandard",
@@ -53,7 +47,21 @@ dependencies = [
53
47
 
54
48
  [project.optional-dependencies]
55
49
  dev = [
56
- "maturin[patchelf,zig]",
50
+ "maturin[patchelf,zig] ; platform_system != 'Windows'",
51
+ "maturin[zig] ; platform_system == 'Windows'",
52
+ "mypy",
53
+ "pylint",
54
+ "pytest",
55
+ "pytest-asyncio",
56
+ "pytest-cov",
57
+ "types-aiofiles",
58
+ "types-tensorflow",
59
+ "types-tqdm",
60
+ "yapf",
61
+ ]
62
+ tf = [
63
+ "tensorflow",
64
+ "types-tensorflow",
57
65
  ]
58
66
 
59
67
  [project.scripts]