Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions documentation/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ Infrastructure / Support
----------------------
* The database migration for this release splits each stored flex-context's ``inflexible-device-sensors`` field into ``inflexible-consumption``/``inflexible-production`` sensor references, classifying each sensor by its ``consumption_is_positive`` attribute (behavior-preserving; sensor attributes themselves are kept). Downgrading merges them back into bare sensor IDs, dropping any source filters added in the meantime [see `PR #2358 <https://www.github.com/FlexMeasures/flexmeasures/pull/2358>`_]
* Speed up listing assets: eager-load each asset's sensors instead of lazy-loading them one query per asset during serialization, and skip loading sensors entirely for field-filtered responses that do not include them [see `PR #2363 <https://www.github.com/FlexMeasures/flexmeasures/pull/2363>`_]
* Speed up scheduling jobs by building the scheduling problem directly with the HiGHS Python API (``highspy``), bypassing Pyomo's model construction and solution-ingestion overhead (roughly a second for a single-device job, and several seconds for multi-device jobs); this direct backend is the new default for the ``FLEXMEASURES_LP_SOLVER`` setting (``"highspy"``), while any Pyomo-based solver (e.g. the previous default ``"appsi_highs"``, or ``"cbc"``) remains available as before [see `PR #2364 <https://www.github.com/FlexMeasures/flexmeasures/pull/2364>`_]
* Price fields in the flex-context (including nested commitment prices, which are now also held to the flex-context's shared currency) are selected for currency validation by field type (``PriceField``) instead of by name suffix [see `PR #2311 <https://www.github.com/FlexMeasures/flexmeasures/pull/2311>`_]
* Document ``SECURITY_TWO_FACTOR`` and related 2FA configuration settings [see `PR #2340 <https://www.github.com/FlexMeasures/flexmeasures/pull/2340>`_]
* ``flexmeasures db upgrade`` now runs ``VACUUM ANALYZE`` after upgrading by default, so Postgres has fresh planner statistics right after a migration; opt out with ``--no-vacuum`` [see `PR #2333 <https://www.github.com/FlexMeasures/flexmeasures/pull/2333>`_]
Expand Down
14 changes: 10 additions & 4 deletions documentation/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,17 @@ Default: ``False``
FLEXMEASURES_LP_SOLVER
^^^^^^^^^^^^^^^^^^^^^^

The command to run the scheduling solver. This is the executable command which FlexMeasures calls via the `pyomo library <http://www.pyomo.org/>`_. Potential values might be ``cbc``, ``cplex``, ``glpk`` or ``appsi_highs``. Consult `their documentation <https://pyomo.readthedocs.io/en/stable/solving_pyomo_models.html#supported-solvers>`_ to learn more.
We have tested FlexMeasures with `HiGHS <https://highs.dev/>`_ and `Cbc <https://coin-or.github.io/Cbc/intro>`_.
Note that you need to install the solver, read more at :ref:`installing-a-solver`.
The scheduling solver backend.

Default: ``"appsi_highs"``
The default, ``"highspy"``, builds the scheduling problem directly with the `HiGHS <https://highs.dev/>`_ Python API (``highspy``, which is installed with FlexMeasures).
This bypasses the `pyomo library <http://www.pyomo.org/>`_ and is much faster to construct, while solving the exact same problem.

Any other value is interpreted as the name of a Pyomo solver interface (the model is then built with Pyomo, which calls the solver).
Potential values might be ``cbc``, ``cplex``, ``glpk`` or ``appsi_highs``. Consult `the Pyomo documentation <https://pyomo.readthedocs.io/en/stable/solving_pyomo_models.html#supported-solvers>`_ to learn more.
We have tested FlexMeasures with `HiGHS <https://highs.dev/>`_ (both via ``highspy`` and via ``appsi_highs``) and `Cbc <https://coin-or.github.io/Cbc/intro>`_.
Note that a separate solver installation is only needed for external solvers such as ``cbc`` — both HiGHS-based choices (``highspy`` and ``appsi_highs``) rely on the ``highspy`` package that is installed together with FlexMeasures. Read more at :ref:`installing-a-solver`.

Default: ``"highspy"``


FLEXMEASURES_LP_SOLVER_OPTIONS
Expand Down
16 changes: 5 additions & 11 deletions documentation/host/deployment.rst
Original file line number Diff line number Diff line change
Expand Up @@ -89,25 +89,19 @@ Install the linear solver on the server
---------------------------------------

To compute schedules, FlexMeasures uses the `HiGHS <https://highs.dev/>`_ mixed integer linear optimization solver (FlexMeasures solver by default) or `Cbc <https://github.com/coin-or/Cbc>`_.
Solvers are used through `Pyomo <http://www.pyomo.org>`_\ , so in principle supporting a `different solver <https://pyomo.readthedocs.io/en/stable/solving_pyomo_models.html#supported-solvers>`_ would be possible.
By default, HiGHS is used directly through its Python API (``highspy``, which is installed together with FlexMeasures), so no extra installation is needed.
Solvers can also be used through `Pyomo <http://www.pyomo.org>`_\ , so in principle supporting a `different solver <https://pyomo.readthedocs.io/en/stable/solving_pyomo_models.html#supported-solvers>`_ would be possible.

You tell FlexMeasures with the config setting :ref:`solver-config` which solver to use.

However, the solver also needs to be installed - in addition to FlexMeasures (the Docker image already has it). Here is advice on how to install the two solvers we test internally:


.. note:: We default to HiGHS, as it seems more powerful


HiGHS can be installed using pip:

.. code-block:: bash

$ pip install highspy

Both HiGHS-based solver choices (``highspy`` and ``appsi_highs``) rely on the ``highspy`` package, which is installed together with FlexMeasures — nothing more to do.
More information on `the HiGHS website <https://highs.dev/>`_.

Cbc needs to be present on the server where FlexMeasures runs, under the ``cbc`` command.
An external solver, on the other hand, needs to be installed in addition to FlexMeasures (the Docker image already has it).
For example, Cbc needs to be present on the server where FlexMeasures runs, under the ``cbc`` command.

You can install it on Debian like this:

Expand Down
8 changes: 2 additions & 6 deletions documentation/host/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -360,13 +360,9 @@ Install an LP solver

For computing schedules, the FlexMeasures platform uses a linear program solver. Currently that is the HiGHS or CBC solvers.

It's already installed in the Docker image. For yourself, you can simply install it like this:
The default solver (HiGHS, used directly via its Python API) is installed together with FlexMeasures, so there is nothing to do here.

.. code-block:: bash

$ pip install highspy

Read more on solvers (e.g. how to install a different one) at :ref:`installing-a-solver`.
Read more on solvers (e.g. how to install a different one, such as CBC) at :ref:`installing-a-solver`.



Expand Down
Loading
Loading