urbansim_templates icon indicating copy to clipboard operation
urbansim_templates copied to clipboard

weird summary table formatting in .yaml configs

Open mxndrwgrdnr opened this issue 6 years ago • 4 comments

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?

mxndrwgrdnr avatar Sep 26 '18 20:09 mxndrwgrdnr

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..

smmaurer avatar Sep 26 '18 21:09 smmaurer

OK, good to know. Gonna label it low priority for now.

mxndrwgrdnr avatar Sep 26 '18 21:09 mxndrwgrdnr

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.

mxndrwgrdnr avatar Sep 26 '18 22:09 mxndrwgrdnr

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

cvanoli avatar Sep 06 '19 19:09 cvanoli