diff --git a/.github/workflows/cibuildwheel.yml b/.github/workflows/cibuildwheel.yml index eaf0861b7..ff1f925ee 100644 --- a/.github/workflows/cibuildwheel.yml +++ b/.github/workflows/cibuildwheel.yml @@ -79,7 +79,7 @@ jobs: # These needs to rotate every new Python release. run: | set -x - echo "CIBW_BUILD=cp310-* cp311-* cp314-*" >> $GITHUB_ENV + echo "CIBW_BUILD=cp310-* cp311-* cp314-* cp314t-*" >> $GITHUB_ENV set +x if: ${{ github.event_name }} == "pull_request" @@ -170,7 +170,7 @@ jobs: uses: pypa/cibuildwheel@v3.3.0 env: CIBW_ARCHS: ARM64 - CIBW_SKIP: "cp310-* cp314t-*" + CIBW_SKIP: "cp310-*" - uses: actions/upload-artifact@v6 with: diff --git a/Changelog b/Changelog index c0267ddfe..88ba8c385 100644 --- a/Changelog +++ b/Changelog @@ -1,9 +1,13 @@ - version 1.7.4 (not yet released) + version 1.7.4 (tag v1.7.4rel) ================================ * Make sure automatic conversion of character arrays <--> string arrays works for Unicode strings (issue #1440). (previously only worked correctly for encoding="ascii"). * Add netcdf plugins (blosc, zstd, bzip2) in wheels. Blosc plugin doesn't work in Windows wheels. Macos wheels now use conda provided libs. (PR #1450) + * Add windows/arm (PR #1453) and free-threaded python wheels (issue #1454). Windows wheels now use netcdf-c 4.9.3. + WARNING: netcdf-c is not thread-safe and netcdf4-python does have internal locking so expect segfaults if you + use netcdf4-python on multiple threads with free-threaded python. Users must exercise care to only call netcdf from + a single thread. version 1.7.3 (tag v1.7.3rel) ============================= diff --git a/README.md b/README.md index 57a352c2d..8b9b52bef 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,12 @@ ## News For details on the latest updates, see the [Changelog](https://github.com/Unidata/netcdf4-python/blob/master/Changelog). +1/5/2026: Version [1.7.4](https://pypi.python.org/pypi/netCDF4/1.7.4) released. Compression plugins now included in wheels, windows/arm and +free-threaded python wheels provided. Automatic conversion of character arrays <--> string arrays works for Unicode (not just ascii) strings. +WARNING: netcdf-c is not thread-safe and netcdf4-python does have internal locking so expect segfaults if you +use netcdf4-python on multiple threads with free-threaded python. Users must exercise care to only call netcdf from +a single thread. + 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. 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. diff --git a/docs/index.html b/docs/index.html index a6b430483..f4f6cbc4d 100644 --- a/docs/index.html +++ b/docs/index.html @@ -3,20 +3,31 @@ - + netCDF4 API documentation - - + @@ -26,7 +37,7 @@

Package netCDF4

-

Version 1.7.2

+

Version 1.7.4

Introduction

netcdf4-python is a Python interface to the netCDF C library.

netCDF version 4 has many features @@ -1003,6 +1014,11 @@

Parallel IO

