diff --git a/tools/podio-vis b/tools/podio-vis index 58d9e061f..a39f38b9f 100755 --- a/tools/podio-vis +++ b/tools/podio-vis @@ -5,6 +5,7 @@ import os import sys import argparse import yaml +from podio_class_generator import read_upstream_edm from podio_gen.generator_utils import DefinitionError from podio_gen.podio_config_reader import PodioConfigReader @@ -15,31 +16,6 @@ except ImportError: sys.exit(1) -def read_upstream_edm(name_path): - """Read an upstream EDM yaml definition file to make the types that are defined - in that available to the current EDM""" - if name_path is None: - return None - - try: - name, path = name_path.split(":") - except ValueError as err: - raise argparse.ArgumentTypeError( - "upstream-edm argument needs to be the upstream package " - "name and the upstream edm yaml file separated by a colon" - ) from err - - if not os.path.isfile(path): - raise argparse.ArgumentTypeError(f"{path} needs to be an EDM yaml file") - - try: - return PodioConfigReader.read(path, name) - except DefinitionError as err: - raise argparse.ArgumentTypeError( - f"{path} does not contain a valid datamodel definition" - ) from err - - class ModelToGraphviz: """Class to transform a data model description into a graphical representation"""