kitikiplot 0.1.6__py3-none-any.whl → 0.1.7__py3-none-any.whl

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: kitikiplot
3
- Version: 0.1.6
3
+ Version: 0.1.7
4
4
  Summary: A Python library to visualize categorical sliding window data.
5
5
  Home-page: https://github.com/BodduSriPavan-111/kitikiplot
6
6
  Author: Boddu Sri Pavan
@@ -117,4 +117,4 @@ BibTeX <br>
117
117
 
118
118
  Please refer <a href="https://github.com/BodduSriPavan-111/kitikiplot/blob/main/tests/unit_test/Readme.md">Readme.md</a> to run the tests
119
119
 
120
- ## Thank You !
120
+ ## Thank You !!
@@ -0,0 +1,12 @@
1
+ kitikiplot/__init__.py,sha256=7LpJy1V-PZ-JlfjsnRMjMXxTKaFt0JP0mj-A0SgS-sE,34
2
+ kitikiplot/kitiki_cell.py,sha256=9kn33x8-4Zp_fVdmp5NK-V7fm3hDXZOxwCNO3uDZqIo,7016
3
+ kitikiplot/kitiki_color_config.py,sha256=No_ayqgQUYXRE7g62obFKVn6avn4jdGn3WuSqZ6F3tA,11677
4
+ kitikiplot/kitikiplot.py,sha256=uH5eQnWxswQsDC1b77cu5U_2m3ODfKRGqCxcredRagQ,19746
5
+ tests/__init__.py,sha256=G6t2Zarmz7Akl21Pmws08EK9CXqJv6In4sCr2LLRqqk,34
6
+ tests/unit_test/__init__.py,sha256=G6t2Zarmz7Akl21Pmws08EK9CXqJv6In4sCr2LLRqqk,34
7
+ tests/unit_test/unit_test.py,sha256=MA4yspvTtnE5kP7j-TYB9ECtbvJQKrDskzRU3JKzNww,4323
8
+ kitikiplot-0.1.7.dist-info/LICENSE,sha256=14Bs-3ieyNjj9kCnVLv8CHRXEvQVM6P5uLe-pz7cBI0,1088
9
+ kitikiplot-0.1.7.dist-info/METADATA,sha256=ttgqnMjJaFIjzyFORJKqCd6q77mT25tUGdVP83MdJ-w,5166
10
+ kitikiplot-0.1.7.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
11
+ kitikiplot-0.1.7.dist-info/top_level.txt,sha256=SjfefiiV1oUpgCKjYpjF2JmFGORHqePe1zAm1JcwBNg,17
12
+ kitikiplot-0.1.7.dist-info/RECORD,,
tests/__init__.py ADDED
@@ -0,0 +1,2 @@
1
+ import sys
2
+ sys.path.append('.')
@@ -0,0 +1,2 @@
1
+ import sys
2
+ sys.path.append('.')
@@ -0,0 +1,129 @@
1
+ """
2
+ ------------------------------------------------------------------------------
3
+ File: unit_test.py
4
+ Description: This file contains test cases for the KitikiPlot class, ensuring
5
+ its functionality across different data types and edge cases.
6
+ Created On: March 22, 2025
7
+ ------------------------------------------------------------------------------
8
+ """
9
+
10
+ """ Import necessary libraries """
11
+ import pytest
12
+ import sys
13
+ import pandas as pd
14
+ import matplotlib.patches as mpatches
15
+ import numpy as np
16
+ from numpy.testing import assert_array_equal
17
+
18
+ sys.path.insert(0, '../kitikiplot')
19
+ from kitikiplot import KitikiPlot
20
+
21
+ """ Fixtures for providing sample data """
22
+
23
+ @pytest.fixture
24
+ def sample_data():
25
+ """
26
+ Returns a sample Pandas DataFrame for testing.
27
+ """
28
+ return pd.DataFrame({"A": [1, 2, 3], "B": [4, 5, 6]})
29
+
30
+ @pytest.fixture
31
+ def sample_list():
32
+ """
33
+ Returns a sample list for testing list-based initialization.
34
+ """
35
+ return [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
36
+
37
+ @pytest.fixture
38
+ def kitiki_plot(sample_data):
39
+ """
40
+ Creates an instance of KitikiPlot using sample data.
41
+ """
42
+ return KitikiPlot(data=sample_data)
43
+
44
+ @pytest.fixture
45
+ def cmap():
46
+ """
47
+ Returns a colormap dictionary for testing color mapping.
48
+ """
49
+ return {0: {1: "red", 2: "blue", 3: "green"}, 1: "black"}
50
+
51
+ @pytest.fixture
52
+ def hmap():
53
+ """
54
+ Returns a hatch map dictionary for testing hatch patterns.
55
+ """
56
+ return {1: "//", 2: "\\", 3: "||"}
57
+
58
+ """ Testing Initialization with Different Data Types """
59
+
60
+ def test_kitiki_plot_initialization(sample_data):
61
+ """
62
+ Tests if KitikiPlot initializes properly with a DataFrame.
63
+ """
64
+ plot = KitikiPlot(data=sample_data)
65
+ assert isinstance(plot, KitikiPlot)
66
+
67
+ def test_kitiki_plot_with_empty_dataframe():
68
+ """
69
+ Tests if KitikiPlot initializes properly with an empty DataFrame.
70
+ """
71
+ empty_df = pd.DataFrame()
72
+ plot = KitikiPlot(data=empty_df)
73
+ assert isinstance(plot, KitikiPlot)
74
+
75
+ def test_kitiki_plot_with_list(sample_list):
76
+ """
77
+ Tests if KitikiPlot initializes properly with a list.
78
+ """
79
+ plot = KitikiPlot(data=sample_list, stride=2, window_length=5)
80
+ assert isinstance(plot, KitikiPlot)
81
+
82
+ def test_kitiki_plot_with_nested_list():
83
+ """
84
+ Tests if KitikiPlot initializes properly with a nested list.
85
+ """
86
+ nested_list = [[1, 2], [3, 4], [5, 6]]
87
+ plot = KitikiPlot(data=nested_list, stride=1, window_length=2)
88
+ assert isinstance(plot, KitikiPlot)
89
+
90
+ """ Testing Edge Cases for 'create' Method """
91
+
92
+ def test_create_rectangle(kitiki_plot, cmap, hmap):
93
+ """
94
+ Tests if the 'create' method generates a valid rectangle object.
95
+ """
96
+ rect = kitiki_plot.create(
97
+ x=0, y=0, each_sample=[1, 2, 3], cell_width=0.5, cell_height=2.0,
98
+ window_gap=1.0, align=True, cmap=cmap, edge_color='black',
99
+ fallback_color='white', hmap=hmap, fallback_hatch=' ',
100
+ display_hatch=True, transpose=False
101
+ )
102
+ assert isinstance(rect, mpatches.Rectangle)
103
+
104
+ def test_create_invalid_rectangle(kitiki_plot, cmap, hmap):
105
+ """
106
+ Tests if the 'create' method raises a KeyError for missing cmap/hmap values.
107
+ """
108
+ with pytest.raises(KeyError) as exc_info:
109
+ kitiki_plot.create(
110
+ x=0, y=0, each_sample=[10], cell_width=0.5, cell_height=2.0,
111
+ window_gap=1.0, align=True, cmap=cmap, edge_color='black',
112
+ fallback_color='white', hmap=hmap, fallback_hatch=' ',
113
+ display_hatch=True, transpose=False
114
+ )
115
+ print(f"exc value is equal to {exc_info.value} and type is {type(exc_info.value)}")
116
+ assert str(10) in str(exc_info.value)
117
+
118
+ def test_create_rectangle_with_unknown_values(kitiki_plot, cmap, hmap):
119
+ """
120
+ Tests if the 'create' method raises a KeyError for unknown cmap/hmap values.
121
+ """
122
+ with pytest.raises(KeyError) as exc_info:
123
+ kitiki_plot.create(
124
+ x=0, y=0, each_sample=[99], cell_width=0.5, cell_height=2.0,
125
+ window_gap=1.0, align=True, cmap=cmap, edge_color='black',
126
+ fallback_color='white', hmap=hmap, fallback_hatch=' ',
127
+ display_hatch=True, transpose=False
128
+ )
129
+ assert str(99) in str(exc_info.value)
@@ -1,9 +0,0 @@
1
- kitikiplot/__init__.py,sha256=7LpJy1V-PZ-JlfjsnRMjMXxTKaFt0JP0mj-A0SgS-sE,34
2
- kitikiplot/kitiki_cell.py,sha256=9kn33x8-4Zp_fVdmp5NK-V7fm3hDXZOxwCNO3uDZqIo,7016
3
- kitikiplot/kitiki_color_config.py,sha256=No_ayqgQUYXRE7g62obFKVn6avn4jdGn3WuSqZ6F3tA,11677
4
- kitikiplot/kitikiplot.py,sha256=uH5eQnWxswQsDC1b77cu5U_2m3ODfKRGqCxcredRagQ,19746
5
- kitikiplot-0.1.6.dist-info/LICENSE,sha256=14Bs-3ieyNjj9kCnVLv8CHRXEvQVM6P5uLe-pz7cBI0,1088
6
- kitikiplot-0.1.6.dist-info/METADATA,sha256=l1vENGblnJamx4ai1SgqcnpEWurapoj_p3YFMlrMxJ0,5164
7
- kitikiplot-0.1.6.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
8
- kitikiplot-0.1.6.dist-info/top_level.txt,sha256=nqjD8Sil5L7rfBQtnmLdJMR-u2BdVFnusZlOIU0Yd00,11
9
- kitikiplot-0.1.6.dist-info/RECORD,,