Guide to the Materials Virtual Lab.
This document provides a guide on setting up your Mac for working within the Materials Virtual Lab.
You will first need to download and install basic compilers:
xcode-select --install
Install homebrew. This will make life a lot easier.
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Use homebrew to install a few key utilities.
brew install git coreutils gcc
It is recommended you reboot your computer after this step.
Create a Github account if you do not have one. Then add your ssh key (in $HOME/.ssh/id_rsa.pub
. If it does not exist, create one using the ssh-keygen
command) to your Github account under settings.
Follow the instructions on this page https://help.github.com/articles/set-up-git.
Conda is a package manager that makes it a lot easier to work with different python versions and packages. After downloading the miniconda installer, run the following in a terminal in the directory where you downloaded the installer:
curl -o Miniconda3-latest-MacOSX-x86_64.sh https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh
bash Miniconda3-latest-MacOSX-x86_64.sh -b
Now, you should start a new terminal before proceeding.
Conda provides the means for you to create isolated environments. It is useful if you are going to work with lots of python packages that may have incompatible dependencies.
To create a new Python >= 3.8 environment named ``mavrl’’ in conda, do
conda create --name mavrl python numpy scipy matplotlib jupyter pandas sympy pymongo
This creates an environment that has the scientific python packages that you need installed as well. These are MKL versions.
To go to that environment, just type:
conda activate mavrl
This should be your default environment for any work. If your environment gets corrupted, simply delete the mavrl environment and recreate a new environment.
Before you setup the repos, it is generally advised that you keep all your repos in a single directory, e.g., $HOME/repos. Many of MAVRL’s useful scripts assume this as the default location for your repos.
These are to be installed in developmental mode from source. You will be working with and modifying these a lot.
git clone git@github.com:materialsproject/pymatgen.git
cd pymatgen
pip install -e .
Do the same for the pymatgen-db, custodian and fireworks repos.
To be installed in developmental mode from source. You will be working with this a lot as well. This is the private overall repo for the MAVRL.
git clone git@github.com:materialsvirtuallab/pymacy.git
cd pymacy
pip install -e .
You need the VASP psuedopotential files in order to generate VASP input files. These are provided in the pymacy repo under resources.
Add a VASP_PSP_DIR to your .pmgrc.yaml, by running the following.
pmg config --add PMG_VASP_PSP_DIR /path/to/pymacy/resources/VASP_PSP
Test that you have set it up correctly by typing:
python -c 'from pymatgen.io.vasp import Potcar; print(Potcar(["Li_sv", "O"]))'
There should be no errors. Otherwise, you have not done setup correctly.
An Integrated Development Environment (IDE) makes it easier for you to code and maintain good style, especially for Python. Note that for group members, it is highly recommended you use an IDE unless you believe yourself to be a superior Python coder to your adviser (and have the goods to prove it).
Download the community version of Pycharm or install it via brew cask install
.
brew cask install pycharm-ce
It is unlikely you need anything more than the community version.
Learn how to commit and push changes with git. The model is that you should be creating branches for anything that you do, and you should commit often.
Pymatgen has extensive documentation at http://pymatgen.org. Read and learn to use it. A hour spent figuring out how to work with pymatgen will save you 100 hours over a year (and probably more as you become more familiar).
Read the materialsvirtuallab Coding guidelines, and follow them strictly.
Here are some recommended software. Most can be installed via homebrew via brew install
or brew cask install
. Note that you can use brew cask install
to install many GUI apps, including Google Chrome
(google-chrome), Zoom (zoomus), etc. You can look for apps using brew cask search
.
brew cask install atom
brew cask install iterm2
brew cask install alfred
brew cask install zotero
brew cask install vesta
All MAVRL group members are required to backup their personal computers as well as data. There are two forms of backup that you will need to do:
Unless it is bad or irrelevant data, do not throw data away, even after you finish a project. Organize your data on your laptops and mavrldata carefully.