-
-
Notifications
You must be signed in to change notification settings - Fork 428
Open
Description
This error affects #3459. It's a bit weird, as it looks like a change in a value that I would not expect under any conditions, no matter what underlying packages change. 28.93617776179148 is being read in as ...177761791473, apparently. Maybe I'm missing the underlying issue, but that doesn't seem possible.
https://github.com/astropy/astroquery/actions/runs/19459612807/job/55680512989?pr=3459
=================================== FAILURES ===================================
_ test_transpiler[region(GAL,180 0,2d) & otype = 'G' & (nbref >= 10|bibyear >= 2000)-CONTAINS(POINT('ICRS', ra, dec), CIRCLE('ICRS', 86.40498828654475, 28.93617776179148, 2.0)) = 1 AND otypes.otype = 'G' AND (nbref >= 10 OR bibyear >= 2000)] _
test = "region(GAL,180 0,2d) & otype = 'G' & (nbref >= 10|bibyear >= 2000)"
result = "CONTAINS(POINT('ICRS', ra, dec), CIRCLE('ICRS', 86.40498828654475, 28.93617776179148, 2.0)) = 1 AND otypes.otype = 'G' AND (nbref >= 10 OR bibyear >= 2000)"
@pytest.mark.parametrize("test, result", [
("region(GAL,180 0,2d) & otype = 'G' & (nbref >= 10|bibyear >= 2000)",
("CONTAINS(POINT('ICRS', ra, dec), CIRCLE('ICRS', 86.40498828654475, 28.93617776179148, 2.0)) = 1"
" AND otypes.otype = 'G' AND (nbref >= 10 OR bibyear >= 2000)")),
("author ∼ 'egret*'", "regexp(author, '^egret.*$') = 1"),
("cat in ('hd','hip','ppm')", "cat IN ('hd','hip','ppm')"),
("author !~ 'test'", "regexp(author, '^test$') = 0"),
("sptype < F4", "sp_type < 'F4'"),
("umag < 1", "allfluxes.u_ < 1"),
("Vmag = 10", "allfluxes.V = 10"),
("otypes != 'Galaxy'", "otypes.otype != 'Galaxy..'"),
("maintype=SNR", "basic.otype = 'SNR'"),
("maintypes=SNR", "basic.otype = 'SNR..'")
]) # these are the examples from http://simbad.cds.unistra.fr/guide/sim-fsam.htx
# plus added examples
def test_transpiler(test, result):
# to regenerate transpiler after a change in utils.py, delete `criteria_parsetab.py`
# and run this test file again.
translated = CriteriaTranslator.parse(test)
> assert translated == result
E AssertionError: assert 'CONTAINS(POI...year >= 2000)' == 'CONTAINS(POI...year >= 2000)'
E Skipping 73 identical leading characters in diff, use -v to show
E - 17776179148, 2.0)) = 1 AND otypes.otype = 'G' AND (nbref >= 10 OR bibyear >= 2000)
E ? ^
E + 177761791473, 2.0)) = 1 AND otypes.otype = 'G' AND (nbref >= 10 OR bibyear >= 2000)
E ? ^^
../../.tox/py39-test-oldestdeps-alldeps/lib/python3.9/site-packages/astroquery/simbad/tests/test_utils.py:103: AssertionError
=========================== short test summary info ============================
FAILED ../../.tox/py39-test-oldestdeps-alldeps/lib/python3.9/site-packages/astroquery/simbad/tests/test_utils.py::test_transpiler[region(GAL,180 0,2d) & otype = 'G' & (nbref >= 10|bibyear >= 2000)-CONTAINS(POINT('ICRS', ra, dec), CIRCLE('ICRS', 86.40498828654475, 28.93617776179148, 2.0)) = 1 AND otypes.otype = 'G' AND (nbref >= 10 OR bibyear >= 2000)] - AssertionError: assert 'CONTAINS(POI...year >= 2000)' == 'CONTAINS(POI...year >= 2000)'
Skipping 73 identical leading characters in diff, use -v to show
- 17776179148, 2.0)) = 1 AND otypes.otype = 'G' AND (nbref >= 10 OR bibyear >= 2000)
? ^
+ 177761791473, 2.0)) = 1 AND otypes.otype = 'G' AND (nbref >= 10 OR bibyear >= 2000)
? ^^
=========== 1 failed, 1868 passed, 2095 skipped, 2 xfailed in 45.06s ===========
py39-test-oldestdeps-alldeps: exit 1 (47.09 seconds) /home/runner/work/astroquery/astroquery/.tmp/py39-test-oldestdeps-alldeps> pytest --pyargs astroquery /home/runner/work/astroquery/astroquery/docs '' pid=2537
py39-test-oldestdeps-alldeps: FAIL code 1 (84.37=setup[37.03]+cmd[0.26,47.09] seconds)
evaluation failed :( (84.48 seconds)