larvaworld.lib.util.naming

Class managing parameter naming

Classes

NamingRegistry

Registry for systematic parameter naming and LaTeX formatting.

Module Contents

class larvaworld.lib.util.naming.NamingRegistry(*args: Any, **kwargs: Any)

Bases: larvaworld.lib.util.dictsNlists.AttrDict

Registry for systematic parameter naming and LaTeX formatting.

Provides dynamic attribute-based naming functions for scientific parameters, supporting prefixes, suffixes, separators, and LaTeX math notation. Used throughout larvaworld for consistent parameter naming conventions.

The registry supports: - Dynamic naming with prefixes (e.g., ‘final_’, ‘initial_’) - Parameter name expansions (e.g., ‘vel’ → ‘velocity’) - XY coordinate generation for body points - Midline and contour point naming - LaTeX math formatting via TexNaming

Attributes:

k_pref: List of supported prefix keywords k_pairs: Dictionary mapping short names to full names tex: TexNaming instance for LaTeX formatting

Example:
>>> nam = NamingRegistry()
>>> nam.vel('x')  # velocity naming
'velocity_x'
>>> nam.final('position')  # prefix naming
'final_position'
>>> nam.xy('head')  # XY coordinates
['head_x', 'head_y']
>>> nam.midline(3)  # body points
['head', 'point2', 'tail']
k_pref = ['final', 'initial', 'cum', 'lin', 'scal', 'abs', 'dst_to', 'bearing_to', 'non']
k_pairs
tex
get_kws(k: str) dict
get_func(k: str)
num(chunk: str) str
xy(points, flat: bool = False, xsNys: bool = False)
chunk_track(chunk_name: str, params: str)
contour(Nc: int)
midline(N: int, type: str = 'point', reverse: bool = False)
contour_xy(Nc: int, flat: bool = False, xsNys: bool = False)
midline_xy(N: int, reverse: bool = False, flat: bool = False, xsNys: bool = False)
property centroid_xy
property traj_xy
at(p: str, t: str) str
atStartStopChunk(p: str, chunk: str)
property on_food
property off_food