Skip to content

Commit

Permalink
bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
francoviscarra committed Oct 25, 2023
1 parent 49577fa commit 271f147
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
10 changes: 6 additions & 4 deletions pyCRC_plot/CRC.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@ def hill_eq(x,bot,top, ec50, hs=1):


def fit_individual(x,ydata):
valid = ~(np.isnan(x) | np.isnan(ydata))
popt, pcov = curve_fit(
f=hill_eq, # model function
xdata=x, # x data
ydata=ydata, # y data
xdata=x[valid], # x data
ydata=ydata[valid], # y data
p0=(0, 1, -6), # initial value of the parameters
maxfev=5000,)
# nan_policy="omit")
Expand All @@ -38,10 +39,11 @@ def fit_hill(x, ydata): #, label, title):
fit_curve = []
for cname in ydata:
column = ydata[cname]
valid = ~(np.isnan(x) | np.isnan(column))
popt, pcov = curve_fit(
f=hill_eq, # model function
xdata=x, # x data
ydata=column, # y data
xdata=x[valid], # x data
ydata=column[valid], # y data
p0=(0, 1, -6), # initial value of the parameters
maxfev=5000,)
# nan_policy="omit")
Expand Down
7 changes: 4 additions & 3 deletions pyCRC_plot/gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
marker_cycle = ["o", "s", "v", "^"] * 2
fill_cycle = ["full"]*4 + ["none"]*4

print(fill_cycle)

class main_window(tk.Tk):
def __init__(self):
tk.Tk.__init__(self)
Expand Down Expand Up @@ -211,9 +209,12 @@ def plot_crc(self):
except:
df = df.loc[:, df.columns != 'X']
df.insert(0, column="X", value=x)
df = df.astype("float")
df.replace('', np.nan, inplace=True)

df = df.dropna(how='all')
df = df.dropna(how='all', axis=1)
df = df.astype("float")
print(df)
x = df["X"]
df = df.loc[:, df.columns != 'X']

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ build-backend = "setuptools.build_meta"
[project]
name = "pyCRC_plot"
#dynamic = ["version"]
version = "0.1.3"
version = "0.1.4"
authors = [
{ name="Franco Viscarra", email="[email protected]" },
]
Expand Down

0 comments on commit 271f147

Please sign in to comment.