xeofs
xeofs: Comprehensive EOF analysis in Python with xarray - Published in JOSS (2024)
Science Score: 67.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found 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, zenodo.org -
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (15.8%) to scientific vocabulary
Keywords
Keywords from Contributors
Scientific Fields
Repository
Comprehensive EOF analysis in Python with xarray: A versatile, multidimensional, and scalable tool for advanced climate data analysis
Basic Info
- Host: GitHub
- Owner: xarray-contrib
- License: mit
- Language: Python
- Default Branch: main
- Homepage: https://xeofs.readthedocs.io/
- Size: 44.8 MB
Statistics
- Stars: 122
- Watchers: 6
- Forks: 23
- Open Issues: 18
- Releases: 45
Topics
Metadata Files
README.md

| Versions | [](https://pypi.org/project/xeofs/) [](https://anaconda.org/conda-forge/xeofs) | |----------------------------|:---------------------------------------------------------------------------------------------:| | Build & Testing | [](https://github.com/xarray-contrib/xeofs/actions/workflows/ci.yml) [](https://codecov.io/github/nicrie/xeofs) | | Code Quality |  [](https://github.com/charliermarsh/ruff) | | Documentation | [](https://xeofs.readthedocs.io/en/latest/index.html) | | Citation | [](https://joss.theoj.org/papers/4f50349ee1777b8a61761183047b1180) [](https://zenodo.org/doi/10.5281/zenodo.6323011) | Licensing | [](https://github.com/xarray-contrib/xeofs/blob/main/LICENSE) | | User Engagement |  |
Overview
xeofs is a specialized Python package designed for dimensionality reduction in climate science, aimed at extracting meaningful patterns from large datasets. It provides eigenmethods such as Principal Component Analysis (EOF analysis) and several related variants. Seamlessly integrated with xarray and Dask, xeofs enables efficient handling and scalable computation of large, multi-dimensional datasets.
- Multi-Dimensional: Designed for
xarrayobjects, it applies dimensionality reduction to multi-dimensional data while maintaining data labels. - Dask-Integrated: Supports large datasets via
Daskxarray objects - Extensive Methods: Offers various dimensionality reduction techniques
- Adaptable Output: Provides output corresponding to the type of input, whether single or list of
xr.DataArrayorxr.Dataset - Missing Values: Handles
NaNvalues within the data - Bootstrapping: Comes with a user-friendly interface for model evaluation using bootstrapping
- Efficient: Ensures computational efficiency, particularly with large datasets through randomized SVD
- Modular: Allows users to implement and incorporate new dimensionality reduction methods
Installation
To install the package, use either of the following commands:
bash
conda install -c conda-forge xeofs
or
bash
pip install xeofs
Quickstart
In order to get started with xeofs, follow these simple steps:
Import the package
```python
import xarray as xr # for example data only import xeofs as xe
```
Load example data
```python
t2m = xr.tutorial.opendataset("airtemperature") t2mwest = t2m.isel(lon=slice(None, 20)) t2meast = t2m.isel(lon=slice(21, None))
```
EOF analysis Initiate and fit the EOF/PCA model to the data
```python
eof = xe.single.EOF(n_modes=10) eof.fit(t2m, dim="time") # doctest: +ELLIPSIS
``` Now, you can access the model's EOF components and PC scores:
```py
comps = eof.components() # EOFs (spatial patterns) scores = eof.scores() # PCs (temporal patterns)
```
Varimax-rotated EOF analysis
Initiate and fit an EOFRotator class to the model to obtain a varimax-rotated EOF analysis
```python
rotator = xe.single.EOFRotator(nmodes=3) rotator.fit(eof) # doctest: +ELLIPSIS <xeofs.single.eofrotator.EOFRotator object at ...>
rotcomps = rotator.components() # Rotated EOFs (spatial patterns) rotscores = rotator.scores() # Rotated PCs (temporal patterns)
```
Maximum Covariance Analysis (MCA)
```python
mca = xe.cross.MCA(nmodes=10) mca.fit(t2mwest, t2m_east, dim="time") # doctest: +ELLIPSIS
comps1, comps2 = mca.components() # Singular vectors (spatial patterns) scores1, scores2 = mca.scores() # Expansion coefficients (temporal patterns)
```
Varimax-rotated MCA
```python
rotator = xe.cross.MCARotator(nmodes=10) rotator.fit(mca) # doctest: +ELLIPSIS <xeofs.cross.mcarotator.MCARotator object at ...>
rotcomps = rotator.components() # Rotated singular vectors (spatial patterns) rotscores = rotator.scores() # Rotated expansion coefficients (temporal patterns)
```
To further explore the capabilities of xeofs, check out the available documentation and examples.
For a full list of currently available methods, see the Reference API.
Documentation
For a more comprehensive overview and usage examples, visit the documentation.
Contributing
Contributions are highly welcomed and appreciated. If you're interested in improving xeofs or fixing issues, please read our Contributing Guide.
License
This project is licensed under the terms of the MIT license.
Contact
For questions or support, please open a Github issue.
Credits
- Randomized PCA: scikit-learn
- EOF analysis: Python package eofs by Andrew Dawson
- MCA: Python package xMCA by Yefee
- CCA: Python package CCA-Zoo by James Chapman
- ROCK-PCA: Matlab implementation by Diego Bueso
- Sparse PCA: Based on Ristretto library by Benjamin Erichson
How to cite?
When using xeofs, kindly remember to cite the original references of the methods employed in your work. Additionally, if xeofs is proving useful in your research, we'd appreciate if you could acknowledge its use with the following citation:
bibtex
@article{rieger_xeofs_2024,
author = {Rieger, Niclas and Levang, Samuel J.},
doi = {10.21105/joss.06060},
journal = {Journal of Open Source Software},
month = jan,
number = {93},
pages = {6060},
title = {{xeofs: Comprehensive EOF analysis in Python with xarray}},
url = {https://joss.theoj.org/papers/10.21105/joss.06060},
volume = {9},
year = {2024}
}
Contributors
Owner
- Name: xarray-contrib
- Login: xarray-contrib
- Kind: organization
- Website: https://xarray.dev
- Twitter: xarray_dev
- Repositories: 23
- Profile: https://github.com/xarray-contrib
xarray compatible projects
Citation (CITATION.cff)
cff-version: 1.2.0
message: "If you use this software, please cite it as below."
authors:
- family-names: "Rieger"
given-names: "Niclas"
orcid: "https://orcid.org/0000-0003-3357-1742"
- family-names: "Levang"
given-names: "Samuel J."
title: "xeofs"
abstract: "Comprehensive EOF analysis in Python with xarray."
license: MIT
doi: 10.5281/zenodo.6323011
url: "https://xeofs.readthedocs.io/en/latest/"
repository-code: "https://github.com/xarray-contrib/xeofs"
preferred-citation:
authors:
- family-names: "Rieger"
given-names: "Niclas"
orcid: "https://orcid.org/0000-0003-3357-1742"
- family-names: "Levang"
given-names: "Samuel J."
date-published: "2024-01-02"
doi: 10.21105/joss.06060
issn: 2475-9066
issue: 93
journal: "Journal of Open Source Software"
publisher:
name: "Open Journals"
start: 6060
title: "xeofs: Comprehensive EOF analysis in Python with xarray"
type: article
url: "https://joss.theoj.org/papers/10.21105/joss.06060"
volume: 9
GitHub Events
Total
- Issues event: 16
- Watch event: 17
- Delete event: 2
- Issue comment event: 21
- Push event: 5
- Pull request event: 3
- Pull request review event: 1
- Pull request review comment event: 1
- Fork event: 2
- Create event: 2
Last Year
- Issues event: 16
- Watch event: 17
- Delete event: 2
- Issue comment event: 21
- Push event: 5
- Pull request event: 3
- Pull request review event: 1
- Pull request review comment event: 1
- Fork event: 2
- Create event: 2
Committers
Last synced: 7 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| Niclas Rieger | n****r@g****m | 475 |
| github-actions | g****s@g****m | 30 |
| Sam Levang | 3****g | 24 |
| github-actions[bot] | g****] | 11 |
| github-actions | a****n@g****m | 8 |
| semantic-release | s****e | 8 |
| arfriedman | a****d@g****m | 1 |
| Mattia Almansi | m****i@b****u | 1 |
| Damien Irving | i****n@g****m | 1 |
| Aaron Spring | a****g | 1 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 57
- Total pull requests: 72
- Average time to close issues: 14 days
- Average time to close pull requests: about 11 hours
- Total issue authors: 21
- Total pull request authors: 3
- Average comments per issue: 1.72
- Average comments per pull request: 0.61
- Merged pull requests: 71
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 23
- Pull requests: 26
- Average time to close issues: 5 days
- Average time to close pull requests: about 9 hours
- Issue authors: 10
- Pull request authors: 3
- Average comments per issue: 1.09
- Average comments per pull request: 0.46
- Merged pull requests: 26
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- nicrie (32)
- vdevauxchupin (3)
- n0rdp0l (2)
- arfriedman (2)
- agirnow (2)
- SHEN-Cheng (2)
- mschulzie (2)
- jiwon-j (2)
- thelightonmyway (1)
- roxyboy (1)
- navidcy (1)
- shenyulu (1)
- LKPatel1 (1)
- kafitzgerald (1)
- singledoggy (1)
Pull Request Authors
- nicrie (112)
- slevang (11)
- arfriedman (2)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 2
-
Total downloads:
- pypi 2,026 last-month
-
Total dependent packages: 2
(may contain duplicates) -
Total dependent repositories: 2
(may contain duplicates) - Total versions: 83
- Total maintainers: 1
proxy.golang.org: github.com/xarray-contrib/xeofs
- Documentation: https://pkg.go.dev/github.com/xarray-contrib/xeofs#section-documentation
- License: mit
-
Latest release: v3.0.4+incompatible
published over 1 year ago
Rankings
pypi.org: xeofs
Comprehensive EOF analysis in Python with xarray: A versatile, multidimensional, and scalable tool for advanced climate data analysis
- Documentation: https://xeofs.readthedocs.io/
- License: MIT
-
Latest release: 3.0.4
published over 1 year ago
Rankings
Maintainers (1)
Dependencies
- atomicwrites 1.4.0 develop
- attrs 21.4.0 develop
- cftime 1.5.2 develop
- coverage 6.3.1 develop
- flake8 4.0.1 develop
- iniconfig 1.1.1 develop
- mccabe 0.6.1 develop
- netcdf4 1.5.8 develop
- pluggy 1.0.0 develop
- py 1.11.0 develop
- pycodestyle 2.8.0 develop
- pyflakes 2.4.0 develop
- pytest 7.0.1 develop
- tomli 2.0.1 develop
- appdirs 1.4.4
- certifi 2021.10.8
- charset-normalizer 2.0.12
- colorama 0.4.4
- idna 3.3
- joblib 1.1.0
- numpy 1.22.2
- packaging 21.3
- pandas 1.4.1
- pooch 1.6.0
- pyparsing 3.0.7
- python-dateutil 2.8.2
- pytz 2021.3
- requests 2.27.1
- scikit-learn 1.0.2
- scipy 1.6.1
- six 1.16.0
- threadpoolctl 3.1.0
- tqdm 4.64.0
- urllib3 1.26.8
- xarray 0.21.1
- coverage ^6.3.1 develop
- flake8 ^4.0.1 develop
- netCDF4 ^1.5.7 develop
- pytest ^7.0.1 develop
- numpy ^1.19.2
- pandas ^1.4.1
- pooch ^1.6.0
- python ^3.8
- scikit-learn ^1.0.2
- tqdm ^4.64.0
- xarray ^0.21.1
- actions/checkout v3 composite
- psf/black stable composite
- BobAnkh/auto-generate-changelog v1.2.5 composite
- actions/checkout v2 composite
- abatilo/actions-poetry v2.1.0 composite
- actions/checkout v3 composite
- actions/setup-python v3 composite
- codecov/codecov-action v3 composite
- amannn/action-semantic-pull-request v5 composite
- actions/checkout v3 composite
- pypa/gh-action-pypi-publish release/v1 composite
- python-semantic-release/python-semantic-release master composite
- python-semantic-release/upload-to-gh-release main composite
- xeofs *