Quick Start#
Getting lifelib#
If you are on Windows, simply download lifelib with WinPython from here. Unzip the file. No installation is required. The file contains a custom Python distribution based on WinPython distribution, which includes preinstalled lifelib, modelx, spyder-modelx and all other relevant packages.
If you are on Linux or Mac, follow the manual installation instruction below. If you do not wish to use the WinPython-based distribution, and want to use lifelib on your Anaconda environment, follow the instruction.
Copying a Library#
lifelib is essentially a collection of folders called libraries, which contain models and some other files. You can create your copy of a library, either from IPython console or from command prompts.
Creating a library copy from IPython
You can create a copy of a lifelib library from an IPython console using
lifelib.create
function:
>>> import lifelib
>>> lifelib.create("basiclife", "mylife")
The first parameter is the name of the lifelib library to copy.
The second parameter is the folder path to create.
If only a folder name is given, the folder is created under the current
folder.
The Files widget in Spyder shows where the current folder is.
Alternatively, the current folder can be reported by os.getcwd
function:
>>> import os
>>> os.getcwd()
If the second argument is omitted, the first parameter, which is the library name is used.
Creating a library from command prompt
Alternatively, you can copy a library
by a command lifelib-create
from the command prompt
named “WinPython Command Prompt.exe” included in the unzipped folder.
For example, to create a project folder named
mylife
under the path C:\Users\fumito
by copying lifelib’s default
library basiclife
,
Go to the unzipped folder and start WinPython Command Prompt.exe. Type the following command on the command prompt:
> lifelib-create --template basiclife C:\Users\fumito\mylife
Alternatively, since basiclife
is the default library,
you can get away with –template option like this:
> lifelib-create C:\Users\fumito\mylife
Using lifelib with Spyder#
After creating your copy of the desired library, you can begin exploring and customizing its contents. For interactive exploration and customization, IPython consoles in any Python development tool are suitable.
One recommended tool is Spyder, a popular scientific Python IDE. It is included by default in the WinPython distribution. Spyder is advantageous because of its Spyder plugin for modelx. This plugin enhances Spyder by adding widgets that allow for a graphical interface with lifelib models built using modelx. These widgets facilitate the development, execution, and analysis of models more efficiently.
For detailed guidance on using Spyder with lifelib, refer to the following documentation pages.
Running Notebooks#
lifelib libraries includes many Jupyter Notebooks for demonstrating the functionality of library contents. The following pages shows how to runs the notebooks: