Package: sintef-pyshop
pyshopStatus:The nicest python interface to SHOP!SHOP (Short-term Hydro Operation Planning) is a modeling tool for short-term hydro operation planning developed by SINTEF Energy Research in Trondheim, Norway. SHOP is used for both scientific and commerical purposes, please visit theSHOP home pagefor further information and inquiries regarding access and use.The pyshop package is an open source python wrapper for SHOP, and requires the proper SHOP binaries to function (see step 2).1 Installing pyshopWe currently offer two ways to use pyshop:Install pyshop through pypi (simple and quick)Install pyshop through Sintef's Gitlab Package Registry (useful if you want to avoid public registries)Install pyshop using pypiThe pyshop package can be installed using pip, the package installer for python. Please visit thepip home pagefor installation and any pip related issues. You can install the official pyshop release through the terminal command:pip install sintef-pyshopYou can also clone this repository and install the latest development version. To do this, open a terminal in the cloned pyshop directory and give the command:pip install .You should now see pyshop appear in the list of installed python modules when typing:pip listInstall pyshop using Gitlab Package RegistryCreate apersonal access token.Run the command below with your personal access token:pip install sintef-pyshop --index-url https://__token__:<your_personal_token>@gitlab.sintef.no/api/v4/projects/4012/packages/pypi/simple2 Download the desired SHOP binaries for your systemNOTE: You may not distribute the cplex library as it requires end user licenseThe SHOP core is separate from the pyshop package, and must be downloaded separately. The latest SHOP binaries are found on theSHOP Portal. Access to the portal must be granted by SINTEF Energy Research.The following binaries are required for pyshop to run:Windows:cplex2010.dllshop_cplex_interface.dllshop_pybind.pydLinux:libcplex2010.soshop_cplex_interface.soshop_pybind.soThe solver specific binary is listed as cplex2010 here, but will change as new CPLEX versions become available. It is also possible to use the GUROBI and OSI solvers with SHOP. Note that the shop_cplex_interface.so used to contain the CPLEX binaries in the Linux distribution before SHOP version 14.3, and so older SHOP versions do not require the separate libcplex2010.so file.3 Environment and license fileThe SHOP license file,SHOP_license.dat, must always be located in the directory specified by the environment variableICC_COMMAND_PATH. TheICC_COMMAND_PATHcan be added as a persistent environment variable in the regular ways, or it can be set by pyshop on a session basis. If the keyword argumentlicense_pathis specified when creating an instance of the ShopSession class (see step 4), the environment variable is overridden in the local environment of the executing process. If SHOP complains about not finding the license file, it is likely an issue with theICC_COMMAND_PATHnot being correctly specified.TheICC_COMMAND_PATHis also the default place pyshop will look for the SHOP binaries mentioned in step 2. If the binaries are placed elsewhere, the keyword argumentsolver_pathmust be used when a ShopSession instance is created to ensure the correct binaries are loaded. Note that SHOP versions older than 14.4.0.5 reqiuire libcplex2010.so to be placed in the '/lib' directory when running pyshop in a Linux environment. From version 14.4.0.5, the libcplex2010.so can be placed in the same directory as the other SHOP bionaries.4 Running SHOPNow that pyshop is installed, the SHOP binaries are downloaded, and the license file and binary paths are located, it is possible to run SHOP in python using pyshop:import pyshop as pys

shop = pys.ShopSession(license_path="C:/License/File/Path", solver_path="C:/SHOP/versions/14")

#Set time resolution
#Build topolgy
#Add temporal input
#Run model
#Retreive resultsPlease visit the SHOP Portal for a detailedtutorialand severalexamplesusing pyshop.