ScoreTree
ScoreTree is an easy to use, multi-level grade weighting system that serves as excellent tool for cascade grading methods.
Installation
This package has been released through PyPI, so it can be installed using Python's pip module:
python -m pip install scoretree
Alternatively, it is also possible to clone this repository and install the package via pip and/or build.
Usage
Here is an usage example. Feel free to take a look at other examples in the corresponding section of the repository.
from scoretree import Score, ScoreArea, ScoreTree
# Define a score tree:
st = ScoreTree([
# Add a list of areas to be evaluated:
ScoreArea(name=f"Simulation", weight=1, items=[
# Each area can contain other areas and/or scores:
ScoreArea("Stop maneuver", .2, [
# Scores are the minimal grading unit:
Score(
name="Distance to end",
weight=.8,
score_range=(0, 10),
value=9.8848,
inverse=True
),
Score("Deceleration intensity", .2, (0, 20), value=185555)
]),
# Different instance creation syntax:
ScoreArea("Track performance", .8, [
Score("Speed", .3, (0, 20), 5),
ScoreArea("Efficiency", .7, [
Score("Track time", .5, (0, 40), 30),
Score("Track distance", .5, (0, 200), value=10, inverse=True)
])
])
])
], colorized=True) # Enable or disable colorized output.
print(f"Total simulation score: {st.score}")
This would be the colorized output for the code snippet above:
Contributing
Since this is a very small project that can be easily improved and can expand its functionality way further down the development process, any contributions, suggestions or bug reports are more than welcome!
Metadata
Release files for scoretree 1.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| scoretree-1.1.0.tar.gz | 46.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| scoretree-1.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 84.6 kB
Release files / scoretree-1.1.0.tar.gz
| Download URL | scoretree-1.1.0.tar.gz |
|---|---|
| Size | 46.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6d1ebcdef59a3be2f267bad4b60281547c8757232c968186125eae41b38ba714
|
|
BLAKE2b-256 checksum How to use checksums |
e1b1f0775923f223ea7c28b47c5b3fdd8f7482db2aa4317c1de47398e589a266
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.18
|
Release files / scoretree-1.1.0-py3-none-any.whl
| Download URL | scoretree-1.1.0-py3-none-any.whl |
|---|---|
| Size | 37.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
90eaa4344fdf93fd5a70a43c2789706521ccaa66aabe66f5b28acd67ac4612a6
|
|
BLAKE2b-256 checksum How to use checksums |
372d1104651d4a80503f663250a4a4bc543bc23abba947c51c4ecc9998a39ed2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.18
|