aboutsummaryrefslogtreecommitdiff
path: root/gn3/chancy.py
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2022-12-21 03:39:52 +0300
committerFrederick Muriuki Muriithi2022-12-21 03:39:52 +0300
commitdaa3a9cade431b21bbc48b690c16dcb8746f3dce (patch)
tree9680d2cbfb5c4725a5d9d1166b4f17e6904e223f /gn3/chancy.py
parent6369eceb15755026df518c94cc57a331275fa3d3 (diff)
downloadgenenetwork3-daa3a9cade431b21bbc48b690c16dcb8746f3dce.tar.gz
gn3: (gn3.random -> gn3.chancy): Rename module to avoid conflicts.
Rename the `gn3.random` module to gn3.chancy to avoid conflicts with Python's `random` module. * gn3/random.py -> gn3/chancy.py: rename module * gn3/commands.py: update import * gn3/computations/partial_correlations.py: update import * gn3/computations/qtlreaper.py: update import * gn3/computations/rust_correlation.py: update import * gn3/db/correlations.py: update import * gn3/db/traits.py: update import * gn3/heatmaps.py: update import * tests/integration/conftest.py: update import
Diffstat (limited to 'gn3/chancy.py')
-rw-r--r--gn3/chancy.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/gn3/chancy.py b/gn3/chancy.py
new file mode 100644
index 0000000..f0ba574
--- /dev/null
+++ b/gn3/chancy.py
@@ -0,0 +1,11 @@
+"""
+Functions to generate complex random data.
+"""
+import random
+import string
+
+def random_string(length):
+ """Generate a random string of length `length`."""
+ return "".join(
+ random.choices(
+ string.ascii_letters + string.digits, k=length))