Last active
October 10, 2018 16:08
-
-
Save stevedoyle/b65a3bfb38fffeacad8b2ebe6b19d34e to your computer and use it in GitHub Desktop.
Misc utilities to simplify common tasks in an iPython shell
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def mpps(gbps, size): | |
return (gbps / (size * 8)) * 1000 | |
def gbps(mpps, size): | |
return mpps * size * 8 / 1000; | |
def pkt_size(gbps, mpps): | |
return (gbps * 1000) / mpps / 8 | |
################################################## | |
def cyclespp(freq_mhz, mpps): | |
return freq_mhz / mpps | |
################################################## | |
import decimal | |
def eng(x): | |
return decimal.Decimal(x).normalize().to_eng_string() | |
def sep(x): | |
return "{:,}".format(x) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment