pharmpy / modelbuilder Goto Github PK
View Code? Open in Web Editor NEWA GUI to build models using Pharmpy
License: BSD 2-Clause "Simplified" License
A GUI to build models using Pharmpy
License: BSD 2-Clause "Simplified" License
It shouldn't be possible to set any number smaller than 1 for the number of cutoffs
I think the font should be a fixed width font in the text box displaying the model code. This will make the code look better, but also the mathematical rendering.
For example after starting the app: "Model Type" and "Model format" are labels and "Write model" and "Choose dataset" are buttons, but they look exactly the same (perhaps the font is slightly different). I think it should be possible to know what is clickable just by looking.
These are not important right now
If I try to change the name of "POP_CL" in the starting model I get a crash and the name of the parameter is not changed
When running the app the tab in the browser will be constantly toggling between being named "Pharmpy GUI" and "Updating...". I am using Firefox. In chrome it doesn't switch back and forth but is stable on "Pharmpy GUI"
Perhaps to some pop-up of some kind
Currently it says "PLACEHOLDER Pharmpy GUI Navbar", but since we don't have a navbar yet perhaps it should simply say "Pharmpy model builder"
I see that the file __pycache__/designfile.cpython-311.pyc
is in the repo. This is a binary compiled file and shouldn't be commited.
Write a complete user guide, along with examples to help new users
If I increase up to say 3 peripherals it becomes impossible to go back down to 1 or 0. The number changes, but the model code stays the same
We should move the "Model statements" button. If possible the functionality could be replacing the generic code view, but it seems as if the text renderer is buggy. If not possible simply remove the button.
There is not MX-button selected in the route at start, but it seems as if IV is actually the default. Perhaps it should be selected
Zero order elimination is currently missing
Running pip install -r requirements.txt
causes error for pywin32
on linux due to it being windows specific
Directly switching to MM elimination after starting the app causes a crash.
I think this is actually a bug in Pharmpy:
Traceback (most recent call last):
File "/home/rikard/devel/modelbuilder/app.py", line 174, in update_abs_elim
"MM": set_michaelis_menten_elimination(globals()["model"]),
File "/home/rikard/devel/modelbuilder_venv/lib/python3.10/site-packages/pharmpy/modeling/odes.py", line 573, in set_michaelis_menten_elimination
model = _do_michaelis_menten_elimination(model)
File "/home/rikard/devel/modelbuilder_venv/lib/python3.10/site-packages/pharmpy/modeling/odes.py", line 645, in _do_michaelis_menten_elimination
km_init, clmm_init = _get_mm_inits(model, numer, combined)
File "/home/rikard/devel/modelbuilder_venv/lib/python3.10/site-packages/pharmpy/modeling/odes.py", line 753, in _get_mm_inits
dv_max = get_observations(model).max()
File "/home/rikard/devel/modelbuilder_venv/lib/python3.10/site-packages/pharmpy/modeling/data.py", line 257, in get_observations
idcol = model.datainfo.id_column.name
File "/home/rikard/devel/modelbuilder_venv/lib/python3.10/site-packages/pharmpy/model/datainfo.py", line 738, in id_column
return self.typeix['id'][0]
File "/home/rikard/devel/modelbuilder_venv/lib/python3.10/site-packages/pharmpy/model/datainfo.py", line 1008, in __getitem__
raise IndexError(f"No columns of type {i} available")
IndexError: No columns of type id available
No the UI says "Additative" error model. It should be "Additive"
Hi!
Looked around a little and noticed that uploaded datasets are required to be in the repo folder and will give an error message otherwise. Could be nice to allow other paths as well
Currently "PK" is the only "Model type" that can be selected so keep the radio button with only one selection, but "Example type" should be removed.
It feels like the width of the numeric input boxes is too wide in comparison to the rest of the buttons in the same column and also given the small amount of text they will contain. Perhaps they could be made less wide
After creating a parameter it will is added to the parameter list and a THETA value is added to the nonmem code. But when switching to another tab the parameter is vanishing.
Currently, only statements and ETA abstraction are visible
Would be nice to see the structure of the model in a screen, either in a box below the model_code
or as a separate option of the model_code
.
Alignment of title differ between computers
When setting the model type to oral and then selecting first order absorption (which the model already has), an extra MAT parameter statement will be added.
It seems as if the parameters object gets converted to have different values when going to the parameters tab.
When editing values in the parameter table, it does not update accordingly
Perhaps this should be part of the Pharmpy documentation instead.
Would be nice to have specific links per page with specific informaiton
Perhaps "model view" instead
If stepping up to some transits and down again I cannot change the model code to be 0 transits again.
The app gives an error when directly switching to the "Parameter Variability" tab
Traceback (most recent call last):
File "/home/rikard/devel/modelbuilder/app.py", line 440, in render_iiv_iov_data
occ_opts = globals()["model"].datainfo.typeix["idv"].names + globals()["model"].datainfo.typeix["unknown"].names
File "/home/rikard/devel/modelbuilder_venv/lib/python3.10/site-packages/pharmpy/model/datainfo.py", line 1008, in __getitem__
raise IndexError(f"No columns of type {i} available")
IndexError: No columns of type idv available
During handling of the above exception, another exception occurred:
IndexError: No columns of type unknown available
When changing from generic model format to nonmem model format after having changed the iiv of some parameters the code is not nonmem code anymore:
The nonmem code looks as follows:
{"parameters": {"parameters": [{"name": "POP_CL", "init": 0.01, "lower": 0, "upper": null, "fix": false}, {"name": "POP_VC", "init": 1, "lower": 0, "upper": null, "fix": false}, {"name": "IIV_CL", "init": 0.1, "lower": null, "upper": null, "fix": false}, {"name": "IIV_VC", "init": 0.1, "lower": null, "upper": null, "fix": false}, {"name": "IIV_CL_IIV_CL", "init": 0.01, "lower": -Infinity, "upper": Infinity, "fix": false}, {"name": "sigma", "init": 0.09, "lower": -Infinity, "upper": Infinity, "fix": false}]}, "random_variables": {"dists": [{"class": "JointNormalDistribution", "names": ["ETA_CL", "ETA_VC"], "level": "IIV", "mean": "MutableDenseMatrix([[Integer(0)], [Integer(0)]])", "variance": "MutableDenseMatrix([[Symbol('IIV_CL'), Symbol('IIV_CL_IIV_CL')], [Symbol('IIV_CL_IIV_CL'), Symbol('IIV_VC')]])"}, {"class": "NormalDistribution", "name": "epsilon_p", "level": "RUV", "mean": "Integer(0)", "variance": "Symbol('sigma')"}], "eta_levels": {"levels": [{"name": "IIV", "reference": true, "group": "ID"}, {"name": "IOV", "reference": false, "group": "OCC"}]}, "epsilon_levels": {"levels": [{"name": "RUV", "reference": true, "group": null}]}}, "statements": {"statements": [{"class": "Assignment", "symbol": "Symbol('CL')", "expression": "Mul(Symbol('POP_CL'), exp(Symbol('ETA_CL')))"}, {"class": "Assignment", "symbol": "Symbol('VC')", "expression": "Mul(Symbol('POP_VC'), exp(Symbol('ETA_VC')))"}, {"class": "CompartmentalSystem", "compartments": [{"class": "Output"}, {"class": "Compartment", "name": "CENTRAL", "amount": "Symbol('A_CENTRAL')", "dose": {"class": "Bolus", "amount": "Symbol('AMT')", "admid": 1}, "input": "Integer(0)", "lag_time": "Integer(0)", "bioavailability": "Integer(1)"}], "rates": [[1, 0, "Mul(Symbol('CL'), Pow(Symbol('VC'), Integer(-1)))"]], "t": "Symbol('t')"}, {"class": "Assignment", "symbol": "Symbol('IPRED')", "expression": "Mul(Symbol('A_CENTRAL'), Pow(Symbol('VC'), Integer(-1)))"}, {"class": "Assignment", "symbol": "Symbol('IPREDADJ')", "expression": "Piecewise(ExprCondPair(Float('2.2250000000000002e-16', precision=53), Equality(Symbol('IPRED'), Integer(0))), ExprCondPair(Symbol('IPRED'), true))"}, {"class": "Assignment", "symbol": "Symbol('IPREDADJ1')", "expression": "Piecewise(ExprCondPair(Float('2.2250000000000002e-16', precision=53), Equality(Symbol('IPRED'), Integer(0))), ExprCondPair(Symbol('IPRED'), true))"}, {"class": "Assignment", "symbol": "Symbol('Y')", "expression": "Add(Symbol('IPRED'), Mul(Symbol('IPREDADJ1'), Symbol('epsilon_p')))"}]}, "estimation_steps": {"steps": [{"method": "FOCE", "interaction": true, "cov": null, "evaluation": false, "maximum_evaluations": 99999, "laplace": false, "isample": null, "niter": null, "auto": null, "keep_every_nth_iter": null, "solver": null, "solver_rtol": null, "solver_atol": null, "tool_options": {}}]}, "datainfo": {"columns": [{"name": "ID", "type": "id", "scale": "nominal", "continuous": false, "categories": null, "unit": "1", "datatype": "int32", "drop": false, "descriptor": null}, {"name": "TIME", "type": "idv", "scale": "ratio", "continuous": true, "categories": null, "unit": "1", "datatype": "float64", "drop": false, "descriptor": null}, {"name": "DV", "type": "dv", "scale": "ratio", "continuous": true, "categories": null, "unit": "1", "datatype": "float64", "drop": false, "descriptor": null}, {"name": "AMT", "type": "dose", "scale": "ratio", "continuous": true, "categories": null, "unit": "1", "datatype": "float64", "drop": false, "descriptor": null}, {"name": "DVID", "type": "unknown", "scale": "ratio", "continuous": true, "categories": null, "unit": "1", "datatype": "float64", "drop": false, "descriptor": null}], "path": null, "separator": "\\s+"}, "value_type": "PREDICTION", "dependent_variables": {"Y": 1}, "observation_transformation": {"Symbol('Y')": "Symbol('Y')"}, "initial_individual_estimates": null, "__magic__": "Pharmpy Model", "__version__": "0.99.0"}
In the same way we can generate e.g. NONMEM code, there should be a tab for R/Python code generation.
Include a folder called /models
that is the default path unless otherwise specified.
Fix issue with write
not naming models correctly
Move callbacks to separate files corresponding to each tab, then import from there into app.py
Will improve maintaining , debugging and readability.
Perhpas simple black
Perhaps the numeric input field could always be visible and have 0 as default. Then we don't need the toggle and hide functionality.
Perhaps to only "Model Builder"
Currently this selector is confusing. The "editable" option seems too low level. The "dataset path" has some strange default value.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.