Skip to content

Commit

Permalink
Update docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
delucchi-cmu committed Oct 19, 2023
1 parent 59b6fee commit e219dc7
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 11 deletions.
3 changes: 1 addition & 2 deletions benchmarks/benchmarks.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,9 @@ def time_test_cone_filter_multiple_order():
"dec_column": "dec",
}
)
pixels = [HealpixPixel(6, 30), HealpixPixel(7, 124), HealpixPixel(8, 5000)]
pixels = [HealpixPixel(6, 30), HealpixPixel(7, 124), HealpixPixel(7, 5000)]
catalog = Catalog(catalog_info, pixels)
filtered_catalog = catalog.filter_by_cone(47.1, 6, 30)
print("filtered_catalog", filtered_catalog.get_healpix_pixels())
assert filtered_catalog.get_healpix_pixels() == [HealpixPixel(6, 30), HealpixPixel(7, 124)]


Expand Down
5 changes: 2 additions & 3 deletions src/hipscat/catalog/catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,8 @@ def __init__(
Args:
catalog_info: CatalogInfo object with catalog metadata
pixels: Specifies the pixels contained in the catalog. Can be either a Dataframe with
columns `Norder`, `Dir`, and `Npix` matching a `partition_info.csv` file, a
`PartitionInfo object`, or a `PixelTree` object
pixels: Specifies the pixels contained in the catalog. Can be either a
list of HealpixPixel, `PartitionInfo object`, or a `PixelTree` object
catalog_path: If the catalog is stored on disk, specify the location of the catalog
Does not load the catalog from this path, only store as metadata
storage_options: dictionary that contains abstract filesystem credentials
Expand Down
9 changes: 4 additions & 5 deletions src/hipscat/catalog/healpix_dataset/healpix_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,8 @@ def __init__(
Args:
catalog_info: CatalogInfo object with catalog metadata
pixels: Specifies the pixels contained in the catalog. Can be either a Dataframe with
columns `Norder`, `Dir`, and `Npix` matching a `partition_info.csv` file, a
`PartitionInfo object`, or a `PixelTree` object
pixels: Specifies the pixels contained in the catalog. Can be either a
list of HealpixPixel, `PartitionInfo object`, or a `PixelTree` object
catalog_path: If the catalog is stored on disk, specify the location of the catalog
Does not load the catalog from this path, only store as metadata
storage_options: dictionary that contains abstract filesystem credentials
Expand Down Expand Up @@ -66,7 +65,7 @@ def _get_partition_info_from_pixels(pixels: PixelInputTypes) -> PartitionInfo:
)
if pd.api.types.is_list_like(pixels):
return PartitionInfo.from_healpix(pixels)
raise TypeError("Pixels must be of type PartitionInfo, Dataframe, PixelTree, or List[HealpixPixel]")
raise TypeError("Pixels must be of type PartitionInfo, PixelTree, or List[HealpixPixel]")

@staticmethod
def _get_pixel_tree_from_pixels(pixels: PixelInputTypes) -> PixelTree:
Expand All @@ -76,7 +75,7 @@ def _get_pixel_tree_from_pixels(pixels: PixelInputTypes) -> PixelTree:
return pixels
if pd.api.types.is_list_like(pixels):
return PixelTreeBuilder.from_healpix(pixels)
raise TypeError("Pixels must be of type PartitionInfo, Dataframe, PixelTree, or List[HealpixPixel]")
raise TypeError("Pixels must be of type PartitionInfo, PixelTree, or List[HealpixPixel]")

@classmethod
def _read_args(
Expand Down
1 change: 0 additions & 1 deletion src/hipscat/catalog/partition_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ class PartitionInfo:

def __init__(self, pixel_list: List[HealpixPixel]) -> None:
self.pixel_list = pixel_list
# self.data_frame = pixels

def get_healpix_pixels(self) -> List[HealpixPixel]:
"""Get healpix pixel objects for all pixels represented as partitions.
Expand Down

0 comments on commit e219dc7

Please sign in to comment.