-
Notifications
You must be signed in to change notification settings - Fork 5
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
Formalize YAML metadata fields #56
Comments
note
by meta
)note
by meta
)
I don't really see what problem this is solving. Can you give an example of what you think would go in the To avoid creating backwards incompatibilities in the example I gave, I think it would be reasonable for that additional comment-parsing behavior of |
The way I see this, From a user perspective, this would mean that Example To give a specific example, let's assume that I download a YAML mechanism file from group XYZ's website, and am interested in specifics of some reaction
and get a result (which may be
that may or may not exist for this specific reaction (and may only be used by group XYZ), and/or use
in order to get to the desired information. Further, I may want to use If a |
PS: I haven't given an actual example of YAML input yet. Keeping with the definition of
As the Obviously, a lot of this is perfectly compatible with #11; the only difference is that |
@ischoegl Thanks for posting the YAML sample, it helps clarify. I think having some sort of hierarchical structure for the data may make sense, but I have some reservations as well. The biggest reservation is that I don't think there's a need for it at the present moment. I think it is possible to leave everything at the top-level of a given definition without sacrificing backwards compatibility. For instance, we can print deprecation warnings and include the contents of a field in two places for a time, if necessary. We can certainly do our best to avoid this, but I think users upgrading, and especially upgrading across a major version change, should expect some changes. My second reservation is that it is hard to define what qualifies as metadata, so I think that eventually, any I believe what @speth has in mind is much more flexible than the implementation proposed here and in Cantera/cantera#881. My understanding is that users will not need to access the fields of the YAML as attributes/properties of a class (although if I understand correctly, the ability to dynamically generate attributes may be possible, particularly in Python). As such, there's no need to formalize anything right now and we can effectively punt, with the small caveat that In all, I am not in favor of formalizing into the user interface any fields in YAML that Cantera doesn't use directly for calculations. Since the YAML data is not available to users right now anyways, I would prefer to wait for a more complete implementation than bake in something that limits future flexibility. Yes, that means it won't be ready for 2.5. Hopefully (🤞) it won't be 2 years before 2.6 is released with this functionality. |
@bryanwweber ... thanks for the feedback
I thought that this was the point?! Accessing fields as dynamic attributes is straightforward, and would be quite beneficial.
To provide an example where
No doubt about that, but I never saw the efforts as mutually exclusive (as I tried to point out elsewhere, there is no contradiction). All I am promoting here is to formalize one field ( Regardless, I closed Cantera/cantera#881 and hope that my suggestion can be considered at a later point. |
note
by meta
)note
by meta
)
note
by meta
)
I'm not sure anyone has ever said that YAML fields would/should be accessible as instance attributes, specifically. There are other options, for instance as @speth has said, he is planning to provide complete access as language-natural data types (dictionaries & lists in Python, etc.). Given the flexibility that we imagine as being possible with YAML, IMO users expecting access by instance attributes is not really feasible, although if it is possible to do dynamic generation, that might be appropriate.
I agree that metadata is useful. IMO, providing access in a way that is natural for what users know is in their own input files is better than trying to standardize on a dedicated attribute, particularly since the definition of metadata depends on the application.
Unfortunately, I do believe there is a conflict, in the sense I don't believe that defining a field called |
I agree that getting 2.5 out is probably the highest priority.
I believe most users will use other’s input files, so it’s not natural to guess. Thus far, I have never had a need to generate my own mechanism (I’m not a kineticist) and rely on whatever is provided; it would be great to take the guesswork out and access whatever is provided via a dedicated attribute. I assume that not being the author of an input file is the norm amongst end users.
What you mentioned here is imho not mutually exclusive. Dynamic attributes are straight-forward, and certainly feasible (see e.g. most attributes and methods of |
Probably no longer necessary. |
Abstract
Based on a discussion in Cantera/cantera#881, the description of metadata appears to not be fully formalized. At the moment,
ck2yaml
createsnote
anddescription
fields. See @speth's commentMotivation
Defining
note
anddescription
now with potentially moving to other ways of storing metadata in the future will create potential issues in terms of backward compatibility. At the moment,note
contains CHEMKIN comments that qualify as metadata if the YAML file is generated byck2yaml
. I.e. if someone uses a YAML file generated byck2yaml
in 2.5, and then revisits a problem in, say, 3.1, the YAMLnote
fields should still be supported/readable? I strongly believe that onceck2yaml
creates a precedent of defining specific fields it will be difficult to change in future releases.With Cantera 2.5 still in alpha stage, there's a (rapidly closing) window of opportunity to 'future-proof' metadata fields by renaming
note
anddescription
tometa
and treating them as a genericAnyValue
fields. It thus can be a string (as in the current implementation) for 2.5 or any other structure down the road.Possible Solutions
Rename
note
anddescription
tometa
in YAML files (sed
replacements in current YAML data), update converters and parsers.References
The text was updated successfully, but these errors were encountered: