Skip to content

Commit

Permalink
Fix comment typos
Browse files Browse the repository at this point in the history
  • Loading branch information
Casper-Guo committed Oct 10, 2023
1 parent 97c4ec8 commit 3567ef8
Show file tree
Hide file tree
Showing 10 changed files with 24 additions and 22 deletions.
19 changes: 11 additions & 8 deletions fastf1/_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,12 @@ def timing_data(path: str,
- Driver (str): Driver number
- NumberOfLaps (int): Number of laps driven by this driver including the lap in this row
- NumberOfPitStops (int): Number of pit stops of this driver
- PitInTime (pandas.Timedelta): Session time at which the driver entered the pits. Consequentially,
if this value is not NaT the lap in this row is an inlap.
- PitOutTime (pandas.Timedelta): Session time at which the driver exited the pits. Consequentially,
if this value is not NaT the lap in this row is an outlap.
- PitInTime (pandas.Timedelta): Session time at which the
driver entered the pits. Consequently, if this value is
not NaT the lap in this row is an inlap.
- PitOutTime (pandas.Timedelta): Session time at which the
driver exited the pits. Consequently, if this value is
not NaT, the lap in this row is an outlap.
- Sector1/2/3Time (pandas.Timedelta): Sector times (one column for each sector time)
- Sector1/2/3SessionTime (pandas.Timedelta): Session time at which the corresponding sector time
was set (one column for each sector's session time)
Expand Down Expand Up @@ -238,7 +240,7 @@ def _align_laps(laps_data, stream_data):
leader = None
max_delta = None

# try to align on the first lap where useable data is available
# try to align on the first lap where usable data is available
# ideally, this is the end of the first lap
offset = -1 # start at -1 so that value it is zero on first iteration

Expand All @@ -256,7 +258,7 @@ def _align_laps(laps_data, stream_data):
_logger.warning('Skipping lap alignment (no suitable lap)!')
return

# find the leader after the first useable lap and get the expected
# find the leader after the first usable lap and get the expected
# gaps to the leader for all other drivers

if not pd.isnull(
Expand Down Expand Up @@ -786,7 +788,7 @@ def timing_app_data(path, response=None, livedata=None):
livedata: An instance of :class:`fastf1.livetiming.data.LiveTimingData` to use as a source instead of the api
Returns:
A DataFrame contianing one column for each data channel as listed above.
A DataFrame containing one column for each data channel listed above.
Raises:
SessionNotAvailableError: in case the F1 livetiming api returns no data
Expand Down Expand Up @@ -1197,7 +1199,8 @@ def track_status_data(path, response=None, livedata=None):
Track status is indicated using single digit integer status codes (as string). List of known statuses:
- '1': Track clear (beginning of session ot to indicate the end of another status)
- '1': Track clear (beginning of session or to indicate the end
of another status)
- '2': Yellow flag (sectors are unknown)
- '3': ??? Never seen so far, does not exist?
- '4': Safety Car
Expand Down
2 changes: 1 addition & 1 deletion fastf1/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ def merge_channels(
missing values will be interpolated.
:attr:`Telemetry.TELEMETRY_FREQUENCY` determines if and how the data is resampled. This can be overridden using
the `frequency` keyword fo this method.
the `frequency` keyword for this method.
Merging and resampling:
Expand Down
2 changes: 1 addition & 1 deletion fastf1/ergast/sphinx.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ def _generate_df_description(self, root_category, splitcategory):
flat = ErgastResultFrame._prepare_response(tree, root_category,
cast=False)
# print the flattened data nicely formatted as a table (use str
# represenation of a dataframe for this)
# representation of a dataframe for this)
# remove the last line (unnecessary info about dataframe)
result_str = '\n'.join(
str(pd.DataFrame(flat).iloc[0]).split('\n')[:-1]
Expand Down
2 changes: 1 addition & 1 deletion fastf1/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -894,7 +894,7 @@ def get_event_by_name(
name and officialName of each event. This is not guaranteed to return
the correct result. You should therefore always check if the function
actually returns the event you had wanted.
To gurantee the function returns the event queried, toggle
To guarantee the function returns the event queried, toggle
strict_search, which will only return an event if its event name
matches (non case sensitive) the query string.
Expand Down
2 changes: 1 addition & 1 deletion fastf1/legacy.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def fix_suzuka(projection_index, _s):

# For tracks like suzuka (therefore only suzuka) we have
# a beautiful crossing point. So, FOR F**K SAKE, sometimes
# shortest distance may fall below the bridge or viceversa
# shortest distance may fall below the bridge or vice-versa
# gotta do some monotony sort of check. Not the cleanest
# solution.
def moving_average(a, n=3):
Expand Down
2 changes: 1 addition & 1 deletion fastf1/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ def soft_exceptions(descr_name: str, msg: str, logger: logging.Logger):
# partially and FastF1 will not become completely unusable.
# For development purposes the automatic error handling can be disabled
# by explicitly setting `Logger.debug = True` or by setting the environment
# variable `FASTF1_DEBUG=1`. In this case, all unhandled excpetions will
# variable `FASTF1_DEBUG=1`. In this case, all unhandled exceptions will
# be raised.
def __decorator(func):
@functools.wraps(func)
Expand Down
8 changes: 4 additions & 4 deletions fastf1/req.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
# of charge and in their spare time. Because of that, they may have very
# limited server capacity. We should accept that and be grateful that they
# even exist in the first place.
# Other APIs may be provided by larger companies. But consequentially they
# Other APIs may be provided by larger companies. But consequently they
# also need to cope with more traffic. We should accept their API limits as
# well.
#
Expand Down Expand Up @@ -138,7 +138,7 @@ class Cache:
should almost always be left enabled to speed up the runtime of your
0scripts and to prevent exceeding the rate limit of api servers.
The default cache directory is defined, in order of precendence, in one
The default cache directory is defined, in order of precedence, in one
of the following ways:
#. A call to :func:`enable_cache`
Expand Down Expand Up @@ -177,15 +177,15 @@ class Cache:
>>> import fastf1
>>> fastf1.Cache.enable_cache('path/to/cache') # doctest: +SKIP
# change cache directory to an exisitng empty directory on your machine
# change cache directory to an existing empty directory on your machine
>>> session = fastf1.get_session(2021, 5, 'Q')
>>> # ...
An alternative way to set the cache directory is to configure an
environment variable `FASTF1_CACHE`. However, this value will be
ignored if `Cache.enable_cache()` is called.
If no explicit location is provied, Fast-F1 will use a default location
If no explicit location is provided, Fast-F1 will use a default location
depending on operating system.
- Windows: `%LOCALAPPDATA%\\\\Temp\\\\fastf1`
Expand Down
5 changes: 2 additions & 3 deletions fastf1/signalr_aio/transports/_transport.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-

# python compatiblity for <3.6
# python compatibility for <3.6
try:
ModuleNotFoundError
except NameError:
ModuleNotFoundError = ImportError

# -----------------------------------
# Internal Imports
from ._exceptions import ConnectionClosed
from ._parameters import WebSocketParameters
from ._queue_events import InvokeEvent, CloseEvent

Expand Down Expand Up @@ -109,4 +108,4 @@ async def _producer_handler(self, ws):
break
self.invoke_queue.task_done()
except Exception as e:
raise e
raise e
2 changes: 1 addition & 1 deletion fastf1/testing/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@


class SubprocessTestError(Exception):
"""Raised if an Excpetion is encounterd in a subprocess test.
"""Raised if an Exception is encountered in a subprocess test.
"""
pass

Expand Down
2 changes: 1 addition & 1 deletion fastf1/tests/test_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def _test_cache_used_and_clear(tmpdir):
mocker.get('https://livetiming.formula1.com/static/2020/Index.json',
content=content, status_code=200)

# create mock repsonses for general api requests
# create mock responses for general api requests
with open('fastf1/testing/reference_data/2020_05_FP2/'
'ergast_race.raw', 'rb') as fobj:
content = fobj.read()
Expand Down

0 comments on commit 3567ef8

Please sign in to comment.