Fix latent validation error in get_random() when nodes are isolated#3141
Open
anusa-saha wants to merge 1 commit intopgmpy:devfrom
Open
Fix latent validation error in get_random() when nodes are isolated#3141anusa-saha wants to merge 1 commit intopgmpy:devfrom
anusa-saha wants to merge 1 commit intopgmpy:devfrom
Conversation
Contributor
Author
|
@ankurankan do i need to add a test for this as well?? |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #3141 +/- ##
=======================================
Coverage 95.83% 95.83%
=======================================
Files 527 527
Lines 29842 29842
=======================================
Hits 28599 28599
Misses 1243 1243
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The following checklist is mandatory.
Your PR will be closed if you remove the checklist or do not answer the questions to a satisfactory level. Use of LLMs is strictly forbidden for any part of this checklist (including for improving language), and will result in a ban if we find any use of LLMs.
Your checklist for this pull request
Please answer the following questions:
Did you use an LLM for any assistance with this PR? Please describe in detail (around a paragraph) how and what you used it for?
Yes, to find minimal changes to remove the bugs
Are you able to fully explain your changes? We expect you to fully understand the algorithm and take full responsibility for any changes in this PR.
Yes
What steps have you taken to verify that the changes correctly address the issue? And what edge cases have you considered? Other than running tests, what else have you verified?
This causes an error for isolated edges
Has the LLM added try-except blocks? They will need to be removed; any error handling must be explicit.
N/A
Have you used LLM for generating tests? They need to be compressed into a smaller number of tests without reducing coverage.
N/A
Issue number(s) that this pull request fixes
List of changes to the codebase in this pull request
dag.edges()(which dropped isolated nodes), we now pass the entire dag to the model constructor so all nodes are preserved.model.latents = dag.latentsafter the graph is fully built, ensuring all latent variables exist in the model.