cherab.imas.datasets.clear_cacheΒΆ

cherab.imas.datasets.clear_cache(datasets: Callable[[...], str] | Collection[Callable[[...], str]] | None = None) NoneSourceΒΆ

Clean the cherab-imas datasets cache directory.

If a cherab.imas.datasets method or a list/tuple of the same is provided, then clear_cache removes all the data files associated to the passed dataset method callable(s).

By default, it removes all the cached data files.

Parameters:
datasets: Callable[[...], str] | Collection[Callable[[...], str]] | None = NoneΒΆ

cherab.imas.datasets method or a list/tuple of the same whose cached data files are to be removed. If None, all the cached data files are removed.

Examples

>>> from cherab.imas import datasets
>>> data_path = datasets.iter_jintrac()
>>> datasets.clear_cache([datasets.iter_jintrac])
Cleaning the file iter_scenario_53298_seq1_DD4.nc for dataset iter_jintrac

If no argument is passed, all cached dataset files are removed.

>>> datasets.clear_cache()
Cleaning the cache directory ~/Library/Caches/cherab/imas!