Skip to content

Commit 91d59ee

Browse files
authored
Re-generate test data, and update expectations. (#467)
1 parent 12db6ea commit 91d59ee

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+43
-30
lines changed

tests/conftest.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ def margin_catalog_info(margin_cache_catalog_info_data) -> TableProperties:
116116
def small_sky_schema() -> pa.Schema:
117117
return pa.schema(
118118
[
119+
pa.field("_healpix_29", pa.int64()),
119120
pa.field("id", pa.int64()),
120121
pa.field("ra", pa.float64()),
121122
pa.field("dec", pa.float64()),
@@ -124,7 +125,6 @@ def small_sky_schema() -> pa.Schema:
124125
pa.field("Norder", pa.uint8()),
125126
pa.field("Dir", pa.uint64()),
126127
pa.field("Npix", pa.uint64()),
127-
pa.field("_healpix_29", pa.int64()),
128128
]
129129
)
130130

@@ -133,6 +133,7 @@ def small_sky_schema() -> pa.Schema:
133133
def small_sky_source_schema() -> pa.Schema:
134134
return pa.schema(
135135
[
136+
pa.field("_healpix_29", pa.int64()),
136137
pa.field("source_id", pa.int64()),
137138
pa.field("source_ra", pa.float64()),
138139
pa.field("source_dec", pa.float64()),
@@ -145,7 +146,6 @@ def small_sky_source_schema() -> pa.Schema:
145146
pa.field("Norder", pa.uint8()),
146147
pa.field("Dir", pa.uint64()),
147148
pa.field("Npix", pa.uint64()),
148-
pa.field("_healpix_29", pa.int64()),
149149
]
150150
)
151151

@@ -166,18 +166,18 @@ def association_catalog_schema() -> pa.Schema:
166166
def margin_catalog_schema() -> pa.Schema:
167167
return pa.schema(
168168
[
169+
pa.field("_healpix_29", pa.int64()),
169170
pa.field("id", pa.int64()),
170171
pa.field("ra", pa.float64()),
171172
pa.field("dec", pa.float64()),
172173
pa.field("ra_error", pa.int64()),
173174
pa.field("dec_error", pa.int64()),
174-
pa.field("Norder", pa.uint8()),
175-
pa.field("Dir", pa.uint64()),
176-
pa.field("Npix", pa.uint64()),
177-
pa.field("_healpix_29", pa.int64()),
178175
pa.field("margin_Norder", pa.uint8()),
179176
pa.field("margin_Dir", pa.uint64()),
180177
pa.field("margin_Npix", pa.uint64()),
178+
pa.field("Norder", pa.uint8()),
179+
pa.field("Dir", pa.uint64()),
180+
pa.field("Npix", pa.uint64()),
181181
]
182182
)
183183

@@ -196,6 +196,8 @@ def catalog_path(test_data_dir) -> str:
196196
def margin_catalog_pixels() -> list[HealpixPixel]:
197197
return [
198198
HealpixPixel(0, 4),
199+
HealpixPixel(0, 7),
200+
HealpixPixel(0, 8),
199201
HealpixPixel(1, 44),
200202
HealpixPixel(1, 45),
201203
HealpixPixel(1, 46),

tests/data/generate_data.ipynb

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
"import tempfile\n",
3333
"from pathlib import Path\n",
3434
"from dask.distributed import Client\n",
35+
"from hats.io.file_io import remove_directory\n",
3536
"\n",
3637
"tmp_path = tempfile.TemporaryDirectory()\n",
3738
"tmp_dir = tmp_path.name\n",
@@ -61,6 +62,7 @@
6162
"metadata": {},
6263
"outputs": [],
6364
"source": [
65+
"remove_directory(\"./small_sky\")\n",
6466
"with tempfile.TemporaryDirectory() as pipeline_tmp:\n",
6567
" args = ImportArguments(\n",
6668
" input_path=Path(hats_import_dir) / \"small_sky\",\n",
@@ -97,6 +99,7 @@
9799
"metadata": {},
98100
"outputs": [],
99101
"source": [
102+
"remove_directory(\"./small_sky_order1\")\n",
100103
"with tempfile.TemporaryDirectory() as pipeline_tmp:\n",
101104
" args = ImportArguments(\n",
102105
" input_path=Path(hats_import_dir) / \"small_sky\",\n",
@@ -126,6 +129,7 @@
126129
"metadata": {},
127130
"outputs": [],
128131
"source": [
132+
"remove_directory(\"./small_sky_order1_id_index\")\n",
129133
"with tempfile.TemporaryDirectory() as pipeline_tmp:\n",
130134
" args = IndexArguments(\n",
131135
" input_catalog_path=\"small_sky\",\n",
@@ -165,6 +169,7 @@
165169
"metadata": {},
166170
"outputs": [],
167171
"source": [
172+
"remove_directory(\"./small_sky_order1_margin\")\n",
168173
"with tempfile.TemporaryDirectory() as pipeline_tmp:\n",
169174
" args = MarginCacheArguments(\n",
170175
" margin_threshold=7200,\n",
@@ -241,6 +246,7 @@
241246
"metadata": {},
242247
"outputs": [],
243248
"source": [
249+
"remove_directory(\"./small_sky_source\")\n",
244250
"with tempfile.TemporaryDirectory() as pipeline_tmp:\n",
245251
" args = ImportArguments(\n",
246252
" input_path=Path(hats_import_dir) / \"small_sky_source\",\n",
@@ -284,6 +290,7 @@
284290
"metadata": {},
285291
"outputs": [],
286292
"source": [
293+
"remove_directory(\"./small_sky_source_object_index\")\n",
287294
"with tempfile.TemporaryDirectory() as pipeline_tmp:\n",
288295
" args = IndexArguments(\n",
289296
" input_catalog_path=\"small_sky_source\",\n",
@@ -321,6 +328,7 @@
321328
"metadata": {},
322329
"outputs": [],
323330
"source": [
331+
"remove_directory(\"./square_map\")\n",
324332
"with tempfile.TemporaryDirectory() as pipeline_tmp:\n",
325333
" csv_file = Path(pipeline_tmp) / \"square_map.csv\"\n",
326334
" value_frame.to_csv(csv_file, index=False)\n",
@@ -360,7 +368,7 @@
360368
],
361369
"metadata": {
362370
"kernelspec": {
363-
"display_name": "demo",
371+
"display_name": "hats",
364372
"language": "python",
365373
"name": "python3"
366374
},
Binary file not shown.
-2.93 KB
Binary file not shown.
-2.94 KB
Binary file not shown.

tests/data/small_sky/point_map.fits

48 MB
Binary file not shown.

tests/data/small_sky/properties

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ hats_col_dec=dec
77
hats_max_rows=1000000
88
hats_order=0
99
moc_sky_fraction=0.08333
10-
hats_builder=hats-import v0.3.6.dev26+g40366b4
11-
hats_creation_date=2024-10-11T18\:18UTC
12-
hats_estsize=49177
10+
hats_builder=hats-import v0.4.6.dev1+gf00cd7a
11+
hats_creation_date=2025-03-05T16\:16UTC
12+
hats_estsize=98318
1313
hats_release_date=2024-09-18
1414
hats_version=v0.1
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
-2.96 KB
Binary file not shown.
0 Bytes
Binary file not shown.

tests/data/small_sky_order1/properties

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ hats_col_dec=dec
77
hats_max_rows=1000000
88
hats_order=1
99
moc_sky_fraction=0.08333
10-
hats_builder=hats-import v0.3.6.dev26+g40366b4
11-
hats_creation_date=2024-10-11T18\:18UTC
12-
hats_estsize=48
10+
hats_builder=hats-import v0.4.6.dev1+gf00cd7a
11+
hats_creation_date=2025-03-05T16\:16UTC
12+
hats_estsize=27
1313
hats_release_date=2024-09-18
1414
hats_version=v0.1
Binary file not shown.
Binary file not shown.
Binary file not shown.

tests/data/small_sky_order1_id_index/properties

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ dataproduct_type=index
44
hats_nrows=131
55
hats_primary_table_url=small_sky
66
hats_index_column=id
7-
hats_builder=hats-import v0.3.6.dev26+g40366b4
8-
hats_creation_date=2024-10-11T18\:18UTC
9-
hats_estsize=8
7+
hats_builder=hats-import v0.4.6.dev1+gf00cd7a
8+
hats_creation_date=2025-03-05T16\:16UTC
9+
hats_estsize=3
1010
hats_release_date=2024-09-18
1111
hats_version=v0.1
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

tests/data/small_sky_order1_margin/partition_info.csv

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
Norder,Npix
22
0,4
3+
0,7
4+
0,8
35
1,44
46
1,45
57
1,46
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
#HATS catalog
22
obs_collection=small_sky_order1_margin
33
dataproduct_type=margin
4-
hats_nrows=28
4+
hats_nrows=47
55
hats_col_ra=ra
66
hats_col_dec=dec
77
hats_primary_table_url=small_sky_order1
88
hats_margin_threshold=7200.0
99
hats_order=1
10-
moc_sky_fraction=0.16667
11-
hats_builder=hats-import v0.3.6.dev26+g40366b4
12-
hats_creation_date=2024-10-11T18\:18UTC
13-
hats_estsize=58
10+
moc_sky_fraction=0.33333
11+
hats_builder=hats-import v0.4.6.dev1+gf00cd7a
12+
hats_creation_date=2025-03-05T16\:16UTC
13+
hats_estsize=36
1414
hats_release_date=2024-09-18
1515
hats_version=v0.1
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
-4.38 KB
Binary file not shown.
48 MB
Binary file not shown.

tests/data/small_sky_source/properties

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ hats_col_dec=source_dec
77
hats_max_rows=3000
88
hats_order=2
99
moc_sky_fraction=0.16667
10-
hats_builder=hats-import v0.3.6.dev26+g40366b4
11-
hats_creation_date=2024-10-11T18\:19UTC
12-
hats_estsize=50207
10+
hats_builder=hats-import v0.4.6.dev1+gf00cd7a
11+
hats_creation_date=2025-03-05T16\:16UTC
12+
hats_estsize=99275
1313
hats_release_date=2024-09-18
1414
hats_version=v0.1
Binary file not shown.
Binary file not shown.
Binary file not shown.

tests/data/small_sky_source_object_index/properties

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ dataproduct_type=index
44
hats_nrows=148
55
hats_primary_table_url=small_sky_source
66
hats_index_column=object_id
7-
hats_builder=hats-import v0.3.6.dev26+g40366b4
8-
hats_creation_date=2024-10-11T18\:19UTC
9-
hats_estsize=9
7+
hats_builder=hats-import v0.4.6.dev1+gf00cd7a
8+
hats_creation_date=2025-03-05T16\:16UTC
9+
hats_estsize=3
1010
hats_release_date=2024-09-18
1111
hats_version=v0.1
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
-951 Bytes
Binary file not shown.
-1011 Bytes
Binary file not shown.

tests/data/square_map/properties

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ hats_nrows=12
55
hats_max_rows=1000000
66
hats_order=1
77
moc_sky_fraction=0.25000
8-
hats_builder=hats-import v0.4.1
9-
hats_creation_date=2024-11-20T19\:32UTC
10-
hats_estsize=52
8+
hats_builder=hats-import v0.4.6.dev1+gf00cd7a
9+
hats_creation_date=2025-03-05T16\:16UTC
10+
hats_estsize=34
1111
hats_release_date=2024-09-18
1212
hats_version=v0.1

tests/hats/catalog/margin_cache/test_margin_catalog.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ def test_margin_filter(margin_catalog_info, margin_catalog_pixels):
7676
pixels = [HealpixPixel(1, 44)]
7777
filtered_catalog = catalog.filter_from_pixel_list(pixels)
7878
assert filtered_catalog.get_healpix_pixels() == [
79+
HealpixPixel(0, 8),
7980
HealpixPixel(1, 44),
8081
HealpixPixel(1, 45),
8182
HealpixPixel(1, 46),

0 commit comments

Comments
 (0)