Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split from xclim #8

Open
wants to merge 125 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
125 commits
Select commit Hold shift + click to select a range
16d9ecf
PASSED: test_base.py
coxipi Jul 25, 2024
6ca941b
Merge branch 'main' of github.com:Ouranosinc/xsdba into split_from_xclim
coxipi Jul 25, 2024
c484509
update authorship
coxipi Jul 25, 2024
a7a91b1
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 25, 2024
b830f7f
PASSED: test_nbutils.py
coxipi Jul 25, 2024
acd4254
Merge branch 'split_from_xclim' of github.com:Ouranosinc/xsdba into s…
coxipi Jul 25, 2024
0abb877
PASSED: test_utils.py
coxipi Jul 25, 2024
44f108d
True xclim independance (oops)
coxipi Jul 25, 2024
bee1a17
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 25, 2024
b15a67c
new file forgotten
coxipi Jul 25, 2024
683c663
Merge branch 'split_from_xclim' of github.com:Ouranosinc/xsdba into s…
coxipi Jul 25, 2024
ebc9457
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 25, 2024
6546d44
PASSED: test_loess.py
coxipi Jul 25, 2024
c56c403
Merge branch 'split_from_xclim' of github.com:Ouranosinc/xsdba into s…
coxipi Jul 25, 2024
eb0fe2d
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 25, 2024
4a3c7c1
disable ruff autoformat, add rst directives to .flake8
Zeitsperre Jul 25, 2024
9daf879
fix numpydoc docstrings, add bibliography directives for later
Zeitsperre Jul 25, 2024
0f78ee7
remove blanket noqa statements
Zeitsperre Jul 25, 2024
a8706ad
PASSED: test_detrending (simple units handling added)
coxipi Jul 26, 2024
4605d03
Merge branch 'split_from_xclim' of github.com:Ouranosinc/xsdba into s…
coxipi Jul 26, 2024
36f9009
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 26, 2024
9f9279b
forgot to add detrending (rule SS01 broken)
coxipi Jul 26, 2024
fe2d1d6
Merge branch 'split_from_xclim' of github.com:Ouranosinc/xsdba into s…
coxipi Jul 26, 2024
8673e2c
credit where it's due
Zeitsperre Jul 26, 2024
77fbd7a
drop Python3.8
Zeitsperre Jul 26, 2024
8dcb0fb
linting
Zeitsperre Jul 26, 2024
fa3f64e
PASSED: test_processing.py (no hydro conv & missing EQM)
coxipi Jul 27, 2024
9914b03
Merge branch 'split_from_xclim' of github.com:Ouranosinc/xsdba into s…
coxipi Jul 27, 2024
4c521be
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 27, 2024
e553171
incorporate EQM in test_processing (+ add fixtures)
coxipi Jul 29, 2024
f3b6b99
Merge branch 'split_from_xclim' of github.com:Ouranosinc/xsdba into s…
coxipi Jul 29, 2024
2666314
PASSED: test_adjustment.py (except internet/open_dataset)
coxipi Jul 29, 2024
b59911c
PASSED: test_properties.py (pytest.warning remain)
coxipi Jul 31, 2024
448cb03
forgot indicators
coxipi Jul 31, 2024
ca8bb75
PASSED: test_measures.py
coxipi Jul 31, 2024
a504b6c
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 31, 2024
91d2a96
PASSED: test_units.py (still needs more tests)
coxipi Jul 31, 2024
1fdf371
Merge branch 'split_from_xclim' of github.com:Ouranosinc/xsdba into s…
coxipi Jul 31, 2024
ed49891
typo in list comprehension
coxipi Jul 31, 2024
cbcdf3c
don't use compare_units; test harmonize_units
coxipi Jul 31, 2024
41fdd03
test harmonize_units; don't use compare_units;
coxipi Jul 31, 2024
ea731e0
PASSED: test_indicators.py (only core functionalities)
coxipi Jul 31, 2024
0db32bf
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 31, 2024
45ca16e
formatting
coxipi Jul 31, 2024
9685858
Merge branch 'split_from_xclim' of github.com:Ouranosinc/xsdba into s…
coxipi Jul 31, 2024
00ba549
remove xc dependence, formatting, dependencies
coxipi Aug 1, 2024
25ed32b
ExtremeValues added & tests & formatting
coxipi Aug 1, 2024
52546bc
formatting
coxipi Aug 1, 2024
45ec1b6
add MBCn tests
coxipi Aug 1, 2024
47cd132
SBCK added & tests
coxipi Aug 1, 2024
0a93b8a
what a beaut! (add logos)
coxipi Aug 1, 2024
c5e5f6b
correct size of logo
coxipi Aug 1, 2024
9b55d7d
notebooks added
coxipi Aug 2, 2024
9c98e61
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 2, 2024
51bd9dc
Cleaning: remove many xclim mentions
coxipi Aug 2, 2024
6e994dc
Merge branch 'split_from_xclim' of https://github.com/Ouranosinc/xsdb…
coxipi Aug 2, 2024
adfa2cb
link logo
coxipi Aug 2, 2024
4647475
update CHANGELOG
coxipi Aug 2, 2024
213d869
remove some dead code
coxipi Aug 2, 2024
df76855
add back test (mainly checks with Cannon)
coxipi Aug 2, 2024
71373a8
fixed test_to_additive
coxipi Aug 2, 2024
d6968af
some formatting cleaning
coxipi Aug 2, 2024
1f4f6b6
minor convention fixes
Zeitsperre Aug 5, 2024
8b7d8e9
ignore xclim submodules folder
Zeitsperre Aug 5, 2024
69a576c
docstring fixes
Zeitsperre Aug 5, 2024
6f38d4a
update environment
Zeitsperre Aug 5, 2024
9be9d52
add annotation imports
Zeitsperre Aug 5, 2024
1de32a3
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 5, 2024
8c1afaa
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 5, 2024
9164be9
fix illegal pipe
Zeitsperre Aug 5, 2024
75a159e
add needed functions for generate_atmos - WIP
Zeitsperre Aug 5, 2024
e65adcc
remove generate_atmos and dependencies
coxipi Aug 19, 2024
9f46e40
new numpydoc API
coxipi Aug 21, 2024
eed0d89
Merge branch 'main' of https://github.com/Ouranosinc/xsdba into split…
coxipi Aug 21, 2024
dee8a1b
update dependencies for github
coxipi Aug 28, 2024
de7f9ab
remove py3.8 from testing suite
coxipi Aug 28, 2024
4c872a5
remove generate_atmos uses / imports
coxipi Aug 28, 2024
06b353f
pin pytest/xdoctest
coxipi Aug 29, 2024
35442a4
remove extra pytest pin
coxipi Aug 29, 2024
ce09357
add pooch deps
coxipi Aug 29, 2024
ac280ce
xclim as opt dep for prop/meas
coxipi Sep 13, 2024
42ff945
Merge branch 'main' of https://github.com/Ouranosinc/xsdba into split…
coxipi Sep 13, 2024
3556b1c
fix fixtures, add pytest-xdist
Zeitsperre Sep 13, 2024
fc4ed5c
install development version of xclim
Zeitsperre Sep 13, 2024
e59282f
fix testdata fetching
Zeitsperre Sep 17, 2024
5b9ff87
remove more xclim duplicated code
coxipi Sep 17, 2024
7e184ff
Merge branch 'split_from_xclim' of https://github.com/Ouranosinc/xsdb…
coxipi Sep 17, 2024
ca1672b
ignore top import errors
coxipi Sep 17, 2024
805e369
position of exception
coxipi Sep 17, 2024
2f31dc6
address several dependency issues, fix some broken tests, add require…
Zeitsperre Oct 2, 2024
bd60551
drop Python3.9, stage Python3.13
Zeitsperre Oct 2, 2024
6ebaf29
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 2, 2024
73cec4a
coding convention fixes
Zeitsperre Oct 2, 2024
07991e4
Merge branch 'main' into split_from_xclim
Zeitsperre Oct 2, 2024
80117d0
add xclim v0.53 workaround
Zeitsperre Oct 2, 2024
55606d9
first try at configuring references
Zeitsperre Oct 7, 2024
923b0e9
fix tests, remove xclim redundancies
coxipi Oct 7, 2024
a88df39
Merge branch 'split_from_xclim' of https://github.com/Ouranosinc/xsdb…
coxipi Oct 7, 2024
a69dd31
add pint2cfunits and netcdf4 dependency
coxipi Oct 7, 2024
8e22153
remove `sdba-` in references
coxipi Oct 7, 2024
12e02d1
solve some docs problems, remove unused functions
coxipi Oct 21, 2024
6196909
fix make docs errors
coxipi Oct 23, 2024
fc316ea
add nbsphinx
coxipi Oct 23, 2024
c0c8c2d
add ipython to dependencies
coxipi Oct 24, 2024
0599392
add ipykernel to deps
coxipi Oct 24, 2024
803e677
cleaning (dependencies, remove xclim53 hacks)
coxipi Oct 25, 2024
0eff028
update sdba from xclim
coxipi Oct 29, 2024
16e594c
remove atmosds, not necessary
coxipi Oct 30, 2024
1e7dc68
remove unused functions (units, get_calendar)
coxipi Oct 31, 2024
7ef3264
pins: pint , cf-xr
coxipi Oct 31, 2024
b177320
remove unused fcts/imports, add needed imports
coxipi Oct 31, 2024
c8b57b7
import uses_dask from base
coxipi Oct 31, 2024
a7f9cc0
units2pint now accepts a str with magnitude
coxipi Nov 1, 2024
c9e67d7
make parse_string private
coxipi Nov 1, 2024
bd39c92
val -> value
coxipi Nov 1, 2024
52628da
Merge branch 'main' into split_from_xclim
Zeitsperre Nov 4, 2024
11731fc
fast-forward cookiecutter
Zeitsperre Nov 4, 2024
bbd8ca9
try a different approach
Zeitsperre Nov 4, 2024
a4ad584
force Python in tox
Zeitsperre Nov 4, 2024
18ce70e
typo fix
Zeitsperre Nov 4, 2024
f031599
simplify tox.int
coxipi Nov 5, 2024
43d6503
Merge branch 'split_from_xclim' of https://github.com/Ouranosinc/xsdb…
coxipi Nov 5, 2024
0e0fe94
Merge branch 'main' of https://github.com/Ouranosinc/xsdba into split…
coxipi Nov 5, 2024
f6e6efd
try something else for tox.ini
coxipi Nov 5, 2024
bb18108
Merge pull request #39 from Ouranosinc/fast-forward
Zeitsperre Nov 5, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .cruft.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"template": "https://github.com/Ouranosinc/cookiecutter-pypackage",
"commit": "1d9ee5f08d3e8e4f78a4aabb75e2ce4eff8750bf",
"commit": "f750ad2185cbb56df6f7e98a269bdd8399283ea8",
"checkout": null,
"context": {
"cookiecutter": {
Expand Down
8 changes: 8 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ ignore =
F,
W503
per-file-ignores =
rst-directives =
bibliography,
autolink-skip
rst-roles =
doc,
mod,
Expand All @@ -25,3 +28,8 @@ rst-roles =
py:mod,
py:obj,
py:ref
ref,
cite:cts,
cite:p,
cite:t,
cite:ts
13 changes: 8 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,10 @@ jobs:
matrix:
os: [ 'ubuntu-latest' ]
python-version:
- "3.8"
- "3.9"
- "3.10"
- "3.11"
- "3.12"
# - "3.13.0-rc.2"
# - "3.13"
steps:
- name: Harden Runner
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
Expand All @@ -84,7 +82,7 @@ jobs:
key: ${{ matrix.os }}-Python${{ matrix.python-version }}-${{ hashFiles('pyproject.toml', 'tox.ini') }}
- name: Test with tox
run: |
python -m tox
python -m tox -e ${{ matrix.python-version }}-coveralls
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_FLAG_NAME: run-${{ matrix.python-version }}
Expand All @@ -98,7 +96,7 @@ jobs:
strategy:
matrix:
os: [ 'ubuntu-latest' ]
python-version: [ "3.9", "3.10", "3.11", "3.12" ]
python-version: [ "3.10", "3.11", "3.12" ]
defaults:
run:
shell: bash -l {0}
Expand All @@ -118,6 +116,11 @@ jobs:
create-args: >-
python=${{ matrix.python-version }}
micromamba-version: "1.5.10-0" # pinned to avoid the breaking changes with mamba and micromamba (2.0.0).
- name: Install xclim development version
# FIXME: This is a workaround to install xclim v0.53, which is not released.
run: |
echo "Installing xclim from main branch until version 0.53.0+ is released"
python -m pip install git+https://github.com/Ouranosinc/xclim.git@main
Zeitsperre marked this conversation as resolved.
Show resolved Hide resolved
- name: Install xsdba
run: |
python -m pip install --no-deps .
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/publish-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ jobs:
files.pythonhosted.org:443
github.com:443
pypi.org:443
ruf-repo-cdn.sigstore.dev:443
upload.pypi.org:443
- name: Checkout Repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/tag-testpypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ jobs:
files.pythonhosted.org:443
github.com:443
pypi.org:443
ruf-repo-cdn.sigstore.dev:443
test.pypi.org:443
- name: Checkout Repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ repos:
hooks:
- id: ruff
args: [ '--fix' ]
- id: ruff-format
# - id: ruff-format
- repo: https://github.com/pycqa/flake8
rev: 7.1.1
hooks:
Expand Down
5 changes: 5 additions & 0 deletions .zenodo.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
"name": "Smith, Trevor James",
"affiliation": "Ouranos, Montréal, Québec, Canada",
"orcid": "0000-0001-5393-8359"
},
{
"name": "Dupuis, Éric",
"affiliation": "Ouranos, Montréal, Québec, Canada",
"orcid": "0000-0001-7976-4596"
}
],
"keywords": [
Expand Down
5 changes: 3 additions & 2 deletions AUTHORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@ Credits
Development Lead
----------------

* Trevor James Smith <smith.trevorj@ouranos.ca> `@Zeitsperre <https://github.com/Zeitsperre>`_
* Éric Dupuis <dupuis.eric@ouranos.ca> `@coxipi <https://github.com/coxipi>`_

Co-Developers
-------------

None yet. Why not be the first?
* Pascal Bourgault <[email protected]> `@aulemahal <https://github.com/aulemahal>`_
* Trevor James Smith <[email protected]> `@Zeitsperre <https://github.com/Zeitsperre>`_

Contributors
------------
Expand Down
10 changes: 4 additions & 6 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,20 @@ Changelog
`Unreleased <https://github.com/Ouranosinc/xsdba>`_ (latest)
------------------------------------------------------------

Contributors:
Contributors: Éric Dupuis (:user:`coxipi`), Trevor James Smith (:user:`Zeitsperre`).

Changes
^^^^^^^
* No change.
* Split `sdba` from `xclim` and duplicate code where needed. (:pull:`8`)
* `units` are a copy (or almost) of given modules in `xclim`. A lot of duplicated code from xclim's `calendar` is also in xsdba's `base`. (:pull:`8`)

Fixes
^^^^^
* No change.

.. _changes_0.1.0:

`v0.1.0 <https://github.com/Ouranosinc/xsdba/tree/0.1.0>`_
----------------------------------------------------------

Contributors: Trevor James Smith (:user:`Ouranosinc`)
Contributors: Trevor James Smith (:user:`Zeitsperre`)

Changes
^^^^^^^
Expand Down
4 changes: 2 additions & 2 deletions CI/requirements_ci.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
bump-my-version==0.28.0
coveralls==4.0.1
pip==24.3.1
flit==3.10.1
flit==3.9.0
tox==4.23.2
tox-gh==1.4.1
tox-gh==1.4.4
16 changes: 7 additions & 9 deletions CI/requirements_ci.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# This file is autogenerated by pip-compile with Python 3.8
# This file is autogenerated by pip-compile with Python 3.9
# by the following command:
#
# pip-compile --generate-hashes --output-file=CI/requirements_ci.txt CI/requirements_ci.in
Expand Down Expand Up @@ -399,27 +399,25 @@ tox==4.23.2 \
# via
# -r CI/requirements_ci.in
# tox-gh
tox-gh==1.4.1 \
--hash=sha256:005b33d16eef1bd1dae9f7d8b3cef53374af7d475f9c9c33ef098247741fb694 \
--hash=sha256:da422beccbdc5ad5994fe8faf6c193f2d794e957628b052ba23e7fcf9e2e340f
tox-gh==1.4.4 \
--hash=sha256:4ea585f66585b90f5826b1677cfc9453747792a0f9ff83d468603bc17556e07b \
--hash=sha256:b962e0f8c4619e98d11c2a135939876691e148b843b7dac4cff7de1dc4f7c215
# via -r CI/requirements_ci.in
typing-extensions==4.12.2 \
--hash=sha256:04e5ca0351e0f3f85c6853954072df659d0d13fac324d0072316b67d7794700d \
--hash=sha256:1a7ead55c7e559dd4dee8856e3a88b41225abfe1ce8df57b7c13915fe121ffb8
# via
# annotated-types
# pydantic
# pydantic-core
# rich
# rich-click
# tox
urllib3==2.2.2 \
--hash=sha256:a448b2f64d686155468037e1ace9f2d2199776e17f0a46610480d311f73e3472 \
--hash=sha256:dd505485549a7a552833da5e6063639d0d177c04f23bc3864e41e5dc5f612168
# via requests
virtualenv==20.26.6 \
--hash=sha256:280aede09a2a5c317e409a00102e7077c6432c5a38f0ef938e643805a7ad2c48 \
--hash=sha256:7345cc5b25405607a624d8418154577459c3e0277f5466dd79c49d5e492995f2
virtualenv==20.27.1 \
--hash=sha256:142c6be10212543b32c6c45d3d3893dff89112cc588b7d0879ae5a1ec03a47ba \
--hash=sha256:f11f1b8a29525562925f745563bfd48b189450f61fb34c4f9cc79dd5aa32a1f4
# via tox
wcmatch==8.5.2 \
--hash=sha256:17d3ad3758f9d0b5b4dedc770b65420d4dac62e680229c287bf24c9db856a478 \
Expand Down
5 changes: 5 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ This package was created with Cookiecutter_ and the `Ouranosinc/cookiecutter-pyp
:target: https://github.com/psf/black
:alt: Python Black

.. |logo| image:: https://raw.githubusercontent.com/Ouranosinc/xsdba/main/docs/logos/xsdba-logo-small-light.png
:target: https://github.com/Ouranosinc/xsdba
:alt: Xsdba
:class: xsdba-logo-small no-theme

.. |build| image:: https://github.com/Ouranosinc/xsdba/actions/workflows/main.yml/badge.svg
:target: https://github.com/Ouranosinc/xsdba/actions
:alt: Build Status
Expand Down
81 changes: 81 additions & 0 deletions docs/api.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
===
API
===

.. _xsdba-user-api:

xsdba Module
============

.. automodule:: xsdba.adjustment
:members:
:exclude-members: BaseAdjustment
:special-members:
:show-inheritance:
:noindex:

.. automodule:: xsdba.processing
:members:
:noindex:

.. automodule:: xsdba.detrending
:members:
:show-inheritance:
:exclude-members: BaseDetrend
:noindex:

.. automodule:: xsdba.utils
:members:
:noindex:

.. autoclass:: xsdba.base.Grouper
:members:
:class-doc-from: init
:noindex:

.. automodule:: xsdba.nbutils
:members:
:noindex:

.. automodule:: xsdba.loess
:members:
:noindex:

.. automodule:: xsdba.properties
:members:
:exclude-members: StatisticalProperty
:noindex:

.. automodule:: xsdba.measures
:members:
:exclude-members: StatisticalMeasure
:noindex:

.. _`xsdba-developer-api`:

xsdba Utilities
---------------

.. automodule:: xsdba.base
:members:
:show-inheritance:
:exclude-members: Grouper
:noindex:

.. autoclass:: xsdba.detrending.BaseDetrend
:members:
:noindex:

.. autoclass:: xsdba.adjustment.TrainAdjust
:members:
:noindex:

.. autoclass:: xsdba.adjustment.Adjust
:members:
:noindex:

.. autofunction:: xsdba.properties.StatisticalProperty
:noindex:

.. autofunction:: xsdba.measures.StatisticalMeasure
:noindex:
Loading
Loading