From 3567ef8d17013070ee1111e4d71b382881fc0db4 Mon Sep 17 00:00:00 2001 From: Casper Guo Date: Tue, 10 Oct 2023 14:53:14 -0400 Subject: [PATCH] Fix comment typos --- fastf1/_api.py | 19 +++++++++++-------- fastf1/core.py | 2 +- fastf1/ergast/sphinx.py | 2 +- fastf1/events.py | 2 +- fastf1/legacy.py | 2 +- fastf1/logger.py | 2 +- fastf1/req.py | 8 ++++---- fastf1/signalr_aio/transports/_transport.py | 5 ++--- fastf1/testing/__init__.py | 2 +- fastf1/tests/test_cache.py | 2 +- 10 files changed, 24 insertions(+), 22 deletions(-) diff --git a/fastf1/_api.py b/fastf1/_api.py index ce878a41d..0a1997519 100644 --- a/fastf1/_api.py +++ b/fastf1/_api.py @@ -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) @@ -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 @@ -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( @@ -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 @@ -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 diff --git a/fastf1/core.py b/fastf1/core.py index 582b6b495..4d3590747 100644 --- a/fastf1/core.py +++ b/fastf1/core.py @@ -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: diff --git a/fastf1/ergast/sphinx.py b/fastf1/ergast/sphinx.py index 28256dbf9..e007071cc 100644 --- a/fastf1/ergast/sphinx.py +++ b/fastf1/ergast/sphinx.py @@ -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] diff --git a/fastf1/events.py b/fastf1/events.py index 272bc6f06..c378825eb 100644 --- a/fastf1/events.py +++ b/fastf1/events.py @@ -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. diff --git a/fastf1/legacy.py b/fastf1/legacy.py index e79567d5a..ba59315d3 100644 --- a/fastf1/legacy.py +++ b/fastf1/legacy.py @@ -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): diff --git a/fastf1/logger.py b/fastf1/logger.py index b35e6c3b8..226cdc46e 100644 --- a/fastf1/logger.py +++ b/fastf1/logger.py @@ -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) diff --git a/fastf1/req.py b/fastf1/req.py index 70db60547..1796a71b4 100644 --- a/fastf1/req.py +++ b/fastf1/req.py @@ -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. # @@ -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` @@ -177,7 +177,7 @@ 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') >>> # ... @@ -185,7 +185,7 @@ class Cache: 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` diff --git a/fastf1/signalr_aio/transports/_transport.py b/fastf1/signalr_aio/transports/_transport.py index 37868502b..6c2dfdf21 100644 --- a/fastf1/signalr_aio/transports/_transport.py +++ b/fastf1/signalr_aio/transports/_transport.py @@ -1,7 +1,7 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# python compatiblity for <3.6 +# python compatibility for <3.6 try: ModuleNotFoundError except NameError: @@ -9,7 +9,6 @@ # ----------------------------------- # Internal Imports -from ._exceptions import ConnectionClosed from ._parameters import WebSocketParameters from ._queue_events import InvokeEvent, CloseEvent @@ -109,4 +108,4 @@ async def _producer_handler(self, ws): break self.invoke_queue.task_done() except Exception as e: - raise e \ No newline at end of file + raise e diff --git a/fastf1/testing/__init__.py b/fastf1/testing/__init__.py index ddc81a442..f170c5a62 100644 --- a/fastf1/testing/__init__.py +++ b/fastf1/testing/__init__.py @@ -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 diff --git a/fastf1/tests/test_cache.py b/fastf1/tests/test_cache.py index 0ef7e164c..7b976a318 100644 --- a/fastf1/tests/test_cache.py +++ b/fastf1/tests/test_cache.py @@ -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()