1#######################################################################
2# Copyright (C) 2019-present, Blosc Development team <blosc@blosc.org>
3# All rights reserved.
4#
5# This source code is licensed under a BSD-style license (found in the
6# LICENSE file in the root directory of this source tree)
7#######################################################################
8
9from enum import Enum
10import os
11import shutil
12
13
14class Codec(Enum):
15    """
16    Available codecs.
17    """
18    BLOSCLZ = 0
19    LZ4 = 1
20    LZ4HC = 2
21    ZLIB = 4
22    ZSTD = 5
23
24
25class Filter(Enum):
26    """
27    Available filters.
28    """
29    NOFILTER = 0
30    SHUFFLE = 1
31    BITSHUFFLE = 2
32    DELTA = 3
33    TRUNC_PREC = 4
34
35
36def remove(urlpath):
37    """
38    Remove a caterva file.
39
40    Parameters
41    ----------
42    urlpath: String
43        The array urlpath.
44    """
45    if os.path.exists(urlpath):
46        if os.path.isdir(urlpath):
47            shutil.rmtree(urlpath)
48        else:
49            os.remove(urlpath)
50