{ "cells": [ { "cell_type": "markdown", "id": "09905e7d", "metadata": {}, "source": [ "# Getting started\n", "\n", "This documentation presents an updated overview of available functionality in SHOP. Many of the functionalities are presented through examples. SHOP supports several input formats as decribed in the [introduction](interaction). For new SHOP users, the introduction example is recommended before looking into more advanced functionality. To get started coding your own models you can run the SHOP with the following options:\n", "\n", "1. Use the [vLab](https://vlab.sintef.energy) where pyshop is preinstalled in a Jupyter based environment\n", "2. Run pyshop locally using predefined Devcontainer with all the required depedencies and only download the SHOP license and binaries\n", "3. [Download SHOP](https://shop.sintef.energy/files/shop-releases/) from the portal and install [pyshop](https://gitlab.sintef.no/energy/shop/pyshop) on your local computer\n", "\n", "
\n", "\n", "## Launching code with SHOP vlab\n", "\n", "This documentation contains executable code examples that can be executed on the SHOP virtual lab simply by hovering ![](images/rocket.png) in the top right corner and select ![](images/jupyter-hub.png). This will redirect you to the virtual lab.\n", "\n", "You can try it out here and now by clicking the ![](images/jupyter-hub.png) to execute the code below." ] }, { "cell_type": "code", "execution_count": 1, "id": "a058f7e3", "metadata": { "tags": [ "remove-output" ] }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Hello Prodrisk!\n" ] } ], "source": [ "print(\"Hello Prodrisk!\")" ] }, { "cell_type": "markdown", "id": "6cec67f9", "metadata": {}, "source": [ "Happy coding!\n", "\n", "## Run SHOP Locally Using Visual Studio Dev Containers\n", "\n", "[Visual Studio Dev Containers](https://code.visualstudio.com/docs/devcontainers/containers) lets you run a fully functional development environment using Docker and Visual Studio Code. This might simplify setting up pyshop for new users. Follow the guide below to setup the devcontainer for pyshop.\n", "\n", "### Installation\n", "\n", "Install the following dependencies:\n", "\n", "1. Install the code editor called [Visual Studio Code](https://code.visualstudio.com/Download). Visual Studio Code is free\n", "2. Install Docker: [Docker desktop](https://www.docker.com/products/docker-desktop/) (might require a paid license depending on your organization), or a free alternative called [Podman](https://podman.io/)\n", "\n", "### Setup\n", "\n", "1. Create a folder called `.devcontainer` in your root directory with a file called `devcontainer.json`. Your folder structure should look like the example below:\n", "\n", " ![Devcontainer folder setup](images/devcontainer-folder.png)\n", "\n", "2. Copy and paste the contents of [devcontainer.json](https://gitlab.sintef.no/energy/shop/pyshop/-/blob/main/.devcontainer/devcontainer.json?ref_type=heads) into your `devcontainer.json` file.\n", "3. Create a folder called `bin` in your root directory and add the following files: `libcplex2010.so`, `shop_cplex_interface.so`, your shop license e.g `SHOP_license.dat`, shop pybind e.g `shop_pybind.cpython-312-x86_64-linux-gnu.so`. Your bin folder should now look like:\n", "\n", " ![Binary folder with the required files](images/bin-folder.png)\n", "\n", "4. Open your project using the devcontainer config files by running the command:\n", " ![Searching for devcontainer command](images/dev-containers-reopen.png)\n", "\n", "More in depth guides on how to customize devcontainers can be found in the [devcontainer documentation](https://code.visualstudio.com/docs/devcontainers/create-dev-container)" ] } ], "metadata": { "jupytext": { "text_representation": { "extension": ".md", "format_name": "myst", "format_version": 0.13, "jupytext_version": "1.13.8" } }, "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.12.9" }, "source_map": [ 12, 30, 33 ] }, "nbformat": 4, "nbformat_minor": 5 }