style: 代码格式化
This commit is contained in:
@@ -4,6 +4,7 @@ Examples and usage patterns for HeurAMS modules.
|
||||
This file demonstrates how to use the various HeurAMS components
|
||||
in common scenarios and workflows.
|
||||
"""
|
||||
|
||||
import json
|
||||
from datetime import datetime, timezone
|
||||
from pathlib import Path
|
||||
@@ -28,12 +29,9 @@ class BasicUsageExamples:
|
||||
print("=== Creating Basic Atom ===")
|
||||
|
||||
# Create the components
|
||||
nucleon = Nucleon(
|
||||
content="What is the capital of France?",
|
||||
answer="Paris"
|
||||
)
|
||||
nucleon = Nucleon(content="What is the capital of France?", answer="Paris")
|
||||
electron = Electron() # Uses default values
|
||||
orbital = Orbital() # Uses default values
|
||||
orbital = Orbital() # Uses default values
|
||||
|
||||
# Combine into an Atom
|
||||
atom = Atom(nucleon=nucleon, electron=electron, orbital=orbital)
|
||||
@@ -55,7 +53,7 @@ class BasicUsageExamples:
|
||||
|
||||
nucleon = Nucleon(
|
||||
content="The {{c1::capital}} of {{c2::France}} is {{c3::Paris}}.",
|
||||
answer="capital, France, Paris"
|
||||
answer="capital, France, Paris",
|
||||
)
|
||||
electron = Electron()
|
||||
orbital = Orbital()
|
||||
@@ -126,7 +124,7 @@ class AlgorithmExamples:
|
||||
|
||||
print("\nAfter review (quality 1 - failed):")
|
||||
print(f" Repetitions: {new_electron.repetitions}") # Should reset to 0
|
||||
print(f" Interval: {new_electron.interval} days") # Should reset to 1
|
||||
print(f" Interval: {new_electron.interval} days") # Should reset to 1
|
||||
|
||||
return new_electron
|
||||
|
||||
@@ -145,20 +143,17 @@ class ReactorExamples:
|
||||
atom = Atom("test_atom")
|
||||
|
||||
# Create nucleon with content
|
||||
nucleon = Nucleon("nucleon_id", {
|
||||
"content": "What is the capital of Germany?",
|
||||
"answer": "Berlin"
|
||||
})
|
||||
nucleon = Nucleon(
|
||||
"nucleon_id",
|
||||
{"content": "What is the capital of Germany?", "answer": "Berlin"},
|
||||
)
|
||||
|
||||
# Create electron with algorithm data
|
||||
electron = Electron("electron_id")
|
||||
|
||||
# Create orbital configuration
|
||||
orbital = Orbital(
|
||||
quick_view=[["cloze", 1]],
|
||||
recognition=[],
|
||||
final_review=[],
|
||||
puzzle_config={}
|
||||
quick_view=[["cloze", 1]], recognition=[], final_review=[], puzzle_config={}
|
||||
)
|
||||
|
||||
# Link components to atom
|
||||
@@ -219,4 +214,4 @@ def run_all_examples():
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
run_all_examples()
|
||||
run_all_examples()
|
||||
|
||||
Reference in New Issue
Block a user