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
File details
Details for the file energy_consumption_reporter-0.1.2.tar.gz
.
File metadata
- Download URL: energy_consumption_reporter-0.1.2.tar.gz
- Upload date:
- Size: 3.2 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.1 CPython/3.10.12 Linux/6.5.0-26-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 059a3362d08a0456b026f623108a40b5fe76fc5ca07b5dafe8651a1f7b9e9b1b |
|
MD5 | 3e8ec1099c27da37a3c5dcb664831bd3 |
|
BLAKE2b-256 | 8099e485a51cb2efa547656df0fc42c201f43e1ef0d07e4aa0417fd91c6c0197 |
File details
Details for the file energy_consumption_reporter-0.1.2-py3-none-any.whl
.
File metadata
- Download URL: energy_consumption_reporter-0.1.2-py3-none-any.whl
- Upload date:
- Size: 3.3 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.1 CPython/3.10.12 Linux/6.5.0-26-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e94d1c64caec7fba6da8f72fed5c1952b06d0bae52960d784e0e9f840e02f90c |
|
MD5 | 5133d1cd0bfe0a6e0a37a23acde2fd59 |
|
BLAKE2b-256 | c0ce1419f5b29a3d862ad25205bb97721be467a4aef7d740ac7ed675b9cf4cbf |