Fast-F1 icon indicating copy to clipboard operation
Fast-F1 copied to clipboard

[ENH] Type hints

Open BCurbs opened this issue 2 years ago • 7 comments

Proposed new feature or change:

When using the library, it is hard to either manually mark things as certain types, as the data classes aren't easily exposed, and the methods don't say what type they return, so ides have problems with seeing what methods are available for an object.

BCurbs avatar Nov 14 '22 16:11 BCurbs

Yes, this is absolutely on the list of things that I'd like to get done. All new parts of FastF1 are already written with type hints. And older code should get type hints as well.

theOehrly avatar Nov 14 '22 18:11 theOehrly

Could you take a look at draft pr #287 @theOehrly ? I think it should add a lot, though I went through quite quickly, and if I'm on the right track, I'll go through more comprehensively.

BCurbs avatar Nov 14 '22 18:11 BCurbs

This is at least mostly complete, if it is fully satisfied by #287, this can be closed.

BCurbs avatar Jan 10 '23 14:01 BCurbs

I'll leave it open for now as a general reminder, and there are still some places that might need improvement.

theOehrly avatar Jan 11 '23 09:01 theOehrly

I can work on this. What are some parts of the library that still need type hints added?

Casper-Guo avatar Apr 28 '23 17:04 Casper-Guo

Large parts of FastF1 have type hints now. But there are some places throughout where they are still missing. I can't narrow it down really.

theOehrly avatar Apr 29 '23 11:04 theOehrly

although i haven't tested mypy with FastF1, it may help - https://stackoverflow.com/a/43187908

borolepratik avatar Feb 20 '24 15:02 borolepratik