Skip to content
This repository has been archived by the owner on Jan 27, 2023. It is now read-only.

Commit

Permalink
Let uproot_methods find single class implementations for templates
Browse files Browse the repository at this point in the history
  • Loading branch information
Beojan Stanislaus committed May 7, 2020
1 parent 3c0b015 commit ee56b7f
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions uproot_methods/classes/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,14 @@
# BSD 3-Clause License; see https://github.com/scikit-hep/uproot-methods/blob/master/LICENSE

def hasmethods(name):
if name not in globals() and name in hasmethods.loaders:
globals()[name] = hasmethods.loaders[name].load_module(name)
if name not in globals():
if name in hasmethods.loaders:
globals()[name] = hasmethods.loaders[name].load_module(name)
elif '_3c_' in name and '_3e_' in name:
bare_name = name.split('_3c_')[0]
if bare_name in hasmethods.loaders:
globals()[name] = hasmethods.loaders[bare_name].load_module(bare_name)

return name in globals() and isinstance(getattr(globals()[name], "Methods", None), type)

import pkgutil
Expand Down

0 comments on commit ee56b7f

Please sign in to comment.