Skip to content

Conversation

@Musab1Blaser
Copy link
Contributor

Works on #2349

This PR makes changes get_ancestors_of to ancestors for both DAG and NaiveBayes model, updating instances wherever called, including within tests.

Issue number(s) that this pull request fixes

List of changes to the codebase in this pull request

  • replaces all instances of get_ancestors_of with ancestors (in DAG base, NaiveBayes model, identification/adjustment, Discrete BN tests, NaiveBayes tests)

@Musab1Blaser Musab1Blaser changed the title ENH: Make ancestors method public for DAG and NaiveBayes model #2349 ENH: Make ancestors method public for DAG and NaiveBayes model Oct 13, 2025
Copy link
Member

@ankurankan ankurankan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Musab1Blaser I think everything looks good. Could you just change the name ancestors -> get_ancestors as we discussed in the issue?

@Musab1Blaser
Copy link
Contributor Author

@ankurankan sure, will do. Also, I think either my formatter or the repos auto formatter slightly reordered the import statements in the test file as can be seen. Should I create a new pr without this unnecessary change or leave it be and just make the discussed changes.

Copy link
Member

@ankurankan ankurankan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Thanks for the PR @Musab1Blaser. @daehyun99 Any comments?

@daehyun99
Copy link
Contributor

@ankurankan
I think it looks good too.
I don't have any comments.
Thanks.

@ankurankan ankurankan merged commit 3f091ae into pgmpy:dev Oct 18, 2025
15 checks passed
@github-project-automation github-project-automation bot moved this from PR In Progress to Done in Release v1.1 Oct 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[ENH] Rename DAG._get_ancestors_of to DAG.ancestors

3 participants