3dem / model-angelo

Automatic atomic model building program for cryo-EM maps
MIT License
110 stars 18 forks source link

install_script.sh adaption for variable environment #89

Closed jowodo closed 7 months ago

jowodo commented 7 months ago

The install_script.sh is currently very rigid w.r.t. conda environment names. It is SOP to name conda environments with the following scheme: name-version. Currenlty this is how I install model-angelo:

VERSION=1.0.4
URL='https://github.com/3dem/model-angelo'
TMPDIR=$(mktemp -d)
pushd $TMPDIR
git clone --depth 1 --branch v$VERSION -q $URL model-angelo
pushd model-angelo
export TORCH_HOME=/scratch/mirror/modelangelo/$VERSION
mkdir -p $TORCH_HOME
# see https://github.com/3dem/model-angelo/pull/88
sed -i "s/ -n model_angelo/ -n modelangelo-$VERSION/" install_script.sh
sed -i "s/model_angelo$/modelangelo-$VERSION/" install_script.sh
sed -i "s/model_angelo\"/modelangelo-$VERSION\"/" install_script.sh 
source install_script.sh --download-weights
popd
rm -rf $TMPDIR

This could be much more elegantly solved with pull request #88:

VERSION=1.0.4
URL='https://github.com/3dem/model-angelo'
TMPDIR=$(mktemp -d)
pushd $TMPDIR
git clone --depth 1 --branch v$VERSION -q $URL model-angelo
pushd model-angelo
export TORCH_HOME=/scratch/mirror/modelangelo/$VERSION
mkdir -p $TORCH_HOME
source install_script.sh --download-weights --name modelangelo-$VERSION
popd
rm -rf $TMPDIR
jamaliki commented 7 months ago

Thank you! This was merged