Skip to content

Commit

Permalink
DOCS
Browse files Browse the repository at this point in the history
  • Loading branch information
petrasvestartas committed Apr 22, 2024
1 parent 7db3e9a commit d1ff2c6
Show file tree
Hide file tree
Showing 4 changed files with 114 additions and 6 deletions.
35 changes: 35 additions & 0 deletions bash/install.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
@echo off
setlocal

echo Installing Anaconda...
bitsadmin /transfer "AnacondaDownload" /download /priority normal https://repo.anaconda.com/archive/Anaconda3-2023.01-Windows-x86_64.exe "%cd%\Anaconda3-Installer.exe"
start /wait "" "%cd%\Anaconda3-Installer.exe" /InstallationType=JustMe /RegisterPython=0 /S /D=%UserProfile%\Anaconda3

echo Installing Visual Studio Code...
bitsadmin /transfer "VSCodeDownload" /download /priority normal https://update.code.visualstudio.com/latest/win32-x64/stable "%cd%\VSCodeSetup.exe"
start /wait "" "%cd%\VSCodeSetup.exe" /VERYSILENT /MERGETASKS=!runcode

echo Checking for C:\code directory...
if not exist "C:\code\" mkdir "C:\code"

echo Cloning the repository...
cd /d C:\code
git clone https://github.com/petrasvestartas/compas_wood.git
cd compas_wood

echo Creating Anaconda environment...
call %UserProfile%\Anaconda3\Scripts\conda.bat create -n compas_wood_3_9_10 python=3.9.10 compas -y

echo Activating environment...
call %UserProfile%\Anaconda3\Scripts\activate.bat compas_wood_3_9_10

echo Installing Python requirements...
pip install -r requirements.txt
pip install -e .

echo Cleaning up installation files...
del "%cd%\Anaconda3-Installer.exe"
del "%cd%\VSCodeSetup.exe"

echo All set!
pause
36 changes: 36 additions & 0 deletions bash/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/bin/bash

# Ensure script is run with sudo to have the necessary permissions
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root"
exit 1
fi

# Install Anaconda
echo "Downloading Anaconda..."
curl -O https://repo.anaconda.com/archive/Anaconda3-2023.01-MacOSX-x86_64.sh
echo "Installing Anaconda..."
bash Anaconda3-2023.01-MacOSX-x86_64.sh -b -p $HOME/anaconda3

# Install Visual Studio Code
echo "Installing Visual Studio Code..."
brew install --cask visual-studio-code

# Create code directory and clone the repository
echo "Setting up project directory and cloning repository..."
mkdir -p /Users/$(whoami)/code
cd /Users/$(whoami)/code
git clone https://github.com/petrasvestartas/compas_wood.git
cd compas_wood

# Setup Conda environment
echo "Creating and activating conda environment..."
$HOME/anaconda3/bin/conda create -n compas_wood_3_9_10 python=3.9.10 compas -y
source $HOME/anaconda3/bin/activate compas_wood_3_9_10

# Install Python dependencies
echo "Installing Python dependencies..."
pip install -r requirements.txt
pip install -e .

echo "Environment setup is complete!"
Binary file added docs/_images/vscode_environment.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
49 changes: 43 additions & 6 deletions docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,28 @@ Installation
Conda
=====

Create environment
------------------

.. code-block:: bash
git clone https://github.com/petrasvestartas/compas_wood.git
conda create -n compas_wood_3_9_10 python=3.9.10 compas
conda activate compas_wood_3_9_10
Clone and install compas_wood
-----------------------------

.. code-block:: bash
git clone https://github.com/petrasvestartas/compas_wood.git
cd compas_wood
pip install -r requirements.txt
pip install -e .
Geometry is displayed using compas_viewer. Please clone the viewer to have the latest version install in the current environment:¨
Display via compas_viewer
-------------------------


.. code-block:: bash
Expand All @@ -25,8 +37,33 @@ Geometry is displayed using compas_viewer. Please clone the viewer to have the l
pip install -e .
Pip
===
.. code-block:: bash
Visual Studio Code
------------------

- Launch ``VSCode`` and select the ``compas_wood_3_9_10`` Python environment using ``CTRL+SHIFT+P``.
- Open a new terminal via ``Terminal -> New Terminal``.
- Navigate to the ``docs/examples`` folder and execute any ``.py`` example file by right-clicking and selecting ``Run Python File in Terminal``.

.. figure:: /_images/vscode_environment.gif
:figclass: figure
:class: figure-img img-fluid

Notes
=====

If you are new to Anaconda World, install these tools first:

- `Anaconda <https://www.anaconda.com/download>`_

- `Visual Studio Code <https://code.visualstudio.com/download>`_

- `Git <https://git-scm.com/downloads>`_




.. Pip
.. ===
.. .. code-block:: bash
pip install compas_wood
.. pip install compas_wood

0 comments on commit d1ff2c6

Please sign in to comment.