📖 Full documentation: https://nanolab.cl/laser_setup/ — start with the
Installation guide
and the hands-on Tutorials
(no hardware required). The documentation source lives in docs/ and can be
previewed locally with uv run --group docs mkdocs serve.
Experimental setup for Laser, I-V, and Transfer Curve measurements. This project utilizes PyMeasure under the hood and extends it with a YAML-based configuration system (via OmegaConf and Hydra) for flexible instrument and procedure management. It is strongly recommended to read the PyMeasure documentation to understand the underlying structure and classes.
This project allows for the communication between the computer and the instruments used in the experimental setup, as well as the control of the instruments. The following instruments are supported:
- Keithley 2450 SourceMeter (Reference Manual) (Requires NI-VISA installed)
- Keithley 6517B Electrometer (Reference Manual (Also requires NI-VISA))
- TENMA Power Supply
- Thorlabs PM100D Power Meter (Reference Manual)
- Bentham TLS120Xe Light Source (Reference Manual)
As well as all instruments available in the PyMeasure library.
- Optional installation via uv for handling Python dependencies.
- YAML configs laser_setup/assets/templates/ that leverage Hydra instantiation to dynamically load modules and objects.
- A robust main GUI window (see laser_setup.display.main_window.py) that displays available procedures and scripts.
- An experiment window (laser_setup.display.experiment_window.py) for running PyMeasure-based procedures with plots, logs, and parameter inputs.
- Sequences: run multiple procedures in series using the SequenceWindow.
- InstrumentManager (laser_setup.instruments.manager.py) for centralized instrument setup and teardown.
If you have procedures defined in a Python script and in the YAML (see procedures.yaml for examples), you can invoke them directly:
laser_setup <procedure_name>This will load the relevant procedure class from the OmegaConf-based configs, then open an ExperimentWindow.
If you prefer to run procedures directly from Python, you can import the relevant Procedure classes and call them directly.
Scripts can be run similarly by name:
laser_setup <script_name>The recommended way is with uv, which installs
everything into a project-local environment (nothing system-wide). The repository
pins Python 3.12 via .python-version.
git clone https://github.com/nanolab-fcfm/laser_setup.git
cd laser_setup
uv sync # create the environment and install dependencies
uv run laser_setup # launch the main windowSee the full Installation guide for the Docker option, instrument drivers (NI-VISA), and troubleshooting.
uv run laser_setup # main window (GUI hub)
uv run laser_setup FakeProcedure # a demo experiment, no hardware needed
uv run laser_setup -d It # a real procedure with simulated instruments
uv run laser_setup --help # list every procedure and scriptThis launches the window defined in MainWindow. New here? Follow the hands-on Tutorials.
Most configuration is handled in YAML files and can be loaded or overridden at runtime. OmegaConf merges these with defaults, enabling dynamic instantiation of procedures, sequences, instruments and parameters. The YAML templates are stored in laser_setup/assets/templates.
You can edit YAML settings to define:
- Main window parameters (e.g., README file, window size, icon, etc.).
- Procedures, Scripts, and Sequences.
- Instrument settings, pointing to classes that the InstrumentManager will initialize.
To maximize functionality, all user-written procedures should be subclasses of BaseProcedure, which is a subclass of Procedure from PyMeasure. These procedures inherit the following:
- The following parameters (
pymeasure.experiment.Parametertype):procedure_version(version of the procedure)show_more(boolean to show more parameters in the GUI)info(information about the procedure)skip_startup(boolean to skip the startup method)skip_shutdown(boolean to skip the shutdown method)start_time(start time of the procedure, set withtime.time())
- Their corresponding INPUTS (Inputs to display in the GUI)
- Base
startupandshutdownmethods instruments, anInstrumentManagerobject that handles the instruments used in the procedure
Develop custom procedures by:
- Subclassing
BaseProcedure. - Defining your
INPUTSandDATA_COLUMNS. - Setting up your parameters.
- Setting up your instruments.
- Overriding
startup,execute, andshutdownas needed.
Use the SequenceWindow to group multiple procedures in series. This allows chaining them together without manually rerunning each experiment. Edit or create new sequence entries in YAML to define the flow of procedures.
- Code contributions should follow typical pull-request workflow on GitHub.
- Documentation lives in
docs/(MkDocs Material) and is published to GitHub Pages. See the Contributing guide and Building & deploying the docs.