to write to it.
  • You cannot use variable-length (VLEN) data types.
  • +

    Import warning regarding threads: +The underlying netcdf-c library is not thread-safe, so netcdf4-python cannot perform parallel +IO in a multi-threaded environment. +Users should expect segfaults if a netcdf file is opened on multiple threads - care should +be taken to restrict netcdf4-python usage to a single thread, even when using free-threaded python.

    Dealing with strings

    The most flexible way to store arrays of strings is with the Variable-length (vlen) string data type. However, this requires @@ -1018,7 +1034,7 @@

    Dealing with strings

    (dtype S1) variable, the chartostring() utility function is used to convert the array of characters to an array of strings with one less dimension (the last dimension is interpreted as the length of each string) when reading the data. The character -set (usually ascii) is specified by the _Encoding attribute. If _Encoding +set is specified by the _Encoding attribute. If _Encoding is 'none' or 'bytes', then the character array is converted to a numpy fixed-width byte string array (dtype S#), otherwise a numpy unicode (dtype U#) array is created. @@ -1196,7 +1212,7 @@

    Support for complex numbers

    Support for complex numbers is handled via the nc-complex library. See there for further details.

    -

    contact: Jeffrey Whitaker jeffrey.s.whitaker@noaa.gov

    +

    contact: Jeffrey Whitaker whitaker.jeffrey@gmail.com

    copyright: 2008 by Jeffrey Whitaker.

    license: Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

    The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

    @@ -1229,7 +1245,7 @@

    Functions

    def date2index(dates, nctime, calendar=None, select='exact', has_year_zero=None)
    -

    date2index(dates, nctime, calendar=None, select=u'exact', has_year_zero=None)

    +

    date2index(dates, nctime, calendar=None, select='exact', has_year_zero=None)

    Return indices of a netCDF time variable corresponding to the given dates.

    dates: A datetime object or a sequence of datetime objects. The datetime objects should not include a time-zone offset.

    @@ -1347,10 +1363,10 @@

    Functions

    used to build the module, and when it was built.

    -def num2date(times, units, calendar='standard', only_use_cftime_datetimes=True, only_use_python_datetimes=False, has_year_zero=None) +def num2date(times,
    units,
    calendar='standard',
    only_use_cftime_datetimes=True,
    only_use_python_datetimes=False,
    has_year_zero=None)
    -

    num2date(times, units, calendar=u'standard', only_use_cftime_datetimes=True, only_use_python_datetimes=False, has_year_zero=None)

    +

    num2date(times, units, calendar='standard', only_use_cftime_datetimes=True, only_use_python_datetimes=False, has_year_zero=None)

    Return datetime objects given numeric time values. The units of the numeric time values are described by the units argument and the calendar keyword. The returned datetime objects represent @@ -1460,10 +1476,10 @@

    Functions

    (default) or 'U1' (if dtype='U')

    -def stringtochar(a, encoding='utf-8') +def stringtochar(a, encoding='utf-8', n_strlen=None)
    -

    stringtochar(a,encoding='utf-8')

    +

    stringtochar(a,encoding='utf-8',n_strlen=None)

    convert a string array to a character array with one extra dimension

    a: Input numpy string array with numpy datatype 'SN' or 'UN', where N @@ -1473,6 +1489,10 @@

    Functions

    optional kwarg encoding can be used to specify character encoding (default utf-8). If encoding is 'none' or 'bytes', a numpy.string_ the input array is treated a raw byte strings (numpy.string_).

    +

    optional kwarg n_strlen is the number of characters in each string. +Default +is None, which means n_strlen will be set to a.itemsize (the number of bytes +used to represent each string in the input array).

    returns a numpy character array with datatype 'S1' or 'U1' and shape a.shape + (N,), where N is the length of each string in a.

    @@ -1834,7 +1854,7 @@

    Methods

    datatype.

    -def createVariable(self, varname, datatype, dimensions=(), compression=None, zlib=False, complevel=4, shuffle=True, szip_coding='nn', szip_pixels_per_block=8, blosc_shuffle=1, fletcher32=False, contiguous=False, chunksizes=None, endian='native', least_significant_digit=None, significant_digits=None, quantize_mode='BitGroom', fill_value=None, chunk_cache=None) +def createVariable(self,
    varname,
    datatype,
    dimensions=(),
    compression=None,
    zlib=False,
    complevel=4,
    shuffle=True,
    szip_coding='nn',
    szip_pixels_per_block=8,
    blosc_shuffle=1,
    fletcher32=False,
    contiguous=False,
    chunksizes=None,
    endian='native',
    least_significant_digit=None,
    significant_digits=None,
    quantize_mode='BitGroom',
    fill_value=None,
    chunk_cache=None)

    createVariable(self, varname, datatype, dimensions=(), compression=None, zlib=False, @@ -3144,7 +3164,7 @@

    Methods