Skip to content

docs: refactor and complete docstrings for autoarray/geometry#225

Merged
Jammy2211 merged 1 commit intomainfrom
feature/documentation-geometry
Mar 9, 2026
Merged

docs: refactor and complete docstrings for autoarray/geometry#225
Jammy2211 merged 1 commit intomainfrom
feature/documentation-geometry

Conversation

@Jammy2211
Copy link
Owner

Summary

  • geometry_util.py — the most significant fixes:
    • convert_shape_native_1d: Parameters section said pixel_scales throughout — parameter is shape_native
    • convert_pixel_scales_1d/2d: had "The input pixel" as incomplete descriptions
    • central_pixel_coordinates_1d_from: had "1d" ×3 instead of "1D" and old-style type hints
    • central_scaled_coordinate_1d_from: origin described as (y,x) when it is 1D (x,)
    • pixel_coordinates_1d_from and scaled_coordinates_1d_from: had no docstrings at all
    • scaled_coordinates_2d_from: copy-pasted from pixel_coordinates_2d_from so Parameters said scaled_coordinates_2d (wrong — param is pixel_coordinates_2d) and Returns said "pixel-value coordinate" (wrong — returns scaled coordinate)
    • transform_grid_2d_to/from_reference_frame: only documented grid parameter, omitting centre, angle, xp, and had no Returns
    • Fixed all "gird" typos (×5) and "sepration" in extent_symmetric_from
  • geometry_2d.py — same copy-paste error in scaled_coordinates_2d_from; central_scaled_coordinates was 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" typos
  • abstract_2d.pyextent abstract property had no docstring; extent_square was missing a Returns description explaining the (x_min, x_max, y_min, y_max) format and the squaring logic
  • geometry_2d_irregular.py — expanded minimal class docstring to explain how Geometry2DIrregular differs from Geometry2D (no pixel scale — extent is stored directly) and its intended use

Test plan

  • No functional changes — docstrings only
  • Verify no import errors: python -c "import autoarray"
  • Existing test suite passes: python -m pytest test_autoarray/

🤖 Generated with Claude Code

- 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>
@Jammy2211 Jammy2211 merged commit 1ec232c into main Mar 9, 2026
8 checks passed
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.

1 participant