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

Fix DCEGM/calcCrossPoints' return fields #909

Merged
merged 8 commits into from
Jan 14, 2021

Conversation

Mv77
Copy link
Contributor

@Mv77 Mv77 commented Jan 13, 2021

DCEGM's calcCrossPoints, which I implemented a while ago, has an annoying behavior.

The number of things it returns depends on whether or not it finds crossing points in the value function. This produces bugs when one calls the function, as one can not know how many things will be returned. This tiny PR fixes that issue.

@sbenthall
Copy link
Contributor

Makes sense to make this change.
A nitpick: to keep the type signature consistent, the second returned element should be an ndarray not a list.

This can be done with np.array([]) or np.empty(0)

@Mv77
Copy link
Contributor Author

Mv77 commented Jan 14, 2021

Great point. Fixed in the previous commit.

@sbenthall sbenthall merged commit 3c8b069 into econ-ark:master Jan 14, 2021
@Mv77 Mv77 deleted the DCEGM/Fix-xIngs branch January 14, 2021 19:42
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.

2 participants