Skip to content

improve rxd memory usage with __slots__#3572

Merged
ramcdougal merged 5 commits into
masterfrom
slots
Aug 19, 2025
Merged

improve rxd memory usage with __slots__#3572
ramcdougal merged 5 commits into
masterfrom
slots

Conversation

@ramcdougal

Copy link
Copy Markdown
Member

No description provided.

@sonarqubecloud

Copy link
Copy Markdown

@ramcdougal ramcdougal changed the title initial slots improve memory usage with __slots__ Aug 17, 2025
@ramcdougal ramcdougal changed the title improve memory usage with __slots__ improve rxd memory usage with __slots__ Aug 17, 2025
@github-actions

Copy link
Copy Markdown
Contributor

✔️ 2e6f8aa -> artifacts URL

@azure-pipelines

Copy link
Copy Markdown

✔️ 2e6f8aa -> Azure artifacts URL

@codecov

codecov Bot commented Aug 17, 2025

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 68.38%. Comparing base (435a3db) to head (2e6f8aa).
⚠️ Report is 47 commits behind head on master.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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_region class (_initilized_initialized)
  • Converts _OverrideLockouts class to use @dataclass decorator 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.

Comment thread share/lib/python/neuron/rxd/options.py
@ramcdougal ramcdougal merged commit 199f14f into master Aug 19, 2025
43 checks passed
@ramcdougal ramcdougal deleted the slots branch August 19, 2025 11:59
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.

3 participants