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

Fix/skip extract simulation config if review duration is zero #142

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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading