-
Notifications
You must be signed in to change notification settings - Fork 16
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 ports tests #595
Add ports tests #595
Conversation
Reviewer's Guide by SourceryThis pull request introduces comprehensive tests for the Ports and DPorts classes, enhancing the robustness of port handling within the kfactory library. It includes tests for filtering, equality checks, port creation, copying, and more. Additionally, it refactors the settings classes to use a mixin for shared functionality and adds a repr method to several classes. Class diagram for Settings refactoringclassDiagram
class SettingMixin {
+__getitem__(key: str)
+get(__key: str, default: Any)
+__contains__(__key: str)
+__str__()
}
class KCellSettings {
+restrict_types(data: dict)
}
class KCellSettingsUnits {
+restrict_types(data: dict)
}
class Info {
+restrict_types(data: dict)
+update(data: dict)
+__setitem__(key: str, value: MetaData)
+__iadd__(other: Info)
+__add__(other: Info)
}
SettingMixin <|-- KCellSettings
SettingMixin <|-- KCellSettingsUnits
SettingMixin <|-- Info
note for SettingMixin "New mixin class for shared settings functionality"
note for KCellSettings "Settings for BaseKCell"
note for KCellSettingsUnits "Settings for KCell units"
note for Info "Info for KCell"
Class diagram for Ports and DPortsclassDiagram
class ProtoPort {
<<abstract>>
+name: str
+port_type: str
+layer: LayerEnum
+width: float|int
}
class Port {
+width: int
+__repr__()
}
class DPort {
+width: float
+__repr__()
}
class ProtoPorts {
<<abstract>>
+create_port()
+__eq__(other)
+clear()
}
class Ports {
+create_port(width: int, layer, ...)
}
class DPorts {
+create_port(width: float, layer, ...)
}
ProtoPort <|-- Port
ProtoPort <|-- DPort
ProtoPorts <|-- Ports
ProtoPorts <|-- DPorts
Ports o-- Port
DPorts o-- DPort
note for Port "Integer-based port (DBU)"
note for DPort "Float-based port (microns)"
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.
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #595 +/- ##
==========================================
+ Coverage 63.61% 66.00% +2.39%
==========================================
Files 64 64
Lines 9561 9504 -57
Branches 1777 1771 -6
==========================================
+ Hits 6082 6273 +191
+ Misses 2928 2714 -214
+ Partials 551 517 -34 ☔ View full report in Codecov by Sentry. |
Summary by Sourcery
Add support for Ports in kfactory.
New Features:
Ports.filter
,Ports.contains
,Ports.create_port
,Ports.get_all_named
,Ports.copy
,Ports.print
, andPorts.pformat
methods.Tests: