xlin 0.1.34__tar.gz → 0.1.35__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: xlin
3
- Version: 0.1.34
3
+ Version: 0.1.35
4
4
  Summary: toolbox for LinXueyuan
5
5
  License: MIT
6
6
  Author: LinXueyuanStdio
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "xlin"
3
- version = "0.1.34"
3
+ version = "0.1.35"
4
4
  description = "toolbox for LinXueyuan"
5
5
  authors = ["LinXueyuanStdio <23211526+LinXueyuanStdio@users.noreply.github.com>"]
6
6
  license = "MIT"
@@ -108,9 +108,9 @@ Kurtosis: {float((data - mean).mean()**4 / std**4):.4f}\
108
108
 
109
109
  # 显示图形
110
110
  plt.tight_layout()
111
- plt.show()
112
111
  if fig_save_path is not None:
113
112
  plt.savefig(fig_save_path, dpi=300)
113
+ plt.show()
114
114
 
115
115
 
116
116
  def draw_preds_labels(preds: list[str], labels: list[str], title="Pred and Label Class Distribution", fig_save_path: Optional[str]=None):
@@ -159,9 +159,9 @@ def draw_preds_labels(preds: list[str], labels: list[str], title="Pred and Label
159
159
  plt.suptitle(title)
160
160
 
161
161
  plt.tight_layout()
162
- plt.show()
163
162
  if fig_save_path is not None:
164
163
  plt.savefig(fig_save_path, dpi=300)
164
+ plt.show()
165
165
 
166
166
 
167
167
  def generate_classification_report(predictions: List[str], labels: List[str]) -> dict:
@@ -328,4 +328,9 @@ if __name__ == "__main__":
328
328
  preds = ["cat", "dog", "cat", "dog", "extra1", "extra2"]
329
329
  truth = ["cat", "cat", "dog", "dog", "dog", "dog"]
330
330
 
331
- print_classification_report(preds, truth)
331
+ print_classification_report(preds, truth)
332
+
333
+ import random
334
+
335
+ lengths = [random.randint(0, 100) for _ in range(100)]
336
+ draw_histogram(lengths, bins=50, title="Length Distribution", fig_save_path="length_distribution.png")
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