MatplotLibAPI 4.0.1__tar.gz → 4.0.3__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.
Files changed (76) hide show
  1. {matplotlibapi-4.0.1 → matplotlibapi-4.0.3}/.github/workflows/ci.yml +4 -1
  2. {matplotlibapi-4.0.1 → matplotlibapi-4.0.3}/PKG-INFO +5 -5
  3. {matplotlibapi-4.0.1 → matplotlibapi-4.0.3}/README.md +3 -3
  4. matplotlibapi-4.0.3/examples/bubble.py +42 -0
  5. {matplotlibapi-4.0.1 → matplotlibapi-4.0.3}/examples/network.py +5 -5
  6. {matplotlibapi-4.0.1 → matplotlibapi-4.0.3}/examples/sample_data.py +6 -15
  7. {matplotlibapi-4.0.1 → matplotlibapi-4.0.3}/pyproject.toml +2 -2
  8. matplotlibapi-4.0.3/src/MatplotLibAPI/__init__.py +6 -0
  9. {matplotlibapi-4.0.1 → matplotlibapi-4.0.3}/src/MatplotLibAPI/accessor.py +146 -545
  10. {matplotlibapi-4.0.1 → matplotlibapi-4.0.3}/src/MatplotLibAPI/area.py +7 -38
  11. {matplotlibapi-4.0.1 → matplotlibapi-4.0.3}/src/MatplotLibAPI/bar.py +3 -38
  12. matplotlibapi-4.0.3/src/MatplotLibAPI/base_plot.py +169 -0
  13. {matplotlibapi-4.0.1 → matplotlibapi-4.0.3}/src/MatplotLibAPI/box_violin.py +5 -41
  14. {matplotlibapi-4.0.1 → matplotlibapi-4.0.3}/src/MatplotLibAPI/bubble.py +31 -109
  15. {matplotlibapi-4.0.1 → matplotlibapi-4.0.3}/src/MatplotLibAPI/composite.py +237 -17
  16. {matplotlibapi-4.0.1 → matplotlibapi-4.0.3}/src/MatplotLibAPI/heatmap.py +72 -60
  17. {matplotlibapi-4.0.1 → matplotlibapi-4.0.3}/src/MatplotLibAPI/histogram.py +2 -26
  18. {matplotlibapi-4.0.1 → matplotlibapi-4.0.3}/src/MatplotLibAPI/network/__init__.py +2 -0
  19. {matplotlibapi-4.0.1 → matplotlibapi-4.0.3}/src/MatplotLibAPI/network/constants.py +1 -0
  20. {matplotlibapi-4.0.1 → matplotlibapi-4.0.3}/src/MatplotLibAPI/network/core.py +45 -56
  21. {matplotlibapi-4.0.1 → matplotlibapi-4.0.3}/src/MatplotLibAPI/network/plot.py +95 -6
  22. {matplotlibapi-4.0.1 → matplotlibapi-4.0.3}/src/MatplotLibAPI/pie.py +2 -39
  23. {matplotlibapi-4.0.1 → matplotlibapi-4.0.3}/src/MatplotLibAPI/pivot.py +9 -34
  24. {matplotlibapi-4.0.1 → matplotlibapi-4.0.3}/src/MatplotLibAPI/table.py +1 -29
  25. {matplotlibapi-4.0.1 → matplotlibapi-4.0.3}/src/MatplotLibAPI/timeserie.py +2 -30
  26. {matplotlibapi-4.0.1 → matplotlibapi-4.0.3}/src/MatplotLibAPI/treemap.py +3 -1
  27. matplotlibapi-4.0.3/src/MatplotLibAPI/types.py +6 -0
  28. {matplotlibapi-4.0.1 → matplotlibapi-4.0.3}/src/MatplotLibAPI/waffle.py +1 -43
  29. {matplotlibapi-4.0.1 → matplotlibapi-4.0.3}/src/MatplotLibAPI/word_cloud.py +5 -57
  30. {matplotlibapi-4.0.1 → matplotlibapi-4.0.3}/tests/test_heatmap.py +4 -2
  31. {matplotlibapi-4.0.1 → matplotlibapi-4.0.3}/tests/test_network.py +85 -2
  32. matplotlibapi-4.0.3/tests/test_network_preprocessing.py +117 -0
  33. matplotlibapi-4.0.1/examples/network.png +0 -0
  34. matplotlibapi-4.0.1/src/MatplotLibAPI/__init__.py +0 -7
  35. matplotlibapi-4.0.1/src/MatplotLibAPI/base_plot.py +0 -88
  36. matplotlibapi-4.0.1/src/MatplotLibAPI/typing.py +0 -12
  37. matplotlibapi-4.0.1/src/MatplotLibAPI/utils.py +0 -85
  38. {matplotlibapi-4.0.1 → matplotlibapi-4.0.3}/.github/dependabot.yml +0 -0
  39. {matplotlibapi-4.0.1 → matplotlibapi-4.0.3}/.github/workflows/python-publish.yml +0 -0
  40. {matplotlibapi-4.0.1 → matplotlibapi-4.0.3}/.gitignore +0 -0
  41. {matplotlibapi-4.0.1 → matplotlibapi-4.0.3}/.pre-commit-config.yaml +0 -0
  42. {matplotlibapi-4.0.1 → matplotlibapi-4.0.3}/AGENTS.md +0 -0
  43. {matplotlibapi-4.0.1 → matplotlibapi-4.0.3}/LICENSE +0 -0
  44. {matplotlibapi-4.0.1 → matplotlibapi-4.0.3}/SECURITY.md +0 -0
  45. {matplotlibapi-4.0.1 → matplotlibapi-4.0.3}/SUGGESTIONS.md +0 -0
  46. {matplotlibapi-4.0.1 → matplotlibapi-4.0.3}/examples/__init__.py +0 -0
  47. {matplotlibapi-4.0.1 → matplotlibapi-4.0.3}/scripts/pre_commit.sh +0 -0
  48. {matplotlibapi-4.0.1 → matplotlibapi-4.0.3}/src/MatplotLibAPI/mcp/__init__.py +0 -0
  49. {matplotlibapi-4.0.1 → matplotlibapi-4.0.3}/src/MatplotLibAPI/mcp/metadata.py +0 -0
  50. {matplotlibapi-4.0.1 → matplotlibapi-4.0.3}/src/MatplotLibAPI/mcp/renderers.py +0 -0
  51. {matplotlibapi-4.0.1 → matplotlibapi-4.0.3}/src/MatplotLibAPI/mcp_server.py +0 -0
  52. {matplotlibapi-4.0.1 → matplotlibapi-4.0.3}/src/MatplotLibAPI/network/scaling.py +0 -0
  53. {matplotlibapi-4.0.1 → matplotlibapi-4.0.3}/src/MatplotLibAPI/sankey.py +0 -0
  54. {matplotlibapi-4.0.1 → matplotlibapi-4.0.3}/src/MatplotLibAPI/style_template.py +0 -0
  55. {matplotlibapi-4.0.1 → matplotlibapi-4.0.3}/src/MatplotLibAPI/sunburst.py +0 -0
  56. {matplotlibapi-4.0.1 → matplotlibapi-4.0.3}/tests/__init__.py +0 -0
  57. {matplotlibapi-4.0.1 → matplotlibapi-4.0.3}/tests/conftest.py +0 -0
  58. {matplotlibapi-4.0.1 → matplotlibapi-4.0.3}/tests/test_area.py +0 -0
  59. {matplotlibapi-4.0.1 → matplotlibapi-4.0.3}/tests/test_bar.py +0 -0
  60. {matplotlibapi-4.0.1 → matplotlibapi-4.0.3}/tests/test_box_violin.py +0 -0
  61. {matplotlibapi-4.0.1 → matplotlibapi-4.0.3}/tests/test_bubble.py +0 -0
  62. {matplotlibapi-4.0.1 → matplotlibapi-4.0.3}/tests/test_composite.py +0 -0
  63. {matplotlibapi-4.0.1 → matplotlibapi-4.0.3}/tests/test_dependencies.py +0 -0
  64. {matplotlibapi-4.0.1 → matplotlibapi-4.0.3}/tests/test_histogram.py +0 -0
  65. {matplotlibapi-4.0.1 → matplotlibapi-4.0.3}/tests/test_mcp_server.py +0 -0
  66. {matplotlibapi-4.0.1 → matplotlibapi-4.0.3}/tests/test_pie.py +0 -0
  67. {matplotlibapi-4.0.1 → matplotlibapi-4.0.3}/tests/test_pivot.py +0 -0
  68. {matplotlibapi-4.0.1 → matplotlibapi-4.0.3}/tests/test_sankey.py +0 -0
  69. {matplotlibapi-4.0.1 → matplotlibapi-4.0.3}/tests/test_smoke.py +0 -0
  70. {matplotlibapi-4.0.1 → matplotlibapi-4.0.3}/tests/test_style_template.py +0 -0
  71. {matplotlibapi-4.0.1 → matplotlibapi-4.0.3}/tests/test_sunburst.py +0 -0
  72. {matplotlibapi-4.0.1 → matplotlibapi-4.0.3}/tests/test_table.py +0 -0
  73. {matplotlibapi-4.0.1 → matplotlibapi-4.0.3}/tests/test_timeseries.py +0 -0
  74. {matplotlibapi-4.0.1 → matplotlibapi-4.0.3}/tests/test_treemap.py +0 -0
  75. {matplotlibapi-4.0.1 → matplotlibapi-4.0.3}/tests/test_waffle.py +0 -0
  76. {matplotlibapi-4.0.1 → matplotlibapi-4.0.3}/tests/test_wordcloud.py +0 -0
@@ -14,7 +14,7 @@ jobs:
14
14
  runs-on: ubuntu-latest
15
15
  strategy:
16
16
  matrix:
17
- python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
17
+ python-version: ["3.9", "3.10", "3.11", "3.12"]
18
18
 
19
19
  steps:
20
20
  - uses: actions/checkout@v4
@@ -44,3 +44,6 @@ jobs:
44
44
 
45
45
  - name: Type check with pyright
46
46
  run: pyright src
47
+
48
+ - name: Run tests with coverage
49
+ run: pytest -q --cov=src --cov-report=term-missing --cov-fail-under=70
@@ -1,8 +1,8 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: MatplotLibAPI
3
- Version: 4.0.1
3
+ Version: 4.0.3
4
4
  License-File: LICENSE
5
- Requires-Python: >=3.8
5
+ Requires-Python: >=3.9
6
6
  Requires-Dist: kaleido
7
7
  Requires-Dist: matplotlib
8
8
  Requires-Dist: nbformat
@@ -66,7 +66,7 @@ fig = Bubble(
66
66
  x='gdp_per_capita',
67
67
  y='population',
68
68
  z='population',
69
- ).fplot(title='Country Statistics')
69
+ ).fplot_w(title='Country Statistics')
70
70
 
71
71
  # Display the plot
