-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprepare_path.sh
executable file
·36 lines (32 loc) · 994 Bytes
/
prepare_path.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# ============================
# Path preparation:
# ============================
# Should be run from the root folder /Ising
# -------------------------
# PYTHONPATH:
# -------------------------
# Adding the Ising directory to the PYTHONPATH
# Must be used in the directory /path/to/Ising/
path_append() {
if [ -n "$2" ]; then
case ":$(eval "echo \$$1"):" in
*":$2:"*) :;;
*) eval "export $1=\${$1:+\"\$$1:\"}$2" ;;
esac
else
case ":$PATH:" in
*":$1:"*) :;;
*) export PATH="${PATH:+"$PATH:"}$1" ;;
esac
fi
}
path_append PATH $PWD
path_append PYTHONPATH $PWD
# Preparing paths for figures and operators
sed -i "s|isingPath = .*|isingPath = '"$PWD"'|" ising/utils/file_utils.py
# Making directories for files and operators if they do not already exist
mkdir -p operators
mkdir -p figures
mkdir -p figures/thermalization
mkdir -p figures/thermalization/basic
mkdir -p figures/thermalization/largeops