Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CLI function for adding assets & weather sensors; add dummy market (#74)
* add new-asset CLI function; move Asset schema to data package and enrich its validations * group CLI commands (in the data package) into add, delete, db-ops and jobs groups * add weather sensor CLI function; starting a unified Sensor schema in the process * protect analytics view against crashing if no relevant weather sensor is found * add default weather sensor types and a dummy TOU market as structure * update documentation with new CLI commands; add complete CLI reference * prepare add weather sensor command for printing out the EA address
- Loading branch information
1 parent
aef5f8e
commit f68d014
Showing
29 changed files
with
1,089 additions
and
589 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
.. _cli-changelog: | ||
|
||
********************** | ||
FlexMeasures CLI Changelog | ||
********************** | ||
|
||
|
||
since v0.2.4 | March XX, 2021 | ||
===================== | ||
|
||
* Refactor CLI into the main groups ``add``, ``delete``, ``jobs`` and ``db-ops`` | ||
* Add ``flexmeasures add asset``, ``flexmeasures add user`` and ``flexmeasures add weather-sensor`` | ||
* split the ``populate-db`` command into ``flexmeasures add structure`` and ``flexmeasures add forecasts`` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
.. _cli: | ||
|
||
Command Line Interface (CLI) | ||
============================= | ||
|
||
FlexMeasures comes with a command-line utility, which helps to manage data. | ||
Below, we list all available commands. | ||
|
||
Each command has more extensive documentation if you call it with ``--help``. | ||
|
||
We keep track of changes to these commands in :ref:`cli-changelog`. | ||
You can also get the current overview over the commands you have available by: | ||
|
||
.. code-block:: | ||
flexmeasures --help | ||
This also shows admin commands made available through Flask and installed extensions (such as `Flask-Security <https://flask-security-too.readthedocs.io>`_ and `Flask-Migrate <https://flask-migrate.readthedocs.io>`_), | ||
of which some are referred to in this documentation. | ||
|
||
|
||
``add`` - Add data | ||
-------------- | ||
|
||
================================================= ======================================= | ||
``flexmeasures add structure`` Initialize structural data like asset types, | ||
market types and weather sensor types. | ||
``flexmeasures add user`` Create a FlexMeasures user. | ||
``flexmeasures add asset`` Create a new asset. | ||
``flexmeasures add weather-sensor`` Add a weather sensor. | ||
``flexmeasures add external-weather-forecasts`` Collect weather forecasts from the DarkSky API. | ||
``flexmeasures add forecasts`` Create forecasts. | ||
================================================= ======================================= | ||
|
||
|
||
``delete`` - Delete data | ||
-------------- | ||
|
||
================================================= ======================================= | ||
``flexmeasures delete structure`` Delete all structural (non time-series) data like assets (types), | ||
markets (types) and weather sensors (types) and users. | ||
``flexmeasures delete user`` Delete a user & also their assets and power measurements. | ||
``flexmeasures delete measurements`` Delete measurements (with horizon <= 0). | ||
``flexmeasures delete prognoses`` Delete forecasts and schedules (forecasts > 0). | ||
================================================= ======================================= | ||
|
||
|
||
``jobs`` - Job queueing | ||
-------------- | ||
|
||
================================================= ======================================= | ||
``flexmeasures jobs run-worker`` Start a worker process for forecasting and/or scheduling jobs. | ||
``flexmeasures jobs clear-queue`` Clear a job queue. | ||
================================================= ======================================= | ||
|
||
|
||
``db-ops`` - Operations on the whole database | ||
-------------- | ||
|
||
================================================= ======================================= | ||
``flexmeasures db-ops dump`` Create a dump of all current data (using `pg_dump`). | ||
``flexmeasures db-ops load`` Load backed-up contents (see `db-ops save`), run `reset` first. | ||
``flexmeasures db-ops reset`` Reset database data and re-create tables from data model. | ||
``flexmeasures db-ops restore`` Restore the dump file, see `db-ops dump` (run `reset` first). | ||
``flexmeasures db-ops save`` Backup db content to files. | ||
================================================= ======================================= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.