Skip to content

Commit

Permalink
remove threadedsensivities stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
mjohnson541 committed Jul 7, 2024
1 parent c8b9c74 commit ade56dd
Showing 1 changed file with 0 additions and 29 deletions.
29 changes: 0 additions & 29 deletions pyrms/rms.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,34 +20,5 @@ def pygetfluxdiagram(bsol,t,centralspecieslist=[],superimpose=False,

rms.pygetfluxdiagram = pygetfluxdiagram

# These functions force the returned object to be a jlwrap object,
# to avoid the solution object gets converted into list of lists
_threadedsensitivities_inds = Main.pyfunctionret(rms.threadedsensitivities, Main.Any, Main.PyAny, Main.PyAny)
_threadedsensitivities = Main.pyfunctionret(rms.threadedsensitivities, Main.Any, Main.PyAny)
# Allow us the get the solution object in the julia wrapped object without
# it being converted into list of lists
get = Main.pyfunctionret(Main.get, Main.Any, Main.PyAny, Main.PyAny, Main.PyAny)
def pythreadedsensitivities(react, inds=None,
odesolver=Main.nothing, senssolver=Main.nothing,
odekwargs={"abstol": 1e-20, "reltol": 1e-6},
senskwargs={"abstol": 1e-6, "reltol": 1e-3}):
if inds is not None:
# the sol_dict returned here is a jlwrap object and is not easy to access the contents
sol_dict = _threadedsensitivities_inds(react, inds,
odesolver=odesolver, senssolver=senssolver,
odekwargs=odekwargs, senskwargs=senskwargs)
# pysol_dict is the python dictionary, but the solution object got turned into list of lists
pysol_dict = Main.PyObject(sol_dict)
# this remakes the dictionary with the values as julia wrapped object ODEsolution,
# but at the same time allows the user to access it normally like a dictionary
return {key: get(sol_dict, key, Main.Any) for key in pysol_dict.keys()}
else:
sol = _threadedsensitivities(react,
odesolver=odesolver, senssolver=senssolver,
odekwargs=odekwargs, senskwargs=senskwargs)
return sol

rms.pythreadedsensitivities = pythreadedsensitivities

sys.modules[__name__] = rms

0 comments on commit ade56dd

Please sign in to comment.