docs: refactor and complete docstrings for autoarray/geometry#225
Merged
docs: refactor and complete docstrings for autoarray/geometry#225
Conversation
- geometry_util.py: fix convert_shape_native_1d which had wrong parameter name
(said 'pixel_scales' throughout, parameter is 'shape_native'); fix
convert_pixel_scales_1d/2d which had incomplete 'The input pixel' descriptions;
fix central_pixel_coordinates_1d_from which had wrong dimension labels ('1d' ×3
instead of '1D'); fix central_scaled_coordinate_1d_from origin described as (y,x)
when it is 1D (x,); add docstrings to pixel_coordinates_1d_from and
scaled_coordinates_1d_from which had none; fix scaled_coordinates_2d_from which
had copy-pasted Parameters (said 'scaled_coordinates_2d' when param is
'pixel_coordinates_2d') and wrong Returns ('pixel-value' instead of 'scaled');
add full Parameters and Returns to transform_grid_2d_to/from_reference_frame
which only documented 'grid' and omitted 'centre', 'angle', 'xp', and Returns;
fix all 'gird' typos (×5); fix 'sepration' typo in extent_symmetric_from
- geometry_2d.py: fix scaled_coordinates_2d_from which had same copy-paste error
as the util function; add Returns to central_scaled_coordinates; add Returns
sections to grid_pixels_2d_from, grid_pixel_centres_2d_from,
grid_pixel_indexes_2d_from, grid_scaled_2d_from; fix 'higher y' → 'highest y'
(×2); fix 'gird' typos
- abstract_2d.py: add docstring to abstract 'extent' property which had none;
expand 'extent_square' to describe the squaring behaviour and add Returns
- geometry_2d_irregular.py: expand minimal class docstring to explain how this
differs from Geometry2D and why it stores extent directly
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
geometry_util.py— the most significant fixes:convert_shape_native_1d: Parameters section saidpixel_scalesthroughout — parameter isshape_nativeconvert_pixel_scales_1d/2d: had"The input pixel"as incomplete descriptionscentral_pixel_coordinates_1d_from: had"1d"×3 instead of"1D"and old-style type hintscentral_scaled_coordinate_1d_from:origindescribed as(y,x)when it is 1D(x,)pixel_coordinates_1d_fromandscaled_coordinates_1d_from: had no docstrings at allscaled_coordinates_2d_from: copy-pasted frompixel_coordinates_2d_fromso Parameters saidscaled_coordinates_2d(wrong — param ispixel_coordinates_2d) and Returns said"pixel-value coordinate"(wrong — returns scaled coordinate)transform_grid_2d_to/from_reference_frame: only documentedgridparameter, omittingcentre,angle,xp, and had no Returns"gird"typos (×5) and"sepration"inextent_symmetric_fromgeometry_2d.py— same copy-paste error inscaled_coordinates_2d_from;central_scaled_coordinateswas missing Parameters/Returns; all four grid conversion methods (grid_pixels_2d_from,grid_pixel_centres_2d_from,grid_pixel_indexes_2d_from,grid_scaled_2d_from) were missing Returns sections; fixed"higher y"→"highest y"(×2) and"gird"typosabstract_2d.py—extentabstract property had no docstring;extent_squarewas missing a Returns description explaining the(x_min, x_max, y_min, y_max)format and the squaring logicgeometry_2d_irregular.py— expanded minimal class docstring to explain howGeometry2DIrregulardiffers fromGeometry2D(no pixel scale — extent is stored directly) and its intended useTest plan
python -c "import autoarray"python -m pytest test_autoarray/🤖 Generated with Claude Code