Skip to content

Commit 8229282

Browse files
committed
Add a single benchmark
1 parent 1fb783a commit 8229282

File tree

1 file changed

+22
-6
lines changed

1 file changed

+22
-6
lines changed

benchmarks/benchmarks.py

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,30 @@
33
For more information on writing benchmarks:
44
https://asv.readthedocs.io/en/stable/writing_benchmarks.html."""
55

6-
from hats_tap import example_benchmarks
6+
import pathlib
77

8+
from hats_tap.adql_to_lsdb import parse_adql_entities
89

9-
def time_computation():
10+
11+
def time_sample1_parse():
1012
"""Time computations are prefixed with 'time'."""
11-
example_benchmarks.runtime_computation()
13+
samples_dir = pathlib.Path(__file__).parent.parent / "src" / "hats_tap" / "samples"
1214

15+
adql = (samples_dir / "sample1.adql").read_text()
16+
result = parse_adql_entities(adql)
1317

14-
def mem_list():
15-
"""Memory computations are prefixed with 'mem' or 'peakmem'."""
16-
return example_benchmarks.memory_computation()
18+
assert result["tables"] == ["gaia_dr3.gaia"]
19+
assert result["columns"] == [
20+
"source_id",
21+
"ra",
22+
"dec",
23+
"phot_g_mean_mag",
24+
"phot_variable_flag",
25+
]
26+
assert result["spatial_search"] == {
27+
"type": "ConeSearch",
28+
"ra": 270.0,
29+
"dec": 23.0,
30+
"radius": 0.25,
31+
}
32+
assert result["limits"] == 15

0 commit comments

Comments
 (0)