Git Product home page Git Product logo

scoretree's Introduction

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

python -m pip install scoretree

Note

The command above asumes that your Python interpreter is aliased to python and references a version equal to or greater than 3.10

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!

scoretree's People

Contributors

erlete avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.