Skip to content

Commit

Permalink
Fix/skip group if it is empty (#98)
Browse files Browse the repository at this point in the history
  • Loading branch information
L-M-Sherlock authored Mar 25, 2024
1 parent 5fb95e1 commit 40d8601
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 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 = "4.27.0"
version = "4.27.1"
readme = "README.md"
dependencies = [
"matplotlib>=3.7.0",
Expand Down
9 changes: 5 additions & 4 deletions src/fsrs_optimizer/fsrs_optimizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -814,10 +814,11 @@ def pretrain(self, dataset=None, verbose=True):
group = self.S0_dataset_group[
self.S0_dataset_group["r_history"] == first_rating
]
if group.empty and verbose:
tqdm.write(
f"Not enough data for first rating {first_rating}. Expected at least 1, got 0."
)
if group.empty:
if verbose:
tqdm.write(
f"Not enough data for first rating {first_rating}. Expected at least 1, got 0."
)
continue
delta_t = group["delta_t"]
recall = (group["y"]["mean"] * group["y"]["count"] + average_recall * 1) / (
Expand Down

0 comments on commit 40d8601

Please sign in to comment.