diff --git a/tests/conftest.py b/tests/conftest.py index b92bb83..475eade 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -223,7 +223,7 @@ def small_sky_xmatch_catalog_cloud(small_sky_xmatch_dir_cloud): @pytest.fixture def small_sky_order1_hats_catalog_cloud(small_sky_order1_dir_cloud): - return hc.catalog.Catalog.read_hats(small_sky_order1_dir_cloud) + return hc.read_hats(small_sky_order1_dir_cloud) @pytest.fixture diff --git a/tests/hats/catalog/test_catalog_cloud.py b/tests/hats/catalog/test_catalog_cloud.py index e72db0f..bd7f8de 100644 --- a/tests/hats/catalog/test_catalog_cloud.py +++ b/tests/hats/catalog/test_catalog_cloud.py @@ -5,16 +5,6 @@ from hats.loaders import read_hats -def test_load_catalog_small_sky(small_sky_dir_cloud): - """Instantiate a catalog with 1 pixel""" - cat = Catalog.read_hats(small_sky_dir_cloud) - - assert cat.catalog_name == "small_sky" - assert len(cat.get_healpix_pixels()) == 1 - - assert is_valid_catalog(small_sky_dir_cloud) - - def test_load_catalog_small_sky_with_loader(small_sky_dir_cloud): """Instantiate a catalog with 1 pixel""" cat = read_hats(small_sky_dir_cloud) diff --git a/tests/hats/inspection/test_visualize_catalog_cloud.py b/tests/hats/inspection/test_visualize_catalog_cloud.py deleted file mode 100644 index 76b40e9..0000000 --- a/tests/hats/inspection/test_visualize_catalog_cloud.py +++ /dev/null @@ -1,18 +0,0 @@ -import healpy as hp -from hats.catalog import Catalog -from hats.inspection import plot_pixels, plot_points - -# pylint: disable=no-member - - -def test_generate_map_order1(small_sky_dir_cloud, mocker): - """Basic test that map data can be generated (does not test that a plot is rendered)""" - cat = Catalog.read_hats(small_sky_dir_cloud) - - mocker.patch("healpy.mollview") - plot_pixels(cat) - hp.mollview.assert_called_once() - - hp.mollview.reset_mock() - plot_points(cat) - hp.mollview.assert_called_once() diff --git a/tests/hats_import/test_create_margin.py b/tests/hats_import/test_create_margin.py index 8287b17..7809eb2 100644 --- a/tests/hats_import/test_create_margin.py +++ b/tests/hats_import/test_create_margin.py @@ -1,5 +1,5 @@ import hats_import.margin_cache.margin_cache as mc -from hats.catalog.healpix_dataset.healpix_dataset import HealpixDataset +from hats import read_hats from hats_import.margin_cache.margin_cache_arguments import MarginCacheArguments @@ -30,7 +30,7 @@ def test_margin_cache_gen( mc.generate_margin_cache(args, dask_client) - catalog = HealpixDataset.read_hats(args.catalog_path) + catalog = read_hats(args.catalog_path) assert catalog.on_disk assert catalog.catalog_path == args.catalog_path @@ -61,6 +61,6 @@ def test_margin_cache_gen_read_from_cloud( mc.generate_margin_cache(args, dask_client) - catalog = HealpixDataset.read_hats(args.catalog_path) + catalog = read_hats(args.catalog_path) assert catalog.on_disk assert catalog.catalog_path == args.catalog_path diff --git a/tests/hats_import/test_run_catalog_import.py b/tests/hats_import/test_run_catalog_import.py index 30f6c0d..205cc38 100644 --- a/tests/hats_import/test_run_catalog_import.py +++ b/tests/hats_import/test_run_catalog_import.py @@ -2,7 +2,7 @@ import hats_import.catalog.run_import as runner import pytest -from hats.catalog.catalog import Catalog +from hats import read_hats from hats_import.catalog.arguments import ImportArguments from hats_import.catalog.file_readers import CsvReader @@ -30,7 +30,7 @@ def test_catalog_import_write_to_cloud( runner.run(args, dask_client) # Check that the catalog metadata file exists - catalog = Catalog.read_hats(args.catalog_path) + catalog = read_hats(args.catalog_path) assert catalog.on_disk assert catalog.catalog_path == args.catalog_path assert catalog.catalog_info.ra_column == "ra" @@ -61,7 +61,7 @@ def test_catalog_import_read_from_cloud(dask_client, small_sky_parts_dir_cloud, runner.run(args, dask_client) # Check that the catalog metadata file exists - catalog = Catalog.read_hats(args.catalog_path) + catalog = read_hats(args.catalog_path) assert catalog.on_disk assert catalog.catalog_path == args.catalog_path assert catalog.catalog_info.ra_column == "ra" diff --git a/tests/hats_import/test_run_index.py b/tests/hats_import/test_run_index.py index 65832ab..f844dbd 100644 --- a/tests/hats_import/test_run_index.py +++ b/tests/hats_import/test_run_index.py @@ -1,6 +1,6 @@ import hats_import.index.run_index as runner import pyarrow as pa -from hats.catalog.dataset.dataset import Dataset +from hats import read_hats from hats.io.file_io import read_parquet_metadata from hats_import.index.arguments import IndexArguments @@ -25,7 +25,7 @@ def test_run_index( runner.run(args, dask_client) # Check that the catalog metadata file exists - catalog = Dataset.read_hats(args.catalog_path) + catalog = read_hats(args.catalog_path) assert catalog.on_disk assert catalog.catalog_path == args.catalog_path @@ -67,7 +67,7 @@ def test_run_index_read_from_cloud(small_sky_order1_dir_cloud, tmp_path, dask_cl runner.run(args, dask_client) # Check that the catalog metadata file exists - catalog = Dataset.read_hats(args.catalog_path) + catalog = read_hats(args.catalog_path) assert catalog.on_disk assert catalog.catalog_path == args.catalog_path diff --git a/tests/hats_import/test_run_soap.py b/tests/hats_import/test_run_soap.py index 7ca9694..08d2bc1 100644 --- a/tests/hats_import/test_run_soap.py +++ b/tests/hats_import/test_run_soap.py @@ -1,6 +1,6 @@ import hats_import.soap.run_soap as runner import pytest -from hats.catalog.association_catalog.association_catalog import AssociationCatalog +from hats import read_hats from hats.io.file_io import read_parquet_metadata from hats_import.soap.arguments import SoapArguments @@ -36,7 +36,7 @@ def test_object_to_self_write_to_cloud( runner.run(small_sky_soap_args, dask_client) ## Check that the association data can be parsed as a valid association catalog. - catalog = AssociationCatalog.read_hats(small_sky_soap_args.catalog_path) + catalog = read_hats(small_sky_soap_args.catalog_path) assert catalog.on_disk assert catalog.catalog_path == small_sky_soap_args.catalog_path assert len(catalog.get_join_pixels()) == 4 @@ -66,7 +66,7 @@ def test_object_to_self_write_to_cloud( runner.run(small_sky_soap_args, dask_client) ## Check that the association data can be parsed as a valid association catalog. - catalog = AssociationCatalog.read_hats(small_sky_soap_args.catalog_path) + catalog = read_hats(small_sky_soap_args.catalog_path) assert catalog.on_disk assert catalog.catalog_path == small_sky_soap_args.catalog_path assert len(catalog.get_join_pixels()) == 4 @@ -101,7 +101,7 @@ def test_object_to_self_read_from_cloud( runner.run(small_sky_soap_args, dask_client) ## Check that the association data can be parsed as a valid association catalog. - catalog = AssociationCatalog.read_hats(small_sky_soap_args.catalog_path) + catalog = read_hats(small_sky_soap_args.catalog_path) assert catalog.on_disk assert catalog.catalog_path == small_sky_soap_args.catalog_path assert len(catalog.get_join_pixels()) == 4 diff --git a/tests/lsdb/catalog/test_index_search.py b/tests/lsdb/catalog/test_index_search.py index dbed426..3f4c4c3 100644 --- a/tests/lsdb/catalog/test_index_search.py +++ b/tests/lsdb/catalog/test_index_search.py @@ -1,8 +1,8 @@ -from hats.catalog.index.index_catalog import IndexCatalog +from hats import read_hats def test_index_search(small_sky_order1_catalog_cloud, small_sky_index_dir_cloud): - catalog_index = IndexCatalog.read_hats(small_sky_index_dir_cloud) + catalog_index = read_hats(small_sky_index_dir_cloud) index_search_catalog = small_sky_order1_catalog_cloud.index_search([900], catalog_index) index_search_df = index_search_catalog.compute()