An application to define, manage, and execute various energy system simulation models
Project description
Spine Toolbox
An application to define, manage, and execute various energy system simulation models.
Programming language
- Python 3.7
- Python 3.8
Please note that Python 3.9 is not supported yet.
License
Spine Toolbox is released under the GNU Lesser General Public License (LGPL) license. All accompanying documentation, original graphics and other material are released under the Creative Commons BY-SA 4.0 license. Licenses of all packages used by Spine Toolbox are listed in the Spine Toolbox User Guide.
Installation
Three options for installing Spine toolbox exist: as an application within an existing Python installation, using stand-alone installation package and using the source files directly (for developers).
With standard Python installation
Spine Toolbox is available on The Python Package Index (PyPI). This option is the recommended way to get the most recent release version but a working Python installation is also required.
NOTE: If you already have Spine toolbox installed globally using pip, please first
uninstall using pip uninstall spinetoolbox
.
-
Install Python 3.8. On Windows systems, the easiest way is through Microsoft Store or Python.org. On OS X, get the latest release at Python.org. Most Linux distributions have Python preinstalled, but please check which version you have and update if necessary.
-
Make sure you have the latest version of pip installed:
python3 -m pip install --upgrade pip
-
Install pipx. Open a terminal and type
python3 -m pip install pipx python3 -m pipx ensurepath
-
Install the latest Spine Toolbox release using
pipx install spinetoolbox
You can now start Spine Toolbox by calling spinetoolbox
on the command line.
To update the installation, run
pipx upgrade spinetoolbox
If you need a more recent version, you can install the latest development version using
pipx install git+https://github.com/Spine-project/Spine-Toolbox.git#egg=spinetoolbox
Please note that the stability of the latest version is not quaranteed.
Stand-alone installer packages
We offer stand-alone binary installers for the Windows platform (64-bit).
This option is suitable for users who cannot install Python or don’t care so much
about updates. Download the latest version from here,
install and run spinetoolbox.exe
.
Getting the source
This option is for the developers who wish to debug or edit the Spine Toolbox source code. First, follow the above instructions on installing Python and upgrading pip.
-
Clone or download the latest source code of Spine Toolbox from its GitHub repository.
-
Browse to the folder and create a virtual environment using
python3 -m venv .venv
-
Activate the environment using
.venv\Scripts\activate.bat
(Windows cmd.exe) orsource .venv/bin/activate
(bash, zsh). -
Install Spine Toolbox using pip. Note that the terminal prompt should indicate the activated environment.
pip install -r requirements.txt
-
(Optional) Install additional development packages with
pip install -r dev-requirements.txt
You can now run Spine Toolbox by calling spinetoolbox
when the environment
is activated. To update, just pull or copy the latest changes from the repository
and run
pip install --upgrade -r requirements.txt [-r dev-requirements.txt]
About requirements
Python 3.7 or Python 3.8 is required.
See file setup.py
and requirements.txt
for packages required to run Spine Toolbox.
(Additional packages needed for development are listed in dev-requirements.txt
.)
The requirements include three packages (spinedb_api
,
spine_engine
, and spine_items
),
developed by the Spine project consortium. Since these packages are developed very actively at the moment,
they may get upgraded quite regularly whenever you run python -m pip install --upgrade -r requirements.txt
.
Building the User Guide
You can find the latest documentation on readthedocs.
If you want to build the documentation yourself,
source files for the User Guide can be found in docs/source
directory. In order to
build the HTML docs, you need to install the optional requirements (see section
'Installing requirements' above). This installs Sphinx (among other things), which
is required in building the documentation. When Sphinx is installed, you can build the
HTML pages from the user guide source files by using the bin/build_doc.bat
script on
Windows or the bin/build_doc.sh
script on Linux and Mac. After running the script, the
index page can be found in docs/build/html/index.html
. The User Guide can also
be opened from Spine Toolbox menu Help->User Guide (F2).
Troubleshooting
Installation fails
Please make sure you are using Python 3.7 or Python 3.8 to install the requirements.
Installation fails on Linux
If Python runs into errors while installing on Linux systems, running the following commands in a terminal may help:
sudo apt install libpq-dev
sudo apt-get install unixodbc-dev
Problems in starting the application
If there are problems in starting Spine Toolbox, the chances are that the required
packages were not installed successfully. In case this happens, the first thing you
should check is that you don't have Qt
, PyQt4
, PyQt5
, PySide
, and PySide2
packages installed in the same environment. These do not play nice together and may
introduce conflicts. In addition, make sure that you do not have multiple versions
of these Qt
related packages installed in the same environment. The easiest way
to solve this problem is to create a blank (e.g. virtual environment) Python
environment just for PySide2
applications and installing the requirements again.
Warning: Using the conda-forge channel for installing the requirements is not recommended.
The required qtconsole
package from the conda-forge channel also
installs qt
and PyQt
packages. Since this is a PySide2
application, those are
not needed and there is a chance of conflicts between the packages.
Note: Supported PySide2 version is 5.14. Spine Toolbox does not support PySide2 version 5.15 (yet).
ImportError: DLL load failed while importing win32api
If you installed Spine Toolbox without Conda on Python 3.8 on Windows,
you may see this error when trying to execute a project item. The cause of this error
is the package pywin32
version 225. To fix this error, upgrade the package to version
300 using the following command
pip install --upgrade "pywin32==300"
After the process has finished, restart the application. Note: pywin32 v301 does not work.
Contribution Guide
All are welcome to contribute!
See detailed instructions for contribution in Spine Toolbox User Guide.
Below are the bare minimum things you need to know.
Setting up development environment
-
Install the developer requirements:
pip install -r dev-requirements.txt
-
Optionally, run
pre-commit install
in project's root directory. This sets up some git hooks.
Coding style
- Black is used for Python code formatting. The project's GitHub page includes instructions on how to integrate Black in IDEs.
- Google style docstrings
Linting
It is advisable to run pylint
regularly on files that have been changed.
The project root includes a configuration file for pylint
.
pylint
's user guide includes instructions on how to integrate the tool in IDEs.
Unit tests
Unit tests are located in the tests
directory.
You can run the entire test suite from project root by
python -m unittest
Reporting bugs
If you think you have found a bug, please check the following before creating a new issue:
- Make sure you’re on the latest version.
- Try older versions.
- Try upgrading/downgrading the dependencies
- Search the project’s bug/issue tracker to make sure it’s not a known issue.
What to put in your bug report:
- Python version. What version of the Python interpreter are you using? 32-bit or 64-bit?
- OS. What operating system are you on?
- Application Version. Which version or versions of the software are you using? If you have forked the project from Git, which branch and which commit? Otherwise, supply the application version number (Help->About menu).
- How to recreate. How can the developers recreate the bug? A screenshot demonstrating the bug is usually the most helpful thing you can report. Relevant output from the Event Log and debug messages from the console of your run, should also be included.
Feature requests
The developers of Spine Toolbox are happy to hear new ideas for features or improvements to existing functionality. The format for requesting new features is free. Just fill out the required fields on the issue tracker and give a description of the new feature. A picture accompanying the description is a good way to get your idea into development faster. But before you make a new issue, please check that there isn't a related idea already open in the issue tracker.
This project has received funding from the European Union’s Horizon 2020 research and innovation programme under grant agreement No 774629. |
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for spinetoolbox-0.6.1a6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2547076cfc66cb7dd5ba10be01a823fe9c7a172b44cf76ce20f9e63a244dfc9b |
|
MD5 | 1b98ff0a411234cc295e8763cc0b424c |
|
BLAKE2b-256 | 81b67b5ebde55bb1d96a2ffa2573bfc5b61dc278324ce9becf1de8e12ea3d8ea |