Skip to content
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

Dependency graph #659

Merged
merged 15 commits into from
Jan 30, 2025
Merged

Dependency graph #659

merged 15 commits into from
Jan 30, 2025

Conversation

polinabinder1
Copy link
Collaborator

@polinabinder1 polinabinder1 commented Jan 24, 2025

This generates a dependency graph between the bionemo sub-packages. Additionally, this will check that the pyproject.toml files agree with what's in the source files. This will also parse the source files to make sure that dependencies are correct between the bionemo sub-packages.

Signed-off-by: Polina Binder <[email protected]>
@codecov-commenter
Copy link

codecov-commenter commented Jan 25, 2025

Codecov Report

Attention: Patch coverage is 67.37589% with 46 lines in your changes missing coverage. Please review.

Project coverage is 86.27%. Comparing base (846c348) to head (c1f0c7d).

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...ages/bionemo-fw/src/bionemo/fw/dependency_graph.py 67.37% 46 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #659      +/-   ##
==========================================
- Coverage   86.65%   86.27%   -0.38%     
==========================================
  Files         117      118       +1     
  Lines        7021     7162     +141     
==========================================
+ Hits         6084     6179      +95     
- Misses        937      983      +46     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@dorotat-nv dorotat-nv left a comment

Choose a reason for hiding this comment

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

I am not sure is pyproject.toml is the up to date source of dependency information anymore. I am not sure how it is maintained.

If no, I thin we should implement a script that parses dependency graph for subpackages from the scripts, ie parse the project.toml files of the main project and its subpackages, extract the import paths used in Python scripts under the src directory of each subpackage, and verifies all imports starting with from bionemo.

@trvachov
Copy link
Collaborator

To me this looks like a good start just need to document "how to run" script in github PR description. I don't necessary need this to do any more than in currently does ( @pstjohn @dorotat-nv , I suggest we constrain our review just to "graph drawing" rather than any sort of py file parsing + CI enforcement.

Copy link
Collaborator

@dorotat-nv dorotat-nv left a comment

Choose a reason for hiding this comment

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

Could this script be relocated under internal/scripts?

@polinabinder1 polinabinder1 force-pushed the polinabinder/package_dependencies branch 2 times, most recently from ccab862 to 94fd399 Compare January 28, 2025 22:00
@polinabinder1 polinabinder1 force-pushed the polinabinder/package_dependencies branch from 94fd399 to ad206c4 Compare January 28, 2025 22:01
Signed-off-by: Polina Binder <[email protected]>
@polinabinder1
Copy link
Collaborator Author

Could this script be relocated under internal/scripts?

Done!

Copy link
Collaborator

@pstjohn pstjohn left a comment

Choose a reason for hiding this comment

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

This looks great, the module was laid out nicely and you have a lot of clear, reusable functions.

I do think we need unit tests for these functions though. Copilot could likely do that pretty quickly. Ideally any public function / class / method should get a test for all its expected behavior and edge cases, but even just a basic test for each of these functions would be great

I also think we should add those resulting images to our documentation; along with a command of how to run this to regenerate them.

Unfortunately putting this in internal/scripts means it's harder to write tests for; we don't execute pytests in that subdirectory. Maybe this could live in bionemo-fw? Or we could add that directory to our pytest call. But I'm worried that if we don't exercise this script in CI, it will break quickly without us realizing it and we won't be able to use it in planning a version bump / release strategy.

Signed-off-by: Polina Binder <[email protected]>
Signed-off-by: Polina Binder <[email protected]>
Signed-off-by: Polina Binder <[email protected]>
Signed-off-by: Polina Binder <[email protected]>
Signed-off-by: Polina Binder <[email protected]>
Signed-off-by: Polina Binder <[email protected]>
Signed-off-by: Polina Binder <[email protected]>
Signed-off-by: Polina Binder <[email protected]>
Copy link
Collaborator

@pstjohn pstjohn left a comment

Choose a reason for hiding this comment

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

LGTM, feel free to self-resolve other comments. Thanks!

@polinabinder1 polinabinder1 added this pull request to the merge queue Jan 30, 2025
Merged via the queue into main with commit b3829e0 Jan 30, 2025
7 checks passed
@polinabinder1 polinabinder1 deleted the polinabinder/package_dependencies branch January 30, 2025 18:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants