Skip to content

Commit

Permalink
update path names
Browse files Browse the repository at this point in the history
  • Loading branch information
borisbolliet committed Oct 2, 2024
1 parent fc2cd6d commit 271b3b6
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
32 changes: 16 additions & 16 deletions class-sz/download_emulators.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,42 +19,42 @@ touch build/.base
# Depth for searching directories
DEPTH=3

# Function to find the cosmopower-organization directory
find_cosmopower_dir() {
find "$1" -maxdepth "$DEPTH" -type d -name "cosmopower-organization" -print -quit
# Function to find the class_sz_data_directory directory
find_class_sz_data_dir() {
find "$1" -maxdepth "$DEPTH" -type d -name "class_sz_data_directory" -print -quit
}



COSMOPOWER_DIR=$(find_cosmopower_dir "..")
CLASS_SZ_DATA_DIR=$(find_class_sz_data_dir "..")

if [ -z "$COSMOPOWER_DIR" ]; then
COSMOPOWER_DIR=$(find_cosmopower_dir ".")
if [ -z "$CLASS_SZ_DATA_DIR" ]; then
CLASS_SZ_DATA_DIR=$(find_class_sz_data_dir ".")
fi

if [ -n "$COSMOPOWER_DIR" ]; then
echo "Found cosmopower-organization directory at: $(realpath "$COSMOPOWER_DIR")"
PATH_TO_COSMOPOWER_ORGANIZATION=$(realpath "$COSMOPOWER_DIR")
if [ -n "$CLASS_SZ_DATA_DIR" ]; then
echo "Found class_sz_data_directory directory at: $(realpath "$CLASS_SZ_DATA_DIR")"
PATH_TO_CLASS_SZ_DATA=$(realpath "$CLASS_SZ_DATA_DIR")
else
echo "--> cosmopower-organization directory not found within $DEPTH levels up or down."
echo "--> class_sz_data_directory directory not found within $DEPTH levels up or down."
echo "--> We will install it one level up!"
cd ..
mkdir cosmopower-organization
cd cosmopower-organization
mkdir class_sz_data_directory
cd class_sz_data_directory
git clone https://github.com/cosmopower-organization/lcdm.git
git clone https://github.com/cosmopower-organization/mnu.git
git clone https://github.com/cosmopower-organization/mnu-3states.git
git clone https://github.com/cosmopower-organization/ede.git
git clone https://github.com/cosmopower-organization/neff.git
git clone https://github.com/cosmopower-organization/wcdm.git
cd ..
PATH_TO_COSMOPOWER_ORGANIZATION=$(realpath "cosmopower-organization")
PATH_TO_CLASS_SZ_DATA=$(realpath "class_sz_data_directory")
fi


# Write environment setup to file
echo "export PATH_TO_COSMOPOWER_ORGANIZATION=${PATH_TO_COSMOPOWER_ORGANIZATION}" > "${MDIR}/../set_class_sz_env.sh"
echo "PATH_TO_COSMOPOWER_ORGANIZATION is set to ${PATH_TO_COSMOPOWER_ORGANIZATION}"
echo "export PATH_TO_CLASS_SZ_DATA=${PATH_TO_CLASS_SZ_DATA}" > "${MDIR}/../set_class_sz_env.sh"
echo "PATH_TO_CLASS_SZ_DATA is set to ${PATH_TO_CLASS_SZ_DATA}"

# Export the variable
export PATH_TO_COSMOPOWER_ORGANIZATION="${PATH_TO_COSMOPOWER_ORGANIZATION}"
export PATH_TO_CLASS_SZ_DATA="${PATH_TO_CLASS_SZ_DATA}"
4 changes: 2 additions & 2 deletions class-sz/python/classy.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ cdef class Class:

property PATH_TO_CLASS_SZ_DATA:
def __get__(self):
return classy_szfast.path_to_cosmopower_organization + '/class_sz/class-sz/'
return classy_szfast.path_to_class_sz_data + '/class_sz/class-sz/'



Expand Down Expand Up @@ -358,7 +358,7 @@ cdef class Class:
sprintf(self.fc.filename,"%s",dumc)
self.ncp = set()
if default: self.set_default()
# print('PATH_TO_CLASS_SZ_DATA',classy_szfast.path_to_cosmopower_organization)


def __dealloc__(self):
if self.allocated:
Expand Down

0 comments on commit 271b3b6

Please sign in to comment.