You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

10 lines
389 B

  1. from nd2reader.parser.v3 import V3Parser
  2. from nd2reader.exc import InvalidVersionError
  3. def get_parser(fh, major_version, minor_version):
  4. parsers = {(3, None): V3Parser}
  5. parser = parsers.get((major_version, minor_version)) or parsers.get((major_version, None))
  6. if not parser:
  7. raise InvalidVersionError("No parser is available for that version.")
  8. return parser(fh)