Skip to content

Commit

Permalink
chore(rplibs): fit to dep ver
Browse files Browse the repository at this point in the history
  • Loading branch information
breakthewall committed Nov 21, 2023
1 parent aedc9af commit d393c99
Showing 1 changed file with 22 additions and 15 deletions.
37 changes: 22 additions & 15 deletions rptools/rplibs/rpSBML.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,25 @@
from copy import deepcopy
from filetype import guess
from hashlib import sha256
from math import isnan
from pandas import DataFrame as pd_DataFrame
#from math import isnan
from pandas import (
DataFrame as pd_DataFrame,
concat as pd_concat
)

from os import (
path as os_path,
remove
)
from json import (
load as json_load,
dump as json_dump,
# dump as json_dump,
dumps as json_dumps
)
from inspect import (
getmembers as inspect_getmembers,
ismethod as inspect_ismethod
)
# from inspect import (
# getmembers as inspect_getmembers,
# ismethod as inspect_ismethod
# )
from logging import (
Logger,
getLogger
Expand All @@ -30,12 +33,12 @@
Dict,
Tuple,
TypeVar,
Union
# Union
)
from tempfile import (
NamedTemporaryFile,
TemporaryDirectory,
gettempdir,
# gettempdir,
)
import cobra
from cobra import (
Expand Down Expand Up @@ -2492,14 +2495,18 @@ def _specie_id_from_exchange(
# Create list of exchange reactions
for reaction in model.getModel().getListOfReactions():
if model.is_boundary_type(reaction, "exchange", compartment_id):
compound = dict(
model_id=_specie_id_from_exchange(
reaction,
logger
compound = pd_DataFrame(
dict(
model_id=_specie_id_from_exchange(
reaction,
logger
),
libsbml_reaction=reaction
),
libsbml_reaction=reaction
index=[0]
)
df = df.append(compound, ignore_index=True)
# df = df.append(compound, ignore_index=True)
df = pd_concat([df, compound], ignore_index=True)
# Fmg
df.sort_values('model_id', inplace=True)
df.reset_index(inplace=True, drop=True)
Expand Down

0 comments on commit d393c99

Please sign in to comment.