Skip to content

docs: refactor docstrings for autoarray/structures package#227

Merged
Jammy2211 merged 2 commits intomainfrom
feature/documentation-structures
Mar 9, 2026
Merged

docs: refactor docstrings for autoarray/structures package#227
Jammy2211 merged 2 commits intomainfrom
feature/documentation-structures

Conversation

@Jammy2211
Copy link
Owner

Summary

abstract_structure.py

  • Added docstrings to all undocumented properties: geometry, derive_grid, derive_indexes, derive_mask, shape_slim, shape_native, pixel_scales, pixel_scale, header_dict, pixel_area, total_area, origin, unmasked_grid, total_pixels
  • Expanded trimmed_after_convolution_from from a bare NotImplementedError to a descriptive docstring

arrays/uniform_2d.py

  • Added missing header, skip_mask, xp params to __init__
  • Added docstrings to in_counts, in_counts_per_second, original_orientation, readout_offsets
  • Fixed "locaiton" typo in brightest_sub_pixel_coordinate_in_region_from
  • Fixed self-referential sentence in same method (said "this function" when describing the previous function)
  • Fixed no_mask example: was calling aa.Array2D.manual (non-existent) with a syntax error (trailing period on pixel scale)

arrays/array_2d_util.py

  • Fixed convert_array description ("input array input a convert" → clear description)
  • Added docstring to check_array_2d
  • Fixed "oigin"/"reszied" typos in resized_array_2d_from
  • Fixed wrong function name in index_slim_for_index_2d_from example (index_flat_for_index_2d_from → correct name)
  • Removed duplicate array_2d_native parameter in array_2d_slim_from

arrays/irregular.py / arrays/uniform_1d.py

  • Added docstrings to ArrayIrregular.values, ArrayIrregular.native
  • Added full Array1D.__init__ docstring (was completely missing)
  • Fixed "Make Array2D from input list" comment → "Make Array1D"

grids/grid_2d_util.py

  • Fixed "he " → "The" (×2 missing capital T), "silm" → "slim" typos
  • Fixed "flloat" → "float" (×2) in radial grid functions
  • Fixed mask_2dmask parameter name in grid_2d_slim_from docstring
  • Added docstrings to convert_grid, check_grid_slim, check_grid_2d, check_grid_2d_and_mask_2d

grids/grid_1d_util.py

  • Rewrote convert_grid_1d docstring (was copy-pasted from Grid2D with wrong class names Grid2D/grid_2d/mask_2d)
  • Fixed grid_1d_slim_via_mask_from (said "2D mask array" for a 1D function; wrong example syntax)

grids/uniform_1d.py

  • Fixed __init__ params (was "(y,x)" and "2D mask" for a 1D grid)
  • Fixed no_mask example: wrong import autogrid, wrong function np.ndgrid, wrong label "Grid2D"
  • Fixed __native__ section that referenced Grid2D instead of Grid1D

grids/irregular_2d.py

  • Added docstrings to values, slim, native properties
  • Fixed "*Coordinate* instance" → "Grid2DIrregular instance" (×2)

visibilities.py

  • Fixed "visibilitiy" → "visibility" typo

Test plan

  • Docstring-only changes; no logic was modified
  • Verify the package imports cleanly: python -c "import autoarray"

🤖 Generated with Claude Code

Jammy2211 and others added 2 commits March 9, 2026 15:50
- abstract_mask: add docstrings to _xp, mask, dimensions properties;
  fix pixel_scale phrasing; fix is_all_false (was backwards)
- mask_2d: add invert/xp to __init__ params; add docstrings to
  native_for_slim, derive_indexes, derive_mask, derive_grid, zoom,
  shape_native, mask_centre; fix from_fits (was "image", add all params);
  fix unmasked_blurred_array_from wrong params; fix "ndarraay" typo
- mask_1d: add invert/xp to __init__ params; fix header_dict (was "2D
  mask"); fix all_false ("(y,x)"→"1D"); fix "image image" typo;
  add shape_native/shape_slim docstrings; add derive_mask/derive_grid
  docstrings; add from_fits Returns
- derive/mask_2d: fix "everu"→"every"; add allow_padding param to
  blurring_from
- derive/grid_2d: fix border property incorrectly said "edge grid"
- derive/indexes_2d: fix "71,3]"→"[7,3]" typo
- derive/zoom_2d: fix incomplete class docstring sentence; fix "centred"
  phrasing in offset_pixels/offset_scaled; fix extent_from wrong method
  reference; add Returns sections throughout
- derive/mask_1d: fix to_mask_2d references "to_mask_1d"
- derive/grid_1d: complete rewrite of class and all_false docstrings
  which incorrectly referenced Mask2D/Grid2D/DeriveGrid2D throughout

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- abstract_structure: add docstrings to all undocumented properties
  (geometry, derive_grid, derive_indexes, derive_mask, shape_slim,
  shape_native, pixel_scales, pixel_scale, header_dict, pixel_area,
  total_area, origin, unmasked_grid, total_pixels); expand
  trimmed_after_convolution_from (was bare NotImplementedError)

- arrays/uniform_2d: add missing params (header, skip_mask, xp) to
  __init__; add docstrings to in_counts, in_counts_per_second,
  original_orientation, readout_offsets; fix "locaiton" typo; fix
  self-referential sentence in brightest_sub_pixel_coordinate; fix
  no_mask example (was aa.Array2D.manual + syntax error with period)

- arrays/array_2d_util: fix "input array input a convert" description;
  add docstring to check_array_2d; fix "oigin"/"reszied" typos;
  fix wrong function name in example (index_flat_for_index_2d_from →
  index_slim_for_index_2d_from); remove duplicate array_2d_native param

- arrays/irregular: add docstrings to values and native properties

- arrays/uniform_1d: add full __init__ docstring; fix "Make Array2D"
  comment → "Make Array1D"

- grids/grid_2d_util: fix "he " → "The" (×2); fix "silm" → "slim";
  fix "flloat" → "float" (×2); fix mask_2d param name in grid_2d_slim_from;
  add docstrings to convert_grid, check_grid_slim, check_grid_2d,
  check_grid_2d_and_mask_2d

- grids/grid_1d_util: rewrite convert_grid_1d docstring (was
  copy-pasted from Grid2D with wrong class/param names grid_2d/mask_2d);
  fix grid_1d_slim_via_mask_from ("2D mask" → "1D mask", wrong example)

- grids/uniform_1d: fix __init__ params (was "(y,x)" for a 1D grid);
  fix no_mask params and example ("autogrid", "np.ndgrid", "Grid2D");
  fix __native__ section referencing Grid2D instead of Grid1D

- grids/irregular_2d: add docstrings to values, slim, native properties;
  fix "*Coordinate* instance" → "Grid2DIrregular instance" (×2)

- visibilities: fix "visibilitiy" typo

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@Jammy2211 Jammy2211 merged commit 52894f3 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