Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem in parameter fitting (pravastatin) #150

Open
matthiaskoenig opened this issue May 12, 2022 · 0 comments
Open

Problem in parameter fitting (pravastatin) #150

matthiaskoenig opened this issue May 12, 2022 · 0 comments
Labels
bug Something isn't working parameter estimation

Comments

@matthiaskoenig
Copy link
Owner

multiprocessing.pool.RemoteTraceback: 
"""
Traceback (most recent call last):
  File "/usr/lib/python3.9/multiprocessing/pool.py", line 125, in worker
    result = (True, func(*args, **kwds))
  File "/usr/lib/python3.9/multiprocessing/pool.py", line 48, in mapstar
    return list(map(*args))
  File "/home/mkoenig/git/sbmlsim/src/sbmlsim/fit/runner.py", line 176, in worker
    return _run_optimization_serial(**kwargs)  # type: ignore
  File "/home/mkoenig/git/sbmlsim/src/sbmlsim/utils.py", line 60, in timed
    result = function(*args, **kw)
  File "/home/mkoenig/git/sbmlsim/src/sbmlsim/fit/runner.py", line 236, in _run_optimization_serial
    fits, trajectories = problem.optimize(
  File "/home/mkoenig/git/sbmlsim/src/sbmlsim/fit/optimization.py", line 561, in optimize
    fit, trajectory = self._optimize_single(
  File "/home/mkoenig/git/sbmlsim/src/sbmlsim/utils.py", line 60, in timed
    result = function(*args, **kw)
  File "/home/mkoenig/git/sbmlsim/src/sbmlsim/fit/optimization.py", line 608, in _optimize_single
    opt_result = scipy.optimize.least_squares(
  File "/home/mkoenig/.virtualenvs/pkdb_models/lib/python3.9/site-packages/scipy/optimize/_lsq/least_squares.py", line 928, in least_squares
    result = trf(fun_wrapped, jac_wrapped, x0, f0, J0, lb, ub, ftol, xtol,
  File "/home/mkoenig/.virtualenvs/pkdb_models/lib/python3.9/site-packages/scipy/optimize/_lsq/trf.py", line 123, in trf
    return trf_bounds(
  File "/home/mkoenig/.virtualenvs/pkdb_models/lib/python3.9/site-packages/scipy/optimize/_lsq/trf.py", line 338, in trf_bounds
    f_new = fun(x_new)
  File "/home/mkoenig/.virtualenvs/pkdb_models/lib/python3.9/site-packages/scipy/optimize/_lsq/least_squares.py", line 815, in fun_wrapped
    return np.atleast_1d(fun(x, *args, **kwargs))
  File "/home/mkoenig/git/sbmlsim/src/sbmlsim/fit/optimization.py", line 686, in residuals
    simulator.set_model(model=self.models[k])
  File "/home/mkoenig/git/sbmlsim/src/sbmlsim/simulator/simulation_serial.py", line 54, in set_model
    self.model = RoadrunnerSBMLModel(
  File "/home/mkoenig/git/sbmlsim/src/sbmlsim/model/model_roadrunner.py", line 90, in __init__
    self.uinfo = self.parse_units(ureg)
  File "/home/mkoenig/git/sbmlsim/src/sbmlsim/model/model_roadrunner.py", line 182, in parse_units
    uinfo = UnitsInformation.from_sbml(sbml=self.source.path, ureg=ureg)
  File "/home/mkoenig/git/sbmlsim/src/sbmlsim/units.py", line 91, in from_sbml
    return UnitsInformation.from_sbml_doc(doc, ureg=ureg)
  File "/home/mkoenig/git/sbmlsim/src/sbmlsim/units.py", line 197, in from_sbml_doc
    uid_dict: Dict[str, str] = UnitsInformation.model_uid_dict(model, ureg=ureg)
  File "/home/mkoenig/git/sbmlsim/src/sbmlsim/units.py", line 157, in model_uid_dict
    for udef in model.getListOfUnitDefinitions():
AttributeError: 'NoneType' object has no attribute 'getListOfUnitDefinitions'
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/mkoenig/git/pkdb_models/pkdb_models/models/pravastatin/fitting/fitting.py", line 257, in <module>
    results = run_fit_subset(
  File "/home/mkoenig/git/pkdb_models/pkdb_models/models/pravastatin/fitting/fitting.py", line 209, in run_fit_subset
    results_all: Dict[str, Tuple[OptimizationResult, OptimizationProblem]] = fit_pravastatin(
  File "/home/mkoenig/git/pkdb_models/pkdb_models/models/pravastatin/fitting/fitting.py", line 159, in fit_pravastatin
    results[opid] = fit_op(op)
  File "/home/mkoenig/git/pkdb_models/pkdb_models/models/pravastatin/fitting/fitting.py", line 134, in fit_op
    opt_result, op = fitlsq(op, size=10, n_cores=10, **fit_kwargs)
  File "/home/mkoenig/git/pkdb_models/pkdb_models/models/pravastatin/fitting/fitting.py", line 60, in fitlsq
    opt_res = run_optimization(
  File "/home/mkoenig/git/sbmlsim/src/sbmlsim/utils.py", line 60, in timed
    result = function(*args, **kw)
  File "/home/mkoenig/git/sbmlsim/src/sbmlsim/fit/runner.py", line 159, in run_optimization
    opt_results: List[OptimizationResult] = pool.map(worker, args_list)
  File "/usr/lib/python3.9/multiprocessing/pool.py", line 364, in map
    return self._map_async(func, iterable, mapstar, chunksize).get()
  File "/usr/lib/python3.9/multiprocessing/pool.py", line 771, in get
    raise self._value
AttributeError: 'NoneType' object has no attribute 'getListOfUnitDefinitions'
@matthiaskoenig matthiaskoenig added bug Something isn't working parameter estimation labels May 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working parameter estimation
Projects
None yet
Development

No branches or pull requests

1 participant