Download and install this stuff before starting the installation in the next section. It is likely all of this is already installed unless you are on a new computer, but it is worth double checking.
- Anaconda (or MiniConda)
- Anaconda is used to manage the python environment for the code. MiniConda is a minimal version of Anaconda that doesn't come with a lot of the prepackaged additional software of the full Anaconda installation (i.e. the Spyder IDE, Anaconda Navigator, etc.). MiniConda is sufficient if you just plan on running this measurement software. This is most likely already installed if you are using a computer others have already run measurements or python on.
- NI-VISA
- The NI-VISA driver facilitates communication to instruments and it needs to be installed on a compuer before connections to instruments can be established. This is most likely already installed if you are using a computer others have already connected to instruments.
- Git for Windows
- Git is used to manage versioning of the code. For example if you make changes to the code that you want others to use, or want to pull changes to your machine that someone else made. This is most likely already installed if you are using a computer others also use for measurements.
- DB Browser for SQLite
- Lets you browse the database that contains all the sloth experients (in case you manually need to add or delete an experiment) as well as the database that contains all of your measurement data.
- VS Code (Optional)
- This is an IDE that allows for effiecent development and editing of python code. It also has a lot of useful plugins like running Jupyter notebooks for instance. It is not required, but it can be useful to have some IDE if you plan on making lots of changes to the code.
- Note some instruments such as certain pressure gauges, DAQs, flow meters, etc. may require addition drivers from the manufacturer to function.
Clone Git repository by opening git bash
and navigating to the folder where you want to save the project. Note the c drive can be accessed via /c/
in git bash
.
git clone https://gitlab.jhuapl.edu/stalwart-sloth/software/sloth-measurement-software.git
If you are having git issues see this git setup section of the environment setup page on the wiki.
This will create the enviroment through conda install commands. The enviroment name is specified on the first line of the enviroment.yml file. Feel free to change it if you want a different enviroment name. Change to the directory that contains the project code before running these commands.
conda env create -f environment.yml
conda activate sloth_qcodes
pip install -e .
If you are having Anaconda issues, see the conda setup section of the environment setup page on the wiki.
Check out the go-offline for scripts to transfer your environment to an offline system.
This is just making sure that we ran all the previous steps correctly.
- With the newly created environment active in
Anaconda3 Prompt
run the following to test importing the measurement code in a python environment.
python
- In the python interpreter try importing pcqcodes.
import pcqcodes
Saving data to a network drive can be unreliable, if for example the network drops. A solution to this is to enable 'Always available offline' on the folder where you save data. This will allow the that folder to be available even when the network drops and will resync when it becomes available again. You can also enable this feature on the directory that contains the measurement database (link below) to avoid connectivity issues to it.
V:\Projects\Mechanical_Engineering\CPH91\Experimental\Measurement Database
To enable this feature right click on the folder or file on the share drive you want to be available offline and select 'Always available offline'.
If you run into issues and need to recreate the environment remove the previous environment by running the following command.
conda remove --name sloth_qcodes --all
See settings.template.json
and launch.template.json
for setup to run python test and debug. Test DB should be used when running tests.
Conda command reference
Git cheatsheet
Github-flavored Markdown