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

Warnings about VariationPath overrides when none are used #486

Open
alexander-held opened this issue Aug 20, 2024 · 1 comment
Open

Warnings about VariationPath overrides when none are used #486

alexander-held opened this issue Aug 20, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@alexander-held
Copy link
Member

The

variation override specified, but {VariationPath} not found in default path

warning message triggers for histogram inputs even when no overrides are used at the moment.

Example test that will currently fail for test__histo_path:

# no variation path anywhere, so no warning
assert (
    collector._histo_path(
        "f.root:h1", "", {}, {}, {}, None
    )
    == "f.root:h1"
)
assert (
    "variation override specified, but {VariationPath} not found in default path"
    not in [rec.message for rec in caplog.records]
)
caplog.clear()

This needs to be fixed, presumably in templates.collector._histo_path.

@alexander-held alexander-held added the bug Something isn't working label Aug 20, 2024
@MoAly98
Copy link
Collaborator

MoAly98 commented Feb 25, 2025

@alexander-held I think the existing test on this is also not probing the correct bit of the code...

Consider this test for example:

    # warning: no variation path in template
    assert (
        collector._histo_path(
            "f.root:h1", "", {},  {"VariationPath": "sample.root"}, {},, None
        )
        == "f.root:h1"
    )
    assert (
        "variation override specified, but {VariationPath} not found in default path"
        in [rec.message for rec in caplog.records]
  • The variation path is passed in the sample dictionary, so it should be the next argument
  • We test for overrides on variation path when a systematic is defined only, and in this test, the systematic is not defined (no template specified). Is there a valid setup where the template key in the systematic dictionary does not exist and VariationPath is non-empty? if not, maybe this is a logic that needs to be added in collector._histo_path.

The following is a valid setup for a systematic:

{"Name": "variation", "Up": {"SamplePath": "var", "VariationPath": "up"}}

whereas

{"VariationPath": "sample.root"}

is not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants