Skip to content

Add experiment template files for lab code standardisation#11

Open
iezqrom wants to merge 2 commits intomainfrom
standardise-experiment-scripts
Open

Add experiment template files for lab code standardisation#11
iezqrom wants to merge 2 commits intomainfrom
standardise-experiment-scripts

Conversation

@iezqrom
Copy link

@iezqrom iezqrom commented Nov 27, 2025

This PR adds five template files to src/experiment/ to standardise experiment code across the lab. The templates include globals.py for centralised experimental parameters (UPPERCASE constants organised by sections), run.py as the entry point with signal handling, setup.py for pre-experiment hardware and system checks, utils.py with example utility functions, and wrapup.py for post-experiment cleanup and data validation. All files use Google-style docstrings, British English spelling, and follow lab coding standards (no comments, explicit types, snake_case variables).
The templates are designed as placeholders with examples rather than full implementations, allowing customisation while maintaining consistency. Key features include: automatic copying of globals.py to experiment folders for reproducibility tracking, retry logic using while loops and Confirm.ask() prompts (defaulting to yes), try/except blocks for graceful error handling, and separation of concerns with experiment logic in experiment.py. The structure follows best practices from existing lab experiments, providing clear guidance on hardware checks, data validation, and cleanup procedures.

@iezqrom iezqrom requested a review from vkaramanis November 27, 2025 10:42
…n signal_handler and simplifying the experiment function. Update setup checks to include retry logic with error handling for hardware and software validations.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments