Skip to content

Commit

Permalink
Merge branch 'main' into hipscat/issue/53/healpy
Browse files Browse the repository at this point in the history
  • Loading branch information
delucchi-cmu authored Jul 18, 2024
2 parents de6c9c0 + 72a7626 commit bf704d0
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/add-issue-to-project-tracker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
name: Add issue to project
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected].1
- uses: actions/[email protected].2
with:
project-url: https://github.com/orgs/astronomy-commons/projects/7
github-token: ${{ secrets.ADD_TO_PROJECT_PAT }}
2 changes: 1 addition & 1 deletion src/hipscat_import/catalog/file_readers.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ def __init__(
if self.column_names:
self.kwargs["names"] = self.column_names
elif not self.header and schema_parquet is not None:
self.kwargs["names"] = schema_parquet.columns
self.kwargs["names"] = list(schema_parquet.columns)

if self.type_map:
self.kwargs["dtype"] = self.type_map
Expand Down
34 changes: 34 additions & 0 deletions tests/hipscat_import/catalog/test_argument_validation.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
"""Tests of argument validation"""

import pytest
from hipscat.io import write_metadata

from hipscat_import.catalog.arguments import ImportArguments, check_healpix_order_range
from hipscat_import.catalog.file_readers import CsvReader

# pylint: disable=protected-access

Expand Down Expand Up @@ -206,6 +208,38 @@ def test_provenance_info(blank_data_dir, tmp_path):
assert "epoch" in runtime_args


def test_write_provenance_info(formats_dir, tmp_path):
"""Verify that provenance info can be written to JSON file."""
input_file = formats_dir / "gaia_minimum.csv"
schema_file = formats_dir / "gaia_minimum_schema.parquet"

args = ImportArguments(
output_artifact_name="gaia_minimum",
input_file_list=[input_file],
file_reader=CsvReader(
comment="#",
header=None,
schema_file=schema_file,
),
ra_column="ra",
dec_column="dec",
sort_columns="solution_id",
use_schema_file=schema_file,
output_path=tmp_path,
dask_tmp=tmp_path,
highest_healpix_order=2,
pixel_threshold=3_000,
progress_bar=False,
)

write_metadata.write_provenance_info(
catalog_base_dir=args.catalog_path,
dataset_info=args.to_catalog_info(0),
tool_args=args.provenance_info(),
storage_options=args.output_storage_options,
)


def test_check_healpix_order_range():
"""Test method check_healpix_order_range"""
check_healpix_order_range(5, "order_field")
Expand Down

0 comments on commit bf704d0

Please sign in to comment.