-
Notifications
You must be signed in to change notification settings - Fork 27
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
Allow saving of imported mat files as json #42
Conversation
When importing .mat models, the membranePot type is numpy's int16. The change makes it a standard int so that it can be saved as json.
Codecov Report
@@ Coverage Diff @@
## master #42 +/- ##
=======================================
Coverage 70.92% 70.92%
=======================================
Files 46 46
Lines 3401 3401
=======================================
Hits 2412 2412
Misses 989 989
Continue to review full report at Codecov.
|
Hi! %run tutorial_basics.py
from pytfa.io.json import save_json_model, load_json_model
save_json_model(mytfa, 'tmp.json')
m = load_json_model('tmp.json') I indeed see the mat file is decoded as a numpy int, but the encoding of the JSON and decoding casts it directly to a Python int. |
It might be a python 3.8 error:
|
Yes indeed, I found evidence of it here |
Ok, good to go! |
Thanks! |
Bypassing Travis because failing on GLPK not sympy anymore. See PR #49 * Dev: Incremental update (#29) * MNT: Pypi details * MNT: Adding veriable creation logs * FIX: typo * FIX: Issue #28, incorrect variable referencing * TST: adding tests for some of the analysis functions * FIX: more fixes from #28 * FIX: fixed transport reaction function * TST: Better tests, with a smaller model for I/O * TST/FIX: relative<- absolute paths for small_model resources * FIX: typo in paths to small_model resources for tests * VER: Bump v0.9.0-b2 * VER: bump to v0.9.1 * Update LICENSE.txt * Fixing a couple of minor bugs and added new variable class (#35) Thank you @remidhum * FIX: fixed the apply_directionality function solution.raw dataframe index does not contain the fwd and bwd use variables. * ENH: added new binary variable class This class is usefull to deal with inactive reactions in a model. * ENH: deal with models without an objective function Objective function is set to Zero (symbol("0") does not work!) if there is no defined objective function * OOPS: change proper function ... * FIX: fixed the failing test As suggested, I added a check to determine what object type is passed. * MNT: solution object type testing improved * LIC: Create CLAI * Name correction (#41) Thank you for this correction :) Since I copied this from Google scholar, maybe check that they got your name right! Cheers, Pierre * Allow saving of imported mat files as json (#42) * Allow saving of imported mat files as json When importing .mat models, the membranePot type is numpy's int16. The change makes it a standard int so that it can be saved as json. * convert to float * VER: Bump to 0.9.2 * MNT: removing warnings from deprecated usage of logger.warn * FIX: metabolite thermo data was not recovered upon serialization * FIX: Equilibrator update + reqs for building Dockerfile * FIX: newer pypi version * FIX: actual newer pypi version * Update README.rst * Update utils.py * Zero import Co-authored-by: realLCSB <[email protected]> Co-authored-by: Pierre Salvy <[email protected]> Co-authored-by: Pierre Salvy <[email protected]> Co-authored-by: RémiDhum <[email protected]> Co-authored-by: Daniel F Hernandez <[email protected]>
When importing .mat models, the membranePot type is numpy's int16. The change makes it a standard int so that it can be saved as json.