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 proved 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.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5fd75176ef6e14ee77b264e3cb2f983bed172dff5b72302e486b22947653497c |
|
MD5 | 2a7880cb438b1dd5ad6bf8f06c8881f2 |
|
BLAKE2b-256 | ac6447e3c0f69a2f4710db2f44c99b4f85040b6b8d9f1645d70eb51a88f59bd0 |
Close
Hashes for energy_consumption_reporter-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2a5a19a1f264fcf9fd4bb10a901e2dab66042fbf20d58f1f6ea6dccf5caa9673 |
|
MD5 | f27d5aaf3a054b36f866fc395a5e2eee |
|
BLAKE2b-256 | 73dce69f26642cea80f1b06f412c226f38adc9b37c79faed5cc7940a8edb7af9 |