Replies: 4 comments 5 replies
-
I'm a fan of this idea though I'm not sure I understand all the details of your pro/con list. My suggestion would be introduce the possibility of attaching a python dictionary associated with any particular surface/cell/etc object. When MontePy writes the input deck, the dictionary would precede the line defining the surface/cell (however this could get weird if the user adds additional comments immediately preceding the line that defines the cell/surface and tries to read the input deck back into MontePy - for that reason I'm actually more of a fan of putting the dictionary in the same line with For example:
You could have some standardised keys of course but I think the user should have some additional flexibility. This would permit the user to sort objects based on completely arbitrary criteria as well. Everything said, I don't think you need a new mini-markup syntax - if the next non-space character after |
Beta Was this translation helpful? Give feedback.
-
One major con that has been brought up is: data could get desynchronized. The most important alternative option is: serialization with #193. This would allow the data to be more consistent and would allow all this additional data. I think I am of the mind that this is the ultimately solution: don't hack, go with the flow. |
Beta Was this translation helpful? Give feedback.
-
Comment syntax is a dangerous drug. Once you start down the dark path, forever will it dominate your destiny. The thought makes me feel mopey. Comment syntax: not even once. MontePy should always read and write pure MCNP. A once-through tool that uses MontePy may be an acceptable place for an embedded syntax in MCNP comments, just as there are legitimate pharmaceutical applications for otherwise harmful substances. |
Beta Was this translation helpful? Give feedback.
-
Yes I agree with this sentiment, and I think I will close this as a forbidden fruit task. |
Beta Was this translation helpful? Give feedback.
-
So this has come up a few times, and I am personally kind of conflicted about it. The fundamental issue is that MCNP input syntax is rather lossy, you can't name or tag cells, surfaces, etc.
That is the role of comments,
however, when your input is not being directly accessed these comments have less utility.
In the past have been proposal to add names to objects #76.
So the idea I am contemplating: adding support for embedding a markup language in
c
style comments.Likely contenders would be JSON and YAML as of writing. This might look like:
or
The downside to yaml is this would be totally valid and confusing:
Here are some thoughts I've been having:
Pros
Cons
/** */
or///
Could we create something likec c
orc $
orc /** .... c */
Beta Was this translation helpful? Give feedback.
All reactions