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

ensure un-sorted hist de-duplication #339

Merged
merged 7 commits into from Dec 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
19 changes: 5 additions & 14 deletions CHANGELOG.rst
Expand Up @@ -4,23 +4,14 @@ Changelog
v0.9.1 - unreleased
-------------------

New Features
^^^^^^^^^^^^

Breaking changes
^^^^^^^^^^^^^^^^

Deprecations
^^^^^^^^^^^^

Bug fixes
^^^^^^^^^

Documentation
^^^^^^^^^^^^^

Internal Changes
^^^^^^^^^^^^^^^^
Ensure de-duplicating the historical ensemble members conserves their order. Previously,
the legacy calibration routines used `np.unique`, which shuffles them. See `#338
<https://github.com/MESMER-group/mesmer/issues/338>`_ for details.
(`#339 <https://github.com/MESMER-group/mesmer/pull/339>`_).
By `Mathias Hauser`_.


v0.9.0 - 2023.12.19
Expand Down
5 changes: 4 additions & 1 deletion mesmer/utils/convert.py
Expand Up @@ -95,7 +95,10 @@ def separate_hist_future(var_c, time_c, cfg):
hist = np.vstack(hist)

# exclude duplicate historical runs that are available in several scenarios
var_s["hist"] = np.unique(hist, axis=0)
__, idx = np.unique(hist, axis=0, return_index=True)
# ensure hist is not re-ordered
var_s["hist"] = np.take(hist, indices=np.sort(idx), axis=0)

time_s["hist"] = time[:idx_start_fut]

# gather proj
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.