https://github.com/PyPSA/PyPSA
Raw File
Tip revision: 5a0644dc4b13c783620d1ae1f3ae963013ce7e97 authored by Fabian Neumann on 13 July 2023, 19:57:25 UTC
Merge pull request #681 from PyPSA/prep-v0.25
Tip revision: 5a0644d
unit_testing.rst
########################
Unit Testing
########################


Unit testing is performed with ``pytest`` that can be installed via

.. code::

    pip install pytest

The tests can be found in ``pypsa/test/`` and can be run from there via

.. code::

    pytest

Or to run individual tests:

.. code::

    pytest test_lpf_against_pypower.py

Power flow is tested against PYPOWER (the Python implementation of MATPOWER)
and pandapower.

.. warning::

    Note that PYPOWER 5.0 has a bug in the linear load flow, which was fixed in the github version in January 2016.

.. note::

    Note also that the test results against which everything is tested
    were generated with the free software LP solver GLPK; other solver may
    give other results (e.g. Gurobi can give a slightly better result).


Unit testing of new GitHub commits is automated with Github Actions.
back to top