Skip to content

docs: improve NumPy-style docstrings in scene module#455

Open
AlgoFoe wants to merge 2 commits into
brainglobe:mainfrom
AlgoFoe:format-api-ref-scene
Open

docs: improve NumPy-style docstrings in scene module#455
AlgoFoe wants to merge 2 commits into
brainglobe:mainfrom
AlgoFoe:format-api-ref-scene

Conversation

@AlgoFoe

@AlgoFoe AlgoFoe commented Jun 19, 2026

Copy link
Copy Markdown
Member

Description

What is this PR

  • Bug fix
  • Addition of a new feature
  • Other

Why is this PR needed?

  • The codebase lacked consistent docstrings, making Sphinx autodoc output incomplete and hard to read.

What does this PR do?

  • Adds/updates NumPy-style docstrings (module, class, method, function level) in scene.py.

References

  • Part of Issue-96

How has this PR been tested?

  • No functional changes, existing tests pass.

Is this a breaking change?

  • No.

Does this PR require an update to the documentation?

  • Yes.

Checklist:

  • The code has been tested locally
  • Tests have been added to cover all new functionality (unit & integration)
  • The documentation has been updated to reflect any changes
  • The code has been formatted with pre-commit

@AlgoFoe AlgoFoe assigned AlgoFoe and unassigned AlgoFoe Jun 19, 2026
@codecov

codecov Bot commented Jun 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.24%. Comparing base (cdf4266) to head (5c3134c).
⚠️ Report is 7 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #455      +/-   ##
==========================================
- Coverage   89.39%   88.24%   -1.15%     
==========================================
  Files          27       27              
  Lines        1282     1285       +3     
==========================================
- Hits         1146     1134      -12     
- Misses        136      151      +15     

☔ View full report in Codecov by Harness.
📢 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.

@AlgoFoe AlgoFoe marked this pull request as ready for review June 22, 2026 16:39
@IgorTatarnikov IgorTatarnikov self-requested a review June 24, 2026 10:18

@IgorTatarnikov IgorTatarnikov left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good, thanks @AlgoFoe!

Just a few small comments in line. Could you also add more information in the return sections? I've provided one example in line.

Comment thread brainrender/scene.py
"""
Main scene in brainrender.

Coordinates what should be rendered and how it should look.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Just a small wording change!

Suggested change
Coordinates what should be rendered and how it should look.
Coordinates the actors and the overall appearance.

Comment thread brainrender/scene.py
def add(self, *items, names=None, classes=None, transform=True, **kwargs):
def add(
self,
*items: object,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't think object is the correct type here. I'm not sure what the convention is, but my instinct is Mesh | Actor | str | Path but I'm not sure on the convention for *arg type annotation.

Comment thread brainrender/scene.py
Comment on lines +310 to +312
Returns
-------
Actor or list of Actor or None

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
Returns
-------
Actor or list of Actor or None
Returns
-------
Actor or list of Actor or None
The actors added to the scene. None if no actors added.

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.

2 participants