Skip to main content

Split and group energy billing data to analyse usage and aplpy load profiles

Project description

EnergyShaper

Split and group energy billing data to analyse usage and apply load profiles

Build Status Coverage Status

Split into intervals based on load profile

Given a bunch of energy readings:

<Reading start=2017-01-01 00:00:00, end=2017-02-01 00:00:00, usage 155.00>
<Reading start=2017-02-01 00:00:00, end=2017-02-09 00:00:00, usage 40.00>
<Reading start=2017-02-09 00:00:00, end=2017-03-01 00:00:00, usage 100.00>
<Reading start=2017-03-01 00:00:00, end=2017-03-01 12:00:00, usage 2.50>
<Reading start=2017-03-01 12:00:00, end=2017-03-02 00:00:00, usage 2.50>

Split them up based on a user-specified load profile. First split them so each reading is at most a day. The input readings can be at varying read intervals.

daily = list(split_into_daily_intervals(records))

Then split into required interval.

minute = list(split_into_profiled_intervals(daily, interval_m=1,
                                            profile=[1, 1, 1, 1]))

The profile is a list indicating a daily profile at whatever resolution you desire. It will adjust the ratios so they add to 100%.

profile=[0.05, 0.07, 0.12, 0.11, 0.14, 0.14, 0.27, 0.10]

The load will then be split up based on the profile:

<Reading start=2017-01-01 00:00:00, end=2017-01-01 00:01:00, usage 0.00>
<Reading start=2017-01-01 00:01:00, end=2017-01-01 00:02:00, usage 0.00>
<Reading start=2017-01-01 00:02:00, end=2017-01-01 00:03:00, usage 0.00>
...
<Reading start=2017-03-01 23:57:00, end=2017-03-01 23:58:00, usage 0.00>
<Reading start=2017-03-01 23:58:00, end=2017-03-01 23:59:00, usage 0.00>
<Reading start=2017-03-01 23:59:00, end=2017-03-02 00:00:00, usage 0.00>

Grouping intervals

The splitting functions will keep smaller interval lengths if available, so we may want to group them back up again to get a consistent interval across all readings. This will automatically split readings passed to it first.

half_hourly = list(group_into_profiled_intervals(minute, interval_m=30,
                                                 profile=[1, 1, 1, 1])
                                                 )
<Reading start=2017-01-01 00:00:00, end=2017-01-01 00:30:00, usage 0.10>
<Reading start=2017-01-01 00:30:00, end=2017-01-01 01:00:00, usage 0.10>
<Reading start=2017-01-01 01:00:00, end=2017-01-01 01:30:00, usage 0.10>
...
<Reading start=2017-03-01 22:30:00, end=2017-03-01 23:00:00, usage 0.10>
<Reading start=2017-03-01 23:00:00, end=2017-03-01 23:30:00, usage 0.10>
<Reading start=2017-03-01 23:30:00, end=2017-03-02 00:00:00, usage 0.10>

Daily stats

Finally, you can group back up to daily values again. There are a bunch of optional keyword arguments that lets you calculate what the usage is during peak and shoulder periods.

days = list(group_into_daily_summary(MONTH_RECORDS))
<DaySummary 2017-01-01 Usage:5.00>
<DaySummary 2017-01-02 Usage:5.00>
<DaySummary 2017-01-03 Usage:5.00>
...
<DaySummary 2017-02-27 Usage:5.00>
<DaySummary 2017-02-28 Usage:5.00>
<DaySummary 2017-03-01 Usage:5.00>

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

energy_shaper-0.1.tar.gz (5.6 kB view details)

Uploaded Source

Built Distribution

energy_shaper-0.1-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

Details for the file energy_shaper-0.1.tar.gz.

File metadata

  • Download URL: energy_shaper-0.1.tar.gz
  • Upload date:
  • Size: 5.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for energy_shaper-0.1.tar.gz
Algorithm Hash digest
SHA256 88a98d2cbd8b11a242049e62580de5e55ad1b41e394b8f7ef36022ed370bc52a
MD5 a9625821e573160e6d52f32932f43b3c
BLAKE2b-256 0b417355d8bebe89399354f8c17bac437aabb97c44ade2753013dbea755166a8

See more details on using hashes here.

File details

Details for the file energy_shaper-0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for energy_shaper-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e1327804780ae1bbdfc7105e4ee1992d02497a38416f2a3122e0537c51c5caa3
MD5 b859410897e00fc98ed84b10c1ddd0c2
BLAKE2b-256 117dbf11b575250f84966bf9abf7254cd7febd3dc98a17c389f118c051446ee5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page