tascpy 0.1.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.
Files changed (170) hide show
  1. tascpy-0.1.0/LICENSE +21 -0
  2. tascpy-0.1.0/MANIFEST.in +6 -0
  3. tascpy-0.1.0/PKG-INFO +224 -0
  4. tascpy-0.1.0/README.md +188 -0
  5. tascpy-0.1.0/examples/README.md +336 -0
  6. tascpy-0.1.0/examples/advance/01_outlier_analysis_visualization.py +514 -0
  7. tascpy-0.1.0/examples/advance/README.md +178 -0
  8. tascpy-0.1.0/examples/advance/imgs/cleaned_data_trend.png +0 -0
  9. tascpy-0.1.0/examples/advance/imgs/edge_handling_outlier_comparison.png +0 -0
  10. tascpy-0.1.0/examples/advance/imgs/outlier_removal_effect.png +0 -0
  11. tascpy-0.1.0/examples/advance/imgs/outlier_visualization_comparison.png +0 -0
  12. tascpy-0.1.0/examples/basic/01_create_collection.py +155 -0
  13. tascpy-0.1.0/examples/basic/02_data_access.py +140 -0
  14. tascpy-0.1.0/examples/basic/03_column_operations.py +159 -0
  15. tascpy-0.1.0/examples/basic/04_select_operations.py +216 -0
  16. tascpy-0.1.0/examples/basic/05_math_operations.py +192 -0
  17. tascpy-0.1.0/examples/basic/06_filter_search.py +284 -0
  18. tascpy-0.1.0/examples/basic/07_interpolate.py +370 -0
  19. tascpy-0.1.0/examples/basic/08_transform.py +390 -0
  20. tascpy-0.1.0/examples/basic/09_visualization.py +623 -0
  21. tascpy-0.1.0/examples/basic/10_column_combine.py +233 -0
  22. tascpy-0.1.0/examples/basic/11_stats_operations.py +327 -0
  23. tascpy-0.1.0/examples/basic/README.md +391 -0
  24. tascpy-0.1.0/examples/basic/imgs/combine_example.png +0 -0
  25. tascpy-0.1.0/examples/basic/imgs/stats_example.png +0 -0
  26. tascpy-0.1.0/examples/data/README.md +97 -0
  27. tascpy-0.1.0/examples/data/create_load_displacement_sample.py +0 -0
  28. tascpy-0.1.0/examples/data/load_displacement_sample.csv +54 -0
  29. tascpy-0.1.0/examples/data/sample.csv +9 -0
  30. tascpy-0.1.0/examples/domains/README.md +385 -0
  31. tascpy-0.1.0/examples/domains/coordinate/00_coordinate_initialization.py +190 -0
  32. tascpy-0.1.0/examples/domains/coordinate/01_coordinate_visualization_basic.py +144 -0
  33. tascpy-0.1.0/examples/domains/coordinate/02_coordinate_visualization_advanced.py +248 -0
  34. tascpy-0.1.0/examples/domains/coordinate/03_coordinate_timeseries.py +293 -0
  35. tascpy-0.1.0/examples/domains/coordinate/03_coordinate_visualization_timeseries.py +243 -0
  36. tascpy-0.1.0/examples/domains/coordinate/04_coordinate_axis_visualization.py +192 -0
  37. tascpy-0.1.0/examples/domains/coordinate/imgs/coordinate_3d_surface.png +0 -0
  38. tascpy-0.1.0/examples/domains/coordinate/imgs/coordinate_contour.png +0 -0
  39. tascpy-0.1.0/examples/domains/coordinate/imgs/coordinate_distance_matrix.png +0 -0
  40. tascpy-0.1.0/examples/domains/coordinate/imgs/coordinate_gradient_field.png +0 -0
  41. tascpy-0.1.0/examples/domains/coordinate/imgs/coordinate_heatmap.png +0 -0
  42. tascpy-0.1.0/examples/domains/coordinate/imgs/coordinate_positions.png +0 -0
  43. tascpy-0.1.0/examples/domains/coordinate/imgs/coordinate_scatter.png +0 -0
  44. tascpy-0.1.0/examples/domains/coordinate/imgs/coordinate_time_snapshots.png +0 -0
  45. tascpy-0.1.0/examples/domains/coordinate/imgs/coordinate_timeseries.png +0 -0
  46. tascpy-0.1.0/examples/domains/coordinate/imgs/coordinate_vector_field.png +0 -0
  47. tascpy-0.1.0/examples/domains/coordinate/imgs/selected_sensors_temperature.png +0 -0
  48. tascpy-0.1.0/examples/domains/coordinate/imgs/temperature_x_axis_reversed.png +0 -0
  49. tascpy-0.1.0/examples/domains/coordinate/imgs/x_axis_temperature_bar.png +0 -0
  50. tascpy-0.1.0/examples/domains/coordinate/imgs/x_axis_temperature_line.png +0 -0
  51. tascpy-0.1.0/examples/domains/coordinate/imgs/x_axis_temperature_scatter.png +0 -0
  52. tascpy-0.1.0/examples/domains/imgs/cumulative_curve.png +0 -0
  53. tascpy-0.1.0/examples/domains/imgs/load_displacement_analysis.png +0 -0
  54. tascpy-0.1.0/examples/domains/imgs/load_displacement_basic.png +0 -0
  55. tascpy-0.1.0/examples/domains/imgs/load_displacement_report.png +0 -0
  56. tascpy-0.1.0/examples/domains/imgs/multiple_special_curves.png +0 -0
  57. tascpy-0.1.0/examples/domains/imgs/plot_basic.png +0 -0
  58. tascpy-0.1.0/examples/domains/imgs/plot_customized.png +0 -0
  59. tascpy-0.1.0/examples/domains/imgs/plot_offset_yield.png +0 -0
  60. tascpy-0.1.0/examples/domains/imgs/plot_yield_comparison.png +0 -0
  61. tascpy-0.1.0/examples/domains/imgs/plot_yield_details.png +0 -0
  62. tascpy-0.1.0/examples/domains/imgs/skeleton_curve.png +0 -0
  63. tascpy-0.1.0/examples/domains/imgs/special_curves_comparison.png +0 -0
  64. tascpy-0.1.0/examples/domains/imgs/yield_elastic_large_offset.png +0 -0
  65. tascpy-0.1.0/examples/domains/imgs/yield_elastic_small_offset.png +0 -0
  66. tascpy-0.1.0/examples/domains/imgs/yield_linear_offset_failed.png +0 -0
  67. tascpy-0.1.0/examples/domains/imgs/yield_no_intersection_failed.png +0 -0
  68. tascpy-0.1.0/examples/domains/imgs/yield_normal_general.png +0 -0
  69. tascpy-0.1.0/examples/domains/imgs/yield_normal_offset.png +0 -0
  70. tascpy-0.1.0/examples/domains/load_displacement/01_load_displacement_domain.py +448 -0
  71. tascpy-0.1.0/examples/domains/load_displacement/02_load_displacement_special_curves.py +241 -0
  72. tascpy-0.1.0/examples/domains/load_displacement/03_yield_point_calculation.py +680 -0
  73. tascpy-0.1.0/examples/domains/load_displacement/imgs/cumulative_curve.png +0 -0
  74. tascpy-0.1.0/examples/domains/load_displacement/imgs/load_displacement_basic.png +0 -0
  75. tascpy-0.1.0/examples/domains/load_displacement/imgs/multiple_special_curves.png +0 -0
  76. tascpy-0.1.0/examples/domains/load_displacement/imgs/plot_yield_comparison.png +0 -0
  77. tascpy-0.1.0/examples/domains/load_displacement/imgs/skeleton_curve.png +0 -0
  78. tascpy-0.1.0/examples/domains/load_displacement/imgs/special_curves_comparison.png +0 -0
  79. tascpy-0.1.0/examples/domains/load_displacement/imgs/yield_elastic_large_offset.png +0 -0
  80. tascpy-0.1.0/examples/domains/load_displacement/imgs/yield_elastic_small_offset.png +0 -0
  81. tascpy-0.1.0/examples/domains/load_displacement/imgs/yield_linear_offset_failed.png +0 -0
  82. tascpy-0.1.0/examples/domains/load_displacement/imgs/yield_no_intersection_failed.png +0 -0
  83. tascpy-0.1.0/examples/domains/load_displacement/imgs/yield_normal_general.png +0 -0
  84. tascpy-0.1.0/examples/domains/load_displacement/imgs/yield_normal_offset.png +0 -0
  85. tascpy-0.1.0/examples/jupyter/README.md +116 -0
  86. tascpy-0.1.0/pyproject.toml +3 -0
  87. tascpy-0.1.0/requirements.txt +4 -0
  88. tascpy-0.1.0/setup.cfg +4 -0
  89. tascpy-0.1.0/setup.py +40 -0
  90. tascpy-0.1.0/src/tascpy/__init__.py +33 -0
  91. tascpy-0.1.0/src/tascpy/domains/__init__.py +0 -0
  92. tascpy-0.1.0/src/tascpy/domains/converters.py +458 -0
  93. tascpy-0.1.0/src/tascpy/domains/coordinate.py +266 -0
  94. tascpy-0.1.0/src/tascpy/domains/factory.py +76 -0
  95. tascpy-0.1.0/src/tascpy/domains/load_displacement.py +270 -0
  96. tascpy-0.1.0/src/tascpy/experiment.py +108 -0
  97. tascpy-0.1.0/src/tascpy/operations/__init__.py +26 -0
  98. tascpy-0.1.0/src/tascpy/operations/__pycache__/__init__.cpython-312.pyc +0 -0
  99. tascpy-0.1.0/src/tascpy/operations/__pycache__/list_proxy.cpython-312.pyc +0 -0
  100. tascpy-0.1.0/src/tascpy/operations/__pycache__/proxy.cpython-312.pyc +0 -0
  101. tascpy-0.1.0/src/tascpy/operations/__pycache__/registry.cpython-312.pyc +0 -0
  102. tascpy-0.1.0/src/tascpy/operations/__pycache__/stub_generator.cpython-312.pyc +0 -0
  103. tascpy-0.1.0/src/tascpy/operations/coordinate/__init__.py +8 -0
  104. tascpy-0.1.0/src/tascpy/operations/coordinate/__pycache__/__init__.cpython-312.pyc +0 -0
  105. tascpy-0.1.0/src/tascpy/operations/coordinate/__pycache__/basic.cpython-312.pyc +0 -0
  106. tascpy-0.1.0/src/tascpy/operations/coordinate/__pycache__/distance.cpython-312.pyc +0 -0
  107. tascpy-0.1.0/src/tascpy/operations/coordinate/__pycache__/interpolation.cpython-312.pyc +0 -0
  108. tascpy-0.1.0/src/tascpy/operations/coordinate/__pycache__/plot.cpython-312.pyc +0 -0
  109. tascpy-0.1.0/src/tascpy/operations/coordinate/basic.py +140 -0
  110. tascpy-0.1.0/src/tascpy/operations/coordinate/distance.py +289 -0
  111. tascpy-0.1.0/src/tascpy/operations/coordinate/interpolation.py +479 -0
  112. tascpy-0.1.0/src/tascpy/operations/coordinate/plot.py +1397 -0
  113. tascpy-0.1.0/src/tascpy/operations/core/__init__.py +22 -0
  114. tascpy-0.1.0/src/tascpy/operations/core/__pycache__/__init__.cpython-312.pyc +0 -0
  115. tascpy-0.1.0/src/tascpy/operations/core/__pycache__/combine.cpython-312.pyc +0 -0
  116. tascpy-0.1.0/src/tascpy/operations/core/__pycache__/filters.cpython-312.pyc +0 -0
  117. tascpy-0.1.0/src/tascpy/operations/core/__pycache__/interpolate.cpython-312.pyc +0 -0
  118. tascpy-0.1.0/src/tascpy/operations/core/__pycache__/math.cpython-312.pyc +0 -0
  119. tascpy-0.1.0/src/tascpy/operations/core/__pycache__/plot.cpython-312.pyc +0 -0
  120. tascpy-0.1.0/src/tascpy/operations/core/__pycache__/search.cpython-312.pyc +0 -0
  121. tascpy-0.1.0/src/tascpy/operations/core/__pycache__/select.cpython-312.pyc +0 -0
  122. tascpy-0.1.0/src/tascpy/operations/core/__pycache__/split.cpython-312.pyc +0 -0
  123. tascpy-0.1.0/src/tascpy/operations/core/__pycache__/stats.cpython-312.pyc +0 -0
  124. tascpy-0.1.0/src/tascpy/operations/core/__pycache__/transform.cpython-312.pyc +0 -0
  125. tascpy-0.1.0/src/tascpy/operations/core/combine.py +525 -0
  126. tascpy-0.1.0/src/tascpy/operations/core/filters.py +311 -0
  127. tascpy-0.1.0/src/tascpy/operations/core/interpolate.py +299 -0
  128. tascpy-0.1.0/src/tascpy/operations/core/math.py +829 -0
  129. tascpy-0.1.0/src/tascpy/operations/core/plot.py +303 -0
  130. tascpy-0.1.0/src/tascpy/operations/core/search.py +328 -0
  131. tascpy-0.1.0/src/tascpy/operations/core/select.py +228 -0
  132. tascpy-0.1.0/src/tascpy/operations/core/split.py +71 -0
  133. tascpy-0.1.0/src/tascpy/operations/core/stats.py +212 -0
  134. tascpy-0.1.0/src/tascpy/operations/core/transform.py +762 -0
  135. tascpy-0.1.0/src/tascpy/operations/list_proxy.py +161 -0
  136. tascpy-0.1.0/src/tascpy/operations/load_displacement/__init__.py +10 -0
  137. tascpy-0.1.0/src/tascpy/operations/load_displacement/__pycache__/__init__.cpython-312.pyc +0 -0
  138. tascpy-0.1.0/src/tascpy/operations/load_displacement/__pycache__/analysis.cpython-312.pyc +0 -0
  139. tascpy-0.1.0/src/tascpy/operations/load_displacement/__pycache__/curves.cpython-312.pyc +0 -0
  140. tascpy-0.1.0/src/tascpy/operations/load_displacement/__pycache__/cycles.cpython-312.pyc +0 -0
  141. tascpy-0.1.0/src/tascpy/operations/load_displacement/__pycache__/plot.cpython-312.pyc +0 -0
  142. tascpy-0.1.0/src/tascpy/operations/load_displacement/__pycache__/utils.cpython-312.pyc +0 -0
  143. tascpy-0.1.0/src/tascpy/operations/load_displacement/analysis.py +642 -0
  144. tascpy-0.1.0/src/tascpy/operations/load_displacement/curves.py +620 -0
  145. tascpy-0.1.0/src/tascpy/operations/load_displacement/cycles.py +113 -0
  146. tascpy-0.1.0/src/tascpy/operations/load_displacement/plot.py +554 -0
  147. tascpy-0.1.0/src/tascpy/operations/load_displacement/utils.py +103 -0
  148. tascpy-0.1.0/src/tascpy/operations/proxy.py +148 -0
  149. tascpy-0.1.0/src/tascpy/operations/registry.py +359 -0
  150. tascpy-0.1.0/src/tascpy/operations/stub_generator.py +646 -0
  151. tascpy-0.1.0/src/tascpy/plugins/load_displacement.py +411 -0
  152. tascpy-0.1.0/src/tascpy/py.typed +0 -0
  153. tascpy-0.1.0/src/tascpy/typing/__init__.py +21 -0
  154. tascpy-0.1.0/src/tascpy/typing/coordinate.py +1504 -0
  155. tascpy-0.1.0/src/tascpy/typing/core.py +1257 -0
  156. tascpy-0.1.0/src/tascpy/typing/list_proxy.py +93 -0
  157. tascpy-0.1.0/src/tascpy/typing/load_displacement.py +1733 -0
  158. tascpy-0.1.0/src/tascpy/typing/proxy_base.py +27 -0
  159. tascpy-0.1.0/src/tascpy/typing/stubs.py +27 -0
  160. tascpy-0.1.0/src/tascpy/utils/__init__.py +0 -0
  161. tascpy-0.1.0/src/tascpy/utils/conversion.py +20 -0
  162. tascpy-0.1.0/src/tascpy/utils/data.py +681 -0
  163. tascpy-0.1.0/src/tascpy/utils/operation_decorator.py +21 -0
  164. tascpy-0.1.0/src/tascpy/utils/plot.py +208 -0
  165. tascpy-0.1.0/src/tascpy/utils/split.py +191 -0
  166. tascpy-0.1.0/src/tascpy.egg-info/PKG-INFO +224 -0
  167. tascpy-0.1.0/src/tascpy.egg-info/SOURCES.txt +168 -0
  168. tascpy-0.1.0/src/tascpy.egg-info/dependency_links.txt +1 -0
  169. tascpy-0.1.0/src/tascpy.egg-info/requires.txt +4 -0
  170. tascpy-0.1.0/src/tascpy.egg-info/top_level.txt +1 -0
