Skip to content

Commit 2131af7

Browse files
authored
Rename argument -> multi_index (#479)
1 parent 7961777 commit 2131af7

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

src/hats/catalog/dataset/dataset.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def per_pixel_statistics(
7070
exclude_columns: list[str] = None,
7171
include_columns: list[str] = None,
7272
include_stats: list[str] = None,
73-
multiindex=False,
73+
multi_index=False,
7474
):
7575
"""Read footer statistics in parquet metadata, and report on statistics about
7676
each pixel partition.
@@ -83,7 +83,7 @@ def per_pixel_statistics(
8383
names provided. Defaults to None, and returns all non-hats columns.
8484
include_stats (List[str]): if specified, only return the kinds of values from list
8585
(min_value, max_value, null_count, row_count). Defaults to None, and returns all values.
86-
multiindex (bool): should the returned frame be created with a multi-index, first on
86+
multi_index (bool): should the returned frame be created with a multi-index, first on
8787
pixel, then on column name? Default is False, and instead indexes on pixel, with
8888
separate columns per-data-column and stat value combination.
8989
"""
@@ -96,5 +96,5 @@ def per_pixel_statistics(
9696
exclude_columns=exclude_columns,
9797
include_columns=include_columns,
9898
include_stats=include_stats,
99-
multiindex=multiindex,
99+
multi_index=multi_index,
100100
)

src/hats/catalog/healpix_dataset/healpix_dataset.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ def per_pixel_statistics(
295295
exclude_columns: list[str] | None = None,
296296
include_columns: list[str] | None = None,
297297
include_stats: list[str] | None = None,
298-
multiindex=False,
298+
multi_index=False,
299299
include_pixels: list[HealpixPixel] | None = None,
300300
):
301301
"""Read footer statistics in parquet metadata, and report on statistics about
@@ -311,7 +311,7 @@ def per_pixel_statistics(
311311
for the pixels indicated. Defaults to none, and returns all pixels.
312312
include_stats (List[str]): if specified, only return the kinds of values from list
313313
(min_value, max_value, null_count, row_count). Defaults to None, and returns all values.
314-
multiindex (bool): should the returned frame be created with a multi-index, first on
314+
multi_index (bool): should the returned frame be created with a multi-index, first on
315315
pixel, then on column name?
316316
"""
317317
if not self.on_disk:
@@ -326,6 +326,6 @@ def per_pixel_statistics(
326326
exclude_columns=exclude_columns,
327327
include_columns=include_columns,
328328
include_stats=include_stats,
329-
multiindex=multiindex,
329+
multi_index=multi_index,
330330
include_pixels=include_pixels,
331331
)

src/hats/io/parquet_metadata.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ def per_pixel_statistics(
251251
exclude_columns: list[str] = None,
252252
include_columns: list[str] = None,
253253
include_stats: list[str] = None,
254-
multiindex=False,
254+
multi_index=False,
255255
include_pixels: list[HealpixPixel] = None,
256256
):
257257
"""Read footer statistics in parquet metadata, and report on statistics about
@@ -268,7 +268,7 @@ def per_pixel_statistics(
268268
for the pixels indicated. Defaults to none, and returns all pixels.
269269
include_stats (List[str]): if specified, only return the kinds of values from list
270270
(min_value, max_value, null_count, row_count). Defaults to None, and returns all values.
271-
multiindex (bool): should the returned frame be created with a multi-index, first on
271+
multi_index (bool): should the returned frame be created with a multi-index, first on
272272
pixel, then on column name? Default is False, and instead indexes on pixel, with
273273
separate columns per-data-column and stat value combination.
274274
Returns:
@@ -325,7 +325,7 @@ def per_pixel_statistics(
325325
stats_lists = np.array(leaf_stats)
326326
original_shape = stats_lists.shape
327327

328-
if multiindex:
328+
if multi_index:
329329
stats_lists = stats_lists.reshape((original_shape[0] * original_shape[1], original_shape[2]))
330330
frame = pd.DataFrame(
331331
stats_lists,

tests/hats/io/test_parquet_metadata.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -253,14 +253,14 @@ def test_per_pixel_statistics(small_sky_order1_dir):
253253
assert len(result_frame) == 0
254254

255255

256-
def test_per_pixel_statistics_multiindex(small_sky_order1_dir):
256+
def test_per_pixel_statistics_multi_index(small_sky_order1_dir):
257257
partition_info_file = paths.get_parquet_metadata_pointer(small_sky_order1_dir)
258258

259-
result_frame = per_pixel_statistics(partition_info_file, multiindex=True)
259+
result_frame = per_pixel_statistics(partition_info_file, multi_index=True)
260260
# 20 = 5 columns * 4 pixels
261261
assert result_frame.shape == (20, 4)
262262

263-
result_frame = per_pixel_statistics(partition_info_file, exclude_hats_columns=False, multiindex=True)
263+
result_frame = per_pixel_statistics(partition_info_file, exclude_hats_columns=False, multi_index=True)
264264
# 36 = 9 columns * 4 stats per-column
265265
assert result_frame.shape == (36, 4)
266266

@@ -279,7 +279,7 @@ def test_per_pixel_statistics_include_stats(small_sky_order1_dir):
279279
assert result_frame.shape == (4, 1)
280280

281281
result_frame = per_pixel_statistics(
282-
partition_info_file, include_stats=["row_count"], include_columns=["id"], multiindex=True
282+
partition_info_file, include_stats=["row_count"], include_columns=["id"], multi_index=True
283283
)
284284
# 1 = 1 columns * 1 stat per column
285285
assert result_frame.shape == (4, 1)

0 commit comments

Comments
 (0)