Skip to content

Commit

Permalink
Merge branch 'main' into use-pooch
Browse files Browse the repository at this point in the history
  • Loading branch information
Zeitsperre authored Aug 22, 2024
2 parents 0ba3277 + d434dac commit 6065acd
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 7 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@
Changelog
=========

v0.53.0
--------------------
Contributors to this version: Adrien Lamarche (:user:`LamAdr`).

Bug fixes
^^^^^^^^^
* Fixed a small inefficiency in ``_otc_adjust`` (:pull:`1890`).

v0.52.0 (2024-08-08)
--------------------
Contributors to this version: David Huard (:user:`huard`), Trevor James Smith (:user:`Zeitsperre`), Hui-Min Wang (:user:`Hem-W`), Éric Dupuis (:user:`coxipi`), Sarah Gammon (:user:`SarahG-579462`), Pascal Bourgault (:user:`aulemahal`), Juliette Lavoie (:user:`juliettelavoie`), Adrien Lamarche (:user:`LamAdr`).
Expand Down
2 changes: 1 addition & 1 deletion CI/requirements_ci.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
bump-my-version==0.25.4
bump-my-version==0.26.0
coveralls==4.0.1
deptry==0.19.1
flit==3.9.0
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ dev = [
# Dev tools and testing
"black[jupyter] ==24.8.0",
"blackdoc ==0.3.9",
"bump-my-version ==0.25.4",
"bump-my-version ==0.26.0",
"codespell ==2.3.0",
"coverage[toml] >=7.5.0",
"coveralls >=4.0.0",
Expand Down Expand Up @@ -136,7 +136,7 @@ target-version = [
]

[tool.bumpversion]
current_version = "0.52.0"
current_version = "0.52.1-dev.0"
commit = true
commit_args = "--no-verify"
tag = false
Expand Down
2 changes: 1 addition & 1 deletion xclim/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

__author__ = """Travis Logan"""
__email__ = "[email protected]"
__version__ = "0.52.0"
__version__ = "0.52.1-dev.0"


with _resources.as_file(_resources.files("xclim.data")) as _module_data:
Expand Down
4 changes: 1 addition & 3 deletions xclim/sdba/_adjustment.py
Original file line number Diff line number Diff line change
Expand Up @@ -1031,10 +1031,8 @@ def _otc_adjust(
rng = np.random.default_rng()
# The plan row corresponding to a source bin indicates its probabilities to be transported to every target bin
for i, binX_group in enumerate(binX_groups):
# Get the plan row of this bin
pi = np.where((binX[binX_group[0]] == gridX).all(1))[0][0]
# Pick as much target bins for this source bin as there are points in the source bin
choice = rng.choice(range(muY.size), p=plan[pi, :], size=binX_count[i])
choice = rng.choice(range(muY.size), p=plan[i, :], size=binX_count[i])
out[binX_group] = (gridY[choice] + 1 / 2) * bin_width + bin_origin

if jitter_inside_bins:
Expand Down

0 comments on commit 6065acd

Please sign in to comment.