An energy consumption measuring and reporting tool
Project description
Scenario Energy Report
Authors: Delano Flipse, Rodin Haker, Aron Hoogeveen
Setup
This project uses Python 3.10.
Description
Usage
There are two main ways to use this project:
- Use the decorator to test a function. You can provide the amount of times it has to run as a parameter.
@EnergyTest.energy_test(2)
def test_func():
def fib(n):
if n <= 1:
return n
else:
return fib(n-1) + fib(n-2)
assert fib(37) == 24157817, "Not equal"
- Use a with statement to test a particular piece of code once
def test_func3():
with EnergyTest() as test:
def fib(n):
if n <= 1:
return n
else:
return fib(n-1) + fib(n-2)
assert fib(35) == 9227465, "Not equal"
You can set up the following custom parameters:
- model
- report name
- report description
- whether to save a report (in JSON format)
EnergyTest().set_model(EnergyModel)
EnergyTest().set_report_name("Custom Report Name")
EnergyTest().set_report_description("Custom Report Description")
EnergyTest().set_save_report(True)
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
Built Distribution
Close
Hashes for energy_consumption_reporter-0.1.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3bb4a1d7cce5bc848707da551661c0da55d027f8eef816a8e51d2409d0592a2a |
|
MD5 | ea924ed0d2d164e1714d57f3aa342a19 |
|
BLAKE2b-256 | bebe05552f41f3c62d46cca2e1a675055a4bbbe2adcb980eb24bb50fd8dce696 |
Close
Hashes for energy_consumption_reporter-0.1.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | df26ef729a154d97fda07b4c0dd51f363e02b19f59a6e77432beb985d281639c |
|
MD5 | 784aa30288a14016025c7bc9469b3e1b |
|
BLAKE2b-256 | fa3e27c9498ccfbeb882c2600a08ed1baff01d8e64c071dda70ba4ce37be8dfd |