-
Notifications
You must be signed in to change notification settings - Fork 0
Feat/conditional probabilities #139
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
Conversation
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.
Pull Request Overview
This PR introduces conditional probabilities functionality by separating outcome probabilities from outcomes and adding support for conditional probability relationships based on parent options and outcomes.
- Removes the
probabilityfield from theOutcomemodel and creates a newOutcomeProbabilityentity - Adds support for conditional probabilities with parent-child relationships between outcomes and options
- Updates tests and services to work with the new probability model
Reviewed Changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/models/outcome.py | Removes probability field from Outcome model |
| src/models/outcome_probability.py | Adds new OutcomeProbability model with parent relationships |
| src/models/uncertainty.py | Adds outcome_probabilities relationship |
| src/dtos/outcome_probability_dtos.py | Creates DTOs for outcome probability data transfer |
| src/dtos/uncertainty_dtos.py | Updates uncertainty DTOs to include outcome probabilities |
| src/dtos/outcome_dtos.py | Removes probability field from outcome DTOs |
| src/repositories/outcome_probability_repository.py | Adds repository for outcome probability operations |
| src/repositories/uncertainty_repository.py | Updates to handle outcome probabilities |
| src/repositories/outcome_repository.py | Removes probability field handling |
| src/repositories/query_extensions.py | Adds loading for outcome probability relationships |
| src/services/pyagrum_solver.py | Updates solver to work with conditional probabilities |
| src/services/solver_service.py | Adds NotImplementedError for conditional probabilities |
| src/seed_database.py | Updates seed data to use new probability model |
| tests/ | Updates all tests to work with new conditional probability structure |
| alembic/versions/58dceead9599_conditional_prob.py | Database migration for conditional probabilities |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <[email protected]>
jafr67
left a comment
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.
Nice work 👍
* feat: handle conditional prob in pyagrum * refactor: update UUID handling and improve discrete probability management * fix: correct spelling of 'influence' in method names and improve probability scaling logic * fix: add type ignore comments for pyagrum usage and improve type hinting in methods
#177) * feat: add edge connections to discrete probabilities and update related services * feat: implement edge connection handling in discrete probability and update related models * feat: add edge handling to conditional probabilities and refactor related repositories * feat: implement foreign key constraints and cleanup logic for discrete probabilities * feat: enhance uncertainty handling in session manager and issue repository * feat: implement event handlers for session management and discrete probability recalculation * feat: apply relational fixes to discrete probabilities and update foreign key constraints * feat: remove unused imports and tracked entities from DiscreteProbabilityEventHandler * Update src/repositories/uncertainty_repository.py Co-authored-by: Copilot <[email protected]> * Update src/repositories/uncertainty_repository.py Co-authored-by: Copilot <[email protected]> * feat: remove unused imports and improve code clarity across multiple files * feat: remove unused endpoints and related tests for discrete probabilities * feat: update probability field to be optional in DTOs and models; add new Alembic migration * refactor: simplify migration merge --------- Co-authored-by: Copilot <[email protected]>
Migration is missing, will be performed after other pull requests are migrated and merged