pdg.utils module

Utilities for PDG API.

pdg.utils.base_id(pdgid)[source]

Return normalized base part of PDG Identifier.

pdg.utils.best(properties, pedantic=False, quantity=None)[source]

Return the “best” property from an iterable of properties, or raise an exception.

best does (pedantic=False) or does not (pedantic=True) make assumptions about what the best property might be in cases where the choice may be ambiguous. In the latter case, a PdgAmbiguous exception is raised while in the former case the best property is determined based on data flags and position in the Summary Tables. PdgNoDataError will be raised if there is no property that qualifies as best one.

quantity is an optional string that in case of an exception will describe the property being sought.

pdg.utils.make_id(baseid, edition=None)[source]

Return normalized full PDG Identifier, possibly including edition.

pdg.utils.parse_id(pdgid)[source]

Parse PDG Identifier and return (normalized base identifier, edition).

pdg.utils.pdg_round(value, error)[source]

Return (value, error) as numbers rounded following PDG rounding rules.