72
72
  plt.show()
@@ -178,7 +178,7 @@ fig = Bubble(
178
178
  x='gdp_per_capita',
179
179
  y='life_expectancy',
180
180
  z='population',
181
- ).fplot()
181
+ ).fplot_w()
182
182
  fig.show()
183
183
  ```
184
184
 
@@ -195,7 +195,7 @@ graph = NetworkGraph.from_pandas_edgelist(
195
195
  target='city_b',
196
196
  edge_weight_col='distance_km',
197
197
  )
198
- fig = graph.fplot(title='City Network', edge_weight_col='distance_km')
198
+ fig = graph.fplot_w(title='City Network', edge_weight_col='distance_km')
199
199
  fig.show()
200
200
  ```
201
201
 
@@ -39,7 +39,7 @@ fig = Bubble(
39
39
  x='gdp_per_capita',
40
40
  y='population',
41
41
  z='population',
42
- ).fplot(title='Country Statistics')
42
+ ).fplot_w(title='Country Statistics')
43
43
 
44
44
  # Display the plot
45
45
  plt.show()
@@ -151,7 +151,7 @@ fig = Bubble(
151
151
  x='gdp_per_capita',
152
152
  y='life_expectancy',
153
153
  z='population',
154
- ).fplot()
154
+ ).fplot_w()
155
155
  fig.show()
156
156
  ```
157
157
 
@@ -168,7 +168,7 @@ graph = NetworkGraph.from_pandas_edgelist(
168
168
  target='city_b',
169
169
  edge_weight_col='distance_km',
170
170
  )
171
- fig = graph.fplot(title='City Network', edge_weight_col='distance_km')
171
+ fig = graph.fplot_w(title='City Network', edge_weight_col='distance_km')
172
172
  fig.show()
173
173
  ```
174
174
 
