Skip to main content

Easy to use, multi-level grade weighting system

Project description

ScoreTree

PyPI Release Package Build and Test Coverage Status Python Version

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 and thus, can be installed using Python's pip module:

python -m pip install --upgrade 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:

sample_output

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!

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

scoretree-0.2.0.tar.gz (46.1 kB view details)

Uploaded Source

Built Distribution

scoretree-0.2.0-py3-none-any.whl (37.6 kB view details)

Uploaded Python 3

File details

Details for the file scoretree-0.2.0.tar.gz.

File metadata

  • Download URL: scoretree-0.2.0.tar.gz
  • Upload date:
  • Size: 46.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for scoretree-0.2.0.tar.gz
Algorithm Hash digest
SHA256 f695a29edd3f383b47cbeb8ecd703c1aa8c2f88eaa100aa3a1f67fbe4186235a
MD5 6b24e2a88bcc8561a52750a4845dd992
BLAKE2b-256 0f6ce81923a79804c7fc941875e9c89c9ba6b30daecb6cf7112d4ecb6b0eec58

See more details on using hashes here.

Provenance

File details

Details for the file scoretree-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: scoretree-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 37.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for scoretree-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ab693668aee901c92bad3d75c83780a7b33276321a0cd998690a3c30dfc12eea
MD5 a57890b294773ef8d7686d2ead3b9882
BLAKE2b-256 acdea55272da90848f397a9dd572b3431e88029049d4295eb1d27fe26037d212

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page