Skip to content

Commit

Permalink
Fix/skip extract simulation config if review duration is zero (#142)
Browse files Browse the repository at this point in the history
* Fix/skip extract_simulation_config if review_duration is zero

* format

* bump version
  • Loading branch information
L-M-Sherlock authored Oct 17, 2024
1 parent b6daa2f commit 6f1d4a9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
6 changes: 5 additions & 1 deletion src/fsrs_optimizer/fsrs_optimizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand Down

0 comments on commit 6f1d4a9

Please sign in to comment.