Giter Club home page Giter Club logo

dumbbell_calc's Introduction

dumbbell_calc

A library and a cli tool to help assemble a modular dumbbell inventory

Requirements

Python 3.7+

Usage

$ python -i dumbbell.py
>>> d = Dumbbell(grip=1.5, plates=[0.75, 1, 2.5, 5])

This creates a dumbbell object with fixed weights for grip and plates.
grip represents the weight of the dumbbell's grip.
plates is a list of plates weights, it's assumed that 2 plates are available of each of them.

>>> d = Dumbbell.calc_exact(min_weight=1.5, max_weight=20, max_delta=1.5) 

This creates a dumbbell with automatically inferred grip and disk weights.
min_weight represents the minimum possible weight (no plates attached, only grip)
max_weight represents the maximum possible weight (all plates attached)
max_delta stands for maximum step allowed between adjacent configurations

>>> d.configurations()
[1.5, 3.0, 3.5, 5.0, 6.5, 8.0, 8.5, 10.0, 11.5, 13.0, 13.5, 15.0, 16.5, 18.0, 18.5, 20.0]

This returns a sorted list of all possible weight configurations for this dumbbell.

>>> d.max_delta()
1.5

This returns a maximum weight difference between any two configurations adjacent in the list.

More features are going to be implemented real soon...

dumbbell_calc's People

Contributors

ashpool37 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.