Skip to content

refactor(nest): drop leading underscore from module files in _nest_network/_nest_spatial/_nest_base#85

Merged
chaoming0625 merged 1 commit into
mainfrom
worktree-denest-underscore-modules
Jun 16, 2026
Merged

refactor(nest): drop leading underscore from module files in _nest_network/_nest_spatial/_nest_base#85
chaoming0625 merged 1 commit into
mainfrom
worktree-denest-underscore-modules

Conversation

@chaoming0625

Copy link
Copy Markdown
Contributor

Summary

De-underscores the module files in three NEST sub-packages so modules read
base.py, simulator.py, kernels.py, … instead of _base.py, _simulator.py,
_kernels.py. The packages themselves keep their leading underscore — only files
inside them are renamed. Pure structural rename, no behavior change.

  • 65 files renamed (git mv, history preserved): 46 in _nest_network/, 15 in _nest_spatial/, 4 in _nest_base/.
  • References rewritten in lockstep: 415 absolute (imports + Sphinx :class:/:meth: docstring refs across sibling packages) + 19 relative same-dir imports.
  • __init__.py files and the top-level package imports are unchanged.

Cross-platform .gitattributes

Replaces the 3-line file with a comprehensive policy: LF in the repo and working
tree on Linux/macOS/Windows for all source/text; CRLF only for Windows scripts
(.bat/.cmd/.ps1); binaries never normalized; plus Linguist + export-ignore
rules. All tracked files renormalized to LF (git add --renormalize).

Also bundled

Pre-existing working-tree change: drops platform='cpu' from
brainstate.environ.set(...) across the test suite (makes tests device-agnostic).

Verification

  • 0 residual underscored submodule references; 0 residual from ._ in the 3 dirs.
  • Import smoke test passes; old underscored module paths gone, new paths import.
  • 480 tests collected; non-NEST slice: 35 tests + 128 subtests pass.

Out of scope

Sibling packages _nest_device, _nest_neuron, _nest_plasticity, _nest_synapse
keep underscored module files.

🤖 Generated with Claude Code

…ST packages

Rename 65 private module files `_<name>.py` -> `<name>.py` in _nest_network/,
_nest_spatial/, and _nest_base/ (the packages keep their underscore), and
rewrite all import statements and Sphinx-docstring cross-references in lockstep
(415 absolute + 19 relative). Pure structural rename — import smoke test and the
non-NEST test slice pass.

Also bundled (pre-existing working-tree changes, committed together by request):
- Drop `platform='cpu'` from `brainstate.environ.set(...)` across the test suite.
- Add a cross-platform .gitattributes (LF in the repo and working tree on Linux,
  macOS, and Windows; CRLF only for Windows .bat/.cmd/.ps1) and renormalize all
  tracked files to LF.

@sourcery-ai sourcery-ai Bot 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.

Sorry, we are unable to review this pull request

The GitHub API does not allow us to fetch diffs exceeding 300 files, and this pull request has 537

@chaoming0625 chaoming0625 merged commit 5026bba into main Jun 16, 2026
2 of 5 checks passed
@github-actions

Copy link
Copy Markdown

🎉 Congratulations on opening your first pull request in brainpy.state! Thank you for your contribution!

A maintainer will review your changes soon. Please make sure:

  • ✅ Your code follows our style guidelines
  • ✅ All tests pass
  • ✅ Documentation is updated (if applicable)
  • ✅ You've filled out the PR template completely

We appreciate your effort in making brainpy.state better. If you have any questions, feel free to ask in the comments.

Welcome to the brainpy.state community! 🌟

@chaoming0625 chaoming0625 deleted the worktree-denest-underscore-modules branch June 16, 2026 16:12
chaoming0625 pushed a commit that referenced this pull request Jun 16, 2026
Brings in #85: drop the leading underscore from module files in
_nest_network/, _nest_spatial/, _nest_base/, plus the cross-platform
.gitattributes and LF renormalization.

Conflict resolutions:
- .gitattributes: kept the cross-platform version from origin/main.
- .gitignore, docs/conf.py, docs/apis/nest-base.rst: kept local main's
  content (origin/main differed only in line endings).
- _nest_network/event_plastic.py, _nest_network/event_proj.py: combined
  origin/main's module rename + nest-import rewrites with local main's
  `_brainpy._delay` -> `_brainpy.delay` delay-module rename.
- Updated 3 stale `_brainpy._delay` docstring refs (plastic_base.py,
  bernoulli_synapse.py, static_synapse.py) to `_brainpy.delay` so the merged
  tree references the renamed delay module consistently.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant