Skip to content

Commit ea76785

Browse files
committed
Simplify more.
1 parent 68cdb12 commit ea76785

File tree

2 files changed

+2
-9
lines changed

2 files changed

+2
-9
lines changed

src/hats/loaders/read_hats.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
}
2727

2828

29-
def read_hats(catalog_path: str | Path | UPath, catalog_type: CatalogType | None = None) -> Dataset:
29+
def read_hats(catalog_path: str | Path | UPath) -> Dataset:
3030
"""Reads a HATS Catalog from a HATS directory
3131
3232
Args:
@@ -43,7 +43,7 @@ def read_hats(catalog_path: str | Path | UPath, catalog_type: CatalogType | None
4343
catalog_path = file_io.get_upath(catalog_path)
4444
try:
4545
properties = TableProperties.read_from_dir(catalog_path)
46-
dataset_type = properties.catalog_type if catalog_type is None else catalog_type
46+
dataset_type = properties.catalog_type
4747
if dataset_type not in DATASET_TYPE_TO_CLASS:
4848
raise NotImplementedError(f"Cannot load catalog of type {dataset_type}")
4949

tests/hats/catalog/loaders/test_read_hats.py

-7
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,6 @@
1-
import pytest
2-
31
from hats.loaders import read_hats
42

53

6-
def test_read_hats_wrong_catalog_type(small_sky_dir):
7-
with pytest.raises(FileNotFoundError):
8-
read_hats(small_sky_dir, catalog_type="unknown")
9-
10-
114
def test_read_hats_branches(
125
small_sky_dir,
136
small_sky_order1_dir,

0 commit comments

Comments
 (0)