Skip to content

Commit

Permalink
Minor updates (#18)
Browse files Browse the repository at this point in the history
* Changed access levels

* Modified access level

* Updated default parameters

* Update Sources/FSRS/Models/FSRSDefaults.swift

* update codecov-action version

---------

Co-authored-by: Jarrett Ye <[email protected]>
  • Loading branch information
ampo0809 and L-M-Sherlock authored Nov 14, 2024
1 parent acb9528 commit 9e0bc91
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 12 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/swift.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ jobs:
with:
output-file: ./coverage/lcov.info

- uses: codecov/codecov-action@v1
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage/lcov.info
Expand Down
4 changes: 2 additions & 2 deletions Sources/FSRS/Algorithm/FSRS.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public class FSRS: FSRSAlgorithm {
}
}

override init(parameters: FSRSParameters) {
override public init(parameters: FSRSParameters) {
super.init(parameters: parameters)
}

Expand Down Expand Up @@ -84,7 +84,7 @@ public class FSRS: FSRSAlgorithm {
* const recordLog = f.repeat(card, new Date(), repeatAfterHandler);
* ```
*/
func `repeat`(
public func `repeat`(
card: Card,
now: Date,
_ completion: ((_ log: IPreview) -> IPreview)? = nil
Expand Down
6 changes: 1 addition & 5 deletions Sources/FSRS/Models/FSRSDefaults.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,7 @@ import Foundation
public class FSRSDefaults {
var defaultRequestRetention = 0.9
var defaultMaximumInterval = 36500.0
var defaultW = [
0.4072, 1.1829, 3.1262, 15.4722, 7.2102, 0.5316, 1.0651, 0.0234, 1.616,
0.1544, 1.0824, 1.9813, 0.0953, 0.2975, 2.2042, 0.2407, 2.9466, 0.5034,
0.6567,
]
var defaultW = [0.4072, 1.1829, 3.1262, 15.4722, 7.2102, 0.5316, 1.0651, 0.0234, 1.616, 0.1544, 1.0824, 1.9813, 0.0953, 0.2975, 2.2042, 0.2407, 2.9466, 0.5034, 0.6567]
var defaultEnableFuzz = false
var defaultEnableShortTerm = true

Expand Down
6 changes: 3 additions & 3 deletions Sources/FSRS/Models/FSRSModels.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public enum CardState: Int, Codable {
case review = 2
case relearning = 3

var stringValue: String {
public var stringValue: String {
switch self {
case .new: return "new"
case .learning: return "learning"
Expand Down Expand Up @@ -144,7 +144,7 @@ public struct Card: Equatable, Codable {
}

public struct RecordLogItem: Codable, Equatable {
var card: Card
public var card: Card
var log: ReviewLog
}

Expand All @@ -157,7 +157,7 @@ public struct FSRSParameters: Codable, Equatable {
var enableFuzz: Bool
var enableShortTerm: Bool

init(
public init(
requestRetention: Double? = nil,
maximumInterval: Double? = nil,
w: [Double]? = nil,
Expand Down
2 changes: 1 addition & 1 deletion Sources/FSRS/Models/FSRSTypes.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public struct IPreview {
self.recordLog = recordLog
}

subscript(rating: Rating) -> RecordLogItem? {
public subscript(rating: Rating) -> RecordLogItem? {
get {
recordLog[rating]
}
Expand Down

0 comments on commit 9e0bc91

Please sign in to comment.