From 1a2194f0428afbdebed38f7afb4e2f46cfe1776e Mon Sep 17 00:00:00 2001 From: chen Date: Mon, 17 Oct 2016 16:23:21 -0400 Subject: [PATCH] remove useless functions --- processing/post/h5_addIPFcolor.py | 29 ----------------------------- 1 file changed, 29 deletions(-) diff --git a/processing/post/h5_addIPFcolor.py b/processing/post/h5_addIPFcolor.py index 469e3e386..e8abc2a0f 100755 --- a/processing/post/h5_addIPFcolor.py +++ b/processing/post/h5_addIPFcolor.py @@ -16,35 +16,6 @@ scriptID = ' '.join([scriptName, damask.version]) # element at a time, maybe there are some other ways to make this # faster. - -# ----- Helper functions ----- # -# ref: http://stackoverflow.com/questions/16801322/how-can-i-check-that-a-list- -# has-one-and-only-one-truthy-value -# NOTE: -# These functions might be useful in the future -def n_trues(iterable, n=1): - """N(trues) = n""" - i = iter(iterable) - return all(any(i) for j in range(n)) and not any(i) - - -def up_to_n_trues(iterable, n=1): - i = iter(iterable) - all(any(i) for j in range(n)) - return not any(i) - - -def at_least_n_trues(iterable, n=1): - i = iter(iterable) - return all(any(i) for j in range(n)) - - -def m_to_n_trues(iterable, m=1, n=1): - i = iter(iterable) - assert m <= n - return at_least_n_trues(i, m) and up_to_n_trues(i, n - m) - - # -------------------------------------------------------------------- # MAIN # --------------------------------------------------------------------