Repository navigation
Installation Instructions
These are the instructions that should be followed to get you started with Elements.
⚠️ We strongly recommend using Anaconda for your python environment, as well as Visual Studio Code as your IDE.
The Elements framework has been tested on the following operating systems:
- Windows 11
- Max OS Monterey-Tahoe
- Ubuntu 22
Clone the Elements repository from HERE
Checkout to the feature/develop branch:
Download the python extension in your visual studio code
Open the Elements folder with the visual studio code
We suggest to download the Anaconda package management system to keep your system clean (optional step)
Download the proper Anaconda python distribution based on your system.
For Windows users, make sure you add Anaconda to the PATH environmental variable.
Open a new command prompt (Ctrl + Shift + `) in visual studio code:
Create a new elements conda environment with the command:
conda create -n elements python=3.9
This creates a new environment, named elements, with a python version 3.9, which is the proper version to run Elements.
You may now activate the environment by running:
`conda activate elements`
⚠️ For linux users do the following, you need to setup the variable PYOPENGL_PLATFORM to x11:1. In terminal, run `nano ~/.bashrc` 2. Add the command ‘export PYOPENGL_PLATFORM=x11’ at the end of the file. 3. Save and quit. 4. Run ‘source ~/.bashrc’ for the changes to take effect.
⚠️ You need to select the proper python interpreter before running any example or test.
Click the python version button on the bottom right and select the elements environment we created.
If the elements interpreter is not shown, click refresh to update the list.
Sometimes, you may need to restart VSCode to refresh the list of environments!
Install the needed packages to your elements environment with the following command:
pip install -e .
Your Elements project is now ready!
Running the included unit tests assures that your installation is proper and complete.
Click the unit test icon on the left side panel. You may run a test by clicking the run test button.
Make sure that all the tests run properly.
If the unit tests are not visible like the image above do the following
-
Make sure you have selected the correct interpreter: Click View>Command Palette, select Python: Select Interpeter and choose Elements (the 3.9.x environment you have previously created).
-
Configure the tests properly: Click View>Command Palette again, select: Python: Configure Tests, select unittest, select the . Root directory option, and finally select the test_*.py option.
The unit tests should appear in the list on the left panel!
Now let's run some Elements examples.
Navigate, e.g., to the examples/B.Introductory folder and click the example_B5_cube_free_fly example.
Then, press small play button on the top right of the file (or usually the F5 button) to run the example.
In order to contribute to contribute to the Elements package:
-
Fork the develop branch.
-
Clone your forked repo to your computer.
-
Install it in editable mode by running:
pip3 install -e .
at the directory where the setup.py file is located.
- Create a
feature branchfrom the develop branch, and work on it. - Push your feature branch to your github repo.
- Open a Pull Request to the original develop branch.