-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: example on how to integrate some tests from Memote #3
- Loading branch information
1 parent
312867d
commit 85302bc
Showing
2 changed files
with
20 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import memote | ||
import cobra | ||
import json | ||
from memote.support import consistency | ||
# needed by memote.support.consitency | ||
from memote.support import consistency_helpers as con_helpers | ||
|
||
def get_consistency(model_filename): | ||
try: | ||
model = cobra.io.read_sbml_model(model_filename + '.xml') | ||
except Exception as e: | ||
errors = json.dumps(str(e)) | ||
print(e) | ||
|
||
is_consistent = consistency.check_stoichiometric_consistency(model) | ||
|
||
return {'memote-tests': { memote.__version__ : is_consistent, 'errors': errors } } |