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

mock_input_data: fix eval computation for new pandas version #589

Merged
merged 1 commit into from
Feb 24, 2022

Conversation

FabianHofmann
Copy link
Contributor

Pull Request doc

Purpose

With the up-to-date pandas version the eval string in powersimdata/tests/mock_input_data.py fails due to a chained call of the @ accessor. This PR provides a fix for that the error.

What the code is doing

Instead of the eval call, use a lambda function for the selection.

Testing

It fixes the tests with the new pandas version.

Time estimate

3 min

Copy link
Contributor

@danielolsen danielolsen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The lambda here is pretty cool! Tests pass:

Copy link
Collaborator

@BainanXia BainanXia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice. Haven't tried using lambda for indexing directly before.

@danielolsen danielolsen merged commit a1b533b into Breakthrough-Energy:develop Feb 24, 2022
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.

4 participants