Skip to content

Commit

Permalink
Feat/optimize with revlog.csv (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
L-M-Sherlock authored Aug 8, 2023
1 parent 1c28497 commit 3110ada
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -150,3 +150,4 @@ meta
*.json
.fsrs_optimizer
*.ipynb
*.zip
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.7.1"
version = "4.8.0"
readme = "README.md"
dependencies = [
"matplotlib>=3.7.0",
Expand Down
13 changes: 9 additions & 4 deletions src/fsrs_optimizer/__main__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import fsrs_optimizer
import argparse
import shutil
import json
import pytz
import os
Expand Down Expand Up @@ -69,10 +70,14 @@ def remembered_fallback_prompt(key: str, pretty: str = None):
save_graphs = graphs_input != "n"

optimizer = fsrs_optimizer.Optimizer()
optimizer.anki_extract(
f"../{filepath}",
remembered_fallbacks["filter_out_suspended_cards"] == "y"
)
if filepath.endswith(".apkg") or filepath.endswith(".colpkg"):
optimizer.anki_extract(
f"../{filepath}",
remembered_fallbacks["filter_out_suspended_cards"] == "y"
)
else:
# copy the file to the current directory and rename it as revlog.csv
shutil.copyfile(f"../{filepath}", "revlog.csv")
analysis = optimizer.create_time_series(
remembered_fallbacks["timezone"],
remembered_fallbacks["revlog_start_date"],
Expand Down

0 comments on commit 3110ada

Please sign in to comment.