Skip to content

Commit

Permalink
Address failing benchmarks (#532)
Browse files Browse the repository at this point in the history
  • Loading branch information
delucchi-cmu authored Dec 18, 2024
1 parent 65134a1 commit c80c318
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
3 changes: 2 additions & 1 deletion benchmarks/asv.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
"HEAD"
],
"install_command": [
"python -mpip install -r requirements.txt {wheel_file}"
"python -mpip install -r requirements.txt {wheel_file}",
"python -mpip install .[full]"
],
"build_command": [
"python -m build --wheel -o {build_cache_dir} {build_dir}"
Expand Down
9 changes: 6 additions & 3 deletions benchmarks/benchmarks.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def time_polygon_search():
catalog_dec = upsample_array(small_sky_order1["dec"].to_numpy(), 10_000)
# Define sky polygon to use in search
vertices = [(300, -50), (300, -55), (272, -55), (272, -50)]
polygon, _ = get_cartesian_polygon(vertices)
polygon = get_cartesian_polygon(vertices)
# Apply vectorized filtering on the catalog points
polygon.contains(np.radians(catalog_ra), np.radians(catalog_dec))

Expand All @@ -57,9 +57,12 @@ def time_box_filter_on_partition():
"""Time box search on a single partition"""
metadata = load_small_sky_order1().hc_structure
mock_partition_df = pd.DataFrame(
np.linspace(-1000, 1000, 100_000), columns=[metadata.catalog_info.ra_column]
{
metadata.catalog_info.ra_column: np.linspace(-1000, 1000, 100_000),
metadata.catalog_info.dec_column: np.linspace(-90, 90, 100_000),
}
)
box_filter(mock_partition_df, ra=(-20, 40), dec=None, metadata=metadata.catalog_info)
box_filter(mock_partition_df, ra=(-20, 40), dec=(-90, 90), metadata=metadata.catalog_info)


def time_create_midsize_catalog():
Expand Down

0 comments on commit c80c318

Please sign in to comment.