Coder Social home page Coder Social logo

modelbuilder's Issues

Hard to distinguish between labels and buttons

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.

Constantly switching the name of the browser tab

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"

Change the top label

Currently it says "PLACEHOLDER Pharmpy GUI Navbar", but since we don't have a navbar yet perhaps it should simply say "Pharmpy model builder"

Remove the "Model statements" button

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.

Crash when directly switching to MM elimination

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

Uploading dataset

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

Remove the "Example type" selector

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.

Length of peripheral/transit input boxes are too wide

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

Cannot create population parameter

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.

Crash when switching to the "Parameter Variability" tab

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

Change from generic model to nonmem model does not work

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"}

Generate R/Python code

In the same way we can generate e.g. NONMEM code, there should be a tab for R/Python code generation.

Move callbacks to different files.

Move callbacks to separate files corresponding to each tab, then import from there into app.py
Will improve maintaining , debugging and readability.

Choose Dataset needs polish

Currently this selector is confusing. The "editable" option seems too low level. The "dataset path" has some strange default value.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.