Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/hats_import/catalog/resume_plan.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,15 +239,15 @@ def read_histogram(self, healpix_order, which_histogram: str = "row_count"):
aggregate_histogram.add(partial)

file_name = file_io.append_paths_to_pointer(self.tmp_path, histogram_binary_file)
with open(file_name, "wb+") as file_handle:
with open(str(file_name), "wb+") as file_handle:
file_handle.write(aggregate_histogram.full_histogram)
if self.delete_resume_log_files:
file_io.remove_directory(
file_io.append_paths_to_pointer(self.tmp_path, histogram_directory),
ignore_errors=True,
)

with open(file_name, "rb") as file_handle:
with open(str(file_name), "rb") as file_handle:
full_histogram = frombuffer(file_handle.read(), dtype=np.int64)

if len(full_histogram) != hp.order2npix(healpix_order):
Expand Down
4 changes: 1 addition & 3 deletions tests/hats_import/catalog/test_map_reduce.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import pyarrow as pa
import pytest
from hats.pixel_math.sparse_histogram import SparseHistogram
from nested_pandas.nestedframe import NestedFrame

import hats_import.catalog.map_reduce as mr
from hats_import.catalog.file_readers import get_file_reader
Expand Down Expand Up @@ -780,9 +781,6 @@ def test_get_mem_size_of_chunk():

def test_get_mem_size_of_chunk_nested():
"""Test the _get_mem_size_of_chunk function with nested data."""
pytest.importorskip("nested_pandas")
from nested_pandas.nestedframe import NestedFrame # pylint: disable=import-outside-toplevel

# Create a small DataFrame and nest it
df = pd.DataFrame(
{
Expand Down