Skip to content

Commit

Permalink
release 0.2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
mtjvc committed Sep 12, 2017
1 parent f991627 commit 93ecad5
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 7 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

python_version = sys.version_info.major

version = '0.2.1'
version = '0.2.2'

author = 'Gal Matijevic'
email = '[email protected]'
Expand Down
16 changes: 15 additions & 1 deletion utils/adql_queries.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,20 @@
) AS sub;
""",
"""
SELECT POINT('icrs', ra, dec) as "p", z AS y FROM "db".tab
SELECT
ATLASsource.*,
2*DEGREES(ASIN(sqrt(power(-0.997825033922517-cx, 2) + power(-0.052293794140904105-cy, 2) + power(-0.040131792532559725-cz,2)) / 2)) * 60 as dist
FROM
ATLASsource
WHERE
dec > -2.3166666666666664
AND
dec < -2.283333333333333
AND
RA >= 182.98331970017435
AND
RA <= 183.01668029982565
AND
((cx * -0.997825033922517 + cy * -0.052293794140904105 + cz * -0.040131792532559725 ) >= 0.9999999576920253)
"""
]
11 changes: 6 additions & 5 deletions utils/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,24 +174,25 @@ def test_translated_mysql_parsing(qs):
qp.set_query(translated_query)
try:
qp.process_query()
except QueryError:
raise
syntax_errors = []
except QuerySyntaxError as e:
syntax_errors = e.syntax_errors
s = time.time() - s
# cols, keys, funcs = qp.columns, qp.keywords, qp.functions
# s = 0.0
# not_so_pretty_print(translated_query, cols, keys, funcs, s,
# qp.syntax_errors)
cols, keys, funcs, dispcols= qp.columns, qp.keywords, qp.functions, \
qp.display_columns
pretty_print(q, cols, keys, funcs, dispcols, s, qp.syntax_errors,
pretty_print(q, cols, keys, funcs, dispcols, s, syntax_errors,
show_diff=True)


if __name__ == '__main__':
test_mysql_parsing(test_queries.queries[-1:])
# test_mysql_parsing(test_queries.queries[-1:])
# test_mysql_parsing(test_queries.queries[35:42])
# test_mysql_parsing(test_queries.queries[6:7])
# test_mysql_parsing(test_queries.queries[:])
# test_mysql_parsing(broken_queries.queries[-1:])
# test_adql_translation(adql_queries.queries[-1:])
# test_translated_mysql_parsing(mysql_adql_queries.queries)
test_translated_mysql_parsing(mysql_adql_queries.queries[-1:])

0 comments on commit 93ecad5

Please sign in to comment.