padawan 0.2__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.
- {padawan-0.2 → padawan-0.2.1}/PKG-INFO +1 -1
- {padawan-0.2 → padawan-0.2.1}/pyproject.toml +1 -1
- {padawan-0.2 → padawan-0.2.1}/src/padawan/__init__.py +1 -1
- {padawan-0.2 → padawan-0.2.1}/src/padawan/repartitioned_dataset.py +21 -30
- {padawan-0.2 → padawan-0.2.1}/.gitignore +0 -0
- {padawan-0.2 → padawan-0.2.1}/.pytest_cache/.gitignore +0 -0
- {padawan-0.2 → padawan-0.2.1}/.pytest_cache/CACHEDIR.TAG +0 -0
- {padawan-0.2 → padawan-0.2.1}/.pytest_cache/README.md +0 -0
- {padawan-0.2 → padawan-0.2.1}/.pytest_cache/v/cache/lastfailed +0 -0
- {padawan-0.2 → padawan-0.2.1}/.pytest_cache/v/cache/nodeids +0 -0
- {padawan-0.2 → padawan-0.2.1}/.pytest_cache/v/cache/stepwise +0 -0
- {padawan-0.2 → padawan-0.2.1}/.readthedocs.yml +0 -0
- {padawan-0.2 → padawan-0.2.1}/LICENSE +0 -0
- {padawan-0.2 → padawan-0.2.1}/README.md +0 -0
- {padawan-0.2 → padawan-0.2.1}/docs/Makefile +0 -0
- {padawan-0.2 → padawan-0.2.1}/docs/api.rst +0 -0
- {padawan-0.2 → padawan-0.2.1}/docs/conf.py +0 -0
- {padawan-0.2 → padawan-0.2.1}/docs/index.rst +0 -0
- {padawan-0.2 → padawan-0.2.1}/docs/make.bat +0 -0
- {padawan-0.2 → padawan-0.2.1}/docs/requirements.txt +0 -0
- {padawan-0.2 → padawan-0.2.1}/src/padawan/collated_dataset.py +0 -0
- {padawan-0.2 → padawan-0.2.1}/src/padawan/dataset.py +0 -0
- {padawan-0.2 → padawan-0.2.1}/src/padawan/joined_dataset.py +0 -0
- {padawan-0.2 → padawan-0.2.1}/src/padawan/json_io.py +0 -0
- {padawan-0.2 → padawan-0.2.1}/src/padawan/mapped_dataset.py +0 -0
- {padawan-0.2 → padawan-0.2.1}/src/padawan/ordering.py +0 -0
- {padawan-0.2 → padawan-0.2.1}/src/padawan/parallelize.py +0 -0
- {padawan-0.2 → padawan-0.2.1}/src/padawan/persisted_dataset.py +0 -0
- {padawan-0.2 → padawan-0.2.1}/src/padawan/reindexed_dataset.py +0 -0
- {padawan-0.2 → padawan-0.2.1}/src/padawan/renamed_dataset.py +0 -0
- {padawan-0.2 → padawan-0.2.1}/src/padawan/sliced_dataset.py +0 -0
- {padawan-0.2 → padawan-0.2.1}/tests/fixtures.py +0 -0
- {padawan-0.2 → padawan-0.2.1}/tests/test_collate.py +0 -0
- {padawan-0.2 → padawan-0.2.1}/tests/test_io.py +0 -0
- {padawan-0.2 → padawan-0.2.1}/tests/test_join.py +0 -0
- {padawan-0.2 → padawan-0.2.1}/tests/test_map.py +0 -0
- {padawan-0.2 → padawan-0.2.1}/tests/test_rename.py +0 -0
- {padawan-0.2 → padawan-0.2.1}/tests/test_repartition.py +0 -0
- {padawan-0.2 → padawan-0.2.1}/tests/test_slice.py +0 -0
- {padawan-0.2 → padawan-0.2.1}/tests/utils.py +0 -0
|
@@ -82,40 +82,31 @@ def get_index_divisions(
|
|
|
82
82
|
.groupby(index_columns)
|
|
83
83
|
.agg(pl.col('__size').sum())
|
|
84
84
|
.sort(index_columns)
|
|
85
|
-
.
|
|
86
|
-
(pl.col('__size').cumsum()/samples_per_partition)
|
|
87
|
-
.ceil().cast(pl.Int32)
|
|
88
|
-
.alias('__part')
|
|
89
|
-
)
|
|
85
|
+
.with_columns(pl.col('__size').cumsum())
|
|
90
86
|
.collect()
|
|
91
87
|
)
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
.
|
|
99
|
-
|
|
88
|
+
|
|
89
|
+
lower_bounds = []
|
|
90
|
+
upper_bounds = []
|
|
91
|
+
sizes = []
|
|
92
|
+
current_size = 0
|
|
93
|
+
while len(sample) > 0:
|
|
94
|
+
head = sample.filter(
|
|
95
|
+
pl.col('__size') <= current_size + samples_per_partition)
|
|
96
|
+
if len(head) == 0:
|
|
97
|
+
head = sample[:1, :]
|
|
98
|
+
sample = sample[1:, :]
|
|
99
|
+
else:
|
|
100
|
+
sample = sample.filter(
|
|
101
|
+
pl.col('__size') > current_size + samples_per_partition)
|
|
102
|
+
lower_bounds.append(head.row(0)[:-1])
|
|
103
|
+
upper_bounds.append(head.row(-1)[:-1])
|
|
104
|
+
sizes.append(head[-1, '__size'] - current_size)
|
|
105
|
+
current_size = head[-1, '__size']
|
|
106
|
+
|
|
100
107
|
divisions = lower_bounds[1:]
|
|
101
108
|
|
|
102
|
-
if samples_per_partition
|
|
103
|
-
upper_bounds = list(
|
|
104
|
-
sample
|
|
105
|
-
.groupby('__part')
|
|
106
|
-
.last()
|
|
107
|
-
.sort('__part')
|
|
108
|
-
.select(index_columns)
|
|
109
|
-
.rows()
|
|
110
|
-
)
|
|
111
|
-
sizes = list(
|
|
112
|
-
sample
|
|
113
|
-
.groupby('__part')
|
|
114
|
-
.agg(pl.col('__size').sum())
|
|
115
|
-
.sort('__part')
|
|
116
|
-
.get_column('__size')
|
|
117
|
-
)
|
|
118
|
-
else:
|
|
109
|
+
if samples_per_partition != rows_per_partition:
|
|
119
110
|
lower_bounds = None
|
|
120
111
|
upper_bounds = None
|
|
121
112
|
sizes = 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
|