Jpp 21.0.0
the software that should make you happy
Loading...
Searching...
No Matches
km3net_testdata Namespace Reference

Namespaces

namespace  __main__
 
namespace  data
 

Functions

 data_path (filename, raise_missing=True)
 
 latest (dataformat, raise_missing=True)
 

Variables

 version = distribution(__name__).version
 
 __version__ = version
 
dict LATEST_VERSIONS
 
list __all__ = ["data_path"]
 

Function Documentation

◆ data_path()

km3net_testdata.data_path ( filename,
raise_missing = True )
Return the absolute filepath for a given filename in test data

Definition at line 32 of file __init__.py.

32def data_path(filename, raise_missing=True):
33 """Return the absolute filepath for a given filename in test data"""
34 ref = importlib_resources.files("km3net_testdata.data") / filename
35 file_manager = ExitStack()
36 atexit.register(file_manager.close)
37 file_path = file_manager.enter_context(as_file(ref))
38 if raise_missing and not file_path.exists():
39 raise RuntimeError("Unknown or missing file: {0}".format(filename))
40 return str(file_path)
41
42

◆ latest()

km3net_testdata.latest ( dataformat,
raise_missing = True )
Return the path to the latest version of the given dataformat

Definition at line 43 of file __init__.py.

43def latest(dataformat, raise_missing=True):
44 """Return the path to the latest version of the given dataformat"""
45 filename = LATEST_VERSIONS.get(dataformat, "latest." + dataformat)
46 return data_path(filename, raise_missing=raise_missing)
47
48

Variable Documentation

◆ version

km3net_testdata.version = distribution(__name__).version

Definition at line 24 of file __init__.py.

◆ __version__

km3net_testdata.__version__ = version
private

Definition at line 25 of file __init__.py.

◆ LATEST_VERSIONS

dict km3net_testdata.LATEST_VERSIONS
Initial value:
1= {
2 "detx": "detx/detx_v3.detx",
3}

Definition at line 27 of file __init__.py.

◆ __all__

list km3net_testdata.__all__ = ["data_path"]
private

Definition at line 49 of file __init__.py.