From c80c3186b99f0a8a0819edc41edfa5713453f0a1 Mon Sep 17 00:00:00 2001 From: Melissa DeLucchi <113376043+delucchi-cmu@users.noreply.github.com> Date: Wed, 18 Dec 2024 12:42:03 -0500 Subject: [PATCH] Address failing benchmarks (#532) --- benchmarks/asv.conf.json | 3 ++- benchmarks/benchmarks.py | 9 ++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/benchmarks/asv.conf.json b/benchmarks/asv.conf.json index d49d3436..bcb9c743 100644 --- a/benchmarks/asv.conf.json +++ b/benchmarks/asv.conf.json @@ -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}" diff --git a/benchmarks/benchmarks.py b/benchmarks/benchmarks.py index c8c5a2fb..e579b720 100644 --- a/benchmarks/benchmarks.py +++ b/benchmarks/benchmarks.py @@ -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)) @@ -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():