urbansim_templates
urbansim_templates copied to clipboard
weird summary table formatting in .yaml configs
Haven't dug tooo deep into this to see if its happening for other template types but this is the first time I've seen it. Estimating a LargeMultinomialLogitStep()
produces a nice looking summary table in a Jupyter notebook (see the last cell here), but a poorly formatted summary table in the .yaml config file generated by registering the step (see here). Low priority for now but maybe you've seen this before @smmaurer?
This is a problem with all the templates, unfortunately, I think. It would be great to fix. Seems to be caused by differences in string encoding between python and yaml.
I'll do some digging and see if there's an easy fix. @janowicz has brought this up as well..
OK, good to know. Gonna label it low priority for now.
It seems to me that the summary table formatting in the .yaml configs look exactly the same as it does in the jupyter notebooks when calling model.summary_table
instead of print(model.summary_table)
. So whatever Python does to strings when calling print
is probably what needs to happen before sending the string off to the .yaml.
I don't think the problem with the format in the yaml file is caused by the print(model.summary_table)
before saving it. It does relate to the multiple sources to fit the model and specifically in the urbansim_templates, is the way the self.summary_table
is saved. In the MNL, self.summary_table = str(results)
https://github.com/UDST/urbansim_templates/blob/master/urbansim_templates/models/large_multinomial_logit.py#L486