pytrendy 1.4.0.dev1__tar.gz → 1.4.0.dev2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pytrendy-1.4.0.dev1 → pytrendy-1.4.0.dev2}/PKG-INFO +1 -1
- {pytrendy-1.4.0.dev1 → pytrendy-1.4.0.dev2}/pyproject.toml +1 -1
- {pytrendy-1.4.0.dev1 → pytrendy-1.4.0.dev2}/pytrendy/detect_trends.py +1 -0
- {pytrendy-1.4.0.dev1 → pytrendy-1.4.0.dev2}/pytrendy/io/plot_pytrendy.py +10 -1
- {pytrendy-1.4.0.dev1 → pytrendy-1.4.0.dev2}/LICENSE +0 -0
- {pytrendy-1.4.0.dev1 → pytrendy-1.4.0.dev2}/README.md +0 -0
- {pytrendy-1.4.0.dev1 → pytrendy-1.4.0.dev2}/pytrendy/__init__.py +0 -0
- {pytrendy-1.4.0.dev1 → pytrendy-1.4.0.dev2}/pytrendy/io/__init__.py +0 -0
- {pytrendy-1.4.0.dev1 → pytrendy-1.4.0.dev2}/pytrendy/io/data/classes_signals.csv +0 -0
- {pytrendy-1.4.0.dev1 → pytrendy-1.4.0.dev2}/pytrendy/io/data/series_synthetic.csv +0 -0
- {pytrendy-1.4.0.dev1 → pytrendy-1.4.0.dev2}/pytrendy/io/data_loader.py +0 -0
- {pytrendy-1.4.0.dev1 → pytrendy-1.4.0.dev2}/pytrendy/io/results_pytrendy.py +0 -0
- {pytrendy-1.4.0.dev1 → pytrendy-1.4.0.dev2}/pytrendy/post_processing/__init__.py +0 -0
- {pytrendy-1.4.0.dev1 → pytrendy-1.4.0.dev2}/pytrendy/post_processing/segments_analyse.py +0 -0
- {pytrendy-1.4.0.dev1 → pytrendy-1.4.0.dev2}/pytrendy/post_processing/segments_get.py +0 -0
- {pytrendy-1.4.0.dev1 → pytrendy-1.4.0.dev2}/pytrendy/post_processing/segments_refine/__init__.py +0 -0
- {pytrendy-1.4.0.dev1 → pytrendy-1.4.0.dev2}/pytrendy/post_processing/segments_refine/abrupt_shaving.py +0 -0
- {pytrendy-1.4.0.dev1 → pytrendy-1.4.0.dev2}/pytrendy/post_processing/segments_refine/artifact_cleanup.py +0 -0
- {pytrendy-1.4.0.dev1 → pytrendy-1.4.0.dev2}/pytrendy/post_processing/segments_refine/gradual_expand_contract.py +0 -0
- {pytrendy-1.4.0.dev1 → pytrendy-1.4.0.dev2}/pytrendy/post_processing/segments_refine/segment_grouping.py +0 -0
- {pytrendy-1.4.0.dev1 → pytrendy-1.4.0.dev2}/pytrendy/post_processing/segments_refine/trend_classify.py +0 -0
- {pytrendy-1.4.0.dev1 → pytrendy-1.4.0.dev2}/pytrendy/post_processing/segments_refine/update_neighbours.py +0 -0
- {pytrendy-1.4.0.dev1 → pytrendy-1.4.0.dev2}/pytrendy/process_signals.py +0 -0
- {pytrendy-1.4.0.dev1 → pytrendy-1.4.0.dev2}/pytrendy/simpledtw.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "pytrendy"
|
|
3
|
-
version = "1.4.0.
|
|
3
|
+
version = "1.4.0.dev2"
|
|
4
4
|
description = "Trend Detection in Python. Applicable for real-world industry use cases in time series."
|
|
5
5
|
authors = [
|
|
6
6
|
{ name = "Russell Sammut Bonnici", email = "r.sammutbonnici@gmail.com" },
|
|
@@ -44,6 +44,7 @@ def detect_trends(df: pd.DataFrame, date_col: str, value_col: str, plot=True, me
|
|
|
44
44
|
- **avoid_noise** (`bool`): Whether to avoid noisy segments in trend detection. Defaults to `True`.
|
|
45
45
|
plot_params (dict, optional):
|
|
46
46
|
Optional dict to customise plot appearance. Only used when `plot` is `True`. Supported keys:
|
|
47
|
+
|
|
47
48
|
- **figsize** (`tuple`): Figure size as (width, height). Defaults to (20, 5).
|
|
48
49
|
- **title** (`str`): Plot title. Defaults to "PyTrendy Detection".
|
|
49
50
|
- **xlabel** (`str`): X-axis label. Defaults to "Date".
|
|
@@ -23,6 +23,7 @@ def plot_pytrendy(df: pd.DataFrame, value_col: str, segments_enhanced: list[dict
|
|
|
23
23
|
If True, suppresses the automatic display of the plot with plt.show(). Defaults to False.
|
|
24
24
|
plot_params (dict, optional):
|
|
25
25
|
Optional dict to customise plot appearance. Supported keys:
|
|
26
|
+
|
|
26
27
|
- **figsize** (`tuple`): Figure size as (width, height). Defaults to (20, 5).
|
|
27
28
|
- **title** (`str`): Plot title. Defaults to "PyTrendy Detection".
|
|
28
29
|
- **xlabel** (`str`): X-axis label. Defaults to "Date".
|
|
@@ -57,6 +58,8 @@ def plot_pytrendy(df: pd.DataFrame, value_col: str, segments_enhanced: list[dict
|
|
|
57
58
|
}
|
|
58
59
|
if plot_params:
|
|
59
60
|
plot_params = dict(plot_params) # avoid mutating caller's dict
|
|
61
|
+
has_custom_legend_loc = 'legend_loc' in plot_params
|
|
62
|
+
has_custom_legend_anchor = 'legend_bbox_to_anchor' in plot_params
|
|
60
63
|
custom_colors = plot_params.pop('colors', None)
|
|
61
64
|
custom_grid = plot_params.pop('grid', None)
|
|
62
65
|
default_params.update(plot_params)
|
|
@@ -64,6 +67,8 @@ def plot_pytrendy(df: pd.DataFrame, value_col: str, segments_enhanced: list[dict
|
|
|
64
67
|
default_params['colors'].update(custom_colors)
|
|
65
68
|
if custom_grid:
|
|
66
69
|
default_params['grid'].update(custom_grid)
|
|
70
|
+
if has_custom_legend_loc and not has_custom_legend_anchor:
|
|
71
|
+
default_params['legend_bbox_to_anchor'] = None
|
|
67
72
|
|
|
68
73
|
# Define colors
|
|
69
74
|
color_map = default_params['colors']
|
|
@@ -173,7 +178,11 @@ def plot_pytrendy(df: pd.DataFrame, value_col: str, segments_enhanced: list[dict
|
|
|
173
178
|
plt.setp(ax.get_xticklabels(), rotation=90, ha='right')
|
|
174
179
|
|
|
175
180
|
# Optional: show grid lines for both
|
|
176
|
-
|
|
181
|
+
grid_params = default_params['grid']
|
|
182
|
+
if grid_params['visible']:
|
|
183
|
+
ax.grid(True, **{k: v for k, v in grid_params.items() if k != 'visible'})
|
|
184
|
+
else:
|
|
185
|
+
ax.grid(False, which='both')
|
|
177
186
|
|
|
178
187
|
ax.set_title(default_params['title'], fontsize=20)
|
|
179
188
|
ax.set_xlabel(default_params['xlabel'])
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pytrendy-1.4.0.dev1 → pytrendy-1.4.0.dev2}/pytrendy/post_processing/segments_refine/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|