theOehrly / Fast-F1

FastF1 is a python package for accessing and analyzing Formula 1 results, schedules, timing data and telemetry
https://docs.fastf1.dev
MIT License
2.51k stars 262 forks source link

[CLN] Collection of code clean-up and improvement tasks #346

Open theOehrly opened 1 year ago

theOehrly commented 1 year ago

This issue is intended for keeping track of some code clean-up and improvement tasks that are not immediately required but should be done at some point.

In no particular order:

Casper-Guo commented 1 year ago

What docstring improvements do you have in mind? I am already reworking some of those functions for #376 so I can take care of that as well.

theOehrly commented 1 year ago

What docstring improvements do you have in mind? I am already reworking some of those functions for #376 so I can take care of that as well.

The short example code snippet in many Laps.pick_* functions use a weird naming convention. For example some_drivers_laps = ff1.pick_teams(['Mercedes', 'Williams']) , but ff1 is commonly used as abbreviation for the module, naming it laps would make more sense. This might be confusing, especially for newcomers.

Casper-Guo commented 1 year ago

I see. I will do some rewriting in my next commit.

On Thu, May 25, 2023 at 4:46 AM Philipp Schaefer @.***> wrote:

What docstring improvements do you have in mind? I am already reworking some of those functions for #376 https://github.com/theOehrly/Fast-F1/pull/376 so I can take care of that as well.

The short example code snippet in many Laps.pick_* functions use a weird naming convention. For example some_drivers_laps = ff1.pick_teams(['Mercedes', 'Williams']) , but ff1 is commonly used as abbreviation for the module, naming it laps would make more sense. This might be confusing, especially for newcomers.

— Reply to this email directly, view it on GitHub https://github.com/theOehrly/Fast-F1/issues/346#issuecomment-1562521252, or unsubscribe https://github.com/notifications/unsubscribe-auth/AVNGPLDWVGX74UMHXLRRBFDXH4L5XANCNFSM6AAAAAAWUQS6YI . You are receiving this because you commented.Message ID: @.***>

Casper-Guo commented 1 year ago

With regards to input structure/style, have you investigated adding isort to pre-commit?

theOehrly commented 1 year ago

With regards to input structure/style, have you investigated adding isort to pre-commit?

Yes, I probably want to add flake8-isort or flake8-import-order.

But I want "fix" all existing imports before that.

And I want to look into what a reasonable module structure is, to prevent circular imports (A problem that I occassionally have). This is not directly related but interesting for potential future additions and refactoring.