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

Minor type/doc fixes #1128

Merged
merged 3 commits into from
Mar 14, 2024
Merged

Conversation

akx
Copy link
Contributor

@akx akx commented Mar 13, 2024

This PR fixes a couple of small typing/docs related things that popped up while running PyCharm's Find Problems on the repo.

@akx
Copy link
Contributor Author

akx commented Mar 13, 2024

cc @stevhliu: mind double-checking that args change (since you apparently added the docs in #1075) – by my reasoning, args can't be a dict since those classes are (occasionally) accessing it with self.args.foo?

Copy link

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@stevhliu
Copy link
Contributor

Hmm, I'm actually not entirely sure about this one 😅 . Here it looks like it is a dict:

https://github.com/TimDettmers/bitsandbytes/blob/b03ce0e0be74888e3a604ec749b761621a6c8407/bitsandbytes/optim/optimizer.py#L407

@akx
Copy link
Contributor Author

akx commented Mar 13, 2024

Hmm, I'm actually not entirely sure about this one 😅 . Here it looks like it is a dict:

You're pointing at what gets passed into MockArgs just below: https://github.com/TimDettmers/bitsandbytes/blob/b03ce0e0be74888e3a604ec749b761621a6c8407/bitsandbytes/optim/optimizer.py#L417

MockArgs itself is a knockoff types.SimpleNamespace that just assigns dict values into itself as attrs:

https://github.com/TimDettmers/bitsandbytes/blob/b03ce0e0be74888e3a604ec749b761621a6c8407/bitsandbytes/optim/optimizer.py#L14-L17

@stevhliu
Copy link
Contributor

stevhliu commented Mar 13, 2024

Ah ok, wasn't aware of types.SimpleNamespace. In that case, it looks good to me. Thanks for fixing the types! 🤗

@Titus-von-Koeller
Copy link
Collaborator

Thanks @akx, good catches! And thanks @stevhliu for reviewing. LGTM

@Titus-von-Koeller Titus-von-Koeller merged commit bf01538 into bitsandbytes-foundation:main Mar 14, 2024
23 checks passed
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.

3 participants