You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What does this mean? Is it a problem? This issue was reported by @msoltadeo.
Diagnosis
This turns out to be a feature of the YAML spec called "anchors and aliases". When data (in this case a list of strings) is passed by name instead of value, and shows up in a YAML file multiple times, PyYAML automatically adds an identifier like &id001 in front of the first occurrence. In subsequent occurrences, only the corresponding alias appears:
model:
fit_filters: *id001
When the YAML file is read back into Python, the data is reconstructed like normal. My understanding is that this helps save space in YAML files, and can also help avoid potential recursion issues.
Resolution
If we want to, we can add a patch to urbansim_templates to disable this YAML feature. I am inclined to do this, since (a) it would make the yaml files a bit more human-readable, and (b) it might work more smoothly in case we need to read or modify the files using an interpreter that doesn't implement this aspect of the YAML spec.
Sometimes saved yaml files can include automatically generated notation like
&id001
:What does this mean? Is it a problem? This issue was reported by @msoltadeo.
Diagnosis
This turns out to be a feature of the YAML spec called "anchors and aliases". When data (in this case a list of strings) is passed by name instead of value, and shows up in a YAML file multiple times, PyYAML automatically adds an identifier like
&id001
in front of the first occurrence. In subsequent occurrences, only the corresponding alias appears:When the YAML file is read back into Python, the data is reconstructed like normal. My understanding is that this helps save space in YAML files, and can also help avoid potential recursion issues.
Resolution
If we want to, we can add a patch to
urbansim_templates
to disable this YAML feature. I am inclined to do this, since (a) it would make the yaml files a bit more human-readable, and (b) it might work more smoothly in case we need to read or modify the files using an interpreter that doesn't implement this aspect of the YAML spec.Sample affected file: repm_rent7.yaml
Demonstration of patch: test.py
References
Discussion and workarounds:
YAML spec:
The text was updated successfully, but these errors were encountered: