-
Notifications
You must be signed in to change notification settings - Fork 1
Add comprehensive docstring for get_exchange_kernels_GaussLegendre #5
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
Conversation
Co-authored-by: skilledwolf <18141588+skilledwolf@users.noreply.github.com>
Co-authored-by: skilledwolf <18141588+skilledwolf@users.noreply.github.com>
There was a problem hiding this comment.
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 adds comprehensive NumPy-style documentation to the get_exchange_kernels_GaussLegendre function, addressing a review feedback request for complete API documentation. The docstring follows the codebase's established NumPy documentation style with complete parameter descriptions, return value specification, error conditions, and implementation notes.
Key changes:
- Expanded one-line summary to a detailed multi-paragraph description of the function's purpose
- Added complete parameter documentation for all 9 arguments including types, semantics, and default values
- Specified explicit return type (
numpy.ndarray of numpy.complex128) with shape information - Documented three distinct error conditions in the Raises section
- Restructured optimization details into proper Notes section with improved formatting
Comments suppressed due to low confidence (1)
src/quantumhall_matrixelements/exchange_legendre.py:160
- Variable Veff is not used.
Veff = None
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| sign_magneticfield : int, optional | ||
| Sign of the charge–field product σ = sgn(q B_z). Must be -1 or +1. | ||
| Default is -1 (internal convention). Use +1 to obtain kernels for | ||
| the opposite magnetic field orientation via conjugation and phase | ||
| factors. |
Copilot
AI
Dec 3, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The docstring states that sign_magneticfield "Must be -1 or +1", but the function does not validate this constraint. The related function get_exchange_kernels_hankel includes explicit validation (if sign_magneticfield not in (1, -1): raise ValueError(...)). Consider either:
- Adding validation at the start of the function to enforce this constraint, or
- Softening the language to "Should be -1 or +1" or "Typically -1 or +1"
This ensures consistency between documentation and actual behavior.
Addresses review feedback requesting complete API documentation for
get_exchange_kernels_GaussLegendre.Changes
numpy.ndarray of numpy.complex128with shape specification✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.