byzh-core 0.0.9.3__tar.gz → 0.0.9.5__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 (31) hide show
  1. {byzh_core-0.0.9.3 → byzh_core-0.0.9.5}/PKG-INFO +1 -1
  2. {byzh_core-0.0.9.3 → byzh_core-0.0.9.5}/byzh/core/Brecorder/record2d.py +11 -6
  3. {byzh_core-0.0.9.3 → byzh_core-0.0.9.5}/byzh_core.egg-info/PKG-INFO +1 -1
  4. {byzh_core-0.0.9.3 → byzh_core-0.0.9.5}/LICENSE +0 -0
  5. {byzh_core-0.0.9.3 → byzh_core-0.0.9.5}/README.md +0 -0
  6. {byzh_core-0.0.9.3 → byzh_core-0.0.9.5}/byzh/core/B_os.py +0 -0
  7. {byzh_core-0.0.9.3 → byzh_core-0.0.9.5}/byzh/core/Barchive/__init__.py +0 -0
  8. {byzh_core-0.0.9.3 → byzh_core-0.0.9.5}/byzh/core/Barchive/archive.py +0 -0
  9. {byzh_core-0.0.9.3 → byzh_core-0.0.9.5}/byzh/core/Brecorder/__init__.py +0 -0
  10. {byzh_core-0.0.9.3 → byzh_core-0.0.9.5}/byzh/core/Brecorder/record1d.py +0 -0
  11. {byzh_core-0.0.9.3 → byzh_core-0.0.9.5}/byzh/core/Btable/__init__.py +0 -0
  12. {byzh_core-0.0.9.3 → byzh_core-0.0.9.5}/byzh/core/Btable/auto_table.py +0 -0
  13. {byzh_core-0.0.9.3 → byzh_core-0.0.9.5}/byzh/core/Bterminal/__init__.py +0 -0
  14. {byzh_core-0.0.9.3 → byzh_core-0.0.9.5}/byzh/core/Bterminal/cmd.py +0 -0
  15. {byzh_core-0.0.9.3 → byzh_core-0.0.9.5}/byzh/core/Bterminal/run_func.py +0 -0
  16. {byzh_core-0.0.9.3 → byzh_core-0.0.9.5}/byzh/core/Btqdm/__init__.py +0 -0
  17. {byzh_core-0.0.9.3 → byzh_core-0.0.9.5}/byzh/core/Btqdm/my_tqdm.py +0 -0
  18. {byzh_core-0.0.9.3 → byzh_core-0.0.9.5}/byzh/core/Butils/__init__.py +0 -0
  19. {byzh_core-0.0.9.3 → byzh_core-0.0.9.5}/byzh/core/Butils/decorator.py +0 -0
  20. {byzh_core-0.0.9.3 → byzh_core-0.0.9.5}/byzh/core/Butils/text_style.py +0 -0
  21. {byzh_core-0.0.9.3 → byzh_core-0.0.9.5}/byzh/core/Butils/timer.py +0 -0
  22. {byzh_core-0.0.9.3 → byzh_core-0.0.9.5}/byzh/core/Bwriter/__init__.py +0 -0
  23. {byzh_core-0.0.9.3 → byzh_core-0.0.9.5}/byzh/core/Bwriter/writer.py +0 -0
  24. {byzh_core-0.0.9.3 → byzh_core-0.0.9.5}/byzh/core/__init__.py +0 -0
  25. {byzh_core-0.0.9.3 → byzh_core-0.0.9.5}/byzh_core.egg-info/SOURCES.txt +0 -0
  26. {byzh_core-0.0.9.3 → byzh_core-0.0.9.5}/byzh_core.egg-info/dependency_links.txt +0 -0
  27. {byzh_core-0.0.9.3 → byzh_core-0.0.9.5}/byzh_core.egg-info/entry_points.txt +0 -0
  28. {byzh_core-0.0.9.3 → byzh_core-0.0.9.5}/byzh_core.egg-info/requires.txt +0 -0
  29. {byzh_core-0.0.9.3 → byzh_core-0.0.9.5}/byzh_core.egg-info/top_level.txt +0 -0
  30. {byzh_core-0.0.9.3 → byzh_core-0.0.9.5}/setup.cfg +0 -0
  31. {byzh_core-0.0.9.3 → byzh_core-0.0.9.5}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: byzh-core
3
- Version: 0.0.9.3
3
+ Version: 0.0.9.5
4
4
  Summary: byzh-core是byzh系列的核心库,包含了一些常用的工具函数和类。
5
5
  Author: byzh_rc
6
6
  License: MIT
@@ -1,12 +1,13 @@
1
1
  import pandas as pd
2
2
  from typing import Literal
3
3
 
4
- # from .. import B_os
5
- from byzh.core import B_os
4
+ from .. import B_os
5
+ # from byzh.core import B_os
6
6
 
7
7
  class B_Record2d:
8
- def __init__(self, csv_path, mode:Literal["w", "a"]="w"):
8
+ def __init__(self, csv_path, mode:Literal["w", "a", "r"]="r"):
9
9
  self.csv_path = csv_path
10
+ self.mode = mode
10
11
 
11
12
  B_os.makedirs(csv_path)
12
13
  self.data = pd.DataFrame()
@@ -15,6 +16,8 @@ class B_Record2d:
15
16
  self.__read()
16
17
  elif mode == "a":
17
18
  self.__read()
19
+ elif mode == "r":
20
+ self.__read()
18
21
 
19
22
  # 支持 recorder[row, col] 访问
20
23
  def __getitem__(self, key):
@@ -28,6 +31,8 @@ class B_Record2d:
28
31
 
29
32
  # 支持 recorder[row, col] = value
30
33
  def __setitem__(self, key, value):
34
+ assert self.mode!="r", "不允许读模式下赋值"
35
+
31
36
  if isinstance(key, tuple) and len(key) == 2: # 赋值操作
32
37
  row, col = key
33
38
  row, col, value = str(row), str(col), str(value)
@@ -74,10 +79,10 @@ class B_Record2d:
74
79
  return float(self[row, col])
75
80
 
76
81
  def get_bool(self, row, col) -> bool:
77
- result = self[row, col]
78
- if result in ("True", "true", "1"):
82
+ result = self.get_str(row, col)
83
+ if result.lower() in ("true", "1"):
79
84
  return True
80
- elif result in ("False", "false", "0"):
85
+ elif result.lower() in ("false", "0"):
81
86
  return False
82
87
  else:
83
88
  raise ValueError(f"无法转换为布尔值 -> {result}")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: byzh-core
3
- Version: 0.0.9.3
3
+ Version: 0.0.9.5
4
4
  Summary: byzh-core是byzh系列的核心库,包含了一些常用的工具函数和类。
5
5
  Author: byzh_rc
6
6
  License: MIT
File without changes
File without changes
File without changes
File without changes