I added in a file that describes the installation (at a high level) in the package, which users will hopefully see if they look at the GitHub repository. At some point, I would like to build up a free PDF that describes how to install and run examples. (Helping with documentation is one of the most pressing needs for outside help.)
Python is an open source programming language, and so it can be downloaded at no cost. The user is free to do what they wish with the software, so long as they follow the terms of the licence agreement. (The sfc_models package is also distributed in this fashion.)
I will not offer instructions on how to install Python; the procedures depend upon the computer’s operating system. There is a great deal of troubleshooting information available on the internet.
The key decision is whether you wish to download the base Python installation or work with an integrated development environment (IDE). I used to do my Python programming with the IDLE GUI (Graphical User Interface) that is installed by default with Python, but I have switched to using the PyCharm™ development environment by JetBrains: (https://www.jetbrains.com/pycharm/). PyCharm is available in two main editions: a free community edition that is sufficient for most programming and a commercial edition that is aimed at professional software developers. In addition, JetBrains has an edition for learning how to program: the user goes through lessons in steps. (There are other programming platforms available for Python; I am not familiar with them.)
Once you have installed Python, there are three ways of using the language.
- You can start the Python interpreter, and then type commands that are then processed. This interactive mode is useful for testing, but it is not the preferred way to do complex tasks. This interactive mode is similar to how Matlab and R are used, but not compiled languages (like C++).
- You can have the Python interpreter start running a script, and then it processes the commands within the script (Python scripts are files with the extension “.py”).
- You can work with a graphical development environment (IDLE, PyCharm) and develop Python scripts. You then launch the scripts using a command within the GUI. This is the usual way of developing in Python.
Once Python is installed, there are two ways of installing the sfc_models package: either downloading the latest Python package or by using the git source control system.
The easiest method is to load the latest production version that has been uploaded to the Python Package Repository (at pypi.org). The package is found at: https://pypi.python.org/pypi/sfc_models/. This download can either be done automatically through PyCharm, or else using the pip installation script on the command line.
The use of PyCharm is the simplest solution; you just need to add the sfc_models package to the Python installation, as described in the PyCharm documentation.
The slightly more complex solution is to use the pip installation script. The script is found in the “scripts” subdirectory below the Python installation. From the command line, you just need to run:
pip install sfc_models
However, you may need to do some steps before running “pip install,” and those steps may vary across operating systems. Since these installation methods will change over time, the reader is referred to online documentation on the usage of pip.
Code examples are found in the sfc_models/examples/scripts directory. You could find this directory, and copy the files to a working directory. Alternatively, you can run an installation script that is available once sfc_models is installed. To do this, open a Python console, and run the following.
from sfc_models.objects import *
Invoking install_examples should bring up pop-up windows that ask you where you wish to install the example scripts.
Using source control is discussed in Section 2.6.