Skip to content

Commit

Permalink
Fix/sort revlog in create_time_series (#37)
Browse files Browse the repository at this point in the history
  • Loading branch information
L-M-Sherlock committed Sep 8, 2023
1 parent c5766ef commit b42e9bd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
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.13.4"
version = "4.13.5"
readme = "README.md"
dependencies = [
"matplotlib>=3.7.0",
Expand Down
1 change: 1 addition & 0 deletions src/fsrs_optimizer/fsrs_optimizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,7 @@ def flags2str(flags: List[int]) -> str:
def create_time_series(self, timezone: str, revlog_start_date: str, next_day_starts_at: int):
"""Step 2"""
df = pd.read_csv("./revlog.csv")
df.sort_values(by=['card_id', 'review_time'], inplace=True, ignore_index=True)
df['review_state'] = df['review_state'].map(lambda x: x if x != New else Learning)
self.state_sequence = np.array(df['review_state'])
self.duration_sequence = np.array(df['review_duration'])
Expand Down

0 comments on commit b42e9bd

Please sign in to comment.