Skip to content
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

[DOC] Include guidelines for private functions in contributing docs #3946

Merged
merged 1 commit into from Sep 2, 2023

Conversation

ymzayek
Copy link
Member

@ymzayek ymzayek commented Sep 1, 2023

I just copied the example from the issue with @jeromedockes cited as the source at the bottom of the example (but it won't render in the html). IS it ok?

@github-actions
Copy link
Contributor

github-actions bot commented Sep 1, 2023

👋 @ymzayek Thanks for creating a PR!

Until this PR is ready for review, you can include the [WIP] tag in its title, or leave it as a github draft.

Please make sure it is compliant with our contributing guidelines. In particular, be sure it checks the boxes listed below.

  • PR has an interpretable title.
  • PR links to Github issue with mention Closes #XXXX (see our documentation on PR structure)
  • Code is PEP8-compliant (see our documentation on coding style)
  • Changelog or what's new entry in doc/changes/latest.rst (see our documentation on PR structure)

For new features:

  • There is at least one unit test per new function / class (see our documentation on testing)
  • The new feature is demoed in at least one relevant example.

For bug fixes:

  • There is at least one test that would fail under the original bug conditions.

We will review it as quick as possible, feel free to ping us with questions if needed.

@codecov
Copy link

codecov bot commented Sep 1, 2023

Codecov Report

Merging #3946 (e50bbfc) into main (25e091a) will decrease coverage by 0.06%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##             main    #3946      +/-   ##
==========================================
- Coverage   91.75%   91.70%   -0.06%     
==========================================
  Files         134      134              
  Lines       15751    15751              
  Branches     3283     3283              
==========================================
- Hits        14453    14444       -9     
- Misses        753      764      +11     
+ Partials      545      543       -2     
Flag Coverage Δ
macos-latest_3.10 91.68% <ø> (ø)
macos-latest_3.11 91.68% <ø> (ø)
macos-latest_3.8 91.64% <ø> (ø)
macos-latest_3.9 91.64% <ø> (ø)
ubuntu-latest_3.10 91.68% <ø> (ø)
ubuntu-latest_3.11 91.68% <ø> (ø)
ubuntu-latest_3.8 91.64% <ø> (ø)
ubuntu-latest_3.9 91.64% <ø> (ø)
windows-latest_3.10 91.62% <ø> (ø)
windows-latest_3.11 91.62% <ø> (ø)
windows-latest_3.8 91.59% <ø> (ø)
windows-latest_3.9 91.59% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

see 6 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Collaborator

@Remi-Gau Remi-Gau left a comment

Choose a reason for hiding this comment

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

Good with me

Copy link
Member

@bthirion bthirion left a comment

Choose a reason for hiding this comment

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

LGTM. Very useful, indeed !

@Remi-Gau Remi-Gau merged commit a00306f into nilearn:main Sep 2, 2023
29 checks passed
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

In some cases when private functions are in a private module (filename beginning with an underscore),
but are used outside of that file, we do not name them with a leading underscore. Example:
Copy link
Member

Choose a reason for hiding this comment

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

thanks! maybe this summary here could read something like:

we start a name with a leading underscore to indicate that it is an internal implementation detail, not to be accessed directly from outside, of the enclosing context: the parent module (for a submodule name), the module (for the name of a top-level function, class or global variable), or the class (for a method or attribute name). Moreover, modules explicitly declare their interface through the __all__ attribute, and any name not listed in __all__ should not be accessed from outside the module

@Remi-Gau
Copy link
Collaborator

Remi-Gau commented Sep 2, 2023

Sorry @jeromedockes I merged this too quickly: will take your comment in a separate issue, so we do not forget about it

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.

None yet

4 participants