aboutsummaryrefslogtreecommitdiff
path: root/gn3/db/traits.py
diff options
context:
space:
mode:
authorBonfaceKilz2021-04-13 16:51:05 +0300
committerBonfaceKilz2021-05-08 19:19:47 +0300
commitafcbd3d249cbe5f309f0a297dcc422427784fcfd (patch)
tree8981208505c63c24ab74e0ee7af3f62c9817041f /gn3/db/traits.py
parentb2cd7e9d929a5417673d6c9dcfa04c6272db2aa6 (diff)
downloadgenenetwork3-afcbd3d249cbe5f309f0a297dcc422427784fcfd.tar.gz
Replace namedtuple with a dataclass
Diffstat (limited to 'gn3/db/traits.py')
-rw-r--r--gn3/db/traits.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/gn3/db/traits.py b/gn3/db/traits.py
index 6c6118a..d315eb9 100644
--- a/gn3/db/traits.py
+++ b/gn3/db/traits.py
@@ -1,10 +1,17 @@
"""This contains all the necessary functions that are required to add traits
to the published database"""
-from collections import namedtuple
from typing import Any, Dict, Optional
+from dataclasses import dataclass
-riset = namedtuple('riset', ['name', 'id'])
+@dataclass(frozen=True)
+class riset:
+ """Class for keeping track of riset. A riset is a group e.g. rat HSNIH-Palmer,
+BXD
+
+ """
+ name: str
+ r_id: int
def get_riset(data_type: str, name: str, conn: Any):