Skip to content

Commit 68542d1

Browse files
committed
chore: use time_line instead of timeline
1 parent a021ec3 commit 68542d1

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

docs/analysis_modules.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Line plots are particularly good for visualizing sequences that are ordered or s
2121

2222
They are often used to compare trends across categories, show the impact of events on performance, and visualize changes over time-like sequences.
2323

24-
Note: While this module can handle datetime values on the x-axis, the **timeline** plot module has additional features that make working with datetimes easier, such as easily resampling the data to alternate time frames.
24+
Note: While this module can handle datetime values on the x-axis, the **plots.time_line** plot module has additional features that make working with datetimes easier, such as easily resampling the data to alternate time frames.
2525

2626
</div>
2727

pyretailscience/plots/line.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
The sequences used in this module can include values like "days since an event" (e.g., -2, -1, 0, 1, 2) or "months
99
since a competitor store opened." **This module is not intended for use with actual datetime values**. If a datetime
1010
or datetime-like column is passed as **`x_col`**, a warning will be triggered, suggesting the use of the
11-
**`timeline`** module.
11+
**`plots.time_line`** module.
1212
1313
### Core Features
1414
@@ -28,7 +28,7 @@
2828
### Limitations and Handling of Temporal Data
2929
3030
- **Limited Handling of Temporal Data**: This module can plot simple time-based sequences, such as "days since an event," but it cannot manipulate or directly handle datetime or date-like columns. It is not optimized for actual datetime values.
31-
If a datetime column is passed or more complex temporal plotting is needed, a warning will suggest using the **`timeline`** module, which is specifically designed for working with temporal data and performing time-based manipulation.
31+
If a datetime column is passed or more complex temporal plotting is needed, a warning will suggest using the **`plots.time_line`** module, which is specifically designed for working with temporal data and performing time-based manipulation.
3232
- **Pre-Aggregated Data Required**: The module does not perform any data aggregation, so all data must be pre-aggregated before being passed in for plotting.
3333
3434
"""
@@ -77,14 +77,14 @@ def plot(
7777
"""
7878
if x_col is not None and pd.api.types.is_datetime64_any_dtype(df[x_col]):
7979
warnings.warn(
80-
f"The column '{x_col}' is datetime-like. Consider using the 'plots.timeline' module for time-based plots.",
80+
f"The column '{x_col}' is datetime-like. Consider using the 'plots.time_line' module for time-based plots.",
8181
UserWarning,
8282
stacklevel=2,
8383
)
8484

8585
elif x_col is None and pd.api.types.is_datetime64_any_dtype(df.index):
8686
warnings.warn(
87-
"The DataFrame index is datetime-like. Consider using the 'plots.timeline' module for time-based plots.",
87+
"The DataFrame index is datetime-like. Consider using the 'plots.time_line' module for time-based plots.",
8888
UserWarning,
8989
stacklevel=2,
9090
)

tests/plots/test_line.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ def test_plot_warns_if_xcol_is_datetime(sample_dataframe, mocker):
9696
)
9797

9898
warnings.warn.assert_called_once_with(
99-
"The column 'x' is datetime-like. Consider using the 'plots.timeline' module for time-based plots.",
99+
"The column 'x' is datetime-like. Consider using the 'plots.time_line' module for time-based plots.",
100100
UserWarning,
101101
stacklevel=2,
102102
)
@@ -265,7 +265,7 @@ def test_plot_with_datetime_index_warns(sample_dataframe, mocker):
265265

266266
# Assert that the warning about datetime-like index was raised
267267
warnings.warn.assert_called_once_with(
268-
"The DataFrame index is datetime-like. Consider using the 'plots.timeline' module for time-based plots.",
268+
"The DataFrame index is datetime-like. Consider using the 'plots.time_line' module for time-based plots.",
269269
UserWarning,
270270
stacklevel=2,
271271
)

0 commit comments

Comments
 (0)