MCPcopy Create free account
hub / github.com/NSLS2/PyXRF / _get_fpath_not_existing

Function _get_fpath_not_existing

pyxrf/model/load_data_from_db.py:3840–3854  ·  view source on GitHub ↗
(fpath)

Source from the content-addressed store, hash-verified

3838
3839
3840def _get_fpath_not_existing(fpath):
3841 # Returns path to the new file that is guaranteed to not exist
3842 # The function cycles through paths obtained by inserting
3843 # version number between name and extension in the prototype path ``fpath``
3844 # The version number is inserted in the form ``filename_v2.ext``
3845
3846 if os.path.exists(fpath):
3847 p, e = os.path.splitext(fpath)
3848 n = 1
3849 while True:
3850 fpath = f"{p}_v{n}{e}"
3851 if not os.path.exists(fpath):
3852 break
3853 n += 1
3854 return fpath
3855
3856
3857def save_data_to_hdf5(

Callers 2

write_db_to_hdfFunction · 0.85
save_data_to_hdf5Function · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected