Add experiment template files for lab code standardisation#11
Open
Add experiment template files for lab code standardisation#11
Conversation
…n signal_handler and simplifying the experiment function. Update setup checks to include retry logic with error handling for hardware and software validations.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.