From 7661d7facb6b71cb5a6db2a98c3ff427e1ca65ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Therese=20Natter=C3=B8y?= Date: Thu, 26 Nov 2020 11:15:57 +0100 Subject: [PATCH] Sort rft dataframe by dates --- CHANGELOG.md | 1 + webviz_subsurface/plugins/_rft_plotter/rft_plotter.py | 1 + 2 files changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ed6d69025..0f9a0ba91 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - [#486](https://github.com/equinor/webviz-subsurface/pull/486) - Bug fix in `PropertyStatistics`. Show realization number instead of dataframe index for hover text. +- [#498](https://github.com/equinor/webviz-subsurface/pull/498) - Bug fix in `RFT-plotter`. Sort dataframe by date to get correct order in date-slider. ## [0.1.4] - 2020-10-29 ### Added diff --git a/webviz_subsurface/plugins/_rft_plotter/rft_plotter.py b/webviz_subsurface/plugins/_rft_plotter/rft_plotter.py index 1271d1c56..8bce09916 100644 --- a/webviz_subsurface/plugins/_rft_plotter/rft_plotter.py +++ b/webviz_subsurface/plugins/_rft_plotter/rft_plotter.py @@ -179,6 +179,7 @@ def __init__( self.ertdatadf["SIMULATED"] - self.ertdatadf["OBSERVED"] ) self.ertdatadf["YEAR"] = pd.to_datetime(self.ertdatadf["DATE"]).dt.year + self.ertdatadf = self.ertdatadf.sort_values(by="DATE") self.ertdatadf["DATE_IDX"] = self.ertdatadf["DATE"].apply( lambda x: list(self.ertdatadf["DATE"].unique()).index(x) )