Skip to content

Commit e49b620

Browse files
authored
Merge branch 'main' into issue/import/453
2 parents 56e9c90 + e07916b commit e49b620

File tree

7 files changed

+29
-6
lines changed

7 files changed

+29
-6
lines changed

docs/conf.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,12 @@
2424
# -- General configuration ---------------------------------------------------
2525
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
2626

27-
extensions = ["sphinx.ext.mathjax", "sphinx.ext.napoleon", "sphinx.ext.viewcode"]
27+
extensions = [
28+
"sphinx.ext.mathjax",
29+
"sphinx.ext.napoleon",
30+
"sphinx.ext.viewcode",
31+
"sphinx_design",
32+
]
2833

2934
extensions.append("autoapi.extension")
3035
extensions.append("nbsphinx")

docs/getting_started.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ The latest release version of HATS is available to install with `pip <https://py
3333
pyenv virtualenv 3.11 hats_env
3434
pyenv local hats_env
3535
36-
We recommend Python versions **>=3.9, <=3.12**.
36+
We recommend Python versions **>=3.10, <=3.12**.
3737

3838
HATS can also be installed from source on `GitHub <https://github.com/astronomy-commons/hats>`_.
3939

docs/index.rst

+2-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ Getting Started
4444
For the most part, we recommend accessing and processing HATS data using the `LSDB package
4545
<https://github.com/astronomy-commons/lsdb>`_ framework. LSDB provides a variety of utility
4646
functions as well as a lazy, distributed execution framework using Dask. However if you are are
47-
interested in using just the HATS package, you can find installation instructions at the :ref:`getting started page<getting_started>`
47+
interested in using just the HATS package, you can find installation instructions at the
48+
:doc:`getting started page</getting_started>`.
4849

4950
Acknowledgements
5051
-------------------------------------------------------------------------------

docs/requirements.txt

+1
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ sphinx
88
sphinx-autoapi
99
sphinx-copybutton
1010
sphinx-book-theme
11+
sphinx-design

src/hats/io/parquet_metadata.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -276,5 +276,5 @@ def aggregate_column_statistics(
276276
"max_value": stats_lists[1],
277277
"null_count": stats_lists[2],
278278
}
279-
)
279+
).set_index("column_names")
280280
return frame

src/hats/pixel_math/healpix_shim.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ def radec2pix(order: int, ra: float, dec: float) -> np.ndarray[np.int64]:
6262
if not is_order_valid(order):
6363
raise ValueError("Invalid value for order")
6464

65-
ra = Longitude(ra, unit="deg")
66-
dec = Latitude(dec, unit="deg")
65+
ra = Longitude(np.asarray(ra, dtype=np.float64), unit="deg")
66+
dec = Latitude(np.asarray(dec, dtype=np.float64), unit="deg")
6767

6868
return cdshealpix.lonlat_to_healpix(ra, dec, order).astype(np.int64)
6969

tests/hats/pixel_math/test_healpix_shim.py

+16
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,22 @@ def test_radec2pix_lonlat():
166166
assert np.all(pixels == expected_pixels)
167167

168168

169+
def test_radec2pix_lonlat_float32():
170+
orders = [0, 1, 5, 10, 20, 29]
171+
ras = np.arange(-180.0, 180.0, 10.0)
172+
ras_f = ras.astype(np.float32)
173+
decs = np.arange(-90.0, 90.0, 180 // len(ras))
174+
decs_f = decs.astype(np.float32)
175+
for order in orders:
176+
expected_pixels = cdshealpix.lonlat_to_healpix(
177+
Longitude(ras, unit="deg"), Latitude(decs, unit="deg"), order
178+
)
179+
# Verify that healpixshim can work with float32 versions
180+
# Fixes https://github.com/astronomy-commons/hats-import/issues/458
181+
pixels = hps.radec2pix(order, ras_f, decs_f)
182+
assert np.all(pixels == expected_pixels)
183+
184+
169185
def test_radec2pix_invalid():
170186
orders = [0, 1, 5, 10, 20, 29]
171187
invalid_orders = [-1000, -1, 30, 40]

0 commit comments

Comments
 (0)