Skip to content

documentation typos and minor mistakes in netcdf-4 doxygen docs #3266

@edhartnett

Description

@edhartnett

Doxygen documentation fixes for netCDF-4 functions in libdispatch

Summary

A review of the Doxygen documentation for netCDF-4 functions in the libdispatch directory found and fixed a number of issues across 11 source files. The fixes are on PR #3265

Issues Found and Fixed

1. Grammar Error: "an netCDF-4" → "a netCDF-4"

The phrase "Not an netCDF-4 file" appeared ~25 times in NC_ENOTNC4 return descriptions. Since "netCDF" is pronounced with a leading consonant sound, the correct article is "a".

Files: dcompound.c (14), denum.c (5), dopaque.c (2), dvlen.c (4), dtype.c (3)

2. Typos

Eight typos were fixed across three files:

File Typo Correction
dvar.c nc_creae() nc_create()
dvar.c scalare scalar
dvar.c wwere (2 occurrences) were
dvar.c preemtion preemption
dfilter.c Find the the param info Find the param info
denum.c user-define enumeration user-defined enumeration
denum.c about a about a member about a member
dvlen.c or and NC_OPAQUE or an NC_OPAQUE

3. Incorrect @return on Stub Function

NC_NOTNC4_put_vlen_element() in dnotnc4.c documented @return ::NC_NOERR No error. but actually returns NC_ENOTNC4. Fixed to match the implementation.

4. Warning Buried in Prose (dvlen.c)

The important warning about nc_free_vlens() only working with fixed-size base types was plain text (WARNING:). Converted to a proper \warning Doxygen tag so it renders as a highlighted warning box in the generated documentation.

5. Missing @since Version Tags

Added @since tags to 9 functions that were introduced in specific releases but lacked version information:

Function File Version
nc_def_var_szip dvar.c 4.0.0
nc_def_var_quantize dvar.c 4.9.0
nc_inq_var_quantize dvarinq.c 4.9.0
nc_def_var_bzip2 dfilter.c 4.9.0
nc_inq_var_bzip2 dfilter.c 4.9.0
nc_def_var_zstandard dfilter.c 4.9.0
nc_inq_var_zstandard dfilter.c 4.9.0
nc_def_var_blosc dfilter.c 4.9.0
nc_inq_var_blosc dfilter.c 4.9.0

6. Vague @returns in Group Functions (dgroup.c)

All 14 public functions in dgroup.c had only a generic @returns Error code or ::NC_NOERR for no error. with no specific error codes listed. Added specific error codes (e.g., NC_EBADID, NC_ENOTNC4, NC_ENOGRP, NC_ENOMEM, NC_EINVAL) derived from the actual NC4 implementations in libsrc4/nc4grp.c.

Also cleaned up nc_def_grp() which mixed @returns and @retval — now consistently uses @returns.

7. Missing @param Descriptions (denum.c)

Two parameters lacked description text:

  • nc_insert_enum(): \param xtype had no description → added "Typeid of the enum type."
  • nc_inq_enum_ident(): \param ncid had no description → added \ref ncid

8. Undocumented Stub Functions (dnotnc4.c)

Five internal stub functions had no Doxygen at all, unlike all other stubs in the same file. Added @internal doc blocks with parameter lists and accurate @return values:

  • NC_NOTNC4_inq_var_filter_ids
  • NC_NOTNC4_inq_var_filter_info
  • NC_NOOP_inq_var_filter_ids
  • NC_NOOP_inq_var_filter_info
  • NC_NOOP_inq_filter_avail

9. Incomplete Code Example (dgroup.c)

The nc_def_grp() example was a stub that declared variables but never actually called nc_def_grp() — just ... and \endcode. Replaced with a complete working example that creates a netCDF-4 file, defines a group, and defines a dimension and variable inside it.

10. Inconsistent Example Section Naming

  • dvarinq.c: nc_inq_varid_example4 and nc_inq_var_example5 had arbitrary numeric suffixes → renamed to nc_inq_varid_example and nc_inq_var_example
  • dparallel.c: Two examples used raw HTML <h1>Example</h1> instead of Doxygen \section tags → converted to \section nc_create_par_example Example and @section nc_var_par_access_example Example

11. Missing @ingroup on Filter Functions (dfilter.c)

Five filter convenience functions lacked @ingroup variables, preventing them from appearing in the variables group in generated docs:

  • nc_def_var_bzip2
  • nc_inq_var_bzip2
  • nc_def_var_zstandard
  • nc_inq_var_zstandard
  • nc_inq_var_blosc

(nc_def_var_blosc already had it.)

12. Missing @ingroup on Group Functions (dgroup.c)

All 14 functions in dgroup.c relied solely on the file-level \defgroup groups / \{ / \} block for group membership. Added explicit @ingroup groups to each function for robustness and consistency with other files like dcompound.c and denum.c.

Files Modified

File Changes
libdispatch/dcompound.c Grammar fix (14 occurrences)
libdispatch/denum.c Grammar fix (5), typos (2), missing param descriptions (2)
libdispatch/dopaque.c Grammar fix (2)
libdispatch/dvlen.c Grammar fix (4), warning tag, typo
libdispatch/dtype.c Grammar fix (3)
libdispatch/dvar.c Typos (5), @since tags (2)
libdispatch/dvarinq.c @since tag (1), example section names (2)
libdispatch/dfilter.c Typo (1), @since tags (6), @ingroup tags (5)
libdispatch/dnotnc4.c Incorrect @return (1), undocumented stubs (5)
libdispatch/dgroup.c Specific error codes (14 functions), example (1), @ingroup tags (14)
libdispatch/dparallel.c HTML → \section tags (2)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions