cf-python

A CF-compliant Earth Science data analysis library

https://github.com/ncas-cms/cf-python

Science Score: 67.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 4 DOI reference(s) in README
  • Academic publication links
    Links to: joss.theoj.org
  • Committers with academic emails
    5 of 14 committers (35.7%) from academic institutions
  • Institutional organization owner
    Organization ncas-cms has institutional domain (cms.ncas.ac.uk)
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (9.2%) to scientific vocabulary

Keywords

cf cfdm cfunits data-analysis earth-science metadata netcdf pp python um

Keywords from Contributors

climate atmospheric-science ocean hydrology conda earth-system-model transformation
Last synced: 6 months ago · JSON representation

Repository

A CF-compliant Earth Science data analysis library

Basic Info
Statistics
  • Stars: 142
  • Watchers: 3
  • Forks: 23
  • Open Issues: 116
  • Releases: 20
Topics
cf cfdm cfunits data-analysis earth-science metadata netcdf pp python um
Created over 6 years ago · Last pushed 6 months ago
Metadata Files
Readme Changelog Contributing License Code of conduct

README.md

cf-python

The Python cf package is an Earth Science data analysis library that is built on a complete implementation of the CF data model.

GitHub tag (latest by date) PyPI Conda

Conda Website GitHub

Codecov GitHub Workflow Status

fair-software.eu

References

Website Website Website

Dask

From version 3.14.0 the cf package uses Dask for all of its data manipulations.

Documentation

http://ncas-cms.github.io/cf-python

Installation

http://ncas-cms.github.io/cf-python/installation.html

Cheat Sheet

https://ncas-cms.github.io/cf-python/cheat_sheet.html

Recipes

https://ncas-cms.github.io/cf-python/recipes

Tutorial

https://ncas-cms.github.io/cf-python/tutorial.html

Functionality

The cf package implements the CF data model for its internal data structures and so is able to process any CF-compliant dataset. It is not strict about CF-compliance, however, so that partially conformant datasets may be ingested from existing datasets and written to new datasets. This is so that datasets which are partially conformant may nonetheless be modified in memory.

A simple example of reading a field construct from a file and inspecting it:

>>> import cf
>>> f = cf.read('file.nc')
>>> print(f[0])
Field: air_temperature (ncvar%tas)
----------------------------------
Data            : air_temperature(time(12), latitude(64), longitude(128)) K
Cell methods    : time(12): mean (interval: 1.0 month)
Dimension coords: time(12) = [1991-11-16 00:00:00, ..., 1991-10-16 12:00:00] noleap
                : latitude(64) = [-87.8638, ..., 87.8638] degrees_north
                : longitude(128) = [0.0, ..., 357.1875] degrees_east
                : height(1) = [2.0] m

The cf package uses Dask for all of its array manipulation and can:

  • read field constructs from netCDF, CDL, Zarr, PP and UM datasets with a choice of netCDF backends,and in local, http, and s3 locations,
  • create new field constructs in memory,
  • write and append field and domain constructs to netCDF datasets on disk,
  • read, create, and manipulate UGRID mesh topologies,
  • read, write, and create coordinates defined by geometry cells,
  • read netCDF and CDL datasets containing hierarchical groups,
  • inspect field constructs,
  • test whether two field constructs are the same,
  • modify field construct metadata and data,
  • create subspaces of field constructs,
  • write field constructs to netCDF datasets on disk,
  • incorporate, and create, metadata stored in external files,
  • read, write, and create data that have been compressed by convention (i.e. ragged or gathered arrays, or coordinate arrays compressed by subsampling), whilst presenting a view of the data in its uncompressed form,
  • combine field constructs arithmetically,
  • manipulate field construct data by arithmetical and trigonometrical operations,
  • perform weighted statistical collapses on field constructs, including those with geometry cells and UGRID mesh topologies,
  • perform histogram, percentile and binning operations on field constructs,
  • regrid structured grid, mesh and DSG field constructs with (multi-)linear, nearest neighbour, first- and second-order conservative and higher order patch recovery methods, including 3-d regridding,
  • apply convolution filters to field constructs,
  • create running means from field constructs,
  • apply differential operators to field constructs,
  • create derived quantities (such as relative vorticity).
  • read and write that data that are quantized to eliminate false precision.

Visualization

Powerful and flexible visualizations of cf field constructs, designed to be produced and configured in as few lines of code as possible, are available with the cf-plot package, which needs to be installed separately to the cf package.

See the cf-plot gallery for a range of plotting possibilities with example code.

Example outputs of cf-plot displaying selected aspects of `cf` field constructs

Command line utilities

During installation the cfa command line utility is also installed, which

  • generates text descriptions of field constructs contained in files, and

  • creates new datasets aggregated from existing files.

Tests

Tests are run from within the cf/test directory:

python run_tests.py

Owner

  • Name: NCAS CMS
  • Login: NCAS-CMS
  • Kind: organization
  • Location: UK

Useful tools to support NERC weather and climate research

GitHub Events

Total
  • Create event: 3
  • Release event: 2
  • Issues event: 42
  • Watch event: 15
  • Issue comment event: 83
  • Push event: 43
  • Pull request event: 45
  • Pull request review comment event: 87
  • Pull request review event: 101
  • Fork event: 2
Last Year
  • Create event: 3
  • Release event: 2
  • Issues event: 42
  • Watch event: 15
  • Issue comment event: 83
  • Push event: 43
  • Pull request event: 45
  • Pull request review comment event: 87
  • Pull request review event: 101
  • Fork event: 2

Committers

Last synced: 6 months ago

All Time
  • Total Commits: 4,259
  • Total Committers: 14
  • Avg Commits per committer: 304.214
  • Development Distribution Score (DDS): 0.321
Past Year
  • Commits: 339
  • Committers: 5
  • Avg Commits per committer: 67.8
  • Development Distribution Score (DDS): 0.366
Top Committers
Name Email Commits
David Hassell d****l@n****k 2,893
Sadie Louise Bartholomew s****w@n****k 1,087
Ankit Bhandekar 8****t 219
Thibault Hallouin t****n@u****e 13
Bruno P. Kinoshita k****w 11
Charles Roberts c****s@r****k 10
Matt m****3@g****m 9
Ollie 5****t 6
Natalia Hunt 5
Tyge Løvset t****o@n****o 2
Alan Iwi a****i@s****k 1
Alexander James Phillips a****l@g****m 1
Sharar-A s****i@n****k 1
William McGinty 3****S 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 367
  • Total pull requests: 555
  • Average time to close issues: 3 months
  • Average time to close pull requests: 11 days
  • Total issue authors: 42
  • Total pull request authors: 11
  • Average comments per issue: 1.87
  • Average comments per pull request: 1.35
  • Merged pull requests: 504
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 39
  • Pull requests: 59
  • Average time to close issues: 10 days
  • Average time to close pull requests: 15 days
  • Issue authors: 9
  • Pull request authors: 4
  • Average comments per issue: 1.31
  • Average comments per pull request: 0.76
  • Merged pull requests: 46
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • davidhassell (137)
  • sadielbartholomew (126)
  • bnlawrence (22)
  • JonathanGregory (13)
  • dlrhodson (7)
  • ThibHlln (6)
  • bewithankit (6)
  • ThatDesert (3)
  • AJamesPhillips (3)
  • lguo-uk (3)
  • m-couldrey (2)
  • kinow (2)
  • ellgil82 (2)
  • matthew-shin (2)
  • dwest77a (2)
Pull Request Authors
  • davidhassell (397)
  • sadielbartholomew (105)
  • bewithankit (36)
  • kinow (6)
  • mattjbr123 (5)
  • alaniwi (3)
  • ThibHlln (2)
  • tylov (2)
  • ThatDesert (1)
  • Sharar-A (1)
  • AJamesPhillips (1)
Top Labels
Issue Labels
enhancement (136) bug (115) question (36) documentation (28) aggregation (23) dask (22) testing (16) performance (15) um/pp (13) netCDF read (11) API review (4.0.0) (9) CFA (9) netCDF write (9) regridding (8) code tidy (8) installation (7) GitHub Actions (6) release (4) dataset write (3) dataset read (3) UGRID (3) CI (3) low priority (2) active storage (2) high priority (2) good first issue (1) compression (1) bug? (1)
Pull Request Labels
dask (196) enhancement (61) documentation (51) bug (46) low priority (28) code tidy (23) aggregation (17) performance (13) regridding (12) CFA (9) high priority (9) testing (9) netCDF read (8) netCDF write (7) CI (6) installation (6) dataset write (5) dataset read (4) release (3) GitHub Actions (3) question (3) UGRID (3) um/pp (3) active storage (3) linting (2) top priority (1) compression (1)

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 1,753 last-month
  • Total dependent packages: 1
  • Total dependent repositories: 9
  • Total versions: 114
  • Total maintainers: 2
pypi.org: cf-python

A CF-compliant earth science data analysis library

  • Versions: 114
  • Dependent Packages: 1
  • Dependent Repositories: 9
  • Downloads: 1,753 Last month
Rankings
Dependent packages count: 4.8%
Dependent repos count: 4.8%
Average: 7.0%
Stargazers count: 7.8%
Forks count: 8.5%
Downloads: 9.3%
Last synced: 6 months ago

Dependencies

requirements.txt pypi
  • cfdm >=1.9.0.2,<1.9.1.0
  • cftime >=1.5.0
  • cfunits >=3.3.4
  • netCDF4 >=1.5.4
  • numpy >=1.15
  • packaging >=20.0
  • psutil >=0.6.0
setup.py pypi
  • ESMF >=8.0
  • cfdm >=1.8.5,
  • cftime >=1.1.3
  • cfunits >=3.2.7
  • matplotlib >=3.0.0
  • mpi4py >=3.0.0
  • netCDF4 >=1.5.3
  • numpy >=1.15
  • psutil >=0.6.0
  • scipy >=1.1.0
  • udunits2 ==2.2.25
.github/workflows/linting.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
  • pre-commit/action v3.0.0 composite
.github/workflows/run-test-suite.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
  • codecov/codecov-action v3 composite
  • conda-incubator/setup-miniconda v2 composite
.github/workflows/test-source-dist.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
  • conda-incubator/setup-miniconda v2 composite
docker/Dockerfile docker
  • continuumio/miniconda3 latest build
pyproject.toml pypi