diff --git a/pk_optimizer/pkGUI.py b/pk_optimizer/pkGUI.py new file mode 100644 index 0000000000000000000000000000000000000000..6e984fc0f72d9d63c910570d5a275bd40bb7c4b0 --- /dev/null +++ b/pk_optimizer/pkGUI.py @@ -0,0 +1,115 @@ +#!/usr/bin/env python +# coding: utf-8 + +# In[9]: + + +#Import Everything + +class pkGUI: + """The pkGUI object creates a GUI of size x by y to display the optimization of parameters for PK models.""" + + def __init__ (self, xdim = 512, ydim = 320, numParam = 4, Flow = 1, Vp = 0.1, Visf = 0.5, PS = 0.15): + + """Initializes the GUI with default size 512 by 320 pixels and one button to start optimization. + Parameters + ---------- + xdim : int + xdim is used for defining the x dimension of your GUI size. + + ydim : int + ydim is used for defining the y dimension of your GUI size. + + numParam: int + numParam is the number of parameters you want to optimize for the model. Defaults to 4. + + Flow : double + Flow is the flow of plasma through the blood vessel in mL/(mL*min). Defaults to 1. + + Vp : double + Vp is the volume of plasma in mL. Defaults to 0.1. + + Visf : double + Visf is the volume of interstitial fluid in mL. Defaults to 0.5. + + PS : double + PS is the permeability-surface area constant in mL/(g*min). Defaults to 0.15. + """ + + self.xdim = xdim + self.ydim = ydim + self.numParam = numParam + self.Flow = Flow + self.Vp = Vp + self.Visf = Visf + self.PS = PS + + #build GUI with dims x, y + #build button in center named Optimize! + + def slider(numParam = 4, labels = ['Flow', 'Vp', 'Visf', 'PS']): + """Adds a slider for each parameter to the GUI with labels as their names. + Parameters + ---------- + numParam : int + numParam is defaulted to 4 (self.numParam) and is used for defining the number of sliders in th GUI. + + labels : str[] + labels are defaulted to Flow, Vp, Visf, and PS, and are used for naming the sliders. + """ + #Creates and sliders with names for each model. + #EVENT: move sliders = move parameter values and change model + + def IOBoxes(numParam = 4): + """Creates text boxes for initial guesses and output text boxes for final parameter values. + Parameters + ---------- + numParam : int + numParam is defaulted to 4 (self.numParam) and is used for defining the number of text boxes in th GUI. + """ + #Creates text boxes for initial guesses + #Creates text boxes for displaying output (optimized) values. + + def passValues(paramName, paramVal): + """If a parameter is changed from slider, it will pass the changes to the Model object and text boxes. + Parameters + ---------- + paramName : str + paramName is the name of the parameter that changed. + + paramVal : double + paramVal is the new value of the parameter that is passed to the model and text boxes. + """ + self.paramName = paramVal + + #update text box output + #update model + + def getValues(paramName, model): + """Get the parameter value of paramName from model model. + + Parameters + ---------- + paramName : str + paramName is the name of the parameter that changed. + + model : model object + model is the model you want to get values from. + """ + #call object for value + + def dispModel(objModel): + """Displays a Model object in GUI. + Parameters + ---------- + objModel : Model object + objModel will be either a 1 Comp or 2 Comp model and will be displayed in the GUI. + """ + #Displays model in GUI + + +# In[ ]: + + + +