Installation#
SM-SPSA can be installed easily through downloading a ZIP file.
Using ZIP#
You can download all files from the GitHub repository. Follow these steps:
Navigate to the GitHub repository.
Select the green “Code” button, select “Local” and then “Download ZIP”. This downloads the whole repository to your local machine.
Open the ZIP and rename the resulting folder to
SMSPSA
. Move the folder to a location of your preference, such as thedocuments
folder.Move to the
SMSPSA
folder with the command line. For example, if you placed theSMSPSA
folder in thedocuments
folder, you can use the following command:
cd documents/SMSPSA
Use an environment manager to create an environment in which you can run the code, such as Anaconda or Miniconda. You can use the following command to create an environment called
SMSPSA
by using theenvironment.yml
file that is also part of yourSMSPSA
folder:
conda env create -f environment.yml
Installing the environment takes a few minutes.
Activate the environment. If you use Anaconda or Miniconda, you can use the following command:
conda activate SMSPSA
Done! See the Quickstart for information on how to run the SM-SPSA algorithm.
Note
If you use a different environment manager than Anaconda or Miniconda, please refer to the documentation of your environment manager on how to create an environment using a requirements.txt
or environment.yml
file.
Checking the installation#
You can check whether the installation was successful by running the included test suite. Follow these steps to do so:
Open the command line and move to the
SMSPSA
folder.Run the tests by using the following command:
pytest smspsa/tests.py
If all tests pass: done! If not, please read the test output carefully to finish the installation.
Note
It might be the case that pytest provides some warnings in the test results. If these are DepreciationWarnings
of packages other than SMSPSA
, you can ignore these.
Dependencies#
The package is dependent on several other Python packages, such as NumPy and pandas. These packages and their versions can be found in the requirement files (requirements.txt
and environment.yml
) in the GitHub repository.