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
401 B

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