skyscapes._repr
===============

.. py:module:: skyscapes._repr

.. autoapi-nested-parse::

   Shared formatting helpers for hierarchical ``__repr__`` methods.

   Each leaf class in skyscapes (atmospheres, disks, stars, zodi) defines
   its own multi-line ``__repr__``; aggregator classes (Planet, System,
   Scene) use :func:`indent` to nest the children one level deeper. The
   result is a tree-shaped summary that lets you call ``repr(scene)`` in
   a notebook and see everything in the scene at a glance.



Functions
---------

.. autoapisummary::

   skyscapes._repr.indent
   skyscapes._repr.fmt_scalar_or_array


Module Contents
---------------

.. py:function:: indent(text, prefix = '  ')

   Prefix every line of ``text`` with ``prefix``.

   Used by aggregator-class reprs (``Scene``, ``System``, ``Planet``)
   to nest the child reprs one level deeper.


.. py:function:: fmt_scalar_or_array(x, fmt = '.3g', max_items = 3)

   Format a scalar or small array compactly.

   For a scalar (shape () or (1,)): formats as ``"3.14"``.
   For a short array: formats as ``"[3.14, 2.72, 1.41]"``.
   For a long array: formats as ``"[3.14, 2.72, ... (N=20)]"``.


