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

LODES and PRISM estimate fix. #236

Merged
merged 3 commits into from
Feb 18, 2025
Merged

LODES and PRISM estimate fix. #236

merged 3 commits into from
Feb 18, 2025

Conversation

meaghan66
Copy link
Contributor

Small name change to estimate_data() for LODES and PRISM.

@JavadocMD
Copy link
Contributor

Part of the reason this got missed (in whichever refactor changed this) is the way these _estimate_<adrio> functions are constructed. Since they take an untyped self argument, it seems like they were originally a class method rather than a standalone function. A class method in Python is forced to take self as the first argument, so the type checker will infer the type of self. But as a standalone function, type checkers cannot infer the type of self so it assigns it "Unknown". The type checker basically gives up validating usage at that point, and IDE tools also can't analyze this, so the auto-renaming tool failed to catch this and the type checker failed to report usage of an undefined property.

All that's to say: please add a type annotation to self. And in fact, it's weird to use self as a name outside of a class (I was initially a bit confused) so please assign a better name there.

@JavadocMD
Copy link
Contributor

JavadocMD commented Feb 14, 2025

Sorry, I could've been more clear. I think you should pass in the ADRIO instance and use the class_name property (which is defined by BaseSimulationFunction) rather than __class__.__name__.

Copy link
Contributor

@JavadocMD JavadocMD left a comment

Choose a reason for hiding this comment

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

Looks good, thanks!

@meaghan66 meaghan66 merged commit 426a222 into main Feb 18, 2025
1 check passed
@meaghan66 meaghan66 deleted the adrio_estimate_fix branch February 18, 2025 20:08
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