From ef68ae02936729bc59f50c85d106433e0d5fb663 Mon Sep 17 00:00:00 2001 From: Gourav Kumar Date: Sun, 24 Jul 2022 08:45:45 +0530 Subject: [PATCH] type hints and docs --- pyfacts/core.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pyfacts/core.py b/pyfacts/core.py index 63461f4..f8149ad 100644 --- a/pyfacts/core.py +++ b/pyfacts/core.py @@ -101,7 +101,7 @@ class _IndexSlicer: def __init__(self, parent_obj: object): self.parent = parent_obj - def __getitem__(self, n): + def __getitem__(self, n) -> Mapping: if isinstance(n, int): keys: list = [self.parent.dates[n]] else: @@ -378,7 +378,7 @@ class TimeSeriesCore: validate_frequency: boolean, default True Whether the provided frequency should be validated against the data. - When set to True, if the expected number of data points are not withint the expected limits, + When set to True, if the expected number of data points are not within the expected limits, it will raise an Exception and object creation will fail. Validation is performed only if data contains at least 12 data points, as a fewer number of data points are not sufficient to determine the frequency correctly. @@ -401,7 +401,7 @@ class TimeSeriesCore: if validate_frequency and len(ts_data) >= 12: if validation["frequency_match"] is not None and not validation["frequency_match"]: raise ValueError( - f"Data appears to be of frquency {validation['expected_frequency']!r}, " + f"Data appears to be of frequency {validation['expected_frequency']!r}, " f"but {frequency!r} was provided. Pass the correct frequency." "\nPass validate_frequency=False to disable this validation." ) @@ -685,7 +685,7 @@ class TimeSeriesCore: return key in self.data def _arithmatic_validator(self, other): - """Validates input data before performing math operatios""" + """Validates input data before performing math operations""" if not isinstance(other, (Number, Series, TimeSeriesCore)): raise TypeError(