This repository has been archived on 2025-04-15. You can view files and clone it, but cannot push or open issues or pull requests.
2023-06-02 16:52:14 +02:00

14 lines
374 B
Python

from .ClusterFile import ClusterFile
from .RawFile import RawFile
from pathlib import Path
def open_file(fname):
"""Convenience function to open files"""
fname = Path(fname)
if fname.suffix == '.clust':
return ClusterFile(fname)
elif fname.suffix == '.json':
return RawFile(fname)
else:
raise ValueError('unsupported file type')