direl-ts-tool-kit 0.6.0__tar.gz → 0.8.0__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.
- {direl_ts_tool_kit-0.6.0 → direl_ts_tool_kit-0.8.0}/LICENCE +0 -0
- {direl_ts_tool_kit-0.6.0 → direl_ts_tool_kit-0.8.0}/PKG-INFO +9 -1
- {direl_ts_tool_kit-0.6.0 → direl_ts_tool_kit-0.8.0}/README.md +8 -0
- {direl_ts_tool_kit-0.6.0 → direl_ts_tool_kit-0.8.0}/direl_ts_tool_kit/__init__.py +0 -0
- {direl_ts_tool_kit-0.6.0 → direl_ts_tool_kit-0.8.0}/direl_ts_tool_kit/plot/__init__.py +0 -0
- {direl_ts_tool_kit-0.6.0 → direl_ts_tool_kit-0.8.0}/direl_ts_tool_kit/plot/plot_style.py +0 -0
- {direl_ts_tool_kit-0.6.0 → direl_ts_tool_kit-0.8.0}/direl_ts_tool_kit/plot/plot_ts.py +136 -0
- {direl_ts_tool_kit-0.6.0 → direl_ts_tool_kit-0.8.0}/direl_ts_tool_kit/utilities/__init__.py +0 -0
- {direl_ts_tool_kit-0.6.0 → direl_ts_tool_kit-0.8.0}/direl_ts_tool_kit/utilities/data_prep.py +0 -0
- {direl_ts_tool_kit-0.6.0 → direl_ts_tool_kit-0.8.0}/direl_ts_tool_kit.egg-info/PKG-INFO +9 -1
- {direl_ts_tool_kit-0.6.0 → direl_ts_tool_kit-0.8.0}/direl_ts_tool_kit.egg-info/SOURCES.txt +0 -0
- {direl_ts_tool_kit-0.6.0 → direl_ts_tool_kit-0.8.0}/direl_ts_tool_kit.egg-info/dependency_links.txt +0 -0
- {direl_ts_tool_kit-0.6.0 → direl_ts_tool_kit-0.8.0}/direl_ts_tool_kit.egg-info/requires.txt +0 -0
- {direl_ts_tool_kit-0.6.0 → direl_ts_tool_kit-0.8.0}/direl_ts_tool_kit.egg-info/top_level.txt +0 -0
- {direl_ts_tool_kit-0.6.0 → direl_ts_tool_kit-0.8.0}/setup.cfg +0 -0
- {direl_ts_tool_kit-0.6.0 → direl_ts_tool_kit-0.8.0}/setup.py +1 -1
|
File without changes
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: direl-ts-tool-kit
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.8.0
|
|
4
4
|
Summary: A toolbox for time series analysis and visualization.
|
|
5
5
|
Home-page: https://gitlab.com/direl/direl_tool_kit
|
|
6
6
|
Author: Diego Restrepo-Leal
|
|
@@ -125,6 +125,14 @@ It focuses on the lower triangular part (corner=True) and includes a
|
|
|
125
125
|
regression line for trend visualization.
|
|
126
126
|
|
|
127
127
|
|
|
128
|
+
#### plot_histogram
|
|
129
|
+
`plot_histogram(df, variable, units="", density=True, color="BLUE_BARS", bins=30)`
|
|
130
|
+
|
|
131
|
+
Generates a histogram plot for a specified numerical variable.
|
|
132
|
+
|
|
133
|
+
The plot visualizes the distribution of the data, with the Y-axis dynamically
|
|
134
|
+
labeled as 'Density' or 'Count' based on the `density` parameter.
|
|
135
|
+
|
|
128
136
|
# Examples
|
|
129
137
|
- [Example 1](https://gitlab.com/direl/direl_tool_kit/-/blob/main/example/example_01.md?ref_type=heads)
|
|
130
138
|
- [Example 2](https://gitlab.com/direl/direl_tool_kit/-/blob/main/example/example_02.md?ref_type=heads)
|
|
@@ -92,6 +92,14 @@ It focuses on the lower triangular part (corner=True) and includes a
|
|
|
92
92
|
regression line for trend visualization.
|
|
93
93
|
|
|
94
94
|
|
|
95
|
+
#### plot_histogram
|
|
96
|
+
`plot_histogram(df, variable, units="", density=True, color="BLUE_BARS", bins=30)`
|
|
97
|
+
|
|
98
|
+
Generates a histogram plot for a specified numerical variable.
|
|
99
|
+
|
|
100
|
+
The plot visualizes the distribution of the data, with the Y-axis dynamically
|
|
101
|
+
labeled as 'Density' or 'Count' based on the `density` parameter.
|
|
102
|
+
|
|
95
103
|
# Examples
|
|
96
104
|
- [Example 1](https://gitlab.com/direl/direl_tool_kit/-/blob/main/example/example_01.md?ref_type=heads)
|
|
97
105
|
- [Example 2](https://gitlab.com/direl/direl_tool_kit/-/blob/main/example/example_02.md?ref_type=heads)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -412,3 +412,139 @@ def pair_plot(X, y):
|
|
|
412
412
|
fig = svm.fig
|
|
413
413
|
|
|
414
414
|
return fig
|
|
415
|
+
|
|
416
|
+
|
|
417
|
+
def plot_histogram(df, variable, units="", density=True, color="BLUE_BARS", bins=30):
|
|
418
|
+
"""
|
|
419
|
+
Generates a histogram plot for a specified numerical variable.
|
|
420
|
+
|
|
421
|
+
The plot visualizes the distribution of the data, with the Y-axis dynamically
|
|
422
|
+
labeled as 'Density' or 'Count' based on the `density` parameter.
|
|
423
|
+
|
|
424
|
+
Parameters
|
|
425
|
+
----------
|
|
426
|
+
df : pd.DataFrame
|
|
427
|
+
The DataFrame containing the data to be plotted.
|
|
428
|
+
variable : str
|
|
429
|
+
The name of the column in 'df' whose distribution will be plotted.
|
|
430
|
+
units : str, optional
|
|
431
|
+
Units to display next to the variable name on the X-axis. Defaults to "".
|
|
432
|
+
density : bool, optional
|
|
433
|
+
If True (default), the Y-axis is scaled to a Probability Density,
|
|
434
|
+
meaning the area under the bars sums to 1. If False, the Y-axis
|
|
435
|
+
displays the raw count of observations per bin.
|
|
436
|
+
color : str, optional
|
|
437
|
+
Key corresponding to the bar color in the global 'paper_colors' dictionary
|
|
438
|
+
(e.g., "BLUE_BARS"). Defaults to "BLUE_LINES".
|
|
439
|
+
bins : int or sequence, optional
|
|
440
|
+
The number of equal-width bins in the range to divide the data.
|
|
441
|
+
Can be an integer (default is 30) or a sequence specifying the bin edges.
|
|
442
|
+
|
|
443
|
+
Returns
|
|
444
|
+
-------
|
|
445
|
+
matplotlib.figure.Figure
|
|
446
|
+
The generated Matplotlib Figure object containing the histogram.
|
|
447
|
+
|
|
448
|
+
Notes
|
|
449
|
+
-----
|
|
450
|
+
The plot applies a fixed style (alpha=0.7, white edge-color) and grid
|
|
451
|
+
for visual consistency.
|
|
452
|
+
"""
|
|
453
|
+
fig, ax = plt.subplots()
|
|
454
|
+
|
|
455
|
+
ax.hist(
|
|
456
|
+
df[variable],
|
|
457
|
+
bins=bins,
|
|
458
|
+
density=density,
|
|
459
|
+
alpha=0.7,
|
|
460
|
+
color=paper_colors[color],
|
|
461
|
+
edgecolor="white",
|
|
462
|
+
)
|
|
463
|
+
|
|
464
|
+
ax.set_xlabel(f"{variable} {units}")
|
|
465
|
+
|
|
466
|
+
if density:
|
|
467
|
+
ax.set_ylabel("Density")
|
|
468
|
+
else:
|
|
469
|
+
ax.set_ylabel("Count")
|
|
470
|
+
|
|
471
|
+
ax.grid(alpha=0.8, linestyle="--")
|
|
472
|
+
|
|
473
|
+
return fig
|
|
474
|
+
|
|
475
|
+
|
|
476
|
+
def plot_data_boxplot(
|
|
477
|
+
df, variable=None, x_label="", y_label="", grid=False, notch=False
|
|
478
|
+
):
|
|
479
|
+
"""
|
|
480
|
+
Generates a boxplot visualization, either for all numerical columns in the
|
|
481
|
+
DataFrame or for a single specified variable.
|
|
482
|
+
|
|
483
|
+
The function applies consistent styling for the boxes, outliers, and median
|
|
484
|
+
lines using predefined colors from 'paper_colors'.
|
|
485
|
+
|
|
486
|
+
Parameters
|
|
487
|
+
----------
|
|
488
|
+
df : pd.DataFrame
|
|
489
|
+
The input DataFrame containing the data to be plotted.
|
|
490
|
+
variable : str, optional
|
|
491
|
+
The column name of the variable to plot.
|
|
492
|
+
- If None (default), boxplots for all numerical columns in the DataFrame
|
|
493
|
+
are generated side-by-side.
|
|
494
|
+
- If a string, a single boxplot for that column is generated.
|
|
495
|
+
x_label : str, optional
|
|
496
|
+
The label for the X-axis. Defaults to "".
|
|
497
|
+
y_label : str, optional
|
|
498
|
+
The label for the Y-axis. Defaults to "".
|
|
499
|
+
grid : bool, optional
|
|
500
|
+
If True, display the grid lines on the plot. This parameter is only
|
|
501
|
+
effective when plotting **all** variables (when `variable` is None).
|
|
502
|
+
Defaults to False.
|
|
503
|
+
notch : bool, optional
|
|
504
|
+
If True, draw a notch around the median. This parameter is only
|
|
505
|
+
effective when plotting **all** variables (when `variable` is None).
|
|
506
|
+
Defaults to False.
|
|
507
|
+
|
|
508
|
+
Returns
|
|
509
|
+
-------
|
|
510
|
+
matplotlib.figure.Figure
|
|
511
|
+
The generated Matplotlib Figure object containing the boxplot(s).
|
|
512
|
+
|
|
513
|
+
Notes
|
|
514
|
+
-----
|
|
515
|
+
The boxplot uses the following fixed style parameters:
|
|
516
|
+
- **Box Line Color:** BLUE_LINES
|
|
517
|
+
- **Outlier Marker:** 'o' (marker size 12)
|
|
518
|
+
- **Median Line Color:** GREEN_LINES
|
|
519
|
+
|
|
520
|
+
When plotting a single variable (`variable` is set), the `grid` and
|
|
521
|
+
`notch` parameters are internally forced to **False**.
|
|
522
|
+
"""
|
|
523
|
+
boxprops = dict(linewidth=4, color=paper_colors["BLUE_LINES"])
|
|
524
|
+
flierprops = dict(marker="o", markersize=12)
|
|
525
|
+
medianprops = dict(linewidth=4, color=paper_colors["GREEN_LINES"])
|
|
526
|
+
|
|
527
|
+
fig, ax = plt.subplots()
|
|
528
|
+
|
|
529
|
+
if not variable:
|
|
530
|
+
ax = df.boxplot(
|
|
531
|
+
grid=grid,
|
|
532
|
+
notch=notch,
|
|
533
|
+
boxprops=boxprops,
|
|
534
|
+
flierprops=flierprops,
|
|
535
|
+
medianprops=medianprops,
|
|
536
|
+
)
|
|
537
|
+
else:
|
|
538
|
+
ax = df[[variable]].boxplot(
|
|
539
|
+
grid=False,
|
|
540
|
+
notch=False,
|
|
541
|
+
boxprops=boxprops,
|
|
542
|
+
flierprops=flierprops,
|
|
543
|
+
medianprops=medianprops,
|
|
544
|
+
)
|
|
545
|
+
|
|
546
|
+
ax.set_xlabel(f"{x_label}")
|
|
547
|
+
ax.set_ylabel(f"{y_label}")
|
|
548
|
+
ax.tick_params(axis="x")
|
|
549
|
+
|
|
550
|
+
return fig
|
|
File without changes
|
{direl_ts_tool_kit-0.6.0 → direl_ts_tool_kit-0.8.0}/direl_ts_tool_kit/utilities/data_prep.py
RENAMED
|
File without changes
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: direl-ts-tool-kit
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.8.0
|
|
4
4
|
Summary: A toolbox for time series analysis and visualization.
|
|
5
5
|
Home-page: https://gitlab.com/direl/direl_tool_kit
|
|
6
6
|
Author: Diego Restrepo-Leal
|
|
@@ -125,6 +125,14 @@ It focuses on the lower triangular part (corner=True) and includes a
|
|
|
125
125
|
regression line for trend visualization.
|
|
126
126
|
|
|
127
127
|
|
|
128
|
+
#### plot_histogram
|
|
129
|
+
`plot_histogram(df, variable, units="", density=True, color="BLUE_BARS", bins=30)`
|
|
130
|
+
|
|
131
|
+
Generates a histogram plot for a specified numerical variable.
|
|
132
|
+
|
|
133
|
+
The plot visualizes the distribution of the data, with the Y-axis dynamically
|
|
134
|
+
labeled as 'Density' or 'Count' based on the `density` parameter.
|
|
135
|
+
|
|
128
136
|
# Examples
|
|
129
137
|
- [Example 1](https://gitlab.com/direl/direl_tool_kit/-/blob/main/example/example_01.md?ref_type=heads)
|
|
130
138
|
- [Example 2](https://gitlab.com/direl/direl_tool_kit/-/blob/main/example/example_02.md?ref_type=heads)
|
|
File without changes
|
{direl_ts_tool_kit-0.6.0 → direl_ts_tool_kit-0.8.0}/direl_ts_tool_kit.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
{direl_ts_tool_kit-0.6.0 → direl_ts_tool_kit-0.8.0}/direl_ts_tool_kit.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
|
|
|
2
2
|
|
|
3
3
|
setup(
|
|
4
4
|
name="direl-ts-tool-kit",
|
|
5
|
-
version="0.
|
|
5
|
+
version="0.8.0",
|
|
6
6
|
description="A toolbox for time series analysis and visualization.",
|
|
7
7
|
long_description=open("README.md", encoding="utf-8").read(),
|
|
8
8
|
long_description_content_type="text/markdown",
|