UDST / choicemodels

Python library for discrete choice modeling
https://udst.github.io/choicemodels
BSD 3-Clause "New" or "Revised" License
74 stars 33 forks source link

[0.2.dev7] MergedChoiceTable check for duplicate column names #54

Closed smmaurer closed 5 years ago

smmaurer commented 5 years ago

This PR adds a check to the MergedChoiceTable constructor to make sure there aren't any column names that overlap between the observations and alternatives tables.

It's ok for the chosen_alternatives column of the observations table to have the same name as the index of the alternatives table, though.

Discussion

This aligns ChoiceModels with the strategy for overlapping column names discussed in UrbanSim Templates issue #67.

Other changes

All the existing unit tests pass, and I wrote some new ones to test permutations of overlapping column names.

Versioning

coveralls commented 5 years ago

Coverage Status

Coverage increased (+0.3%) to 75.189% when pulling d98e956cc3c809a4ec31217526c82bda9325cf84 on column-name-safety into 591521742e235be470bc0004be7941a0e45a151d on master.