-
Notifications
You must be signed in to change notification settings - Fork 2
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
Add test for infinite time parents #101
Conversation
WalkthroughThis update introduces a new test to scrutinize the behavior of graphs with nodes set at infinite times, specifically focusing on parent-child edge additions and the validation of node times. This change is pivotal in addressing the considerations around allowing nodes at infinity within Graphical Isolation with Migration (GIG) models, thus ensuring compatibility with existing paradigms and enhancing the model's robustness in handling edge cases. Changes
Assessment against linked issues
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
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.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files selected for processing (1)
- tests/test_tables.py (1 hunks)
Additional comments: 1
tests/test_tables.py (1)
- 256-265: The test method
test_parent_child_at_inf
correctly addresses the objectives outlined in the PR description by testing the behavior of adding edges with infinite node times. However, there are a few points to consider for improvement:
Exception Message Validation: The use of
match="not less than parent time"
in thepytest.raises
call is good practice as it ensures that the specific error message is being tested. This helps in verifying that the error raised is indeed the one expected due to the violation of node time constraints.Test Coverage: The test covers the scenario where an edge is added with a child node time not less than the parent node time, which is expected to raise a
ValueError
. It also tests adding an edge with valid node times, which should not raise an error. This effectively tests both the negative and positive cases for the addition of edges with infinite times.Clarity and Maintainability: The test is clear and concise, making it easy to understand what is being tested. This is crucial for maintainability and future modifications.
Potential Expansion: While the current test effectively addresses the specific case of adding edges with infinite node times, consider if there are other edge cases or scenarios related to infinite node times that could be beneficial to test. For example, testing the behavior when converting the GIG to a tree sequence with infinite-time nodes present, if applicable based on the library's capabilities and the discussion in issue Should GIGs be allowed to have a node at time=infinity? #95.
Overall, the test method is well-implemented and aligns with the objectives of addressing the handling of nodes at time=infinity within GIGs. It would be beneficial to ensure comprehensive test coverage by considering additional scenarios related to infinite node times, if any.
Fixes #95
Summary by CodeRabbit