Skip to content

Commit

Permalink
Removed unused code [ci skip]
Browse files Browse the repository at this point in the history
  • Loading branch information
micheles committed Oct 13, 2024
1 parent b119499 commit 46bf326
Showing 1 changed file with 0 additions and 24 deletions.
24 changes: 0 additions & 24 deletions openquake/risklib/scientific.py
Original file line number Diff line number Diff line change
Expand Up @@ -1758,30 +1758,6 @@ def get_agg_value(consequence, agg_values, agg_id, xltype, time_event):
raise NotImplementedError(consequence)


# ########################### u64_to_eal ################################# #

def u64_to_eal(u64):
"""
Convert an unit64 into a triple (eid, aid, lid)
>>> u64_to_eal(42949673216001)
(10000, 1000, 1)
"""
eid, x = divmod(u64, TWO32)
aid, lid = divmod(x, 256)
return eid, aid, lid


def eal_to_u64(eid, aid, lid):
"""
Convert a triple (eid, aid, lid) into an uint64:
>>> eal_to_u64(10000, 1000, 1)
42949673216001
"""
return U64(eid * TWO32) + U64(aid * 256) + U64(lid)


if __name__ == '__main__':
# plots of the beta distribution in terms of mean and stddev
# see https://en.wikipedia.org/wiki/Beta_distribution
Expand Down

0 comments on commit 46bf326

Please sign in to comment.