From 52b591d5b5201628f33043e62e5731ad919ee1b9 Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Mon, 20 Jun 2022 14:03:54 +0530 Subject: gn3: genodb: Retire get function. * gn3/genodb.py (get): Delete function. (matrix): Use db.txn.get instead of get. --- gn3/genodb.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/gn3/genodb.py b/gn3/genodb.py index e4f26b6..3f7c71d 100644 --- a/gn3/genodb.py +++ b/gn3/genodb.py @@ -40,18 +40,14 @@ def open(path): txn.abort() env.close() -def get(db, key): - '''Get value associated with key in genotype database.''' - return db.txn.get(key) - def get_metadata(db, hash, metadata): '''Get metadata associated with hash in genotype database.''' return db.txn.get(hash + b':' + metadata.encode()) def matrix(db): '''Get current matrix from genotype database.''' - hash = get(db, b'versions')[0:db.hash_length] - read_optimized_blob = get(db, get(db, b'current')) + hash = db.txn.get(b'versions')[0:db.hash_length] + read_optimized_blob = db.txn.get(db.txn.get(b'current')) nrows = int.from_bytes(get_metadata(db, hash, 'nrows'), byteorder='little') ncols = int.from_bytes(get_metadata(db, hash, 'ncols'), byteorder='little') return GenotypeMatrix(np.reshape(np.frombuffer(read_optimized_blob[0 : nrows*ncols], -- cgit v1.2.3