Skip to content
Snippets Groups Projects
Commit 59c1519c authored by Tamas Gal's avatar Tamas Gal :speech_balloon:
Browse files

Add latest function

parent c5aff448
No related branches found
No related tags found
No related merge requests found
...@@ -23,6 +23,9 @@ except ImportError: ...@@ -23,6 +23,9 @@ except ImportError:
from contextlib2 import ExitStack from contextlib2 import ExitStack
import atexit import atexit
LATEST_VERSIONS = {
"detx": "detx/detx_v3.detx",
}
def data_path(filename, raise_missing=True): def data_path(filename, raise_missing=True):
...@@ -36,4 +39,10 @@ def data_path(filename, raise_missing=True): ...@@ -36,4 +39,10 @@ def data_path(filename, raise_missing=True):
return str(file_path) return str(file_path)
def latest(dataformat, raise_missing=True):
"""Return the path to the latest version of the given dataformat"""
filename = LATEST_VERSIONS.get(dataformat, "latest." + dataformat)
return data_path(filename, raise_missing=raise_missing)
__all__ = ["data_path"] __all__ = ["data_path"]
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment