Skip to content
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

[0.2.dev1] Fixes Small MNL simulation crash #96

Merged
merged 6 commits into from
Feb 28, 2019
Merged

Conversation

smmaurer
Copy link
Member

@smmaurer smmaurer commented Feb 23, 2019

This PR fixes a problem in the Small MNL template that was causing crashes in the simulation stage. This was identified by @xyzjayne.

Problem

Small MNL model steps were crashing in the simulation stage if the output column didn't exist yet, or in certain cases when multiple tables were being assembled.

Causes

When data was being assembled for simulation, the older TemplateStep._get_data() method was requesting the out_column because we used to update it locally before updating Orca (shared.py#L194). This caused errors when the column didn't exist yet.

It was also requesting the choice_column even when simulating, because of a coding mistake involving the special case of PyLogit model expressions (shared.py#L179), which i think was contributing to some of the crashes.

Solution

I updated the Small MNL template to use the new, cleaner utils.get_data() function for both estimation and simulation.

Testing

I replicated the crash in a unit test, and the changes resolve it. @xyzjayne reports that this branch fixes the crashes she was seeing as well.

Versioning

This PR increments the master branch to 0.2.dev1.

This seems like a pretty important bug fix, so i'm also going to apply these changes to the most recent production version and release it as v0.1.2 on pip and conda. (It will be at least a few weeks before v0.2 is ready for release.)

Before merging

  • update changelog and version in docs

@coveralls
Copy link

coveralls commented Feb 23, 2019

Coverage Status

Coverage increased (+1.9%) to 90.936% when pulling ab1af8b on small-mnl-bug into 1879a72 on master.

@mxndrwgrdnr
Copy link
Member

Looks great. Much cleaner!

@smmaurer smmaurer merged commit 2a4d129 into master Feb 28, 2019
@smmaurer smmaurer deleted the small-mnl-bug branch February 28, 2019 02:56
@smmaurer smmaurer mentioned this pull request Feb 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants