Skip to content

Commit

Permalink
Merge pull request #95 from ibm-granite/misc_fixes
Browse files Browse the repository at this point in the history
update docstrings, ease some imports
  • Loading branch information
wgifford authored Aug 1, 2024
2 parents 1ec54d4 + c426968 commit be059fd
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 2 additions & 0 deletions tsfm_public/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"ForecastDFDataset",
"PretrainDFDataset",
"RegressionDFDataset",
"get_datasets",
],
}

Expand Down Expand Up @@ -52,6 +53,7 @@
RegressionDFDataset,
TimeSeriesForecastingPipeline,
TimeSeriesPreprocessor,
get_datasets,
)
else:
# Standard
Expand Down
2 changes: 1 addition & 1 deletion tsfm_public/toolkit/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@

from .dataset import ForecastDFDataset, PretrainDFDataset, RegressionDFDataset
from .time_series_forecasting_pipeline import TimeSeriesForecastingPipeline
from .time_series_preprocessor import TimeSeriesPreprocessor
from .time_series_preprocessor import TimeSeriesPreprocessor, get_datasets
8 changes: 5 additions & 3 deletions tsfm_public/toolkit/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,17 @@ def select_by_index(
end_index: Optional[int] = None,
) -> pd.DataFrame:
"""Select a portion of a dataset based on integer indices into the data.
Note that the range selected is inclusive of the starting index. When ID columns are specified
the selection is done per-time series (i.e., the indices are used relative to each time series).
Note that the range selected is inclusive of the starting index, but exclusive of the end index. When ID
columns are specified the selection is done per-time series (i.e., the indices are used relative to each
time series). The indexing is intended to be similar to python-style indexing into lists, where the end
of the specified range is not included.
Args:
df (pd.DataFrame): Input dataframe.
id_columns (List[str], optional): Columns which specify the IDs in the dataset. Defaults to None.
start_index (Optional[int], optional): Index of the starting point.
Defaults to None. Use None to specify the start of the data.
end_index (Optional[Union[str, datetime]], optional): Index of the ending point.
end_index (Optional[Union[str, datetime]], optional): Index for the end of the selection (not inclusive).
Use None to specify the end of the data. Defaults to None.
Raises:
Expand Down

0 comments on commit be059fd

Please sign in to comment.