Skip to content
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

fix: cobrapy parsing errors of yaml #238

Closed
BenjaSanchez opened this issue Jul 16, 2020 · 11 comments
Closed

fix: cobrapy parsing errors of yaml #238

BenjaSanchez opened this issue Jul 16, 2020 · 11 comments
Assignees
Labels
fixed in devel this issue is already fixed in devel and will be closed after the next release format fix things associated to format of any of the model/data/script files

Comments

@BenjaSanchez
Copy link
Contributor

mentioned in #236:

the Cobrapy import fails because of parsing errors on line 25018, columns 7 and 27

The line in question is - name: [cytochrome c]-L-lysine

However the error message is a bit criptic:

ParserError: while parsing a block mapping
  in "yeastGEM.yml", line 25018, column 7
expected <block end>, but found '<scalar>'
  in "yeastGEM.yml", line 25018, column 27

I'm also assuming that more parsing errors will come as we solve them, so this will remain open until all are adressed.

@BenjaSanchez BenjaSanchez added format fix things associated to format of any of the model/data/script files question ideas/feedback from other people would be appreciated labels Jul 16, 2020
@Midnighter
Copy link

I wonder if the YAML parser expects a list there. Since it is legal to have square brackets denote lists. How is this line written? It should probably be:

- name: "[cytochrome c]-L-lysine"

@BenjaSanchez
Copy link
Contributor Author

@Midnighter the yaml file is written using https://github.com/SysBioChalmers/RAVEN/blob/master/io/writeYaml.m and aims to mimic the format of https://github.com/opencobra/cobrapy/blob/devel/cobra/test/data/mini.yml. The name fields in mini.yml don't use "", so is it only when the name starts with brackets that "" should be used? Other cases that have brackets seem to work fine in yeastGEM.yml, e.g. 2-[3-carboxy-3-(methylammonio)propyl]-L-histidine. For simplicity, should maybe all names use ""?

@Midnighter
Copy link

Yes, it is because it starts with a bracket. I think it would be safest to put all strings in quotes. However, I don't know if this is easily possible with ruamel.yaml since it might add quotes only when necessary and you'd have conflicts with cobrapy again.

@Midnighter
Copy link

Apparently, preserve_quotes=True would be the way to go. Needs a small fix on cobrapy.

@BenjaSanchez
Copy link
Contributor Author

great, I will propose a similar flag for the RAVEN function then. Compatibility with cobrapy is for now only needed in one direction (i.e. model being loaded with cobrapy), so there should not be any conflicts?

@Midnighter
Copy link

That's easier then, indeed.

@BenjaSanchez
Copy link
Contributor Author

update: this was solved with #253 and will be closed on the next release

@BenjaSanchez BenjaSanchez added fixed in devel this issue is already fixed in devel and will be closed after the next release and removed question ideas/feedback from other people would be appreciated labels Nov 25, 2020
@mihai-sysbio
Copy link
Member

Between this and the other fixes in PR #255, I think it should be safe to close this issue.

@BenjaSanchez
Copy link
Contributor Author

@mihai-sysbio the issue is indeed solved, but only in devel. Therefore it's easier to leave it open until a new release, as the issue is still present in master, and could lead to users opening duplicate issues.

@mihai-sysbio
Copy link
Member

Oh I thought that was covered by this line in the issue template:

  • Checked that a similar issue does not exist already

@BenjaSanchez
Copy link
Contributor Author

@mihai-sysbio the fixed in devel label is intended to make it easier on the user, so that they don't have to look through closed issues as well. Note that the default searching filter in GitHub is is:issue is:open. Perhaps this would be clearer if that line read:

  • Checked that a similar open issue does not exist already

@edkerk edkerk closed this as completed Jul 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fixed in devel this issue is already fixed in devel and will be closed after the next release format fix things associated to format of any of the model/data/script files
Projects
None yet
Development

No branches or pull requests

4 participants