Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HATS renaming. Re-imports test data. #40

Merged
merged 2 commits into from
Oct 7, 2024
Merged
Show file tree
Hide file tree
Changes from all 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 .copier-answers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ failure_notification:
include_benchmarks: true
include_docs: false
mypy_type_checking: none
package_name: hipscat_cloudtests
package_name: hats_cloudtests
project_license: BSD
project_name: hipscat_cloudtests
project_name: hats_cloudtests
project_organization: astronomy-commons
python_versions:
- '3.9'
Expand Down
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# hipscat cloudtests
# hats cloudtests

[![Template](https://img.shields.io/badge/Template-LINCC%20Frameworks%20Python%20Project%20Template-brightgreen)](https://lincc-ppt.readthedocs.io/en/latest/)

[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/astronomy-commons/hipscat-cloudtests/smoke-test.yml)](https://github.com/astronomy-commons/hipscat-cloudtests/actions/workflows/smoke-test.yml)
[![benchmarks](https://img.shields.io/github/actions/workflow/status/astronomy-commons/hipscat-cloudtests/asv-main.yml?label=benchmarks)](https://astronomy-commons.github.io/hipscat-cloudtests/)
[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/astronomy-commons/hats-cloudtests/smoke-test.yml)](https://github.com/astronomy-commons/hats-cloudtests/actions/workflows/smoke-test.yml)
[![benchmarks](https://img.shields.io/github/actions/workflow/status/astronomy-commons/hats-cloudtests/asv-main.yml?label=benchmarks)](https://astronomy-commons.github.io/hats-cloudtests/)

Integration tests for cloud read and write through HiPScat and LSDB libraries.
Integration tests for cloud read and write through HATS and LSDB libraries.

## Dev Guide - Getting Started

Expand All @@ -28,7 +28,7 @@ development using the following commands:
>> conda install pandoc
```

## Performing HiPSCat cloud tests locally
## Performing HATS cloud tests locally

The only currently implemented cloud platform is abfs. In order to run the tests, you will need to
export the following environmental variables in a command line:
Expand Down Expand Up @@ -64,13 +64,13 @@ There are various steps to have tests run on another cloud bucket provider (like
@pytest.fixture
def cloud_path(cloud):
if cloud == "abfs":
return "abfs://hipscat/pytests/hipscat"
return "abfs://hats/pytests/hats"

#your new addition
elif cloud == "new_protocol":
return "new_protocol://path/to/pytest/hipscat"
return "new_protocol://path/to/pytest/hats"

raise NotImplementedError("Cloud format not implemented for hipscat tests!")
raise NotImplementedError("Cloud format not implemented for hats tests!")

@pytest.fixture
def storage_options(cloud):
Expand Down Expand Up @@ -106,9 +106,9 @@ def storage_options(cloud):

## Contributing

[![GitHub issue custom search in repo](https://img.shields.io/github/issues-search/astronomy-commons/hipscat-cloudtests?color=purple&label=Good%20first%20issues&query=is%3Aopen%20label%3A%22good%20first%20issue%22)](https://github.com/astronomy-commons/hipscat-cloudtests/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22)
[![GitHub issue custom search in repo](https://img.shields.io/github/issues-search/astronomy-commons/hats-cloudtests?color=purple&label=Good%20first%20issues&query=is%3Aopen%20label%3A%22good%20first%20issue%22)](https://github.com/astronomy-commons/hats-cloudtests/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22)

See the [hipscat contribution guide](https://hipscat.readthedocs.io/en/latest/guide/contributing.html)
See the [hats contribution guide](https://hats.readthedocs.io/en/latest/guide/contributing.html)
for contribution best practices.

## Acknowledgements
Expand Down
6 changes: 3 additions & 3 deletions benchmarks/asv.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
// you know what you are doing.
"version": 1,
// The name of the project being benchmarked.
"project": "hipscat_cloudtests",
"project": "hats_cloudtests",
// The project's homepage.
"project_url": "https://github.com/astronomy-commons/hipscat_cloudtests",
"project_url": "https://github.com/astronomy-commons/hats_cloudtests",
// The URL or local path of the source code repository for the
// project being benchmarked.
"repo": "..",
Expand All @@ -32,7 +32,7 @@
// variable.
"environment_type": "virtualenv",
// the base URL to show a commit for the project.
"show_commit_url": "https://github.com/astronomy-commons/hipscat_cloudtests/commit/",
"show_commit_url": "https://github.com/astronomy-commons/hats_cloudtests/commit/",
// The Pythons you'd like to test against. If not provided, defaults
// to the current version of Python used to run `asv`.
"pythons": [
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/benchmarks.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
For more information on writing benchmarks:
https://asv.readthedocs.io/en/stable/writing_benchmarks.html."""

from hipscat_cloudtests import example_benchmarks
from hats_cloudtests import example_benchmarks


def time_computation():
Expand Down
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[project]
name = "hipscat_cloudtests"
name = "hats_cloudtests"
license = {file = "LICENSE"}
readme = "README.md"
authors = [
Expand All @@ -16,7 +16,7 @@ classifiers = [
dynamic = ["version"]
requires-python = ">=3.9"
dependencies = [
# lsdb, hipscat, and hipscat-import are built from source via requirements.txt
# lsdb, hats, and hats-import are built from source via requirements.txt
"adlfs",
"s3fs",
"moto[server]",
Expand Down Expand Up @@ -104,4 +104,4 @@ ignore = [
]

[tool.coverage.run]
omit=["src/hipscat_cloudtests/_version.py"]
omit=["src/hats_cloudtests/_version.py"]
6 changes: 3 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
git+https://github.com/astronomy-commons/hipscat.git@main
git+https://github.com/astronomy-commons/hipscat-import.git@main
git+https://github.com/astronomy-commons/lsdb.git@main
git+https://github.com/astronomy-commons/hipscat.git@hats
git+https://github.com/astronomy-commons/hipscat-import.git@hats
delucchi-cmu marked this conversation as resolved.
Show resolved Hide resolved
git+https://github.com/astronomy-commons/lsdb.git@hats
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

__all__ = ["greetings", "meaning"]

from .file_checks import assert_parquet_file_ids, assert_text_file_matches
from .file_checks import assert_parquet_file_ids
29 changes: 29 additions & 0 deletions src/hats_cloudtests/file_checks.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
"""Set of convenience methods for testing file contents"""

import numpy.testing as npt
import pandas as pd
import pyarrow as pa


def assert_parquet_file_ids(file_name, id_column, schema: pa.Schema, expected_ids, resort_ids=True):
"""
Convenience method to read a parquet file and compare the object IDs to
a list of expected objects.

Args:
file_name (UPath): fully-specified path of the file to read
id_column (str): column in the parquet file to read IDs from
expected_ids (:obj:`int[]`): list of expected ids in `id_column`
resort_ids (bool): should we re-sort the ids? if False, we will check that the ordering
is the same between the read IDs and expected_ids
"""
data_frame = pd.read_parquet(file_name.path, engine="pyarrow", schema=schema, filesystem=file_name.fs)
assert id_column in data_frame.columns
ids = data_frame[id_column].tolist()
if resort_ids:
ids.sort()
expected_ids.sort()

assert len(ids) == len(expected_ids), f"object list not the same size ({len(ids)} vs {len(expected_ids)})"

npt.assert_array_equal(ids, expected_ids)
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import time

import shortuuid
from hipscat.io.file_io import file_io
from hats.io.file_io import file_io


class TempCloudDirectory:
Expand Down
61 changes: 0 additions & 61 deletions src/hipscat_cloudtests/file_checks.py

This file was deleted.

Binary file modified tests/cloud/data/small_sky/Norder=0/Dir=0/Npix=11.parquet
Binary file not shown.
Binary file modified tests/cloud/data/small_sky/_common_metadata
Binary file not shown.
Binary file modified tests/cloud/data/small_sky/_metadata
Binary file not shown.
8 changes: 0 additions & 8 deletions tests/cloud/data/small_sky/catalog_info.json

This file was deleted.

4 changes: 2 additions & 2 deletions tests/cloud/data/small_sky/partition_info.csv
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Norder,Npix,Dir
0,11,0
Norder,Npix
0,11
Binary file modified tests/cloud/data/small_sky/point_map.fits
Binary file not shown.
14 changes: 14 additions & 0 deletions tests/cloud/data/small_sky/properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#HATS catalog
obs_collection=small_sky
dataproduct_type=object
hats_nrows=131
hats_col_j2000_ra=ra
hats_col_j2000_dec=dec
hats_max_rows=1000000
hats_order=0
moc_sky_fraction=0.08333
hats_builder=hats-import v0.3.6.dev25+g93f6917
hats_creation_date=2024-10-04T14\:57UTC
hats_estsize=17
hats_release_date=2024-09-18
hats_version=v0.1
57 changes: 0 additions & 57 deletions tests/cloud/data/small_sky/provenance_info.json

This file was deleted.

Binary file modified tests/cloud/data/small_sky_object_index/_common_metadata
Binary file not shown.
Binary file modified tests/cloud/data/small_sky_object_index/_metadata
Binary file not shown.
8 changes: 0 additions & 8 deletions tests/cloud/data/small_sky_object_index/catalog_info.json

This file was deleted.

Binary file modified tests/cloud/data/small_sky_object_index/index/part.0.parquet
Binary file not shown.
11 changes: 11 additions & 0 deletions tests/cloud/data/small_sky_object_index/properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#HATS catalog
obs_collection=small_sky_object_index
dataproduct_type=index
hats_nrows=131
hats_primary_table_url=small_sky_order1
hats_index_column=id
hats_builder=hats-import v0.3.6.dev25+g93f6917
hats_creation_date=2024-10-04T14\:57UTC
hats_estsize=11
hats_release_date=2024-09-18
hats_version=v0.1
31 changes: 0 additions & 31 deletions tests/cloud/data/small_sky_object_index/provenance_info.json

This file was deleted.

Binary file modified tests/cloud/data/small_sky_order1/Norder=1/Dir=0/Npix=44.parquet
Binary file not shown.
Binary file modified tests/cloud/data/small_sky_order1/Norder=1/Dir=0/Npix=45.parquet
Binary file not shown.
Binary file modified tests/cloud/data/small_sky_order1/Norder=1/Dir=0/Npix=46.parquet
Binary file not shown.
Binary file modified tests/cloud/data/small_sky_order1/Norder=1/Dir=0/Npix=47.parquet
Binary file not shown.
Binary file modified tests/cloud/data/small_sky_order1/_common_metadata
Binary file not shown.
Binary file modified tests/cloud/data/small_sky_order1/_metadata
Binary file not shown.
8 changes: 0 additions & 8 deletions tests/cloud/data/small_sky_order1/catalog_info.json

This file was deleted.

10 changes: 5 additions & 5 deletions tests/cloud/data/small_sky_order1/partition_info.csv
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Norder,Npix,Dir
1,44,0
1,45,0
1,46,0
1,47,0
Norder,Npix
1,44
1,45
1,46
1,47
Binary file modified tests/cloud/data/small_sky_order1/point_map.fits
Binary file not shown.
Loading