Skip to content

Commit

Permalink
Address smoke test failures. (#35)
Browse files Browse the repository at this point in the history
* Address smoke test failures.

* Remove unused import.
  • Loading branch information
delucchi-cmu authored Aug 14, 2024
1 parent 222d1ed commit 2bd031b
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 28 deletions.
6 changes: 3 additions & 3 deletions tests/hipscat/io/file_io/test_file_io_cloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
get_file_pointer_from_path,
load_csv_to_pandas,
load_json_file,
load_parquet_to_pandas,
load_text_file,
read_parquet_file_to_pandas,
write_dataframe_to_csv,
write_string_to_file,
)
Expand Down Expand Up @@ -37,14 +37,14 @@ def test_load_json(small_sky_dir_local, small_sky_dir_cloud, storage_options):
assert json_dict_cloud == json_dict_local


def test_load_parquet_to_pandas(
def test_read_parquet_to_pandas(
small_sky_catalog_cloud, small_sky_dir_local, small_sky_dir_cloud, storage_options
):
pixel_data_path = pixel_catalog_file(small_sky_dir_local, 0, 11)
pixel_data_path_cloud = pixel_catalog_file(small_sky_dir_cloud, 0, 11)
parquet_df = pd.read_parquet(pixel_data_path)
catalog_schema = small_sky_catalog_cloud.hc_structure.schema
loaded_df = load_parquet_to_pandas(
loaded_df = read_parquet_file_to_pandas(
pixel_data_path_cloud, schema=catalog_schema, storage_options=storage_options
)
pd.testing.assert_frame_equal(parquet_df, loaded_df)
Expand Down
47 changes: 22 additions & 25 deletions tests/hipscat_import/test_create_margin.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import hipscat_import.margin_cache.margin_cache as mc
import pytest
from hipscat.catalog.healpix_dataset.healpix_dataset import HealpixDataset
from hipscat_import.margin_cache.margin_cache_arguments import MarginCacheArguments

Expand All @@ -17,18 +16,17 @@ def test_margin_cache_gen(
- local origin catalog.
- writing to CLOUD.
"""
with pytest.warns(UserWarning, match="smaller resolution"):
args = MarginCacheArguments(
margin_threshold=7200.0,
input_catalog_path=small_sky_order1_dir_local,
output_path=tmp_cloud_path,
output_artifact_name="small_sky_order1_margin",
output_storage_options=storage_options,
dask_tmp=tmp_path,
tmp_dir=tmp_path,
margin_order=8,
progress_bar=False,
)
args = MarginCacheArguments(
input_catalog_path=small_sky_order1_dir_local,
output_path=tmp_cloud_path,
output_artifact_name="small_sky_order1_margin",
output_storage_options=storage_options,
dask_tmp=tmp_path,
tmp_dir=tmp_path,
margin_order=8,
fine_filtering=False,
progress_bar=False,
)

assert args.catalog.catalog_info.ra_column == "ra"

Expand All @@ -51,18 +49,17 @@ def test_margin_cache_gen_read_from_cloud(
- CLOUD origin catalog
- writing to local tmp
"""
with pytest.warns(UserWarning, match="smaller resolution"):
args = MarginCacheArguments(
margin_threshold=7200.0,
input_catalog_path=small_sky_order1_dir_cloud,
input_storage_options=storage_options,
output_path=tmp_path,
output_artifact_name="small_sky_order1_margin",
dask_tmp=tmp_path,
tmp_dir=tmp_path,
margin_order=8,
progress_bar=False,
)
args = MarginCacheArguments(
input_catalog_path=small_sky_order1_dir_cloud,
input_storage_options=storage_options,
output_path=tmp_path,
output_artifact_name="small_sky_order1_margin",
dask_tmp=tmp_path,
tmp_dir=tmp_path,
margin_order=8,
fine_filtering=False,
progress_bar=False,
)

assert args.catalog.catalog_info.ra_column == "ra"

Expand Down

0 comments on commit 2bd031b

Please sign in to comment.