@@ -0,0 +1,42 @@
1
+ """
2
+ Example module for network graph sample data generation and plotting.
3
+
4
+ This module provides functions to generate and plot sample network data for testing.
5
+ """
6
+
7
+ import sys
8
+ from pathlib import Path
9
+ from matplotlib.figure import Figure
10
+ import pandas as pd
11
+
12
+ sys.path.insert(0, str(Path(__file__).resolve().parents[1] / "src"))
13
+ from MatplotLibAPI.bubble import Bubble
14
+
15
+
16
+ def generate_sample_data() -> pd.DataFrame:
17
+ """Generate and save sample data for a bubble chart."""
18
+ data = {
19
+ "country": ["USA", "China", "India", "Brazil", "Nigeria"],
20
+ "population": [331, 1441, 1393, 213, 206], # in millions
21
+ "gdp_per_capita": [63593, 10500, 2191, 7741, 2229],
22
+ "age": [62, 45, 35, 42, 30],
23
+ }
24
+ df = pd.DataFrame(data)
25
+ return df
26
+
27
+
28
+ def plot_sample_data() -> Figure:
29
+ """Load a sample DataFrame for testing."""
30
+
31
+ pd_df = generate_sample_data()
32
+ o_plot = Bubble(
33
+ pd_df=pd_df, label="country", x="population", y="gdp_per_capita", z="age"
34
+ )
35
+ plot_fig = o_plot.fplot(title="Bubble Graph")
36
+
37
+ return plot_fig
38
+
39
+
40
+ if __name__ == "__main__":
41
+ plot_fig = plot_sample_data()
42
+ plot_fig.show()
@@ -10,9 +10,10 @@ from matplotlib.figure import Figure
10
10
  import pandas as pd
11
11
 
12
12
  sys.path.insert(0, str(Path(__file__).resolve().parents[1] / "src"))
13
+ from MatplotLibAPI.network import NetworkGraph
13
14
 
14
15
 
15
- def generate_sample_network_data() -> pd.DataFrame:
16
+ def generate_sample_data() -> pd.DataFrame:
16
17
  """Generate and save sample data for a network graph."""
17
18
  data = {
18
19
  "city_a": ["New York", "London", "Tokyo", "Sydney", "New York"],
@@ -23,11 +24,10 @@ def generate_sample_network_data() -> pd.DataFrame:
23
24
  return df
24
25
 
25
26
 
26
- def plot_sample_network_data() -> Figure:
27
+ def plot_sample_data() -> Figure:
27
28
  """Load a sample DataFrame for testing."""
28
- from MatplotLibAPI.network import NetworkGraph
29
29
 
30
- pd_df = generate_sample_network_data()
30
+ pd_df = generate_sample_data()
31
31
  graph = NetworkGraph.from_pandas_edgelist(
32
32
  pd_df, source="city_a", target="city_b", edge_weight_col="distance_km"
33
33
  )
@@ -37,5 +37,5 @@ def plot_sample_network_data() -> Figure:
37
37
 
38
38
 
39
39
  if __name__ == "__main__":
40
- plot_fig = plot_sample_network_data()
40
+ plot_fig = plot_sample_data()
41
41
  plot_fig.show()
@@ -6,25 +6,16 @@ import pandas as pd
6
6
 
7
7
  def generate_bubble_data():
8
8
  """Generate and save sample data for a bubble chart."""
9
- data = {
10
- "country": ["USA", "China", "India", "Brazil", "Nigeria"],
11
- "population": [331, 1441, 1393, 213, 206], # in millions
12
- "gdp_per_capita": [63593, 10500, 2191, 7741, 2229],
13
- "continent": ["North America", "Asia", "Asia", "South America", "Africa"],
14
- }
15
- df = pd.DataFrame(data)
16
- df.to_csv("data/bubble.csv", index=False)
9
+ from .bubble import generate_sample_data
10
+
11
+ generate_sample_data().to_csv("data/bubble.csv", index=False)
17
12
 
18
13
 
19
14
  def generate_network_data():
20
15
  """Generate and save sample data for a network graph."""
21
- data = {
22
- "city_a": ["New York", "London", "Tokyo", "Sydney", "New York"],
23
- "city_b": ["London", "Tokyo", "Sydney", "New York", "Tokyo"],
24
- "distance_km": [5585, 9562, 7824, 16027, 10850],
25
- }
26
- df = pd.DataFrame(data)
27
- df.to_csv("data/network.csv", index=False)
16
+ from .network import generate_sample_data
17
+
18
+ generate_sample_data().to_csv("data/network.csv", index=False)
28
19
 
29
20
 
30
21
  def generate_pivot_data():
@@ -3,9 +3,9 @@ requires = ["hatchling"]
3
3
  build-backend = "hatchling.build"
4
4
  [project]
5
5
  name = "MatplotLibAPI"
6
- version = "4.0.1"
6
+ version = "4.0.3"
7
7
  readme = "README.md"
8
- requires-python = ">=3.8"
8
+ requires-python = ">=3.9"
9
9
  dependencies = [
10
10
  "pandas",
11
11
  "matplotlib",
@@ -0,0 +1,6 @@
1
+ """Public API and pandas accessor for MatplotLibAPI."""
2
+
3
+ from .accessor import DataFrameAccessor
4
+ from .types import CorrelationMethod
5
+
6
+ __all__ = ["DataFrameAccessor", "CorrelationMethod"]