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 108 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
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
9 changes: 6 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@ jobs:
matrix:
os: [ 'ubuntu-latest' ]
python-version:
- "3.8"
- "3.9"
- "3.10"
- "3.11"
- "3.12"
Expand Down Expand Up @@ -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
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
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:
54 changes: 49 additions & 5 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,18 @@

sys.path.insert(0, os.path.abspath('..'))

import xarray
from pybtex.plugin import register_plugin
from pybtex.style.formatting.alpha import Style as AlphaStyle
from pybtex.style.labels import BaseLabelStyle

xarray.DataArray.__module__ = "xarray"
xarray.Dataset.__module__ = "xarray"
xarray.CFTimeIndex.__module__ = "xarray"

import xsdba


# -- General configuration ---------------------------------------------

# If your documentation needs a minimal Sphinx version, state it here.
Expand All @@ -36,12 +46,21 @@
'sphinx.ext.autodoc',
'sphinx.ext.autosectionlabel',
'sphinx.ext.extlinks',
'sphinx.ext.viewcode',
"sphinx.ext.intersphinx",
"sphinx.ext.napoleon",
'sphinx.ext.todo',
'sphinx.ext.viewcode',
"sphinxcontrib.bibtex",
'sphinx_codeautolink',
'sphinx_copybutton',
"nbsphinx",

]

# suppress "duplicate citation for key" warnings
suppress_warnings = ['bibtex.duplicate_citation']


autosectionlabel_prefix_document = True
autosectionlabel_maxdepth = 2

Expand All @@ -53,6 +72,29 @@
"special-members": False,
}


# Bibliography stuff
# a simple label style which uses the bibtex keys for labels
class XCLabelStyle(BaseLabelStyle):
def format_labels(self, sorted_entries):
for entry in sorted_entries:
yield entry.key


class XCStyle(AlphaStyle):
default_label_style = XCLabelStyle


register_plugin("pybtex.style.formatting", "xcstyle", XCStyle)
bibtex_bibfiles = ["references.bib"]
bibtex_default_style = "xcstyle"
bibtex_reference_style = "author_year"

intersphinx_mapping = {
"scipy": ("https://docs.scipy.org/doc/scipy/", None),
"pandas": ("https://pandas.pydata.org/docs/", None),
}

extlinks = {
"issue": ("https://github.com/Ouranosinc/xsdba/issues/%s", "GH/%s"),
"pull": ("https://github.com/Ouranosinc/xsdba/pull/%s", "PR/%s"),
Expand All @@ -67,7 +109,9 @@
source_suffix = {'.rst': 'restructuredtext'}

# The master toctree document.
master_doc = 'index'
# master_doc = 'index'
root_doc = "index"


# General information about the project.
project = 'xsdba'
Expand Down Expand Up @@ -157,7 +201,7 @@
# (source start file, target name, title, author, documentclass
# [howto, manual, or own class]).
latex_documents = [
(master_doc, 'xsdba.tex',
(root_doc, 'xsdba.tex',
'xsdba Documentation',
'Trevor James Smith', 'manual'),
]
Expand All @@ -168,7 +212,7 @@
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, 'xsdba',
(root_doc, 'xsdba',
'xsdba Documentation',
[author], 1)
]
Expand All @@ -180,7 +224,7 @@
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'xsdba',
(root_doc, 'xsdba',
'xsdba Documentation',
author,
'xsdba',
Expand Down
24 changes: 23 additions & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
@@ -1,24 +1,46 @@
Welcome to xsdba's documentation!
=================================

.. toctree::
:hidden:

self

.. toctree::
:maxdepth: 2
:caption: Contents:
:caption: Table of Contents:

readme
installation
usage
xsdba
contributing
releasing
notebooks/index
notebooks/example
notebooks/advanced_example


.. toctree::
:titlesonly:

authors
changelog
references

.. toctree::
:maxdepth: 1
:caption: All Modules

apidoc/modules


.. toctree::
:maxdepth: 2
:caption: User API

api

Indices and tables
==================
* :ref:`genindex`
Expand Down
Loading
Loading