-
-
Notifications
You must be signed in to change notification settings - Fork 346
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
Add references field to yaml input standard #777
Conversation
5743959
to
7209405
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixing #339. I believe the point it raised is valid.
Moot (commits are dropped) |
a129149
to
b1ac013
Compare
@bryanwweber ... I dropped the commits updating headers of I.e. this PR now just adds the |
@bryanwweber ... it looks like chemkin input files are no longer used in the build script, which eliminates the 'hook' I used for this PR. What do you suggest? See
|
c4e1579
to
15a3d57
Compare
@bryanwweber and @speth ... |
@ischoegl I think the best approach is to add the reference directly into the YAML files that are now committed to the repo. Can you add an example of what the reference format will look like in the file, either as a comment here or in one of the YAML files? |
@bryanwweber ... sure (also, agreed on simply copying information over to your versions at least for This is the header portion for description: |-
GRI-Mech Version 3.0 7/30/99 CHEMKIN-II format
See README30 file at anonymous FTP site unix.sri.com, directory gri;
WorldWideWeb home page http://www.me.berkeley.edu/gri_mech/ or
through http://www.gri.org , under 'Basic Research',
for additional information, contacts, and disclaimer
references:
gri30: |-
@misc{gri30,
title = "GRI-Mech 3.0",
author = "Gregory P. Smith and David M. Golden and Michael Frenklach and
Nigel W. Moriarty and Boris Eiteneer and Mikhail Goldenberg and
C. Thomas Bowman and Ronald K. Hanson and Soonho Song and
William C. {Gardiner Jr.} and Vitali V. Lissianski and
Zhiwei Qin",
year = 1999,
howpublished = \url{http://combustion.berkeley.edu/gri-mech}
}
generator: ck2yaml
input-files: [gri30.inp, gri30_thermo.dat, gri30_tran.dat, gri30.bib]
cantera-version: 2.5.0a3
date: Tue, 07 Jan 2020 19:02:10 +0000
units: {length: cm, time: s, quantity: mol, activation-energy: cal/mol} |
3f7ad89
to
30ef54a
Compare
@bryanwweber ... I removed the temporary renaming, and instead moved the I.e. this PR no longer clashes with your changes from #768. PS: there are likely some additional tweaks for the example and |
30ef54a
to
f4b1811
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding some comments.
# options for h2o2.yaml | ||
opt['h2o2'] = ["--input=h2o2.inp", "--output=h2o2.yaml", | ||
"--transport=gri30_tran.dat", | ||
"--name=ohmech"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could add the gri30.bib
reference here as well (same for others below), i.e. air.yaml
and argon.yaml
.
f4b1811
to
12dae4d
Compare
604e7f4
to
7361678
Compare
@bryanwweber ... for clarification (or users not familiar with BibTeX), I added an auto-generated comment to the references:
# references use BibTeX format
nasa7: |-
@misc{nasa7,
title = "NASA thermodynamic database",
note = "7-term polynomial coefficients in 1971 format",
year = 1993,
howpublished = \url{https://shepherd.caltech.edu/EDL/PublicResources/sdt/cti/NASA7/nasa7.dat}
}
gordon1971: |-
@techreport{gordon1971,
title = "Computer Program for Calculation of Complex Chemical Equilibrium
Composition, Rocket Performance, Incident and Reflected Shocks and
Chapman-Jouguet Detonations",
author = "S. Gordon and B. J. McBride",
year = 1971,
number = "NASA SP-273"
}
mcbride1993: |-
@techreport{mcbride1993,
title = "Coefficients for Calculating Thermodynamic and Transport Properties
of Individual Species",
author = "B. J. McBride and S. Gordon and M. A. Reno",
year = 1993,
number = "NASA TM-4513"
}
|
@ischoegl Can you move the Python example to another branch and PR? I think that will probably be a separate discussion (what to do with the various required files, how to format so people learn the most, etc.) and I'd like to focus this PR on a discussion of the reference format. If you don't think that makes sense, that's OK, but I do think they are sufficiently separate ideas and I don't want a repeat of #768 😄 |
@bryanwweber ... I'd prefer not to (at least for the time being). After #768 the previously existing hook for this PR was removed, so I had to come up with a way to create a proper illustration for what I am suggesting. With less than 250 lines, I believe this PR is still small enough, and I don't see a reason why this PR couldn't partially address Cantera/enhancements#22? PS: I am open to alternate suggestions to the example, and can also move it to another PR after the main solution approach has been worked out (I.e. waiting for @speth’s feedback) |
While I agree that we should add reference information to the YAML files included with Cantera, and encourage users to do the same with input files that they generate, I'm not sure that this is the right solution to the latter concern. I don't like the idea of embedding data in the raw BibTeX format inside the YAML file, when there is such an obvious mapping to a YAML key-value data structure, and many users aren't going to care about the BibTeX format specifically. I do see it as being a reasonable input source, if we are going to support automated processing of reference information, given that many publishers provide an easy way to download a However, I don't think that we should be writing any sort of BibTeX parser ourselves, and I'm kind of skeptical that many users are going to bother installing an extra Python package and downloading or creating the relevant |
@speth ... thanks for the feedback.
I believe it’s relatively straightforward to parse valid syntax (which imho is a reasonable expectation), so I’ll give it a shot. I really don’t like the manual option if there’s a programmatic way of doing this using standardized (and easily obtainable) input. Otherwise there’s no way of ascertaining that the new feature is an improvement over the status quo. PS: To further elaborate, as long as there aren’t any |
Sure, we could parse BibTeX entries, but I don't think that's a rabbit hole we should go down. I can see the case for having a programmatic way of adding user-supplied metadata to the generated input file, but I think it would be better to make that interface fairly generic and not expect I would consider adding a |
7361678
to
bddd757
Compare
@speth ... alright, I added a simple parser (around 30 lines), which produces references:
nasa7: # @misc
title: NASA thermodynamic database
note: 7-term polynomial coefficients in 1971 format
howpublished: |-
\url{https://shepherd.caltech.edu/EDL/PublicResources/sdt/cti/NASA7/nasa7.dat}
gordon1971: # @techreport
title: Computer Program for Calculation of Complex Chemical Equilibrium
Composition, Rocket Performance, Incident and Reflected Shocks and
Chapman-Jouguet Detonations
author: S. Gordon and B. J. McBride
year: 1971
number: NASA SP-273
mcbride1993: # @techreport
title: Coefficients for Calculating Thermodynamic and Transport Properties
of Individual Species
author: B. J. McBride, S. Gordon and M. A. Reno
year: 1993
number: NASA TM-4513
Regarding the |
6a02e7e
to
7b4ab83
Compare
7b4ab83
to
9e1bead
Compare
@ischoegl I am still strongly opposed to implementing any sort of BibTeX parser. If we add this (no matter how simple), where does it stop? Next we get a request for RIS parser, Endnote parser, Crossref parser... Or someone has a BibTeX file that can be read by I think the ultimate resolution to #339 is to manually commit reference information into the YAML files for the files in this repository. Implementing the ability to automatically add extra fields to the YAML output from this conversion is a separate (although related) idea. Like @speth I think a more general I think a better option for automatic parsing and addition of BibTeX into YAML is either
(or both). Regarding the example, the reason I suggested to move that to its own PR is because I don't think the example as currently constituted is that useful, but I wanted to have a little longer discussion of it without getting distracted from the references stuff in this PR. I think the example would be more useful if it was either a Juypter Notebook, so it could have prose explanations of each option (but then that's bordering on the existing API documentation), or as a separate tutorial page on the website, showing the command line incantations and how they change various aspects of the output. Not to mention that the example as a Python script requires us to keep around all the Chemkin input files that I don't think are all that useful anymore... Like I said, this is a longer discussion that's separate from the references. |
@bryanwweber (and @speth) ... thanks for your thoughts.
I do see and acknowledge this argument,
I don't think that this 'slippery slope' argument is fair. The advantage of using a pre-existing input format is that there will be a well-defined references structure. Fwiw, the Cantera citation is provided in BibTeX format 😉 (and I do not think there's a need to include RIS, Endnote, Crossref, etc.).
As mentioned before, if we allow users to put whatever they deem appropriate into To summarize:
PS: looks like it’s not as simple ... a Ad examples, as mentioned, I needed a hook to test what I wrote. |
@bryanwweber ... on further thought, I’m frankly unsure about your proposal to create an external If there’s a constructive way to incorporate this PR into cantera, great. Otherwise, I’ll just close it. |
9e1bead
to
999c5e3
Compare
@bryanwweber and @speth: I added a unit test to complete what I am suggesting as a resolution for #339. As mentioned before, I do not think that external dependencies are workable, as it would increase instead of decrease complexity. If this PR is acceptable as a basis for discussion, I'd fine-tune the formatting, add more tests, copy references over to the yaml input files and move the example to a separate PR (I agree that there may be better suited alternatives) before this is ready to merge. Otherwise, I'll rest my case. PS: implementing the (currently missing) |
999c5e3
to
7e5a74e
Compare
Codecov Report
@@ Coverage Diff @@
## master #777 +/- ##
==========================================
- Coverage 71.44% 71.44% -0.01%
==========================================
Files 372 372
Lines 43950 43952 +2
==========================================
- Hits 31402 31400 -2
- Misses 12548 12552 +4
Continue to review full report at Codecov.
|
Closing this, as #794 provides a more light-weight alternative. |
scons build
&scons test
) and unit tests address code coveragePlease fill in the issue number this pull request is fixing
Fixes Cantera/enhancements#15, fixes #339
Changes proposed in this pull request
references
field to YAML input standardBibTeX
formatted files (passed as--bibtex=
option tock2yaml
)gri30.yaml
for illustration: