Skip to content

Commit

Permalink
Benchmark multiple size inputs to transform coordinates
Browse files Browse the repository at this point in the history
  • Loading branch information
akoumjian committed Dec 6, 2024
1 parent afe1e7a commit 2a50803
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions src/adam_core/coordinates/tests/test_benchmarks.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,10 @@
[OriginCodes.SUN, OriginCodes.SOLAR_SYSTEM_BARYCENTER],
ids=lambda x: f"origin={x.name},",
)
@pytest.mark.parametrize("size", [1, 50, 100])
@pytest.mark.benchmark(group="coord_transforms")
def test_benchmark_transform_cartesian_coordinates(
benchmark, representation, frame, origin
benchmark, representation, frame, origin, size
):
if origin == OriginCodes.SOLAR_SYSTEM_BARYCENTER:
pytest.skip("barycenter transform not yet implemented")
Expand All @@ -37,14 +38,14 @@ def test_benchmark_transform_cartesian_coordinates(
frame_in = "ecliptic"

from_coords = CartesianCoordinates.from_kwargs(
x=np.array([1]),
y=np.array([1]),
z=np.array([1]),
vx=np.array([1]),
vy=np.array([1]),
vz=np.array([1]),
time=Timestamp.from_mjd([50000]),
origin=Origin.from_kwargs(code=["SUN"]),
x=np.array([1] * size),
y=np.array([1] * size),
z=np.array([1] * size),
vx=np.array([1] * size),
vy=np.array([1] * size),
vz=np.array([1] * size),
time=Timestamp.from_mjd([50000] * size),
origin=Origin.from_kwargs(code=[OriginCodes.SUN] * size),
frame=frame_in,
)
benchmark(
Expand Down

0 comments on commit 2a50803

Please sign in to comment.