-
Notifications
You must be signed in to change notification settings - Fork 44
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
YAML format issues in modelFiles/yml/HumanGEM.yml #169
Comments
@dweindl thank you posting the issue. The parsing error is because the specification of "HumanGEM.yml" is slightly different from the one defined in Cobrapy. The HumanGEM Yaml format is originated from RAVEN for the purpose of tracking changes only, and later adjusted according to specific needs (#27, #71). One can use either the SBML "HumanGEM.xml" or MATLAB "HumanGEM.mat" file for importing model. |
Thanks for the quick reply, @Hao-Chalmers . The issue occurs independently of cobrapy. The current file is not valid yaml. I think most of it would be fixed by quoting strings during yaml export in Human-GEM/code/io/writeHumanYaml.m Line 234 in 74de28c
the same way as in Human-GEM/code/io/writeHumanYaml.m Line 232 in 74de28c
|
Can you please confirm if this error can be fixed by systematically adding double quotes? |
Confirming that double quotes for strings will do the job. After running regex replacement Unfortunately, I can't test the proposed export fix due to lack of a matlab license. |
Thanks, will implement the fix accordingly. |
@dweindl the Yaml file had been updated by systematically enclosing string elements with double quote in this fix branch. The new Yaml file can be successfully imported with following code without error. Please double check this. import yaml
yaml_file = "HumanGEM.yml"
with open(yaml_file) as f:
model = yaml.safe_load(f) |
Confirming that the file can be loaded now. Thanks @Hao-Chalmers.
|
@dweindl good to know this, pushing this fix to You are welcome to provide solutions to fix other warnings/errors. |
|
Thanks for the suggestions, @dweindl. We are aiming to continue moving toward a standardized and valid yaml file; however, we also would like to ensure that we maintain compatibility with the cobrapy toolbox. Therefore, we may be a bit slow to address some of these additional issues unless they directly affect functionality, since we will also want to verify that any such changes do not disrupt cobrapy compatibility. As far as I understand, the cobrapy yaml format does not quite follow yaml standards - I could be mistaken, and @BenjaSanchez is likely to know more about this. I would therefore recommend that you make an issue/suggestion on the cobrapy repo that they move toward a fully valid yaml file format, and we of course would follow such a movement. |
Thanks for pointing out the potential issues with cobrapy, @JonathanRob. I wasn't aware of that. As I am not a user of cobrapy, I will rather not complain about potentially different yaml used there. The changes in #170 addressed the issue sufficiently. Thanks @Hao-Chalmers. Feel free to close this. |
@dweindl Thank you for the input that is highly appreciated and always welcome :) Now close this issue. |
@JonathanRob I'm actually not sure if our current standard is 100% equal with cobrapy, I will be testing that soon as I'm working in compatibility issues. If I find anything noteworthy I will let you know here, thanks @dweindl for informing of those issues, will likely be useful for my analysis |
All remaining |
Hi, great project! I was trying to look into the yaml model, but ran into some issues:
Description of the issue:
YAML errors in
modelFiles/yml/HumanGEM.yml
preventing parsing the file.Expected feature/value/output:
Expected to be able to load
modelFiles/yml/HumanGEM.yml
with any yaml parser.Current feature/value/output:
Trying to load
modelFiles/yml/HumanGEM.yml
fails.Main issue is using ":" in unquoted strings, leading to
as well as long list of other issues which seem to be minor.
Reproducing these results:
-> long list of issues
or
->
[...] yaml.scanner.ScannerError: mapping values are not allowed here
I hereby confirm that I have:
master
branch of the repositoryThe text was updated successfully, but these errors were encountered: