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.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | f89d26e77c30392ede202c757a24d6bfe757d689f0bfae11bd545032c754daab |
|
MD5 | ef38297253256a7d48ec54a875dc0450 |
|
BLAKE2b-256 | 17c5f3d3132f4f52d092be9734bc18985e8a5cb97a9818aa815b7063f9f26b44 |
Close
Hashes for energy_consumption_reporter-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 72dd6807931b9de105855ea2339e5d6a50cafbd4c3c4bb514ac6f724d1a4e999 |
|
MD5 | d0ec19b90190f240bf459c038fc6a2a5 |
|
BLAKE2b-256 | 48421acddec3f9b89256f29414f3e648a489bd82bd828643f8eb97251636b1bb |