1
0
Fork 0
mirror of https://github.com/Athemis/pyKinetics.git synced 2025-04-05 06:56:02 +00:00

Move x and y parameters to tuple

This commit is contained in:
Alexander Minges 2015-08-24 17:30:15 +02:00
parent d9179b4221
commit 9b19ac7b89

View file

@ -8,12 +8,14 @@ import warnings
class Replicate(): class Replicate():
"""
def __init__(self, num, x, y, owner): """
def __init__(self, num, xy, owner):
self.logger = owner.logger self.logger = owner.logger
self.num = num + 1 self.num = num + 1
self.x = x self.x, self.y = xy
self.y = y
self.owner = owner self.owner = owner
self.xlim = owner.xlim self.xlim = owner.xlim
self.fitresult = self.fit() self.fitresult = self.fit()
@ -62,12 +64,11 @@ class Replicate():
class Measurement(): class Measurement():
def __init__(self, x, y, conc, conc_unit, owner): def __init__(self, xy, conc, conc_unit, owner):
self.logger = owner.logger self.logger = owner.logger
self.concentration = float(conc) self.concentration = float(conc)
self.concentration_unit = conc_unit self.concentration_unit = conc_unit
self.x = x self.x, self.y = xy
self.y = y
self.replicates = [] self.replicates = []
self.owner = owner self.owner = owner
self.xlim = owner.xlim self.xlim = owner.xlim
@ -80,8 +81,7 @@ class Measurement():
for n in range(num_replicates): for n in range(num_replicates):
self.replicates.append(Replicate(n, self.replicates.append(Replicate(n,
self.x, (self.x, self.y[:, n:n+1]),
self.y[:, n:n+1],
self)) self))
for r in self.replicates: for r in self.replicates:
@ -141,7 +141,7 @@ class Experiment():
x = tmp[:, 0] x = tmp[:, 0]
y = tmp[:, 1:] y = tmp[:, 1:]
# create new measurement and append to list # create new measurement and append to list
measurement = Measurement(x, y, conc, unit, self) measurement = Measurement((x, y), conc, unit, self)
self.measurements.append(measurement) self.measurements.append(measurement)
# iterate over all measurements # iterate over all measurements