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

RunRouter filling skips whole Event if any specs are unknown #188

Open
danielballan opened this issue Sep 24, 2020 · 1 comment
Open

RunRouter filling skips whole Event if any specs are unknown #188

danielballan opened this issue Sep 24, 2020 · 1 comment

Comments

@danielballan
Copy link
Member

The functionality of RunRouter's filling is confusing. By default, it tries to fill and silently gives up if it encounters a spec it doesn't know. You can opt in to stricter behavior. So far, so good.

fill_or_fail: boolean, optional
By default (False), if a document with a spec not in
``handler_registry`` is encountered, let it pass through unfilled. But
if set to True, fill everything and `raise
``UndefinedAssetSpecification`` if some unknown spec is encountered.

But when it fails to resolve a spec, it bails on filling the entire document. That is, if an Event has fields from two detectors, and we know how to fill Detector A but we don't know how to fill Detector B, neither will be filled.

I haven't given thought yet to what we should do about this, just making sure it is documented.

def event_page(self, doc):
descriptor_uid = doc['descriptor']
start_uid = self._descriptor_to_start[descriptor_uid]
try:
doc = self._fillers[start_uid].event_page(doc)
except UndefinedAssetSpecification:
if self.fill_or_fail:
raise

@tacaswell
Copy link
Contributor

I am (on 45s of thought) in favor of filling as much as we can when in forgiving mode. It gives you a nice signal of "that field is broken" ;)

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

2 participants