tascpy-0.1.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 toru_inaba
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,6 @@
1
+ include LICENSE
2
+ include README.md
3
+ include requirements.txt
4
+ recursive-include src/tascpy/typing *
5
+ recursive-include src/tascpy/operations *
6
+ recursive-include examples *
tascpy-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,224 @@
1
+ Metadata-Version: 2.4
2
+ Name: tascpy
3
+ Version: 0.1.0
4
+ Summary: タスク計測データ処理用のPythonライブラリ
5
+ Home-page: https://github.com/toruinaba/tascpy
6
+ Author: toru_inaba
7
+ Author-email: example@example.com
8
+ License: MIT
9
+ Classifier: Development Status :: 3 - Alpha
10
+ Classifier: Intended Audience :: Science/Research
11
+ Classifier: License :: OSI Approved :: MIT License
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: Programming Language :: Python :: 3.8
14
+ Classifier: Programming Language :: Python :: 3.9
15
+ Classifier: Programming Language :: Python :: 3.10
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Topic :: Scientific/Engineering
18
+ Requires-Python: >=3.8
19
+ Description-Content-Type: text/markdown
20
+ License-File: LICENSE
21
+ Requires-Dist: numpy
22
+ Requires-Dist: matplotlib
23
+ Requires-Dist: japanize-matplotlib
24
+ Requires-Dist: setuptools
25
+ Dynamic: author
26
+ Dynamic: author-email
27
+ Dynamic: classifier
28
+ Dynamic: description
29
+ Dynamic: description-content-type
30
+ Dynamic: home-page
31
+ Dynamic: license
32
+ Dynamic: license-file
33
+ Dynamic: requires-dist
34
+ Dynamic: requires-python
35
+ Dynamic: summary
36
+
37
+ # tascpy
38
+
39
+ [![Python Version](https://img.shields.io/badge/python-3.8%2B-blue)](https://www.python.org/downloads/)
40
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
41
+ [![Version](https://img.shields.io/badge/version-0.1.0-green)](https://github.com/toruinaba/tascpy)
42
+
43
+ **tascpy** は、計測アプリケーション「tasc」などから出力される計測データの分析・可視化を効率的に行うための Python ライブラリです。直感的なインターフェースと強力なデータ処理機能を備え、メソッドチェーン形式で複雑な操作を簡潔に記述できます。
44
+
45
+ ## 主な特徴
46
+
47
+ - **メソッドチェーンによる流れるような操作**:複数のデータ処理ステップを連続して記述できます
48
+ - **イミュータブルなデータ操作**:元のデータを変更せず、常に新しいデータセットを生成します
49
+ - **ドメイン特化機能**:荷重-変位データや座標データなど、特定の分析領域に特化した機能を提供します
50
+ - **柔軟なデータ選択**:列名、行インデックス、ステップ値などによる多彩な選択操作をサポートします
51
+ - **高度な数学的処理**:数値演算、補間、正規化など様々な数学的操作を提供します
52
+ - **直感的な可視化**:Matplotlib と連携した簡単かつ高度なデータ可視化機能があります
53
+ - **型ヒントと自動補完**:VSCode などの IDE で自動補完や型チェックを完全サポートします
54
+
55
+ ## インストール方法
56
+
57
+ ### pip からのインストール
58
+
59
+ ```bash
60
+ pip install tascpy
61
+ ```
62
+
63
+ ### ソースからのインストール
64
+
65
+ ```bash
66
+ git clone https://github.com/toruinaba/tascpy.git
67
+ cd tascpy
68
+ pip install -e .
69
+ ```
70
+
71
+ ## 使用例
72
+
73
+ ### 基本的な使い方
74
+
75
+ ```python
76
+ import tascpy
77
+ from tascpy.core.collection import ColumnCollection
78
+
79
+ # CSVファイルからデータを読み込む
80
+ collection = ColumnCollection.from_file(
81
+ filepath="data.csv",
82
+ format_name="csv",
83
+ auto_detect_types=True
84
+ )
85
+
86
+ # データ処理のチェーンメソッド
87
+ result = (
88
+ collection.ops
89
+ .select(columns=["Force", "Displacement"]) # 必要な列を選択
90
+ .filter_by_value("Force", lambda x: x > 0) # 正の荷重値のみ選択
91
+ .add("Force", 10, result_column="AdjustedForce") # 新しい列を作成
92
+ .divide("AdjustedForce", "Displacement", result_column="Stiffness") # 剛性計算
93
+ .end() # チェーンを終了して結果を取得
94
+ )
95
+
96
+ # 結果の表示
97
+ print(f"処理後のデータ: {len(result)} 行 × {len(result.columns)} 列")
98
+ print(f"最大剛性: {result['Stiffness'].max():.2f}")
99
+ ```
100
+
101
+ ### 荷重-変位ドメインの分析
102
+
103
+ ```python
104
+ # 荷重-変位ドメインへの変換
105
+ ld_collection = collection.ops.as_domain(
106
+ "load_displacement",
107
+ load_column="Force",
108
+ displacement_column="Displacement"
109
+ ).end()
110
+
111
+ # 降伏点の計算
112
+ yield_result = (
113
+ ld_collection.ops
114
+ .calculate_stiffness(range_start=0.1, range_end=0.5, result_column="Stiffness")
115
+ .calculate_yield_point(method="offset", offset_ratio=0.002) # 0.2%オフセット法
116
+ .end()
117
+ )
118
+
119
+ # 結果の表示
120
+ print(f"降伏荷重: {yield_result['YieldPoint_Load'].values[0]:.2f} kN")
121
+ print(f"降伏変位: {yield_result['YieldPoint_Displacement'].values[0]:.2f} mm")
122
+ ```
123
+
124
+ ### 可視化の例
125
+
126
+ ```python
127
+ import matplotlib.pyplot as plt
128
+
129
+ # 散布図と線グラフの作成
130
+ fig, ax = plt.subplots(figsize=(10, 6))
131
+
132
+ (
133
+ collection.ops
134
+ .select(columns=["Displacement", "Force"])
135
+ .plot(
136
+ x_column="Displacement",
137
+ y_column="Force",
138
+ plot_type="scatter",
139
+ label="測定データ",
140
+ ax=ax,
141
+ marker="o",
142
+ alpha=0.7
143
+ )
144
+ .end()
145
+ )
146
+
147
+ plt.title("荷重-変位関係")
148
+ plt.xlabel("変位 (mm)")
149
+ plt.ylabel("荷重 (kN)")
150
+ plt.grid(True)
151
+ plt.legend()
152
+ plt.tight_layout()
153
+ plt.show()
154
+ ```
155
+
156
+ ## ドキュメント
157
+
158
+ より詳細なドキュメントとサンプルについては、以下を参照してください:
159
+
160
+ - [基本サンプル集](./examples/basic/README.md) - 基本的な操作と使用例
161
+ - [高度なサンプル](./examples/advance/README.md) - 異常値分析など高度な分析テクニック
162
+ - [ドメイン特化機能](./examples/domains/README.md) - 荷重-変位分析や座標データ処理の例
163
+ - [開発者ガイド](./docs/developer_guide.md) - tascpy の拡張や独自ドメインの開発方法
164
+
165
+ ## 動作環境
166
+
167
+ - Python 3.8 以上
168
+ - 依存ライブラリ:
169
+ - numpy
170
+ - pandas
171
+ - matplotlib
172
+ - scipy
173
+ - japanize-matplotlib (オプション・日本語フォントサポート用)
174
+
175
+ ## スタブファイル生成
176
+
177
+ tascpy のチェーンメソッドは動的に登録されるため、IDE の自動補完を有効にするにはスタブファイルの生成が必要です。初回インポート時に自動生成されますが、手動で実行することも可能です:
178
+
179
+ ```python
180
+ # スタブファイルの手動生成
181
+ from tascpy.operations.stub_generator import generate_stubs
182
+ generate_stubs()
183
+ ```
184
+
185
+ 環境変数でスタブ生成を制御できます:
186
+
187
+ ```python
188
+ import os
189
+ os.environ["TASCPY_GENERATE_STUBS"] = "0" # スタブ生成を無効化
190
+ import tascpy # スタブは生成されません
191
+ ```
192
+
193
+ ## プロジェクト構造
194
+
195
+ ```
196
+ tascpy/
197
+ ├── src/
198
+ │ └── tascpy/
199
+ │ ├── core/ # 基本データ構造
200
+ │ ├── domains/ # ドメイン特化コレクション
201
+ │ ├── operations/ # データ処理操作
202
+ │ └── plugins/ # プラグイン
203
+ ├── tests/ # テストコード
204
+ ├── examples/ # サンプルコード
205
+ ├── docs/ # ドキュメント
206
+ ```
207
+
208
+ ## ライセンス
209
+
210
+ MIT ライセンスの下で公開されています。詳細は [LICENSE](./LICENSE) ファイルを参照してください。
211
+
212
+ ## コントリビューション
213
+
214
+ バグ報告や機能リクエスト、プルリクエストなど、あらゆる形での貢献を歓迎します。詳細は [CONTRIBUTING.md](./CONTRIBUTING.md) を参照してください。
215
+
216
+ ## 著者
217
+
218
+ - Toru Inaba ([@toruinaba](https://github.com/toruinaba)) - 初期開発者
219
+
220
+ ## 謝辞
221
+
222
+ このライブラリの開発にあたり、ご協力いただいたすべての方々に感謝します。
223
+
224
+ このプロジェクトは GitHub Copilot を全面的に活用して開発されています。AI アシスタントによるコード生成とリファクタリングが、開発効率の向上と品質の維持に大きく貢献しています。
tascpy-0.1.0/README.md ADDED
@@ -0,0 +1,188 @@
1
+ # tascpy
2
+
3
+ [![Python Version](https://img.shields.io/badge/python-3.8%2B-blue)](https://www.python.org/downloads/)
4
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
5
+ [![Version](https://img.shields.io/badge/version-0.1.0-green)](https://github.com/toruinaba/tascpy)
6
+
7
+ **tascpy** は、計測アプリケーション「tasc」などから出力される計測データの分析・可視化を効率的に行うための Python ライブラリです。直感的なインターフェースと強力なデータ処理機能を備え、メソッドチェーン形式で複雑な操作を簡潔に記述できます。
8
+
9
+ ## 主な特徴
10
+
11
+ - **メソッドチェーンによる流れるような操作**:複数のデータ処理ステップを連続して記述できます
12
+ - **イミュータブルなデータ操作**:元のデータを変更せず、常に新しいデータセットを生成します
13
+ - **ドメイン特化機能**:荷重-変位データや座標データなど、特定の分析領域に特化した機能を提供します
14
+ - **柔軟なデータ選択**:列名、行インデックス、ステップ値などによる多彩な選択操作をサポートします
15
+ - **高度な数学的処理**:数値演算、補間、正規化など様々な数学的操作を提供します
16
+ - **直感的な可視化**:Matplotlib と連携した簡単かつ高度なデータ可視化機能があります
17
+ - **型ヒントと自動補完**:VSCode などの IDE で自動補完や型チェックを完全サポートします
18
+
19
+ ## インストール方法
20
+
21
+ ### pip からのインストール
22
+
23
+ ```bash
24
+ pip install tascpy
25
+ ```
26
+
27
+ ### ソースからのインストール
28
+
29
+ ```bash
30
+ git clone https://github.com/toruinaba/tascpy.git
31
+ cd tascpy
32
+ pip install -e .
33
+ ```
34
+
35
+ ## 使用例
36
+
37
+ ### 基本的な使い方
38
+
39
+ ```python
40
+ import tascpy
41
+ from tascpy.core.collection import ColumnCollection
42
+
43
+ # CSVファイルからデータを読み込む
44
+ collection = ColumnCollection.from_file(
45
+ filepath="data.csv",
46
+ format_name="csv",
47
+ auto_detect_types=True
48
+ )
49
+
50
+ # データ処理のチェーンメソッド
51
+ result = (
52
+ collection.ops
53
+ .select(columns=["Force", "Displacement"]) # 必要な列を選択
54
+ .filter_by_value("Force", lambda x: x > 0) # 正の荷重値のみ選択
55
+ .add("Force", 10, result_column="AdjustedForce") # 新しい列を作成
56
+ .divide("AdjustedForce", "Displacement", result_column="Stiffness") # 剛性計算
57
+ .end() # チェーンを終了して結果を取得
58
+ )
59
+
60
+ # 結果の表示
61
+ print(f"処理後のデータ: {len(result)} 行 × {len(result.columns)} 列")
62
+ print(f"最大剛性: {result['Stiffness'].max():.2f}")
63
+ ```
64
+
65
+ ### 荷重-変位ドメインの分析
66
+
67
+ ```python
68
+ # 荷重-変位ドメインへの変換
69
+ ld_collection = collection.ops.as_domain(
70
+ "load_displacement",
71
+ load_column="Force",
72
+ displacement_column="Displacement"
73
+ ).end()
74
+
75
+ # 降伏点の計算
76
+ yield_result = (
77
+ ld_collection.ops
78
+ .calculate_stiffness(range_start=0.1, range_end=0.5, result_column="Stiffness")
79
+ .calculate_yield_point(method="offset", offset_ratio=0.002) # 0.2%オフセット法
80
+ .end()
81
+ )
82
+
83
+ # 結果の表示
84
+ print(f"降伏荷重: {yield_result['YieldPoint_Load'].values[0]:.2f} kN")
85
+ print(f"降伏変位: {yield_result['YieldPoint_Displacement'].values[0]:.2f} mm")
86
+ ```
87
+
88
+ ### 可視化の例
89
+
90
+ ```python
91
+ import matplotlib.pyplot as plt
92
+
93
+ # 散布図と線グラフの作成
94
+ fig, ax = plt.subplots(figsize=(10, 6))
95
+
96
+ (
97
+ collection.ops
98
+ .select(columns=["Displacement", "Force"])
99
+ .plot(
100
+ x_column="Displacement",
101
+ y_column="Force",
102
+ plot_type="scatter",
103
+ label="測定データ",
104
+ ax=ax,
105
+ marker="o",
106
+ alpha=0.7
107
+ )
108
+ .end()
109
+ )
110
+
111
+ plt.title("荷重-変位関係")
112
+ plt.xlabel("変位 (mm)")
113
+ plt.ylabel("荷重 (kN)")
114
+ plt.grid(True)
115
+ plt.legend()
116
+ plt.tight_layout()
117
+ plt.show()
118
+ ```
119
+
120
+ ## ドキュメント
121
+
122
+ より詳細なドキュメントとサンプルについては、以下を参照してください:
123
+
124
+ - [基本サンプル集](./examples/basic/README.md) - 基本的な操作と使用例
125
+ - [高度なサンプル](./examples/advance/README.md) - 異常値分析など高度な分析テクニック
126
+ - [ドメイン特化機能](./examples/domains/README.md) - 荷重-変位分析や座標データ処理の例
127
+ - [開発者ガイド](./docs/developer_guide.md) - tascpy の拡張や独自ドメインの開発方法
128
+
129
+ ## 動作環境
130
+
131
+ - Python 3.8 以上
132
+ - 依存ライブラリ:
133
+ - numpy
134
+ - pandas
135
+ - matplotlib
136
+ - scipy
137
+ - japanize-matplotlib (オプション・日本語フォントサポート用)
138
+
139
+ ## スタブファイル生成
140
+
141
+ tascpy のチェーンメソッドは動的に登録されるため、IDE の自動補完を有効にするにはスタブファイルの生成が必要です。初回インポート時に自動生成されますが、手動で実行することも可能です:
142
+
143
+ ```python
144
+ # スタブファイルの手動生成
145
+ from tascpy.operations.stub_generator import generate_stubs
146
+ generate_stubs()
147
+ ```
148
+
149
+ 環境変数でスタブ生成を制御できます:
150
+
151
+ ```python
152
+ import os
153
+ os.environ["TASCPY_GENERATE_STUBS"] = "0" # スタブ生成を無効化
154
+ import tascpy # スタブは生成されません
155
+ ```
156
+
157
+ ## プロジェクト構造
158
+
159
+ ```
160
+ tascpy/
161
+ ├── src/
162
+ │ └── tascpy/
163
+ │ ├── core/ # 基本データ構造
164
+ │ ├── domains/ # ドメイン特化コレクション
165
+ │ ├── operations/ # データ処理操作
166
+ │ └── plugins/ # プラグイン
167
+ ├── tests/ # テストコード
168
+ ├── examples/ # サンプルコード
169
+ ├── docs/ # ドキュメント
170
+ ```
171
+
172
+ ## ライセンス
173
+
174
+ MIT ライセンスの下で公開されています。詳細は [LICENSE](./LICENSE) ファイルを参照してください。
175
+
176
+ ## コントリビューション
177
+
178
+ バグ報告や機能リクエスト、プルリクエストなど、あらゆる形での貢献を歓迎します。詳細は [CONTRIBUTING.md](./CONTRIBUTING.md) を参照してください。
179
+
180
+ ## 著者
181
+
182
+ - Toru Inaba ([@toruinaba](https://github.com/toruinaba)) - 初期開発者
183
+
184
+ ## 謝辞
185
+
186
+ このライブラリの開発にあたり、ご協力いただいたすべての方々に感謝します。
187
+
188
+ このプロジェクトは GitHub Copilot を全面的に活用して開発されています。AI アシスタントによるコード生成とリファクタリングが、開発効率の向上と品質の維持に大きく貢献しています。