IPSL-ncdiff
Easy comparison of NetCDF files. Similar to nccmp, recursive_diff/ncdiff, and ncompare, more tools: https://lguez.github.io/Max_diff_nc/other_utils/!
Why another tool?
Each tool for NetCDF comparison that we have analysed, has lacked in some feature which would be appreciated by us: - No structured output (e.g. json, csv, html): nccmp, ncompare - No comparison of partial files (e.g. only 5 days out of 1 year): all tools - No multi-backend (e.g. handling various formats)
| Feature | IPSL-ncdiff | nccmp | recursive_diff/ncdiff | ncompare | cdo diff | nco diff |
|---|---|---|---|---|---|---|
| Time-aware comparison | ||||||
| Partial file comparison | ||||||
| Per-variable tolerance | ||||||
| Various NetCDF versions | ||||||
| Structured output (e.g. json, csv) |
- It semes that ncdiff doesn't support groups/nested variables
How it works?
ipsl-ncdiff compares two NetCDF files on the dataset and variable level. Two dataset might have dissimilar attributes, dimension list or variable list.
On the variable level, two variables might have dissimilar attributes, compression settings, datatype, dimension, shape or value.
The tool tries to analyse both files and display all found differences!
Furthermore, ipsl-ncdiff provides several options changing the comparison and allowing, e.g. to compare variables of different name or shape.
Performed comparisons
- Dataset (file) level
- Global attributes (new or different):
diff_global_attributes - New variables (left or right side):
diff_new_variables
- Global attributes (new or different):
- Variable level:
diff_variable- Attributes (not implemented)
- Dimensions
- Shape
- Datatype
- Values
- Compression
Other operations
- Alignment of dimensions (when dataset is a subset of bigger file, we can still compare it by matching specified dimensions - usually it's time)
Usage
Installation
ipsl-ncdiff is hosted on official PyPI Python package repository. The installation is as easy as typing:
pip install ipsl-ncdiff
Also, you can install the latest version directly from the repository:
Furthermore, generic linux binary is available here:
Using as a tool
ipsl-ncdiff <NETCDF1> <NETCDF2>
Using as a library
In your Python code:
from ipsl_ncdiff.diff import diff, diff_files, diff_datasets
are_equal, differences = diff(Path("<NETCDF1>"), Path("<NETCDF2>"))
Metadata
Release files for ipsl-ncdiff 0.1.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| ipsl_ncdiff-0.1.4.tar.gz | 31.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ipsl_ncdiff-0.1.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 49.2 kB
Release files / ipsl_ncdiff-0.1.4.tar.gz
| Download URL | ipsl_ncdiff-0.1.4.tar.gz |
|---|---|
| Size | 31.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f07a8df5f8b234a5daa9b6ae42210451e044cd79697f293ee7c5b812526c0db2
|
|
BLAKE2b-256 checksum How to use checksums |
b7be83ee99153f091eb2dda2d6fcf42f7b7892f6b7cbade83f45ad5416a09f5f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.8.22
|
Release files / ipsl_ncdiff-0.1.4-py3-none-any.whl
| Download URL | ipsl_ncdiff-0.1.4-py3-none-any.whl |
|---|---|
| Size | 17.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b3cabafa38b9a145a854b3cffaa87532c7a13676f5412573cd76f70dc7585387
|
|
BLAKE2b-256 checksum How to use checksums |
61d7267ff30bc71c01a4f3597659b8f81c5c6c54466db52b18f2a9ba76609f98
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.8.22
|