Getting started
Trying pyscal
You can try some examples provided with pyscal using Binder without installing the package. Please use this link to try the package.
Installation
Supported operating systems
pyscal can be installed on Linux, Mac OS and Windows based systems.
Installation using conda
pyscal can be installed directly using Conda from the conda-forge channel by the following statement-
conda install -c conda-forge pyscal
This is the recommended way to install if you have an Anaconda distribution.
The above command installs the latest release version of pyscal and works on all three operating systems.
pyscal is no longer maintained for Python 2. Although quick installation method might work for Python 2, all features may not work as expected.
Installation using pip
pyscal is not available on pip directly. However pyscal can be installed using pip by
pip install pybind11
pip install git+https://github.com/pyscal/pyscal
Installation from the repository
pyscal can be built from the repository by-
git clone https://github.com/pyscal/pyscal.git
pip install pybind11
cd pyscal
python setup.py install --user
Using a conda environment
pyscal can also be installed in a conda environment, making it easier to manage dependencies. A python3 Conda environment can be created by,
conda create -n myenv python=3
Once created, the environment can be activated using,
conda activate myenv
In case C++11 is not available, these can be installed using,
(myenv) conda install -c anaconda gcc
Now the pyscal repository can be cloned and the module can be installed. Python dependencies are installed automatically.
(myenv) git clone https://github.com/pyscal/pyscal.git
(myenv) conda install -c conda-forge pybind11
(myenv) cd pyscal
(myenv) python setup.py install
A good guide on managing Conda environments is available
[here](https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html).
Dependencies
Dependencies for the C++ part
C++ 11
Dependencies for the python part
Optional dependencies
Tests
In order to see if the installation worked, the following commands can be tried-
import pyscal.core as pc
pc.test()
The above code does some minimal tests and gives a value of True
if
pyscal was installed successfully. However, pyscal also contains
automated tests which use the
pytest python library, which can
be installed by pip install pytest
. The tests can be run by executing
the command pytest tests/
from the main code directory.
It is good idea to run the tests to check if everything is installed properly.