-
Notifications
You must be signed in to change notification settings - Fork 87
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
resolveMarkupInclusions
takes TextIOBase
as input but can't take it all the way home
#1329
Comments
If it makes any difference, I tried to edit the code snippet above to this (this was actually my first attempt): yaml = YAML()
loadedYaml = yaml.load(pathlib.Path(readPath))
#...skipping some important but unrelated stuff that is the reason for this approach...
yamlStream = TextIOBase()
yaml.dump(loadedYaml, yamlStream)
yamlStream = resolveMarkupInclusions(src=yamlStream, root=pathlib.Path(readPath).parent) And got:
This gets into troubleshooting my code territory and not something wrong with ARMI, but I think what I did in the issue description SHOULD work. |
Arrielle and I have worked on this offline and found a good path forward. It appears to be a combination of two problems: one because an ARMI method has no type hints/docs, and one in ruaml.yaml not round-tripping comments in YAML files well. Both are solvable, PR incoming. |
For the round tripping of comments issue, I found a resolution in my script. I was trying to do: yaml.load(filepath) which on Windows added a armi/armi/utils/textProcessors.py Lines 237 to 238 in 680fcc3
then I did: yaml.load(src) No more windows line endings ruining my day |
If I have code like so:
I get:
resolveMarkupInclusions
should be able to take either a filepath to a yaml, or a yamlTextIOBase
"stream". But as you can see above, this line can't handlesrc
being aTextIOBase
object:armi/armi/utils/textProcessors.py
Line 96 in 47e0215
There is a nonzero chance the error is mine, but I've looked at the problem long enough that I'm comfortable making this issue.
The text was updated successfully, but these errors were encountered: