solves.solve_manager

Solve Manager Module

Manages the application of solves to an optic.

Kramer Harrison, 2025

Classes

SolveManager(optic)

Manages the application of solves to an optic.

class SolveManager(optic)[source]

Manages the application of solves to an optic.

Parameters:

optic (Optic) – The optic object

solves

A list of solve instances.

Type:

list

add(solve_type, surface_idx, *args, **kwargs)[source]

Adds a solve instance to the list of solves.

apply()[source]

Applies all solves in the list.

add(solve_type, surface_idx=None, *args, **kwargs)[source]

Adds a solve instance to the list of solves.

Parameters:
  • solve_type (str) – The type of solve to create.

  • surface_idx (int) – The index of the surface.

  • *args – Variable length argument list.

  • **kwargs – Arbitrary keyword arguments.

apply()[source]

Applies all solves in the list.

clear()[source]

Clears the list of solves.

classmethod from_dict(optic, data)[source]

Creates a SolveManager from a dictionary representation.

Parameters:
  • optic (Optic) – The optic object.

  • data (dict) – The dictionary representation of the solve manager.

Returns:

The solve manager.

Return type:

SolveManager

remap_surface_indices(remap_func)[source]

Remaps the surface indices of all relevant solves.

Parameters:

remap_func (callable) – A function that takes an old surface index and returns a new surface index.

to_dict()[source]

Returns a dictionary representation of the solve manager.

Returns:

A dictionary representation of the solve manager.

Return type:

dict