Shared campbell lab code.
There are a number of packages that should be installed:
pylabrad
pyqt5
- GUI packagepyqt5-stubs
- Linter hints for pyqt5
(nonfunctional, but useful in IDEs for code inspection)qt5reactor
- needed for compatibility between LabRAD's backend (based on twisted
) and pyqt5
numpy
scipy
ok
- This is a package provided by OpalKelly to interface with its FPGAs. We have several versions
in the group's share driveThe first thing that needs to happen to make this work is to set the environment variables that Labrad expects to have. These tell it what settings to use, and are consistent throughout our lab:
Name | Setting | Description |
---|---|---|
LABRADHOST | localhost (or an IP) | The hostname or IP address where the manager is running. If you want this computer to connect to another one, use that computer's IP address. |
LABRADPORT | 7682 | TCP port to use when connecting to the labrad manager. |
LABRADPASSWORD | lab | Password to use for connecting to the manager. If left blank, you'll be prompted for a password every time. |
LABRAD_TLS | off | Transport Level Security (TLS) mode to use for securing connections to the manager. |
LABRAD_TLS_PORT | 7643 | TCP port to use when connecting to the labrad manager with a connection initially secured by TLS. |
LABRADNODE | \<name of the node> | Used by the node server as the name of the labrad node running on this machine. |
See issue templates located at https://github.com/CampbellGroup/common/tree/master/.github/ISSUE_TEMPLATE before submitting issues
New code should...
print(str)
and
try:
...
except Exception as e:
...
Adapted from pylabrad contribution guidelines
User iHaveIssues posts an issue. The issue explains the desired feature or bug to be fixed.
User c0der creates a new branch for development regarding the issue. The branch name is
XX-brief-description-of-issue
where XX
is the issue number.
Development is done in the branch via a series of commits.
When the feature is nearly complete or the bug is fixed, a pull request is filed by a user iPullRequest (usually iPullRequest is the same person as c0der). This notifies other users that new code is ready for review. iPullRequests should ask for a code reviews from qualified users. Those users review the code by reading the changes and running the test code.
Users may add more commits to address outstanding issues with the code.
Once user iDoReviews thinks the code is in good shape, they comment "LGTM" (looks good to me) in the pull request comments.
Writing LGTM on a pull requests indicates that you are convinced the code works as expected and that you now share responsibility with the author for any problems arising from the change.
iPullRequest can now merge the feature branch into master. Only iPullRequests may actually merge the pull request.
For larger or more critical changes, such as refactoring functional code, several reviewers should sign off LGTM on the pull request.
Tests should stand alone as much as possible.
Tests should run from the terminal and not change the users environment, by for example opening windows that the user would have to manually close. For functions that generate plots, use plt.switch_backend('PDF') to switch off the generation of plot windows, which prevent tests from running while open.
When in doubt, testing something is better than testing nothing.
Any changes should pass all existing tests. Run the test code from a terminal with
$ nosetests -w common\tests
Your commit message documents your changes for all time. Take pride in it. Commits should follow this format:
For small fixes, there is no need to open an issue. The contributor must still create a new branch and make a PR for
code review. The branch name should be prefixed with minor
instead of an issue number.
Examples of small fixes include:
* Changing an error (or success) message to be more descriptive.
* Updating docstrings.