Skip to content

Commit

Permalink
Merge branch 'main' into pylint-fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
coxipi authored Aug 22, 2024
2 parents a3917ff + d434dac commit 88ac0a0
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 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 pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,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 88ac0a0

Please sign in to comment.