-
Notifications
You must be signed in to change notification settings - Fork 14
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
start splitting kfactory into subpackages #522
base: main
Are you sure you want to change the base?
Conversation
Reviewer's Guide by SourceryThis PR implements lazy loading for subpackages in kfactory by modifying the package's init.py file. The implementation uses Python's getattr mechanism to dynamically import 'packing' and 'cells' submodules only when they are first accessed. Class diagram for kfactory package restructuringclassDiagram
class kfactory {
+flexgrid_dbu
+flexgrid
+grid_dbu
+grid
+constant
+config
+dpolygon_from_array
+kdb
+lay
+logger
+placer
+polygon_from_array
+port
+VInstance
+VKCell
+cell
+__getattr__(name: str) ModuleType | None
}
note for kfactory "Lazy loading implemented for 'packing' and 'cells' submodules using __getattr__"
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
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.
We've reviewed this pull request using the Sourcery rules engine. If you would also like our AI-powered code review then let us know.
if name in ["packing", "cells"]: | ||
return importlib.import_module("." + name, __name__) |
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.
suggestion (code-quality): We've found these issues:
- Use set when checking membership of a collection of literals (
collection-into-set
) - Use f-string instead of string concatenation (
use-fstring-for-concatenation
)
if name in ["packing", "cells"]: | |
return importlib.import_module("." + name, __name__) | |
if name in {"packing", "cells"}: | |
return importlib.import_module(f".{name}", __name__) |
Label error. Requires at least 1 of: breaking, bug, github_actions, documentation, dependencies, enhancement, feature, maintenance, security. Found: |
Summary by Sourcery
Enhancements: