Closed freiburgermsu closed 1 year ago
I think the workflows or a package you are using is still using the old rxn.x
and rxn.y
to access the solution. Replacing those should fix those. Or do you get those when calling other cobrapy functions?
The warning with the formula wouldn't be fixed by this. This just tells you you have a chemical formula with invalid symbols (not an element).
I have never used x
or y
reaction attributes. Are these actual attributes for reactions, or are they arbitrary placeholders to represent the possible attributes of a Reaction
object? Our code always accesses a solution through the returned output of .optimize()
or slim_optimize()
. I frankly do not know how "reduced_cost" or "shadow_price" would relate to our work.
Can you show which code you are running that causes these warnings? And what version of cobrapy are you using?
Those are the actual names of the attributes and were the old accessors for the primal and dial solution values. There is some code in your codebase that calls Reaction.x
and Reaction.y
though this could also be hidden in another package you are using. Like @Midnighter said, hard to say where those come from without seeing the code.
@Midnighter I am running this package in this Notebook. I am running version 0.26.2
of COBRApy.
Let me know if I can assist in any other way :)
Not @Midnighter but thanks for providing the code! It's caused by the use of DeepDiff in ModelSEEDpy. It goes through all attributes of the Reaction (including the deprecated ones) and diffs them. Should be an easy fix in the modelseedpy code, depending how often it is used. For now you could also just disable DeprecationWarnings for the code fragments that trigger them.
Thank you for rooting the cause! ModelSEEDpy is used very often, so a permanent workaround is desirable. How can I disable DeprecationWarnings
?
You can do
import warnings
warnings.simplefilter("ignore", category=DeprecationWarning)
If you run that at the top of your notebook it will suppress them for the entire notebook.
@cdiener Placing your two lines at the top of the ModelSEEDpy package file concisely eliminated the warnings. Thank you! :pray:
Checklist
Is your feature related to a problem? Please describe it.
My workflows are flooded with warnings like those in the attached. Will these be resolved in a near-term update, or how can these be suppressed until that time?
Describe the solution you would like.
Describe alternatives you considered
Additional context