aboutsummaryrefslogtreecommitdiff
path: root/wqflask/base
diff options
context:
space:
mode:
authorBonfaceKilz2021-05-04 23:46:00 +0300
committerBonfaceKilz2021-05-05 12:26:04 +0300
commit7c6a60d62389fa945f5a7264cde31cf00ddf9fc4 (patch)
tree7e7e95f1034afbbe048eb5f8d80f08f236865c3f /wqflask/base
parent151cbec41a9466f8f716f24ae85c7a5b09919e01 (diff)
downloadgenenetwork2-7c6a60d62389fa945f5a7264cde31cf00ddf9fc4.tar.gz
base: species: Rewrite IndChromosome using a dataclass
Diffstat (limited to 'wqflask/base')
-rw-r--r--wqflask/base/species.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/wqflask/base/species.py b/wqflask/base/species.py
index ce646538..628bcc56 100644
--- a/wqflask/base/species.py
+++ b/wqflask/base/species.py
@@ -20,14 +20,15 @@ class TheSpecies:
self.chromosomes = Chromosomes(dataset=self.dataset)
+@dataclass
class IndChromosome:
- def __init__(self, name, length):
- self.name = name
- self.length = length
+ """Data related to IndChromosome"""
+ name: str
+ length: int
@property
def mb_length(self):
- """Chromosome length in megabases"""
+ """Chromosome length in mega-bases"""
return self.length / 1000000