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 wrong type hints on SimAIClient #106

Merged
merged 7 commits into from
Nov 13, 2024

Conversation

awoimbee
Copy link
Collaborator

@awoimbee awoimbee commented Nov 5, 2024

Fixes #103

The issue is that in:

    @steal_kwargs_type(ClientConfig)
    def __init__(self, **kwargs):

The self arg is causing an issue as it is not present in ClientConfig.

My fix: Concatenate[Any, T]: type self as Any.
We would need python >=3.12 to properly type self, using something like @steal_kwargs_type_on_method[SimAIClient, ClientConfig]()

@awoimbee awoimbee requested review from yias and tmpbeing November 5, 2024 17:21
@awoimbee awoimbee self-assigned this Nov 5, 2024
Copy link

codecov bot commented Nov 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 85.55%. Comparing base (62f8a27) to head (900a880).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #106   +/-   ##
=======================================
  Coverage   85.55%   85.55%           
=======================================
  Files          44       44           
  Lines        2630     2630           
=======================================
  Hits         2250     2250           
  Misses        380      380           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@tmpbeing tmpbeing left a comment

Choose a reason for hiding this comment

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

Ah yes makes sense, thanks ! Thought it was maybe an invisible*args causing the issue but self makes more sense.

src/ansys/simai/core/utils/typing.py Outdated Show resolved Hide resolved
src/ansys/simai/core/utils/typing.py Outdated Show resolved Hide resolved
@awoimbee awoimbee force-pushed the aw/fix-steal-kwargs-type-on-method branch from 835b8b1 to aac1f4d Compare November 13, 2024 16:34
@github-actions github-actions bot added the maintenance Package and maintenance related label Nov 13, 2024
@awoimbee awoimbee merged commit 7196d15 into main Nov 13, 2024
33 checks passed
@awoimbee awoimbee deleted the aw/fix-steal-kwargs-type-on-method branch November 13, 2024 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance Package and maintenance related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Erroneous type hints for SimAIClient
3 participants