netCDF4 1.7.2__tar.gz → 1.7.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {netcdf4-1.7.2 → netcdf4-1.7.3}/.github/workflows/build_latest.yml +23 -14
- {netcdf4-1.7.2 → netcdf4-1.7.3}/.github/workflows/build_master.yml +17 -11
- {netcdf4-1.7.2 → netcdf4-1.7.3}/.github/workflows/build_old.yml +20 -12
- {netcdf4-1.7.2 → netcdf4-1.7.3}/.github/workflows/cibuildwheel.yml +21 -49
- {netcdf4-1.7.2 → netcdf4-1.7.3}/.github/workflows/miniconda.yml +3 -3
- {netcdf4-1.7.2 → netcdf4-1.7.3}/Changelog +11 -0
- {netcdf4-1.7.2 → netcdf4-1.7.3}/MANIFEST.in +0 -1
- {netcdf4-1.7.2/src/netCDF4.egg-info → netcdf4-1.7.3}/PKG-INFO +11 -8
- {netcdf4-1.7.2 → netcdf4-1.7.3}/README.md +2 -0
- {netcdf4-1.7.2 → netcdf4-1.7.3}/docs/index.html +78 -22
- {netcdf4-1.7.2 → netcdf4-1.7.3}/include/membuf.pyx +1 -1
- {netcdf4-1.7.2 → netcdf4-1.7.3}/pyproject.toml +58 -9
- {netcdf4-1.7.2 → netcdf4-1.7.3}/setup.py +32 -3
- {netcdf4-1.7.2 → netcdf4-1.7.3}/src/netCDF4/__init__.pyi +13 -3
- {netcdf4-1.7.2 → netcdf4-1.7.3}/src/netCDF4/_netCDF4.pyx +64 -54
- {netcdf4-1.7.2 → netcdf4-1.7.3}/src/netCDF4/utils.py +6 -6
- {netcdf4-1.7.2 → netcdf4-1.7.3/src/netCDF4.egg-info}/PKG-INFO +11 -8
- {netcdf4-1.7.2 → netcdf4-1.7.3}/src/netCDF4.egg-info/SOURCES.txt +1 -0
- {netcdf4-1.7.2 → netcdf4-1.7.3}/src/netCDF4.egg-info/requires.txt +4 -0
- {netcdf4-1.7.2 → netcdf4-1.7.3}/test/test_cdl.py +10 -0
- netcdf4-1.7.3/test/test_no_iter_contains.py +34 -0
- {netcdf4-1.7.2 → netcdf4-1.7.3}/test/test_open_mem.py +0 -6
- {netcdf4-1.7.2 → netcdf4-1.7.3}/test/test_vlen.py +9 -0
- {netcdf4-1.7.2 → netcdf4-1.7.3}/.github/dependabot.yml +0 -0
- {netcdf4-1.7.2 → netcdf4-1.7.3}/.github/stubtest-allowlist +0 -0
- {netcdf4-1.7.2 → netcdf4-1.7.3}/.gitmodules +0 -0
- {netcdf4-1.7.2 → netcdf4-1.7.3}/LICENSE +0 -0
- {netcdf4-1.7.2 → netcdf4-1.7.3}/README.htmldocs +0 -0
- {netcdf4-1.7.2 → netcdf4-1.7.3}/README.release +0 -0
- {netcdf4-1.7.2 → netcdf4-1.7.3}/checkversion.py +0 -0
- {netcdf4-1.7.2 → netcdf4-1.7.3}/create_docs.sh +0 -0
- {netcdf4-1.7.2 → netcdf4-1.7.3}/examples/README.md +0 -0
- {netcdf4-1.7.2 → netcdf4-1.7.3}/examples/bench.py +0 -0
- {netcdf4-1.7.2 → netcdf4-1.7.3}/examples/bench_compress.py +0 -0
- {netcdf4-1.7.2 → netcdf4-1.7.3}/examples/bench_compress2.py +0 -0
- {netcdf4-1.7.2 → netcdf4-1.7.3}/examples/bench_compress3.py +0 -0
- {netcdf4-1.7.2 → netcdf4-1.7.3}/examples/bench_compress4.py +0 -0
- {netcdf4-1.7.2 → netcdf4-1.7.3}/examples/bench_diskless.py +0 -0
- {netcdf4-1.7.2 → netcdf4-1.7.3}/examples/complex_numbers.py +0 -0
- {netcdf4-1.7.2 → netcdf4-1.7.3}/examples/json_att.py +0 -0
- {netcdf4-1.7.2 → netcdf4-1.7.3}/examples/mpi_example.py +0 -0
- {netcdf4-1.7.2 → netcdf4-1.7.3}/examples/mpi_example_compressed.py +0 -0
- {netcdf4-1.7.2 → netcdf4-1.7.3}/examples/reading_netCDF.ipynb +0 -0
- {netcdf4-1.7.2 → netcdf4-1.7.3}/examples/subset.py +0 -0
- {netcdf4-1.7.2 → netcdf4-1.7.3}/examples/test_stringarr.py +0 -0
- {netcdf4-1.7.2 → netcdf4-1.7.3}/examples/threaded_read.py +0 -0
- {netcdf4-1.7.2 → netcdf4-1.7.3}/examples/tutorial.py +0 -0
- {netcdf4-1.7.2 → netcdf4-1.7.3}/examples/writing_netCDF.ipynb +0 -0
- {netcdf4-1.7.2 → netcdf4-1.7.3}/external/README +0 -0
- {netcdf4-1.7.2 → netcdf4-1.7.3}/external/nc_complex/include/generated_fallbacks/nc_complex_version.h +0 -0
- {netcdf4-1.7.2 → netcdf4-1.7.3}/external/nc_complex/include/nc_complex/nc_complex.h +0 -0
- {netcdf4-1.7.2 → netcdf4-1.7.3}/external/nc_complex/src/nc_complex.c +0 -0
- {netcdf4-1.7.2 → netcdf4-1.7.3}/include/mpi-compat.h +0 -0
- {netcdf4-1.7.2 → netcdf4-1.7.3}/include/netCDF4.pxi +0 -0
- {netcdf4-1.7.2 → netcdf4-1.7.3}/include/netcdf-compat.h +0 -0
- {netcdf4-1.7.2 → netcdf4-1.7.3}/include/no_parallel_support_imports.pxi.in +0 -0
- {netcdf4-1.7.2 → netcdf4-1.7.3}/include/parallel_support_imports.pxi.in +0 -0
- {netcdf4-1.7.2 → netcdf4-1.7.3}/man/nc3tonc4.1 +0 -0
- {netcdf4-1.7.2 → netcdf4-1.7.3}/man/nc4tonc3.1 +0 -0
- {netcdf4-1.7.2 → netcdf4-1.7.3}/man/ncinfo.1 +0 -0
- {netcdf4-1.7.2 → netcdf4-1.7.3}/setup.cfg +0 -0
- {netcdf4-1.7.2 → netcdf4-1.7.3}/src/netCDF4/__init__.py +0 -0
- {netcdf4-1.7.2 → netcdf4-1.7.3}/src/netCDF4/_netCDF4.pyi +0 -0
- {netcdf4-1.7.2 → netcdf4-1.7.3}/src/netCDF4/plugins/empty.txt +0 -0
- {netcdf4-1.7.2 → netcdf4-1.7.3}/src/netCDF4/py.typed +0 -0
- {netcdf4-1.7.2 → netcdf4-1.7.3}/src/netCDF4.egg-info/dependency_links.txt +0 -0
- {netcdf4-1.7.2 → netcdf4-1.7.3}/src/netCDF4.egg-info/entry_points.txt +0 -0
- {netcdf4-1.7.2 → netcdf4-1.7.3}/src/netCDF4.egg-info/top_level.txt +0 -0
- {netcdf4-1.7.2 → netcdf4-1.7.3}/test/20171025_2056.Cloud_Top_Height.nc +0 -0
- {netcdf4-1.7.2 → netcdf4-1.7.3}/test/CRM032_test1.nc +0 -0
- {netcdf4-1.7.2 → netcdf4-1.7.3}/test/__init__.py +0 -0
- {netcdf4-1.7.2 → netcdf4-1.7.3}/test/filter_availability.py +0 -0
- {netcdf4-1.7.2 → netcdf4-1.7.3}/test/issue1152.nc +0 -0
- {netcdf4-1.7.2 → netcdf4-1.7.3}/test/issue671.nc +0 -0
- {netcdf4-1.7.2 → netcdf4-1.7.3}/test/issue672.nc +0 -0
- {netcdf4-1.7.2 → netcdf4-1.7.3}/test/netcdf_dummy_file.nc +0 -0
- {netcdf4-1.7.2 → netcdf4-1.7.3}/test/run_all.py +0 -0
- {netcdf4-1.7.2 → netcdf4-1.7.3}/test/test_Unsigned.py +0 -0
- {netcdf4-1.7.2 → netcdf4-1.7.3}/test/test_alignment.py +0 -0
- {netcdf4-1.7.2 → netcdf4-1.7.3}/test/test_atts.py +0 -0
- {netcdf4-1.7.2 → netcdf4-1.7.3}/test/test_cdf5.py +0 -0
- {netcdf4-1.7.2 → netcdf4-1.7.3}/test/test_chunk_cache.py +0 -0
- {netcdf4-1.7.2 → netcdf4-1.7.3}/test/test_complex.py +0 -0
- {netcdf4-1.7.2 → netcdf4-1.7.3}/test/test_compound_alignment.py +0 -0
- {netcdf4-1.7.2 → netcdf4-1.7.3}/test/test_compoundatt.py +0 -0
- {netcdf4-1.7.2 → netcdf4-1.7.3}/test/test_compoundvar.py +0 -0
- {netcdf4-1.7.2 → netcdf4-1.7.3}/test/test_compression.py +0 -0
- {netcdf4-1.7.2 → netcdf4-1.7.3}/test/test_compression_blosc.py +0 -0
- {netcdf4-1.7.2 → netcdf4-1.7.3}/test/test_compression_bzip2.py +0 -0
- {netcdf4-1.7.2 → netcdf4-1.7.3}/test/test_compression_quant.py +0 -0
- {netcdf4-1.7.2 → netcdf4-1.7.3}/test/test_compression_szip.py +0 -0
- {netcdf4-1.7.2 → netcdf4-1.7.3}/test/test_compression_zstd.py +0 -0
- {netcdf4-1.7.2 → netcdf4-1.7.3}/test/test_create_mem.py +0 -0
- {netcdf4-1.7.2 → netcdf4-1.7.3}/test/test_dap.py +0 -0
- {netcdf4-1.7.2 → netcdf4-1.7.3}/test/test_dims.py +0 -0
- {netcdf4-1.7.2 → netcdf4-1.7.3}/test/test_diskless.py +0 -0
- {netcdf4-1.7.2 → netcdf4-1.7.3}/test/test_endian.py +0 -0
- {netcdf4-1.7.2 → netcdf4-1.7.3}/test/test_enum.py +0 -0
- {netcdf4-1.7.2 → netcdf4-1.7.3}/test/test_fancyslicing.py +0 -0
- {netcdf4-1.7.2 → netcdf4-1.7.3}/test/test_filepath.py +0 -0
- {netcdf4-1.7.2 → netcdf4-1.7.3}/test/test_get_fill_value.py +0 -0
- {netcdf4-1.7.2 → netcdf4-1.7.3}/test/test_get_variables_by_attributes.py +0 -0
- {netcdf4-1.7.2 → netcdf4-1.7.3}/test/test_gold.nc +0 -0
- {netcdf4-1.7.2 → netcdf4-1.7.3}/test/test_grps.py +0 -0
- {netcdf4-1.7.2 → netcdf4-1.7.3}/test/test_grps2.py +0 -0
- {netcdf4-1.7.2 → netcdf4-1.7.3}/test/test_issue908.py +0 -0
- {netcdf4-1.7.2 → netcdf4-1.7.3}/test/test_masked.py +0 -0
- {netcdf4-1.7.2 → netcdf4-1.7.3}/test/test_masked2.py +0 -0
- {netcdf4-1.7.2 → netcdf4-1.7.3}/test/test_masked3.py +0 -0
- {netcdf4-1.7.2 → netcdf4-1.7.3}/test/test_masked4.py +0 -0
- {netcdf4-1.7.2 → netcdf4-1.7.3}/test/test_masked5.py +0 -0
- {netcdf4-1.7.2 → netcdf4-1.7.3}/test/test_masked6.py +0 -0
- {netcdf4-1.7.2 → netcdf4-1.7.3}/test/test_multifile.py +0 -0
- {netcdf4-1.7.2 → netcdf4-1.7.3}/test/test_multifile2.py +0 -0
- {netcdf4-1.7.2 → netcdf4-1.7.3}/test/test_multiple_open_close.py +0 -0
- {netcdf4-1.7.2 → netcdf4-1.7.3}/test/test_ncrc.py +0 -0
- {netcdf4-1.7.2 → netcdf4-1.7.3}/test/test_refcount.py +0 -0
- {netcdf4-1.7.2 → netcdf4-1.7.3}/test/test_rename.py +0 -0
- {netcdf4-1.7.2 → netcdf4-1.7.3}/test/test_scalarvar.py +0 -0
- {netcdf4-1.7.2 → netcdf4-1.7.3}/test/test_scaled.py +0 -0
- {netcdf4-1.7.2 → netcdf4-1.7.3}/test/test_shape.py +0 -0
- {netcdf4-1.7.2 → netcdf4-1.7.3}/test/test_slicing.py +0 -0
- {netcdf4-1.7.2 → netcdf4-1.7.3}/test/test_stringarr.py +0 -0
- {netcdf4-1.7.2 → netcdf4-1.7.3}/test/test_types.py +0 -0
- {netcdf4-1.7.2 → netcdf4-1.7.3}/test/test_unicode.py +0 -0
- {netcdf4-1.7.2 → netcdf4-1.7.3}/test/test_unicodeatt.py +0 -0
- {netcdf4-1.7.2 → netcdf4-1.7.3}/test/test_unlimdim.py +0 -0
- {netcdf4-1.7.2 → netcdf4-1.7.3}/test/test_utils.py +0 -0
- {netcdf4-1.7.2 → netcdf4-1.7.3}/test/test_vars.py +0 -0
- {netcdf4-1.7.2 → netcdf4-1.7.3}/test/ubyte.nc +0 -0
|
@@ -5,30 +5,32 @@ jobs:
|
|
|
5
5
|
name: Python (${{ matrix.python-version }})
|
|
6
6
|
runs-on: ubuntu-latest
|
|
7
7
|
env:
|
|
8
|
-
PNETCDF_VERSION: 1.
|
|
9
|
-
NETCDF_VERSION: 4.9.
|
|
8
|
+
PNETCDF_VERSION: 1.14.1
|
|
9
|
+
NETCDF_VERSION: 4.9.3
|
|
10
10
|
NETCDF_DIR: ${{ github.workspace }}/..
|
|
11
11
|
NETCDF_EXTRA_CONFIG: --enable-pnetcdf
|
|
12
|
-
CC: mpicc.mpich
|
|
12
|
+
#CC: mpicc.mpich
|
|
13
|
+
CC: mpicc
|
|
13
14
|
#NO_NET: 1
|
|
14
15
|
strategy:
|
|
15
16
|
matrix:
|
|
16
|
-
python-version: ["3.
|
|
17
|
+
python-version: ["3.14"]
|
|
17
18
|
steps:
|
|
18
19
|
|
|
19
|
-
- uses: actions/checkout@
|
|
20
|
+
- uses: actions/checkout@v5
|
|
20
21
|
with:
|
|
21
22
|
submodules: true
|
|
22
23
|
|
|
23
24
|
- name: Set up Python ${{ matrix.python-version }}
|
|
24
|
-
uses: actions/setup-python@
|
|
25
|
+
uses: actions/setup-python@v6
|
|
25
26
|
with:
|
|
26
27
|
python-version: ${{ matrix.python-version }}
|
|
27
28
|
|
|
28
29
|
- name: Install Ubuntu Dependencies
|
|
29
30
|
run: |
|
|
30
31
|
sudo apt-get update
|
|
31
|
-
sudo apt-get install mpich libmpich-dev libhdf5-mpich-dev libcurl4-openssl-dev bzip2 libsnappy-dev libblosc-dev libzstd-dev
|
|
32
|
+
#sudo apt-get install mpich libmpich-dev libhdf5-mpich-dev openmpi-bin openmpi-common libopenmpi-dev libhdf5-openmpi-dev libcurl4-openssl-dev bzip2 libsnappy-dev libblosc-dev libzstd-dev
|
|
33
|
+
sudo apt-get install openmpi-common libopenmpi-dev openmpi-bin libhdf5-openmpi-dev libcurl4-openssl-dev bzip2 libsnappy-dev libblosc-dev libzstd-dev
|
|
32
34
|
echo "Download and build PnetCDF version ${PNETCDF_VERSION}"
|
|
33
35
|
wget https://parallel-netcdf.github.io/Release/pnetcdf-${PNETCDF_VERSION}.tar.gz
|
|
34
36
|
tar -xzf pnetcdf-${PNETCDF_VERSION}.tar.gz
|
|
@@ -41,9 +43,12 @@ jobs:
|
|
|
41
43
|
wget https://downloads.unidata.ucar.edu/netcdf-c/${NETCDF_VERSION}/netcdf-c-${NETCDF_VERSION}.tar.gz
|
|
42
44
|
tar -xzf netcdf-c-${NETCDF_VERSION}.tar.gz
|
|
43
45
|
pushd netcdf-c-${NETCDF_VERSION}
|
|
44
|
-
export CPPFLAGS="-I/usr/include/hdf5/mpich -I${NETCDF_DIR}/include"
|
|
46
|
+
#export CPPFLAGS="-I/usr/include/hdf5/mpich -I${NETCDF_DIR}/include"
|
|
47
|
+
export CPPFLAGS="-I/usr/include/hdf5/openmpi -I${NETCDF_DIR}/include"
|
|
45
48
|
export LDFLAGS="-L${NETCDF_DIR}/lib"
|
|
46
|
-
export LIBS="-lhdf5_mpich_hl -lhdf5_mpich -lm -lz"
|
|
49
|
+
#export LIBS="-lhdf5_mpich_hl -lhdf5_mpich -lm -lz"
|
|
50
|
+
export LIBS="-lhdf5_openmpi_hl -lhdf5_openmpi -lm -lz"
|
|
51
|
+
which $CC
|
|
47
52
|
./configure --prefix $NETCDF_DIR --enable-netcdf-4 --enable-shared --enable-dap --enable-parallel4 $NETCDF_EXTRA_CONFIG
|
|
48
53
|
make -j 2
|
|
49
54
|
sudo make install
|
|
@@ -58,13 +63,14 @@ jobs:
|
|
|
58
63
|
- name: Install python dependencies via pip
|
|
59
64
|
run: |
|
|
60
65
|
python -m pip install --upgrade pip
|
|
61
|
-
pip install numpy cython cftime pytest twine wheel check-manifest mpi4py typing-extensions
|
|
66
|
+
python -m pip install numpy cython cftime pytest twine wheel check-manifest mpi4py typing-extensions
|
|
62
67
|
|
|
63
68
|
- name: Install netcdf4-python
|
|
64
69
|
run: |
|
|
65
70
|
export PATH=${NETCDF_DIR}/bin:${PATH}
|
|
66
71
|
export NETCDF_PLUGIN_DIR=${{ github.workspace }}/netcdf-c-${NETCDF_VERSION}/plugins/plugindir
|
|
67
|
-
python
|
|
72
|
+
python -m pip install . --no-build-isolation
|
|
73
|
+
|
|
68
74
|
- name: Test
|
|
69
75
|
run: |
|
|
70
76
|
export PATH=${NETCDF_DIR}/bin:${PATH}
|
|
@@ -74,21 +80,24 @@ jobs:
|
|
|
74
80
|
python run_all.py
|
|
75
81
|
# parallel (hdf5 for netcdf4, pnetcdf for netcdf3)
|
|
76
82
|
cd ../examples
|
|
77
|
-
mpirun.mpich -np 4 python mpi_example.py
|
|
83
|
+
#mpirun.mpich -np 4 python mpi_example.py
|
|
84
|
+
mpirun -np 4 --oversubscribe python mpi_example.py
|
|
78
85
|
if [ $? -ne 0 ] ; then
|
|
79
86
|
echo "hdf5 mpi test failed!"
|
|
80
87
|
exit 1
|
|
81
88
|
else
|
|
82
89
|
echo "hdf5 mpi test passed!"
|
|
83
90
|
fi
|
|
84
|
-
mpirun.mpich -np 4 python mpi_example_compressed.py
|
|
91
|
+
#mpirun.mpich -np 4 python mpi_example_compressed.py
|
|
92
|
+
mpirun -np 4 --oversubscribe python mpi_example_compressed.py
|
|
85
93
|
if [ $? -ne 0 ] ; then
|
|
86
94
|
echo "hdf5 compressed mpi test failed!"
|
|
87
95
|
exit 1
|
|
88
96
|
else
|
|
89
97
|
echo "hdf5 compressed mpi test passed!"
|
|
90
98
|
fi
|
|
91
|
-
mpirun.mpich -np 4 python mpi_example.py NETCDF3_64BIT_DATA
|
|
99
|
+
#mpirun.mpich -np 4 python mpi_example.py NETCDF3_64BIT_DATA
|
|
100
|
+
mpirun -np 4 --oversubscribe python mpi_example.py NETCDF3_64BIT_DATA
|
|
92
101
|
if [ $? -ne 0 ] ; then
|
|
93
102
|
echo "pnetcdf mpi test failed!"
|
|
94
103
|
exit 1
|
|
@@ -6,32 +6,36 @@ jobs:
|
|
|
6
6
|
runs-on: ubuntu-latest
|
|
7
7
|
env:
|
|
8
8
|
NETCDF_DIR: ${{ github.workspace }}/..
|
|
9
|
-
CC: mpicc.mpich
|
|
9
|
+
#CC: mpicc.mpich
|
|
10
|
+
CC: mpicc
|
|
10
11
|
#NO_NET: 1
|
|
11
12
|
strategy:
|
|
12
13
|
matrix:
|
|
13
|
-
python-version: ["3.
|
|
14
|
+
python-version: ["3.14"]
|
|
14
15
|
steps:
|
|
15
16
|
|
|
16
|
-
- uses: actions/checkout@
|
|
17
|
+
- uses: actions/checkout@v5
|
|
17
18
|
with:
|
|
18
19
|
submodules: true
|
|
19
20
|
|
|
20
21
|
- name: Set up Python ${{ matrix.python-version }}
|
|
21
|
-
uses: actions/setup-python@
|
|
22
|
+
uses: actions/setup-python@v6
|
|
22
23
|
with:
|
|
23
24
|
python-version: ${{ matrix.python-version }}
|
|
24
25
|
|
|
25
26
|
- name: Install Ubuntu Dependencies
|
|
26
27
|
run: |
|
|
27
28
|
sudo apt-get update
|
|
28
|
-
sudo apt-get install mpich libmpich-dev libhdf5-mpich-dev libcurl4-openssl-dev bzip2 libsnappy-dev libblosc-dev libzstd-dev
|
|
29
|
+
#sudo apt-get install mpich libmpich-dev libhdf5-mpich-dev libcurl4-openssl-dev bzip2 libsnappy-dev libblosc-dev libzstd-dev
|
|
30
|
+
sudo apt-get install openmpi-common libopenmpi-dev openmpi-bin libhdf5-openmpi-dev libcurl4-openssl-dev bzip2 libsnappy-dev libblosc-dev libzstd-dev
|
|
29
31
|
echo "Download and build netCDF github master"
|
|
30
32
|
git clone https://github.com/Unidata/netcdf-c
|
|
31
33
|
pushd netcdf-c
|
|
32
|
-
export CPPFLAGS="-I/usr/include/hdf5/mpich -I${NETCDF_DIR}/include"
|
|
34
|
+
#export CPPFLAGS="-I/usr/include/hdf5/mpich -I${NETCDF_DIR}/include"
|
|
35
|
+
export CPPFLAGS="-I/usr/include/hdf5/openmpi -I${NETCDF_DIR}/include"
|
|
33
36
|
export LDFLAGS="-L${NETCDF_DIR}/lib"
|
|
34
|
-
export LIBS="-lhdf5_mpich_hl -lhdf5_mpich -lm -lz"
|
|
37
|
+
#export LIBS="-lhdf5_mpich_hl -lhdf5_mpich -lm -lz"
|
|
38
|
+
export LIBS="-lhdf5_openmpi_hl -lhdf5_openmpi -lm -lz"
|
|
35
39
|
autoreconf -i
|
|
36
40
|
./configure --prefix $NETCDF_DIR --enable-netcdf-4 --enable-shared --enable-dap --enable-parallel4
|
|
37
41
|
make -j 2
|
|
@@ -47,13 +51,13 @@ jobs:
|
|
|
47
51
|
- name: Install python dependencies via pip
|
|
48
52
|
run: |
|
|
49
53
|
python -m pip install --upgrade pip
|
|
50
|
-
pip install numpy cython cftime pytest twine wheel check-manifest mpi4py mypy types-setuptools typing-extensions
|
|
54
|
+
python -m pip install numpy cython cftime pytest twine wheel check-manifest mpi4py mypy types-setuptools typing-extensions
|
|
51
55
|
|
|
52
56
|
- name: Install netcdf4-python
|
|
53
57
|
run: |
|
|
54
58
|
export PATH=${NETCDF_DIR}/bin:${PATH}
|
|
55
59
|
export NETCDF_PLUGIN_DIR=${{ github.workspace }}/netcdf-c/plugins/plugindir
|
|
56
|
-
python
|
|
60
|
+
python -m pip install . --no-build-isolation
|
|
57
61
|
|
|
58
62
|
- name: Test
|
|
59
63
|
run: |
|
|
@@ -65,14 +69,16 @@ jobs:
|
|
|
65
69
|
python run_all.py
|
|
66
70
|
# parallel
|
|
67
71
|
cd ../examples
|
|
68
|
-
mpirun.mpich -np 4 python mpi_example.py
|
|
72
|
+
#mpirun.mpich -np 4 python mpi_example.py
|
|
73
|
+
mpirun -np 4 --oversubscribe python mpi_example.py
|
|
69
74
|
if [ $? -ne 0 ] ; then
|
|
70
75
|
echo "hdf5 mpi test failed!"
|
|
71
76
|
exit 1
|
|
72
77
|
else
|
|
73
78
|
echo "hdf5 mpi test passed!"
|
|
74
79
|
fi
|
|
75
|
-
mpirun.mpich -np 4 python mpi_example_compressed.py
|
|
80
|
+
#mpirun.mpich -np 4 python mpi_example_compressed.py
|
|
81
|
+
mpirun -np 4 --oversubscribe python mpi_example_compressed.py
|
|
76
82
|
if [ $? -ne 0 ] ; then
|
|
77
83
|
echo "hdf5 compressed mpi test failed!"
|
|
78
84
|
exit 1
|
|
@@ -9,26 +9,28 @@ jobs:
|
|
|
9
9
|
NETCDF_VERSION: 4.7.4
|
|
10
10
|
NETCDF_DIR: ${{ github.workspace }}/..
|
|
11
11
|
NETCDF_EXTRA_CONFIG: --enable-pnetcdf
|
|
12
|
-
CC: mpicc.mpich
|
|
12
|
+
#CC: mpicc.mpich
|
|
13
|
+
CC: mpicc
|
|
13
14
|
#NO_NET: 1
|
|
14
15
|
strategy:
|
|
15
16
|
matrix:
|
|
16
|
-
python-version: ["3.
|
|
17
|
+
python-version: ["3.14"]
|
|
17
18
|
steps:
|
|
18
19
|
|
|
19
|
-
- uses: actions/checkout@
|
|
20
|
+
- uses: actions/checkout@v5
|
|
20
21
|
with:
|
|
21
22
|
submodules: true
|
|
22
23
|
|
|
23
24
|
- name: Set up Python ${{ matrix.python-version }}
|
|
24
|
-
uses: actions/setup-python@
|
|
25
|
+
uses: actions/setup-python@v6
|
|
25
26
|
with:
|
|
26
27
|
python-version: ${{ matrix.python-version }}
|
|
27
28
|
|
|
28
29
|
- name: Install Ubuntu Dependencies
|
|
29
30
|
run: |
|
|
30
31
|
sudo apt-get update
|
|
31
|
-
sudo apt-get install mpich libmpich-dev libhdf5-mpich-dev libcurl4-openssl-dev bzip2 libsnappy-dev libblosc-dev libzstd-dev
|
|
32
|
+
#sudo apt-get install mpich libmpich-dev libhdf5-mpich-dev libcurl4-openssl-dev bzip2 libsnappy-dev libblosc-dev libzstd-dev
|
|
33
|
+
sudo apt-get install openmpi-common libopenmpi-dev openmpi-bin libhdf5-openmpi-dev libcurl4-openssl-dev bzip2 libsnappy-dev libblosc-dev libzstd-dev
|
|
32
34
|
echo "Download and build PnetCDF version ${PNETCDF_VERSION}"
|
|
33
35
|
wget https://parallel-netcdf.github.io/Release/pnetcdf-${PNETCDF_VERSION}.tar.gz
|
|
34
36
|
tar -xzf pnetcdf-${PNETCDF_VERSION}.tar.gz
|
|
@@ -42,9 +44,11 @@ jobs:
|
|
|
42
44
|
wget https://www.gfd-dennou.org/arch/netcdf/unidata-mirror/netcdf-c-${NETCDF_VERSION}.tar.gz
|
|
43
45
|
tar -xzf netcdf-c-${NETCDF_VERSION}.tar.gz
|
|
44
46
|
pushd netcdf-c-${NETCDF_VERSION}
|
|
45
|
-
export CPPFLAGS="-I/usr/include/hdf5/mpich -I${NETCDF_DIR}/include"
|
|
47
|
+
#export CPPFLAGS="-I/usr/include/hdf5/mpich -I${NETCDF_DIR}/include"
|
|
48
|
+
export CPPFLAGS="-I/usr/include/hdf5/openmpi -I${NETCDF_DIR}/include"
|
|
46
49
|
export LDFLAGS="-L${NETCDF_DIR}/lib"
|
|
47
|
-
export LIBS="-lhdf5_mpich_hl -lhdf5_mpich -lm -lz"
|
|
50
|
+
#export LIBS="-lhdf5_mpich_hl -lhdf5_mpich -lm -lz"
|
|
51
|
+
export LIBS="-lhdf5_openmpi_hl -lhdf5_openmpi -lm -lz"
|
|
48
52
|
./configure --prefix $NETCDF_DIR --enable-netcdf-4 --enable-shared --enable-dap --enable-parallel4 $NETCDF_EXTRA_CONFIG
|
|
49
53
|
make -j 2
|
|
50
54
|
sudo make install
|
|
@@ -59,13 +63,14 @@ jobs:
|
|
|
59
63
|
- name: Install python dependencies via pip
|
|
60
64
|
run: |
|
|
61
65
|
python -m pip install --upgrade pip
|
|
62
|
-
pip install numpy cython cftime pytest twine wheel check-manifest mpi4py typing-extensions
|
|
66
|
+
python -m pip install numpy cython cftime pytest twine wheel check-manifest mpi4py typing-extensions
|
|
63
67
|
|
|
64
68
|
- name: Install netcdf4-python
|
|
65
69
|
run: |
|
|
66
70
|
export PATH=${NETCDF_DIR}/bin:${PATH}
|
|
67
71
|
export NETCDF_PLUGIN_DIR=${{ github.workspace }}/netcdf-c-${NETCDF_VERSION}/plugins/plugindir
|
|
68
|
-
python
|
|
72
|
+
python -m pip install . --no-build-isolation
|
|
73
|
+
|
|
69
74
|
- name: Test
|
|
70
75
|
run: |
|
|
71
76
|
export PATH=${NETCDF_DIR}/bin:${PATH}
|
|
@@ -75,21 +80,24 @@ jobs:
|
|
|
75
80
|
python run_all.py
|
|
76
81
|
# parallel (hdf5 for netcdf4, pnetcdf for netcdf3)
|
|
77
82
|
cd ../examples
|
|
78
|
-
mpirun.mpich -np 4 python mpi_example.py
|
|
83
|
+
#mpirun.mpich -np 4 python mpi_example.py
|
|
84
|
+
mpirun -np 4 --oversubscribe python mpi_example.py
|
|
79
85
|
if [ $? -ne 0 ] ; then
|
|
80
86
|
echo "hdf5 mpi test failed!"
|
|
81
87
|
exit 1
|
|
82
88
|
else
|
|
83
89
|
echo "hdf5 mpi test passed!"
|
|
84
90
|
fi
|
|
85
|
-
mpirun.mpich -np 4 python mpi_example_compressed.py
|
|
91
|
+
#mpirun.mpich -np 4 python mpi_example_compressed.py
|
|
92
|
+
mpirun -np 4 --oversubscribe python mpi_example_compressed.py
|
|
86
93
|
if [ $? -ne 0 ] ; then
|
|
87
94
|
echo "hdf5 compressed mpi test failed!"
|
|
88
95
|
exit 1
|
|
89
96
|
else
|
|
90
97
|
echo "hdf5 compressed mpi test passed!"
|
|
91
98
|
fi
|
|
92
|
-
mpirun.mpich -np 4 python mpi_example.py NETCDF3_64BIT_DATA
|
|
99
|
+
#mpirun.mpich -np 4 python mpi_example.py NETCDF3_64BIT_DATA
|
|
100
|
+
mpirun -np 4 --oversubscribe python mpi_example.py NETCDF3_64BIT_DATA
|
|
93
101
|
if [ $? -ne 0 ] ; then
|
|
94
102
|
echo "pnetcdf mpi test failed!"
|
|
95
103
|
exit 1
|
|
@@ -18,11 +18,11 @@ jobs:
|
|
|
18
18
|
name: Build source distribution
|
|
19
19
|
runs-on: ubuntu-22.04
|
|
20
20
|
steps:
|
|
21
|
-
- uses: actions/checkout@
|
|
21
|
+
- uses: actions/checkout@v5
|
|
22
22
|
with:
|
|
23
23
|
fetch-depth: 0
|
|
24
24
|
|
|
25
|
-
- uses: actions/setup-python@
|
|
25
|
+
- uses: actions/setup-python@v6
|
|
26
26
|
name: Install Python
|
|
27
27
|
with:
|
|
28
28
|
python-version: 3.x
|
|
@@ -59,13 +59,11 @@ jobs:
|
|
|
59
59
|
arch: aarch64
|
|
60
60
|
- os: macos-14
|
|
61
61
|
arch: arm64
|
|
62
|
-
|
|
63
|
-
- os: macos-12
|
|
62
|
+
- os: macos-13
|
|
64
63
|
arch: x86_64
|
|
65
|
-
CIBW_ENVIRONMENT: MACOSX_DEPLOYMENT_TARGET=12.0
|
|
66
64
|
|
|
67
65
|
steps:
|
|
68
|
-
- uses: actions/checkout@
|
|
66
|
+
- uses: actions/checkout@v5
|
|
69
67
|
with:
|
|
70
68
|
fetch-depth: 0
|
|
71
69
|
|
|
@@ -80,33 +78,20 @@ jobs:
|
|
|
80
78
|
shell: bash
|
|
81
79
|
# On PRs we run only oldest and newest Python versions to reduce CI load.
|
|
82
80
|
# Skips pypy and musllinux everywhere.
|
|
83
|
-
# We are
|
|
81
|
+
# We are building 310, 311 and 314 for now.
|
|
82
|
+
# (3.11 is the oldest version for which we support abi3 wheels)
|
|
84
83
|
# These needs to rotate every new Python release.
|
|
85
84
|
run: |
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
echo "CIBW_SKIP=$CIBW_SKIP" >> $GITHUB_ENV
|
|
92
|
-
echo "Setting CIBW_SKIP=$CIBW_SKIP"
|
|
85
|
+
set -x
|
|
86
|
+
echo "CIBW_BUILD=cp310-* cp311-* cp314-*" >> $GITHUB_ENV
|
|
87
|
+
set +x
|
|
88
|
+
|
|
89
|
+
if: ${{ github.event_name }} == "pull_request"
|
|
93
90
|
|
|
94
91
|
- name: "Building ${{ matrix.os }} (${{ matrix.arch }}) wheels"
|
|
95
|
-
uses: pypa/cibuildwheel@
|
|
92
|
+
uses: pypa/cibuildwheel@v3.2.0
|
|
96
93
|
env:
|
|
97
|
-
CIBW_SKIP: ${{ env.CIBW_SKIP }}
|
|
98
94
|
CIBW_ARCHS: ${{ matrix.arch }}
|
|
99
|
-
CIBW_BUILD_FRONTEND: build
|
|
100
|
-
CIBW_MANYLINUX_X86_64_IMAGE: ghcr.io/ocefpaf/manylinux2014_x86_64-netcdf
|
|
101
|
-
CIBW_MANYLINUX_AARCH64_IMAGE: ghcr.io/ocefpaf/manylinux2014_aarch64-netcdf
|
|
102
|
-
# Emulation testing is slow, testing only latest Python.
|
|
103
|
-
CIBW_TEST_SKIP: "cp38-*_aarch64 cp39-*_aarch64 cp310-*_aarch64 cp311-*_aarch64"
|
|
104
|
-
CIBW_ENVIRONMENT: ${{ matrix.CIBW_ENVIRONMENT }}
|
|
105
|
-
CIBW_BEFORE_BUILD_MACOS: brew install hdf5 netcdf
|
|
106
|
-
CIBW_TEST_REQUIRES: pytest cython packaging typing-extensions
|
|
107
|
-
CIBW_TEST_COMMAND: >
|
|
108
|
-
python -c "import netCDF4; print(f'netCDF4 v{netCDF4.__version__}')"
|
|
109
|
-
&& pytest -s -rxs -v {project}/test
|
|
110
95
|
|
|
111
96
|
- uses: actions/upload-artifact@v4
|
|
112
97
|
with:
|
|
@@ -120,14 +105,14 @@ jobs:
|
|
|
120
105
|
strategy:
|
|
121
106
|
matrix:
|
|
122
107
|
os: [windows-latest]
|
|
123
|
-
arch: [
|
|
108
|
+
arch: [AMD64]
|
|
124
109
|
|
|
125
110
|
steps:
|
|
126
|
-
- uses: actions/checkout@
|
|
111
|
+
- uses: actions/checkout@v5
|
|
127
112
|
with:
|
|
128
113
|
fetch-depth: 0
|
|
129
114
|
|
|
130
|
-
- uses: actions/setup-python@
|
|
115
|
+
- uses: actions/setup-python@v6
|
|
131
116
|
name: Install Python
|
|
132
117
|
with:
|
|
133
118
|
python-version: 3.x
|
|
@@ -140,25 +125,12 @@ jobs:
|
|
|
140
125
|
create-args: >-
|
|
141
126
|
python=${{ matrix.python-version }} libnetcdf=4.9.2 --channel conda-forge
|
|
142
127
|
|
|
143
|
-
- name: Install cibuildwheel
|
|
144
|
-
run: |
|
|
145
|
-
python -m pip install --upgrade cibuildwheel delvewheel
|
|
146
|
-
|
|
147
128
|
- name: Build wheels for Windows (${{ matrix.arch }})
|
|
148
|
-
|
|
129
|
+
uses: pypa/cibuildwheel@v3.2.0
|
|
149
130
|
env:
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
netCDF4_DIR="C:\\Users\\runneradmin\\micromamba\\envs\\build\\Library"
|
|
154
|
-
PATH="C:\\Users\\runneradmin\\micromamba\\envs\\build\\Library\\bin;${PATH}"
|
|
155
|
-
CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: >
|
|
156
|
-
delvewheel show {wheel}
|
|
157
|
-
&& delvewheel repair -w {dest_dir} {wheel}
|
|
158
|
-
CIBW_TEST_REQUIRES: pytest cython packaging typing-extensions
|
|
159
|
-
CIBW_TEST_COMMAND: >
|
|
160
|
-
python -c "import netCDF4; print(f'netCDF4 v{netCDF4.__version__}')"
|
|
161
|
-
&& pytest -s -rxs -v {project}\\test
|
|
131
|
+
CIBW_ARCHS: ${{ matrix.arch }}
|
|
132
|
+
# cannot build cftime for this target (missing a wheel at the time of writing)
|
|
133
|
+
CIBW_SKIP: "cp314*"
|
|
162
134
|
|
|
163
135
|
- uses: actions/upload-artifact@v4
|
|
164
136
|
with:
|
|
@@ -171,7 +143,7 @@ jobs:
|
|
|
171
143
|
name: "Show artifacts"
|
|
172
144
|
runs-on: ubuntu-22.04
|
|
173
145
|
steps:
|
|
174
|
-
- uses: actions/download-artifact@
|
|
146
|
+
- uses: actions/download-artifact@v5
|
|
175
147
|
with:
|
|
176
148
|
pattern: pypi-artifacts*
|
|
177
149
|
path: ${{ github.workspace }}/dist
|
|
@@ -189,7 +161,7 @@ jobs:
|
|
|
189
161
|
# upload to PyPI for every tag starting with 'v'
|
|
190
162
|
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v')
|
|
191
163
|
steps:
|
|
192
|
-
- uses: actions/download-artifact@
|
|
164
|
+
- uses: actions/download-artifact@v5
|
|
193
165
|
with:
|
|
194
166
|
pattern: pypi-artifacts*
|
|
195
167
|
path: ${{ github.workspace }}/dist
|
|
@@ -12,7 +12,7 @@ jobs:
|
|
|
12
12
|
# NO_NET: 1
|
|
13
13
|
strategy:
|
|
14
14
|
matrix:
|
|
15
|
-
python-version: [ "3.
|
|
15
|
+
python-version: [ "3.10", "3.11", "3.12", "3.13", "3.14" ]
|
|
16
16
|
os: [windows-latest, ubuntu-latest, macos-latest]
|
|
17
17
|
platform: [x64, x32]
|
|
18
18
|
exclude:
|
|
@@ -24,7 +24,7 @@ jobs:
|
|
|
24
24
|
shell: bash -l {0}
|
|
25
25
|
|
|
26
26
|
steps:
|
|
27
|
-
- uses: actions/checkout@
|
|
27
|
+
- uses: actions/checkout@v5
|
|
28
28
|
with:
|
|
29
29
|
submodules: true
|
|
30
30
|
|
|
@@ -58,7 +58,7 @@ jobs:
|
|
|
58
58
|
run:
|
|
59
59
|
shell: bash -l {0}
|
|
60
60
|
steps:
|
|
61
|
-
- uses: actions/checkout@
|
|
61
|
+
- uses: actions/checkout@v5
|
|
62
62
|
with:
|
|
63
63
|
submodules: true
|
|
64
64
|
|
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
version 1.7.3 (tag v1.7.3rel)
|
|
2
|
+
=============================
|
|
3
|
+
* Python 3.14 wheels (issue #1432)
|
|
4
|
+
* support os.PathLike arguments for `Dataset.fromcdl` and raise a `FileNotFoundError`
|
|
5
|
+
if the cdl is missing and a `FileExistsError` if the nc file already exists (PR #1387)
|
|
6
|
+
* raise more informative error when trying to iterate or
|
|
7
|
+
perform a membership operation on a Dataset (issue #1383)
|
|
8
|
+
* fix type hint for createEnumType (issue #1378)
|
|
9
|
+
* add python 3.13 to windows wheel builds (PR #1377)
|
|
10
|
+
* allow slicing of vlen and string variables with non-unitary strides (issue #1408).
|
|
11
|
+
|
|
1
12
|
version 1.7.2 (tag v1.7.2rel)
|
|
2
13
|
=============================
|
|
3
14
|
* add static type hints (PRs #1302, #1349)
|
|
@@ -1,25 +1,24 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: netCDF4
|
|
3
|
-
Version: 1.7.
|
|
3
|
+
Version: 1.7.3
|
|
4
4
|
Summary: Provides an object-oriented python interface to the netCDF version 4 library
|
|
5
|
-
Author-email: Jeff Whitaker <jeffrey
|
|
6
|
-
License: MIT
|
|
5
|
+
Author-email: Jeff Whitaker <whitaker.jeffrey@gmail.com>
|
|
6
|
+
License-Expression: MIT
|
|
7
7
|
Project-URL: Documentation, https://unidata.github.io/netcdf4-python/
|
|
8
8
|
Project-URL: Repository, https://github.com/Unidata/netcdf4-python
|
|
9
9
|
Keywords: numpy,netcdf,data,science,network,oceanography,meteorology,climate
|
|
10
10
|
Classifier: Development Status :: 3 - Alpha
|
|
11
11
|
Classifier: Programming Language :: Python :: 3
|
|
12
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
13
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
14
12
|
Classifier: Programming Language :: Python :: 3.10
|
|
15
13
|
Classifier: Programming Language :: Python :: 3.11
|
|
16
14
|
Classifier: Programming Language :: Python :: 3.12
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
17
17
|
Classifier: Intended Audience :: Science/Research
|
|
18
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
19
18
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
20
19
|
Classifier: Topic :: System :: Archiving :: Compression
|
|
21
20
|
Classifier: Operating System :: OS Independent
|
|
22
|
-
Requires-Python: >=3.
|
|
21
|
+
Requires-Python: >=3.10
|
|
23
22
|
Description-Content-Type: text/x-rst
|
|
24
23
|
License-File: LICENSE
|
|
25
24
|
Requires-Dist: cftime
|
|
@@ -29,6 +28,10 @@ Provides-Extra: tests
|
|
|
29
28
|
Requires-Dist: Cython; extra == "tests"
|
|
30
29
|
Requires-Dist: packaging; extra == "tests"
|
|
31
30
|
Requires-Dist: pytest; extra == "tests"
|
|
31
|
+
Requires-Dist: typing-extensions>=4.15.0; extra == "tests"
|
|
32
|
+
Provides-Extra: parallel
|
|
33
|
+
Requires-Dist: mpi4py; extra == "parallel"
|
|
34
|
+
Dynamic: license-file
|
|
32
35
|
|
|
33
36
|
netCDF version 4 has many features not found in earlier versions of the library,
|
|
34
37
|
such as hierarchical groups, zlib compression, multiple unlimited dimensions,
|
|
@@ -10,6 +10,8 @@
|
|
|
10
10
|
## News
|
|
11
11
|
For details on the latest updates, see the [Changelog](https://github.com/Unidata/netcdf4-python/blob/master/Changelog).
|
|
12
12
|
|
|
13
|
+
10/13/2025: Version [1.7.3](https://pypi.python.org/pypi/netCDF4/1.7.3) released. Minor updates/bugfixes and python 3.14 wheels, see Changelog for details.
|
|
14
|
+
|
|
13
15
|
10/22/2024: Version [1.7.2](https://pypi.python.org/pypi/netCDF4/1.7.2) released. Minor updates/bugfixes and python 3.13 wheels, see Changelog for details.
|
|
14
16
|
|
|
15
17
|
06/17/2024: Version [1.7.1](https://pypi.python.org/pypi/netCDF4/1.7.1) released. Fixes for wheels, no code changes.
|
|
@@ -297,7 +297,7 @@ supplied by the <a href="http://numpy.scipy.org">numpy module</a>. However,
|
|
|
297
297
|
unlike numpy arrays, netCDF4 variables can be appended to along one or
|
|
298
298
|
more 'unlimited' dimensions. To create a netCDF variable, use the
|
|
299
299
|
<code><a title="netCDF4.Dataset.createVariable" href="#netCDF4.Dataset.createVariable">Dataset.createVariable()</a></code> method of a <code><a title="netCDF4.Dataset" href="#netCDF4.Dataset">Dataset</a></code> or
|
|
300
|
-
<code><a title="netCDF4.Group" href="#netCDF4.Group">Group</a></code> instance. The <code><a title="netCDF4.Dataset.createVariable" href="#netCDF4.Dataset.createVariable">Dataset.createVariable()</a></code>
|
|
300
|
+
<code><a title="netCDF4.Group" href="#netCDF4.Group">Group</a></code> instance. The <code><a title="netCDF4.Dataset.createVariable" href="#netCDF4.Dataset.createVariable">Dataset.createVariable()</a></code> method
|
|
301
301
|
has two mandatory arguments, the variable name (a Python string), and
|
|
302
302
|
the variable datatype. The variable's dimensions are given by a tuple
|
|
303
303
|
containing the dimension names (defined previously with
|
|
@@ -305,19 +305,75 @@ containing the dimension names (defined previously with
|
|
|
305
305
|
variable, simply leave out the dimensions keyword. The variable
|
|
306
306
|
primitive datatypes correspond to the dtype attribute of a numpy array.
|
|
307
307
|
You can specify the datatype as a numpy dtype object, or anything that
|
|
308
|
-
can be converted to a numpy dtype object.
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
<
|
|
319
|
-
|
|
320
|
-
|
|
308
|
+
can be converted to a numpy dtype object. Valid datatype specifiers
|
|
309
|
+
include:</p>
|
|
310
|
+
<table>
|
|
311
|
+
<thead>
|
|
312
|
+
<tr>
|
|
313
|
+
<th>Specifier</th>
|
|
314
|
+
<th>Datatype</th>
|
|
315
|
+
<th>Old typecodes</th>
|
|
316
|
+
</tr>
|
|
317
|
+
</thead>
|
|
318
|
+
<tbody>
|
|
319
|
+
<tr>
|
|
320
|
+
<td><code>'f4'</code></td>
|
|
321
|
+
<td>32-bit floating point</td>
|
|
322
|
+
<td><code>'f'</code></td>
|
|
323
|
+
</tr>
|
|
324
|
+
<tr>
|
|
325
|
+
<td><code>'f8'</code></td>
|
|
326
|
+
<td>64-bit floating point</td>
|
|
327
|
+
<td><code>'d'</code></td>
|
|
328
|
+
</tr>
|
|
329
|
+
<tr>
|
|
330
|
+
<td><code>'i4'</code></td>
|
|
331
|
+
<td>32-bit signed integer</td>
|
|
332
|
+
<td><code>'i'</code> <code>'l'</code></td>
|
|
333
|
+
</tr>
|
|
334
|
+
<tr>
|
|
335
|
+
<td><code>'i2'</code></td>
|
|
336
|
+
<td>16-bit signed integer</td>
|
|
337
|
+
<td><code>'h'</code> <code>'s'</code></td>
|
|
338
|
+
</tr>
|
|
339
|
+
<tr>
|
|
340
|
+
<td><code>'i8'</code></td>
|
|
341
|
+
<td>64-bit signed integer</td>
|
|
342
|
+
<td></td>
|
|
343
|
+
</tr>
|
|
344
|
+
<tr>
|
|
345
|
+
<td><code>'i1'</code></td>
|
|
346
|
+
<td>8-bit signed integer</td>
|
|
347
|
+
<td><code>'b'</code> <code>'B'</code></td>
|
|
348
|
+
</tr>
|
|
349
|
+
<tr>
|
|
350
|
+
<td><code>'u1'</code></td>
|
|
351
|
+
<td>8-bit unsigned integer</td>
|
|
352
|
+
<td></td>
|
|
353
|
+
</tr>
|
|
354
|
+
<tr>
|
|
355
|
+
<td><code>'u2'</code></td>
|
|
356
|
+
<td>16-bit unsigned integer</td>
|
|
357
|
+
<td></td>
|
|
358
|
+
</tr>
|
|
359
|
+
<tr>
|
|
360
|
+
<td><code>'u4'</code></td>
|
|
361
|
+
<td>32-bit unsigned integer</td>
|
|
362
|
+
<td></td>
|
|
363
|
+
</tr>
|
|
364
|
+
<tr>
|
|
365
|
+
<td><code>'u8'</code></td>
|
|
366
|
+
<td>64-bit unsigned integer</td>
|
|
367
|
+
<td></td>
|
|
368
|
+
</tr>
|
|
369
|
+
<tr>
|
|
370
|
+
<td><code>'S1'</code></td>
|
|
371
|
+
<td>single-character string</td>
|
|
372
|
+
<td><code>'c'</code></td>
|
|
373
|
+
</tr>
|
|
374
|
+
</tbody>
|
|
375
|
+
</table>
|
|
376
|
+
<p>The unsigned integer types and the 64-bit integer type
|
|
321
377
|
can only be used if the file format is <code>NETCDF4</code>.</p>
|
|
322
378
|
<p>The dimensions themselves are usually also defined as variables, called
|
|
323
379
|
coordinate variables. The <code><a title="netCDF4.Dataset.createVariable" href="#netCDF4.Dataset.createVariable">Dataset.createVariable()</a></code>
|
|
@@ -1552,8 +1608,8 @@ will clobber an existing file with the same name.
|
|
|
1552
1608
|
if <code>False</code>, an
|
|
1553
1609
|
exception will be raised if a file with the same name already exists.
|
|
1554
1610
|
mode=<code>x</code> is identical to mode=<code>w</code> with clobber=False.</p>
|
|
1555
|
-
<p><strong><code>format</code></strong>: underlying file format (one of <code>'NETCDF4'
|
|
1556
|
-
'NETCDF4_CLASSIC'
|
|
1611
|
+
<p><strong><code>format</code></strong>: underlying file format (one of <code>'NETCDF4'</code>,
|
|
1612
|
+
<code>'NETCDF4_CLASSIC'</code>, <code>'NETCDF3_CLASSIC'</code>, <code>'NETCDF3_64BIT_OFFSET'</code> or
|
|
1557
1613
|
<code>'NETCDF3_64BIT_DATA'</code>.
|
|
1558
1614
|
Only relevant if <code>mode = 'w'</code> (if <code>mode = 'r','a'</code> or <code>'r+'</code> the file format
|
|
1559
1615
|
is automatically detected). Default <code>'NETCDF4'</code>, which means the data is
|
|
@@ -1637,8 +1693,8 @@ CDL file.</p>
|
|
|
1637
1693
|
suffix replaced by <code>.nc</code> is used..</p>
|
|
1638
1694
|
<p><strong><code>mode</code></strong>:
|
|
1639
1695
|
Access mode to open Dataset (Default <code>'a'</code>).</p>
|
|
1640
|
-
<p><strong><code>format</code></strong>: underlying file format to use (one of <code>'NETCDF4'
|
|
1641
|
-
'NETCDF4_CLASSIC'
|
|
1696
|
+
<p><strong><code>format</code></strong>: underlying file format to use (one of <code>'NETCDF4'</code>,
|
|
1697
|
+
<code>'NETCDF4_CLASSIC'</code>, <code>'NETCDF3_CLASSIC'</code>, <code>'NETCDF3_64BIT_OFFSET'</code> or
|
|
1642
1698
|
<code>'NETCDF3_64BIT_DATA'</code>. Default <code>'NETCDF4'</code>.</p>
|
|
1643
1699
|
<p>Dataset instance for <code>ncfilename</code> is returned.</p></div>
|
|
1644
1700
|
</dd>
|
|
@@ -1912,8 +1968,8 @@ Dataset standard attributes: <code>dimensions, dtype, shape, ndim, name</code> a
|
|
|
1912
1968
|
<code>least_significant_digit</code>. Application programs should never modify
|
|
1913
1969
|
these attributes. The <code>dimensions</code> attribute is a tuple containing the
|
|
1914
1970
|
names of the dimensions associated with this variable. The <code>dtype</code>
|
|
1915
|
-
attribute is a string describing the variable's data type (<code>i4
|
|
1916
|
-
S1
|
|
1971
|
+
attribute is a string describing the variable's data type (<code>i4</code>, <code>f8</code>,
|
|
1972
|
+
<code>S1</code>, etc). The <code>shape</code> attribute is a tuple describing the current
|
|
1917
1973
|
sizes of all the variable's dimensions. The <code>name</code> attribute is a
|
|
1918
1974
|
string containing the name of the Variable instance.
|
|
1919
1975
|
The <code>least_significant_digit</code>
|
|
@@ -2347,8 +2403,8 @@ instances, raises OSError.</p></div>
|
|
|
2347
2403
|
<dd>
|
|
2348
2404
|
<div class="desc"><p>Class for reading multi-file netCDF Datasets, making variables
|
|
2349
2405
|
spanning multiple files appear as if they were in one file.
|
|
2350
|
-
Datasets must be in <code>NETCDF4_CLASSIC
|
|
2351
|
-
or NETCDF3_64BIT_DATA
|
|
2406
|
+
Datasets must be in <code>NETCDF4_CLASSIC</code>, <code>NETCDF3_CLASSIC</code>, <code>NETCDF3_64BIT_OFFSET</code>
|
|
2407
|
+
or <code>NETCDF3_64BIT_DATA</code> format (<code>NETCDF4</code> Datasets won't work).</p>
|
|
2352
2408
|
<p>Adapted from <a href="http://pysclint.sourceforge.net/pycdf">pycdf</a> by Andre Gosselin.</p>
|
|
2353
2409
|
<p>Example usage (See <code><a title="netCDF4.MFDataset" href="#netCDF4.MFDataset">MFDataset</a></code> for more details):</p>
|
|
2354
2410
|
<pre><code class="language-python">>>> import numpy as np
|