lumopt2.core.project#
Main project class for managing optimization setup
The Project class supports three ways to set up the base simulation via the ‘setup’ parameter:
Python function: A callable that takes the FDTD object and sets up the simulation Example:
>>> def my_setup(fdtd): >>> fdtd.addfdtd(...) >>> fdtd.addrect(...)
>>> project = Project(setup=my_setup, parametrization=...)
Lumerical script: Path to a .lsf script file that will be executed Example:
>>> project = Project(setup="setup.lsf", parametrization=...)
Project file: Path to an existing .fsp file to load Example:
>>> project = Project(setup="base.fsp", parametrization=...)
Notes#
- Project File Organization:
All project files (.fsp files for each iteration) are automatically saved in a unique folder named “{project_name}_{timestamp}” where:
project_name: Custom name provided (default: “lumopt2_project”)
timestamp: Automatically added to ensure uniqueness (YYYYMMDD_HHMMSS)
Example:
>>> project = Project(..., project_name="my_optimizer") >>> # Creates folder: my_optimizer_20231117_143022/ >>> # Files saved: my_optimizer_20231117_143022/my_optimizer_iter001.fsp >>> # my_optimizer_20231117_143022/my_optimizer_iter002.fsp >>> # etc.
If a folder with the same name already exists, a numeric suffix is added.
Classes#
|
Main project class that coordinates parametrization, FOM, and solver. |