improve rxd memory usage with __slots__#3572
Conversation
|
|
✔️ 2e6f8aa -> artifacts URL |
|
✔️ 2e6f8aa -> Azure artifacts URL |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #3572 +/- ##
=======================================
Coverage 68.37% 68.38%
=======================================
Files 684 684
Lines 116712 116716 +4
=======================================
+ Hits 79803 79811 +8
+ Misses 36909 36905 -4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull Request Overview
This PR optimizes memory usage in the rxd module by adding __slots__ declarations to various classes. The __slots__ mechanism restricts the creation of dynamic attributes and reduces memory overhead per instance by eliminating the default __dict__ storage.
- Adds
__slots__declarations to multiple rxd classes to reduce memory footprint - Fixes a typo in the
_c_regionclass (_initilized→_initialized) - Converts
_OverrideLockoutsclass to use@dataclassdecorator for cleaner implementation
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| species.py | Adds empty __slots__ to _SpeciesMathable base class |
| section1d.py | Defines __slots__ for Section1D class with all instance attributes |
| rxdsection.py | Adds empty __slots__ to RxDSection base class |
| region.py | Defines comprehensive __slots__ for _c_region class and fixes typo |
| rangevar.py | Adds __slots__ to RangeVar class |
| options.py | Converts _OverrideLockouts to dataclass and adds dataclass import |
| node.py | Adds __slots__ to all Node classes (Node, Node1D, Node3D, NodeExtracellular) |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.



No description provided.