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

Issue Title #222

Open
gordonwatts opened this issue Mar 20, 2024 · 0 comments
Open

Issue Title #222

gordonwatts opened this issue Mar 20, 2024 · 0 comments

Comments

@gordonwatts
Copy link
Member

@pytest.mark.skipif(not run_long_running_tests, reason="Skipping long running test")
def test_global_enum_return_with_enum():
    """Run an actual return thing that will generate some output that we can
    examine on a test sample.
    """

    # Define the num class for future reference
    class JetConstitScale(Enum):
        UncalibratedJetConstituent = 0
        CalibratedJetConstituent = 1

    # Declare the enum class
    ctyp.define_enum("xAOD.Jet", "Color", ["Red", "Blue"])

    # Define the `getConstituentsSignalState` method

    # fmt: off
    # Add test compare to JetConstitScale.CalibraatedJetConstituent.Value in
    # a Where clause as a test of translating a global enum
    training_df = as_pandas(
        f_single.SelectMany(lambda e: e.Jets("AntiKt4EMTopoJets"))
        .Select(lambda j: j.getConstituentsSignalState())
    )
    # fmt: on

    assert len(training_df) > 0
    assert all(training_df.col1 == JetConstitScale.CalibratedJetConstituent.value)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant