Closed df7cb closed 3 years ago
It's probably better to use a proper C type, yes. For the Debian patch I wanted to keep the diff short. (It does pass the tests on 20 architectures here.) Will update the PR.
Fwiw I'm getting a regression diff on master which I think isn't my fault:
cat sql/ang2ipix.sql | psql q3c_test > results/ang2ipix.out
diff results/ang2ipix.out expected/ang2ipix.expected
111,113c111,113
< sum
< --------
< 643646
---
EXTENSION = q3c
> sum
> ---------
> 1000000
make: *** [Makefile:78: test] Error 1
I've committed your PR, thanks. Regarding the regression test, this is the recently added check that verifies that ang2ipix & ipix2ang are invertable. What platform does it fail on ? Because on travis it seems to work fine.
Thanks for merging.
I'm seeing in on Debian bullseye (unstable should be the same) amd64 with PG13:
$ LANG=C make test
dropdb --if-exists q3c_test
createdb q3c_test
psql q3c_test -c "CREATE TABLE test (ra double precision, dec double precision)"
CREATE TABLE
psql q3c_test -c "CREATE TABLE test1 (ra double precision, dec double precision)"
CREATE TABLE
psql q3c_test -c "CREATE TABLE test_pm0 (ra double precision, dec double precision, pmra real, pmdec real, epoch real)"
CREATE TABLE
psql q3c_test -c "CREATE TABLE test_pm1 (ra double precision, dec double precision, pmra real, pmdec real, epoch real)"
CREATE TABLE
psql q3c_test -c "CREATE TABLE test_small (ra double precision, dec double precision)"
CREATE TABLE
./gen_data 1 1000000 | psql q3c_test -c "COPY test FROM STDIN WITH DELIMITER ' '"
COPY 1000000
./gen_data 2 1000000 | psql q3c_test -c "COPY test1 FROM STDIN WITH DELIMITER ' '"
COPY 1000000
./gen_data 3 100000 | psql q3c_test -c "COPY test_small FROM STDIN WITH DELIMITER ' '"
COPY 100000
./gen_data 4 1000000 --withpm --pmscale=0 --randomepoch | psql q3c_test -c "COPY test_pm0 FROM STDIN WITH DELIMITER ' '"
COPY 1000000
./gen_data 5 1000000 --withpm --pmscale=1000 --epoch=2015 | psql q3c_test -c "COPY test_pm1 FROM STDIN WITH DELIMITER ' '"
COPY 1000000
psql q3c_test -c 'CREATE EXTENSION q3c'
CREATE EXTENSION
psql q3c_test -c 'CREATE INDEX q3c_idx1 ON test1 (q3c_ang2ipix(ra,dec))'
CREATE INDEX
psql q3c_test -c 'CREATE INdex ON test_pm0 (q3c_ang2ipix(ra,dec))'
CREATE INDEX
psql q3c_test -c 'CREATE INDEX on test_pm1 (q3c_ang2ipix(ra,dec))'
CREATE INDEX
psql q3c_test -c 'CREATE INDEX q3c_idx ON test (q3c_ang2ipix(ra,dec))'
CREATE INDEX
psql q3c_test -c 'CREATE INDEX q3c_idx_small ON test_small (q3c_ang2ipix(ra,dec))'
CREATE INDEX
psql q3c_test -c 'ANALYZE test'
ANALYZE
psql q3c_test -c 'ANALYZE test1'
ANALYZE
psql q3c_test -c 'ANALYZE test_pm0'
ANALYZE
psql q3c_test -c 'ANALYZE test_pm1'
ANALYZE
psql q3c_test -c 'ANALYZE test_small'
ANALYZE
mkdir -p results
cat sql/ang2ipix.sql | psql q3c_test > results/ang2ipix.out
diff results/ang2ipix.out expected/ang2ipix.expected
111,113c111,113
< sum
< --------
< 643646
---
> sum
> ---------
> 1000000
make: *** [Makefile:72: test] Error 1
postgres=# select version();
version
---------------------------------------------------------------------------------------------------------------------------------
PostgreSQL 13.0 (Debian 13.0-3~841.git0dd6746.pgdg+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 10.2.0-13) 10.2.0, 64-bit
Thanks, do you think you could run this query for me
select ra,dec, q3c_ang2ipix(ra,dec), (q3c_ipix2ang(q3c_ang2ipix(ra,dec)))[1], (q3c_ipix2ang(q3c_ang2ipix(ra,dec)))[2] from test
where q3c_ang2ipix(((q3c_ipix2ang(q3c_ang2ipix(ra,dec)))[1]),(q3c_ipix2ang(q3c_ang2ipix(ra,dec)))[2])!=q3c_ang2ipix(ra,dec));
to understand what's going on. I don't see anything on travis, so that's the only thing that can help.
Debian tries to run the testsuite on the installed packages with as few extra dependencies as possible. This change allows compiling gen_data and invoking "make test" without having postgresql-server-dev-* installed.