File: filter_availability.py

package info (click to toggle)
netcdf4-python 1.7.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,604 kB
  • sloc: python: 6,057; ansic: 854; makefile: 15; sh: 2
file content (20 lines) | stat: -rw-r--r-- 671 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
from tempfile import NamedTemporaryFile
from netCDF4 import (
    Dataset,
    __has_zstandard_support__,
    __has_bzip2_support__,
    __has_blosc_support__,
    __has_szip_support__,
)
import os

# True if plugins have been disabled
no_plugins = os.getenv("NO_PLUGINS")


with NamedTemporaryFile(suffix=".nc", delete=False) as tf:
    with Dataset(tf.name, "w") as nc:
        has_zstd_filter = __has_zstandard_support__ and nc.has_zstd_filter()
        has_bzip2_filter = __has_bzip2_support__ and nc.has_bzip2_filter()
        has_blosc_filter = __has_blosc_support__ and nc.has_blosc_filter()
        has_szip_filter = __has_szip_support__ and nc.has_szip_filter()