Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduced shared parquet file contention in testing #440

Merged
merged 2 commits into from
Apr 29, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added tests/tape_tests/data/object/test_object2.parquet
Binary file not shown.
Binary file added tests/tape_tests/data/source/test_source2.parquet
Binary file not shown.
15 changes: 14 additions & 1 deletion tests/tape_tests/test_ensemble.py
Original file line number Diff line number Diff line change
Expand Up @@ -2054,11 +2054,24 @@ def my_mean(flux, time, dup_time, band):

@pytest.mark.parametrize("on", [None, ["ps1_objid", "filterName"], ["filterName", "ps1_objid"]])
@pytest.mark.parametrize("func_label", ["mean", "bounds"])
def test_batch_by_band(parquet_ensemble, func_label, on):
def test_batch_by_band(func_label, on):
"""
Test that ensemble.batch(by_band=True) works as intended.
"""

# TODO(wbeebe): This is a temporary workaround for https://github.com/lincc-frameworks/tape/issues/434 to avoid contention when reading data
# from the test files in parallel. This is the same as `parque_ensmemble` but uses copies of the parquet files referenced there.
wilsonbb marked this conversation as resolved.
Show resolved Hide resolved
parquet_ensemble = Ensemble(client=False)
parquet_ensemble.from_parquet(
"tests/tape_tests/data/source/test_source2.parquet",
"tests/tape_tests/data/object/test_object2.parquet",
id_col="ps1_objid",
time_col="midPointTai",
band_col="filterName",
flux_col="psFlux",
err_col="psFluxErr",
)

if func_label == "mean":

def my_mean(flux):
Expand Down