-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged-redundat-classes,-harmonized-logger-usage #20
Merged-redundat-classes,-harmonized-logger-usage #20
Conversation
…ncy and to avoid potential issues with mixing async and sync code.
…ments and potential issues.
…dles both the relationship map and theme evolution. The NarrativeField class now has a theme_manager attribute, which is used in the EnhancedInteractionEngine for processing theme interactions. The Story class's evolve_themes method now delegates to the ThemeManager, ensuring consistent theme handling across the simulation.
Reviewer's Guide by SourceryThis PR refactors the codebase to improve code organization, introduce better class hierarchies, and standardize logging practices. The changes include introducing a base class for consistent logging, implementing a new Memory dataclass for structured memory management, and reorganizing class relationships to reduce code duplication. Sequence diagram for story interaction processingsequenceDiagram
participant Story1 as Story 1
participant Story2 as Story 2
participant Field as NarrativeField
participant Engine as EnhancedInteractionEngine
participant Manager as ThemeManager
participant Memory as Memory
Story1->>Engine: process_interaction(Story2)
Engine->>Field: detect_resonance(Story1, Story2)
Field-->>Engine: resonance
Engine->>Manager: process_theme_interaction(Story1, Story2)
Manager-->>Engine: theme_impact
Engine->>Story1: update_perspective(Story2, ...)
Story1->>Memory: add_memory(interaction_type, resonance, ...)
Memory-->>Story1: memory added
Updated class diagram for refactored classesclassDiagram
class BaseClass {
+logger
}
class Memory {
+float timestamp
+str interaction_type
+float resonance
+List~str~ themes
+float emotional_impact
+Optional~str~ partner_id
}
class StoryState {
+List~str~ active_themes
+int interaction_count
+update(Memory memory)
}
class ThemeRelationshipMap {
+get_theme_resonance(str theme1, str theme2) float
}
class ThemeEvolutionEngine {
+update_theme_resonance(str theme, float resonance)
+evolve_themes(Story story, interaction_history)
}
class Story {
+List~Memory~ memory_layer
+StoryState memory_state
+add_memory(Memory memory)
+evolve_themes(interaction_history)
}
class NarrativeField {
+ThemeManager theme_manager
}
class ThemeManager {
+ThemeRelationshipMap relationship_map
+ThemeEvolutionEngine evolution_engine
+process_theme_interaction(Story story1, Story story2)
+evolve_themes(Story story, interaction_history)
}
BaseClass <|-- ThemeRelationshipMap
BaseClass <|-- ThemeEvolutionEngine
BaseClass <|-- Story
BaseClass <|-- NarrativeField
BaseClass <|-- ThemeManager
Story --> StoryState
Story --> Memory
NarrativeField --> ThemeManager
ThemeManager --> ThemeRelationshipMap
ThemeManager --> ThemeEvolutionEngine
ThemeEvolutionEngine --> Story
ThemeRelationshipMap --> ThemeEvolutionEngine
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @leonvanbokhorst - I've reviewed your changes and they look great!
Here's what I looked at during the review
- 🟡 General issues: 2 issues found
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟡 Complexity: 1 issue found
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
Summary by Sourcery
Refactor the codebase to improve modularity and consistency by introducing a BaseClass for logger usage, a Memory class for better data encapsulation, and a ThemeManager for theme evolution. Enhance the StoryPhysics and EnhancedInteractionEngine for more realistic simulations and interactions. Update the configuration to increase batch size for performance optimization.
Enhancements:
Build: