diff --git a/pyproject.toml b/pyproject.toml index ca4cf0e..01630bf 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "FSRS-Optimizer" -version = "5.2.0" +version = "5.2.1" readme = "README.md" dependencies = [ "matplotlib>=3.7.0", diff --git a/src/fsrs_optimizer/fsrs_optimizer.py b/src/fsrs_optimizer/fsrs_optimizer.py index fa5bdd6..2178198 100644 --- a/src/fsrs_optimizer/fsrs_optimizer.py +++ b/src/fsrs_optimizer/fsrs_optimizer.py @@ -752,7 +752,11 @@ def create_time_series( if df.empty: raise ValueError("Training data is inadequate.") - if "review_state" in df.columns and "review_duration" in df.columns: + if ( + "review_state" in df.columns + and "review_duration" in df.columns + and not (df["review_duration"] == 0).all() + ): df["review_state"] = df["review_state"].map( lambda x: x if x != New else Learning )