From 916f4eb78254ba4c961d48243d72ba083ef711f2 Mon Sep 17 00:00:00 2001 From: Myned Date: Sun, 19 Nov 2017 23:29:24 -0500 Subject: [PATCH] Added helper for aspect ratio --- src/main/utils/utils.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/utils/utils.py b/src/main/utils/utils.py index 4e21058..d8c7c91 100644 --- a/src/main/utils/utils.py +++ b/src/main/utils/utils.py @@ -159,6 +159,13 @@ def get_kwargs(ctx, args, *, limit=False): raise exc.BoundsError(arg) return {'destination': destination, 'remaining': remaining, 'remove': rm, 'limit': lim} + + +def get_aspectratio(a, b): + divisor = gcd(a, b) + return f'{int(a / divisor)}:{int(b / divisor)}' + + def ci(pos, n): z = 1.96 phat = float(pos) / n