Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix tutorial timezone #535

Merged
merged 2 commits into from Nov 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 5 additions & 5 deletions documentation/tut/toy-example-from-scratch.rst
Expand Up @@ -108,7 +108,7 @@ FlexMeasures offers a command to create a toy account with a battery:
$ flexmeasures add toy-account --kind battery

Toy account Toy Account with user toy-user@flexmeasures.io created successfully. You might want to run `flexmeasures show account --id 1`
The sensor for battery charging is <Sensor 2: charging, unit: MW res.: 0:15:00>.
The sensor for battery (dis)charging is <Sensor 2: discharging, unit: MW res.: 0:15:00>.
The sensor for Day ahead prices is <Sensor 3: Day ahead prices, unit: EUR/MWh res.: 1:00:00>.

And with that, we're done with the structural data for this tutorial!
Expand Down Expand Up @@ -211,12 +211,12 @@ This is time series data, in FlexMeasures we call "beliefs". Beliefs can also be

.. code-block:: console

$ flexmeasures add beliefs --sensor-id 3 --source toy-user prices-tomorrow.csv
$ flexmeasures add beliefs --sensor-id 3 --source toy-user prices-tomorrow.csv --timezone utc
Successfully created beliefs

In FlexMeasures, all beliefs have a data source. Here, we use the username of the user we created earlier. We could also pass a user ID, or the name of a new data source we want to use for CLI scripts.

.. note:: Attention: We created and imported prices where the times have no time zone component! That happens a lot. FlexMeasures will then interpret them as UTC time. So if you are in Amsterdam time, the start time for the first price, when expressed in your time zone, is actually `2022-03-03 01:00:00+01:00`.
.. note:: Attention: We created and imported prices where the times have no time zone component! That happens a lot. Here, we localized the data to UTC time. So if you are in Amsterdam time, the start time for the first price, when expressed in your time zone, is actually `2022-03-03 01:00:00+01:00`.

Let's look at the price data we just loaded:

Expand Down Expand Up @@ -278,7 +278,7 @@ Great. Let's see what we made:
.. code-block:: console

$ flexmeasures show beliefs --sensor-id 2 --start ${TOMORROW}T07:00:00+01:00 --duration PT12H
Beliefs for Sensor 'charging' (Id 2).
Beliefs for Sensor 'discharging' (Id 2).
Data spans 12 hours and starts at 2022-03-04 07:00:00+01:00.
The time resolution (x-axis) is 15 minutes.
┌────────────────────────────────────────────────────────────┐
Expand All @@ -301,7 +301,7 @@ Great. Let's see what we made:
│ ▙▄▄▌ ▐▄▄▞ │
└────────────────────────────────────────────────────────────┘
10 20 30 40
██ charging
██ discharging


Here, negative values denote output from the grid, so that's when the battery gets charged.
Expand Down
2 changes: 1 addition & 1 deletion flexmeasures/cli/data_add.py
Expand Up @@ -1110,7 +1110,7 @@ def add_toy_account(kind: str, name: str):
click.echo(
f"Toy account {name} with user {user.email} created successfully. You might want to run `flexmeasures show account --id {user.account.id}`"
)
click.echo(f"The sensor for battery charging is {charging_sensor}.")
click.echo(f"The sensor for battery discharging is {charging_sensor}.")
click.echo(f"The sensor for Day ahead prices is {day_ahead_sensor}.")


Expand Down