pyroid 0.3.0__tar.gz → 0.7.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 (213) hide show
  1. {pyroid-0.3.0 → pyroid-0.7.0}/.github/workflows/publish.yml +43 -2
  2. pyroid-0.7.0/.github/workflows/tests.yml +72 -0
  3. {pyroid-0.3.0 → pyroid-0.7.0}/.gitignore +2 -1
  4. {pyroid-0.3.0 → pyroid-0.7.0}/Cargo.lock +62 -1
  5. {pyroid-0.3.0 → pyroid-0.7.0}/Cargo.toml +4 -1
  6. {pyroid-0.3.0 → pyroid-0.7.0}/PKG-INFO +38 -5
  7. {pyroid-0.3.0 → pyroid-0.7.0}/README.md +37 -4
  8. pyroid-0.7.0/ci-requirements.txt +4 -0
  9. pyroid-0.7.0/docs/github_actions_workflow.md +65 -0
  10. {pyroid-0.3.0 → pyroid-0.7.0}/docs/index.md +34 -0
  11. pyroid-0.7.0/docs/performance_comparison.md +277 -0
  12. pyroid-0.7.0/docs/rust_tests.md +223 -0
  13. pyroid-0.7.0/pyproject.toml +42 -0
  14. pyroid-0.7.0/python/benchmark_dataframe.py +212 -0
  15. pyroid-0.7.0/python/benchmark_rust_vs_python.py +251 -0
  16. pyroid-0.7.0/python/check_implementation.py +152 -0
  17. pyroid-0.7.0/python/example.py +158 -0
  18. pyroid-0.7.0/python/expected_rust_performance.py +195 -0
  19. pyroid-0.7.0/python/inspect_module.py +40 -0
  20. pyroid-0.7.0/python/pyroid/__init__.py +97 -0
  21. pyroid-0.7.0/python/pyroid/async_impl.py +317 -0
  22. pyroid-0.7.0/python/pyroid/async_ops.py +41 -0
  23. pyroid-0.7.0/python/pyroid/core/__init__.py +59 -0
  24. pyroid-0.7.0/python/pyroid/core.py +174 -0
  25. pyroid-0.7.0/python/pyroid/core_impl.py +178 -0
  26. pyroid-0.7.0/python/pyroid/data/__init__.py +41 -0
  27. pyroid-0.7.0/python/pyroid/data.py +62 -0
  28. pyroid-0.7.0/python/pyroid/data_impl.py +214 -0
  29. pyroid-0.7.0/python/pyroid/image/basic/__init__.py +31 -0
  30. pyroid-0.7.0/python/pyroid/image.py +54 -0
  31. pyroid-0.7.0/python/pyroid/image_impl.py +215 -0
  32. pyroid-0.7.0/python/pyroid/io/__init__.py +44 -0
  33. pyroid-0.7.0/python/pyroid/io.py +67 -0
  34. pyroid-0.7.0/python/pyroid/io_impl.py +186 -0
  35. pyroid-0.7.0/python/pyroid/math/__init__.py +56 -0
  36. pyroid-0.7.0/python/pyroid/math.py +99 -0
  37. pyroid-0.7.0/python/pyroid/math_impl.py +302 -0
  38. pyroid-0.7.0/python/pyroid/ml/basic/__init__.py +34 -0
  39. pyroid-0.7.0/python/pyroid/ml.py +59 -0
  40. pyroid-0.7.0/python/pyroid/ml_impl.py +315 -0
  41. pyroid-0.7.0/python/pyroid/text/__init__.py +51 -0
  42. pyroid-0.7.0/python/pyroid/text.py +72 -0
  43. pyroid-0.7.0/python/pyroid/text_impl.py +175 -0
  44. pyroid-0.7.0/python/run_tests.py +129 -0
  45. pyroid-0.7.0/python/test_import.py +39 -0
  46. pyroid-0.7.0/python/tests/test_async.py +246 -0
  47. pyroid-0.7.0/python/tests/test_async_impl.py +198 -0
  48. pyroid-0.7.0/python/tests/test_core.py +45 -0
  49. pyroid-0.7.0/python/tests/test_data.py +103 -0
  50. pyroid-0.7.0/python/tests/test_data_impl.py +167 -0
  51. pyroid-0.7.0/python/tests/test_image.py +164 -0
  52. pyroid-0.7.0/python/tests/test_image_impl.py +189 -0
  53. pyroid-0.7.0/python/tests/test_io.py +185 -0
  54. pyroid-0.7.0/python/tests/test_io_impl.py +137 -0
  55. pyroid-0.7.0/python/tests/test_math.py +120 -0
  56. pyroid-0.7.0/python/tests/test_math_impl.py +172 -0
  57. pyroid-0.7.0/python/tests/test_ml.py +218 -0
  58. pyroid-0.7.0/python/tests/test_ml_impl.py +209 -0
  59. pyroid-0.7.0/python/tests/test_python_impl.py +105 -0
  60. pyroid-0.7.0/python/tests/test_text.py +93 -0
  61. pyroid-0.7.0/python/tests/test_text_impl.py +172 -0
  62. {pyroid-0.3.0 → pyroid-0.7.0}/setup.py +1 -1
  63. {pyroid-0.3.0 → pyroid-0.7.0}/src/async_ops.rs +2 -2
  64. {pyroid-0.3.0 → pyroid-0.7.0}/src/lib.rs +32 -1
  65. pyroid-0.7.0/tests/common/mod.rs +894 -0
  66. pyroid-0.7.0/tests/test_core.rs +56 -0
  67. pyroid-0.7.0/tests/test_data.rs +184 -0
  68. pyroid-0.7.0/tests/test_math.rs +129 -0
  69. pyroid-0.7.0/tests/test_ml.rs +170 -0
  70. pyroid-0.7.0/tests/test_rust_core.rs +66 -0
  71. pyroid-0.7.0/tests/test_rust_data.rs +184 -0
  72. pyroid-0.7.0/tests/test_rust_image.rs +177 -0
  73. pyroid-0.7.0/tests/test_rust_impl.rs +169 -0
  74. pyroid-0.7.0/tests/test_rust_io.rs +83 -0
  75. pyroid-0.7.0/tests/test_rust_math.rs +128 -0
  76. pyroid-0.7.0/tests/test_rust_text.rs +216 -0
  77. pyroid-0.7.0/tests/test_text.rs +214 -0
  78. pyroid-0.3.0/.github/workflows/semantic-release.yml +0 -100
  79. pyroid-0.3.0/pyproject.toml +0 -78
  80. pyroid-0.3.0/python/pyroid/__init__.py +0 -147
  81. pyroid-0.3.0/python/pyroid/core/__init__.py +0 -103
  82. pyroid-0.3.0/python/pyroid/data/__init__.py +0 -99
  83. pyroid-0.3.0/python/pyroid/image/basic/__init__.py +0 -133
  84. pyroid-0.3.0/python/pyroid/io/__init__.py +0 -139
  85. pyroid-0.3.0/python/pyroid/math/__init__.py +0 -141
  86. pyroid-0.3.0/python/pyroid/ml/basic/__init__.py +0 -254
  87. pyroid-0.3.0/python/pyroid/text/__init__.py +0 -127
  88. {pyroid-0.3.0 → pyroid-0.7.0}/benchmarks/README.md +0 -0
  89. {pyroid-0.3.0 → pyroid-0.7.0}/benchmarks/__init__.py +0 -0
  90. {pyroid-0.3.0 → pyroid-0.7.0}/benchmarks/core/__init__.py +0 -0
  91. {pyroid-0.3.0 → pyroid-0.7.0}/benchmarks/core/benchmark.py +0 -0
  92. {pyroid-0.3.0 → pyroid-0.7.0}/benchmarks/core/reporter.py +0 -0
  93. {pyroid-0.3.0 → pyroid-0.7.0}/benchmarks/core/visualizer.py +0 -0
  94. {pyroid-0.3.0 → pyroid-0.7.0}/benchmarks/dashboard/dashboard.html +0 -0
  95. {pyroid-0.3.0 → pyroid-0.7.0}/benchmarks/dashboard/images/implementation_comparison_linear.html +0 -0
  96. {pyroid-0.3.0 → pyroid-0.7.0}/benchmarks/dashboard/images/implementation_comparison_linear.png +0 -0
  97. {pyroid-0.3.0 → pyroid-0.7.0}/benchmarks/dashboard/images/implementation_comparison_log.html +0 -0
  98. {pyroid-0.3.0 → pyroid-0.7.0}/benchmarks/dashboard/images/implementation_comparison_log.png +0 -0
  99. {pyroid-0.3.0 → pyroid-0.7.0}/benchmarks/dashboard/images/performance_metrics.html +0 -0
  100. {pyroid-0.3.0 → pyroid-0.7.0}/benchmarks/dashboard/images/performance_metrics.png +0 -0
  101. {pyroid-0.3.0 → pyroid-0.7.0}/benchmarks/dashboard/images/real_world_scenarios.html +0 -0
  102. {pyroid-0.3.0 → pyroid-0.7.0}/benchmarks/dashboard/images/real_world_scenarios.png +0 -0
  103. {pyroid-0.3.0 → pyroid-0.7.0}/benchmarks/dashboard/images/scaling_base.html +0 -0
  104. {pyroid-0.3.0 → pyroid-0.7.0}/benchmarks/dashboard/images/scaling_base.png +0 -0
  105. {pyroid-0.3.0 → pyroid-0.7.0}/benchmarks/dashboard/images/scaling_filter.html +0 -0
  106. {pyroid-0.3.0 → pyroid-0.7.0}/benchmarks/dashboard/images/scaling_filter.png +0 -0
  107. {pyroid-0.3.0 → pyroid-0.7.0}/benchmarks/dashboard/images/scaling_map.html +0 -0
  108. {pyroid-0.3.0 → pyroid-0.7.0}/benchmarks/dashboard/images/scaling_map.png +0 -0
  109. {pyroid-0.3.0 → pyroid-0.7.0}/benchmarks/dashboard/images/scaling_matrix_multiply.html +0 -0
  110. {pyroid-0.3.0 → pyroid-0.7.0}/benchmarks/dashboard/images/scaling_matrix_multiply.png +0 -0
  111. {pyroid-0.3.0 → pyroid-0.7.0}/benchmarks/dashboard/images/scaling_mean.html +0 -0
  112. {pyroid-0.3.0 → pyroid-0.7.0}/benchmarks/dashboard/images/scaling_mean.png +0 -0
  113. {pyroid-0.3.0 → pyroid-0.7.0}/benchmarks/dashboard/images/scaling_reduce.html +0 -0
  114. {pyroid-0.3.0 → pyroid-0.7.0}/benchmarks/dashboard/images/scaling_reduce.png +0 -0
  115. {pyroid-0.3.0 → pyroid-0.7.0}/benchmarks/dashboard/images/scaling_regex_replace.html +0 -0
  116. {pyroid-0.3.0 → pyroid-0.7.0}/benchmarks/dashboard/images/scaling_regex_replace.png +0 -0
  117. {pyroid-0.3.0 → pyroid-0.7.0}/benchmarks/dashboard/images/scaling_sort.html +0 -0
  118. {pyroid-0.3.0 → pyroid-0.7.0}/benchmarks/dashboard/images/scaling_sort.png +0 -0
  119. {pyroid-0.3.0 → pyroid-0.7.0}/benchmarks/dashboard/images/scaling_std.html +0 -0
  120. {pyroid-0.3.0 → pyroid-0.7.0}/benchmarks/dashboard/images/scaling_std.png +0 -0
  121. {pyroid-0.3.0 → pyroid-0.7.0}/benchmarks/dashboard/images/scaling_sum.html +0 -0
  122. {pyroid-0.3.0 → pyroid-0.7.0}/benchmarks/dashboard/images/scaling_sum.png +0 -0
  123. {pyroid-0.3.0 → pyroid-0.7.0}/benchmarks/dashboard/images/scaling_text_cleanup.html +0 -0
  124. {pyroid-0.3.0 → pyroid-0.7.0}/benchmarks/dashboard/images/scaling_text_cleanup.png +0 -0
  125. {pyroid-0.3.0 → pyroid-0.7.0}/benchmarks/dashboard/images/speedup_comparison.html +0 -0
  126. {pyroid-0.3.0 → pyroid-0.7.0}/benchmarks/dashboard/images/speedup_comparison.png +0 -0
  127. {pyroid-0.3.0 → pyroid-0.7.0}/benchmarks/demo.py +0 -0
  128. {pyroid-0.3.0 → pyroid-0.7.0}/benchmarks/results/results.json +0 -0
  129. {pyroid-0.3.0 → pyroid-0.7.0}/benchmarks/results/results.md +0 -0
  130. {pyroid-0.3.0 → pyroid-0.7.0}/benchmarks/run_benchmarks.py +0 -0
  131. {pyroid-0.3.0 → pyroid-0.7.0}/benchmarks/suites/__init__.py +0 -0
  132. {pyroid-0.3.0 → pyroid-0.7.0}/benchmarks/suites/async_benchmarks.py +0 -0
  133. {pyroid-0.3.0 → pyroid-0.7.0}/benchmarks/suites/data_benchmarks.py +0 -0
  134. {pyroid-0.3.0 → pyroid-0.7.0}/benchmarks/suites/math_benchmarks.py +0 -0
  135. {pyroid-0.3.0 → pyroid-0.7.0}/benchmarks/suites/scenarios/__init__.py +0 -0
  136. {pyroid-0.3.0 → pyroid-0.7.0}/benchmarks/suites/scenarios/data_pipeline.py +0 -0
  137. {pyroid-0.3.0 → pyroid-0.7.0}/benchmarks/suites/scenarios/high_throughput.py +0 -0
  138. {pyroid-0.3.0 → pyroid-0.7.0}/benchmarks/suites/scenarios/scientific_computing.py +0 -0
  139. {pyroid-0.3.0 → pyroid-0.7.0}/benchmarks/suites/scenarios/text_processing.py +0 -0
  140. {pyroid-0.3.0 → pyroid-0.7.0}/benchmarks/suites/scenarios/web_scraping.py +0 -0
  141. {pyroid-0.3.0 → pyroid-0.7.0}/benchmarks/suites/string_benchmarks.py +0 -0
  142. {pyroid-0.3.0 → pyroid-0.7.0}/build.rs +0 -0
  143. {pyroid-0.3.0 → pyroid-0.7.0}/build_and_install.py +0 -0
  144. {pyroid-0.3.0 → pyroid-0.7.0}/dev-requirements.txt +0 -0
  145. {pyroid-0.3.0 → pyroid-0.7.0}/docs/api/dataframe_ops.md +0 -0
  146. {pyroid-0.3.0 → pyroid-0.7.0}/docs/api/image_ops.md +0 -0
  147. {pyroid-0.3.0 → pyroid-0.7.0}/docs/api/index.md +0 -0
  148. {pyroid-0.3.0 → pyroid-0.7.0}/docs/api/io_ops.md +0 -0
  149. {pyroid-0.3.0 → pyroid-0.7.0}/docs/api/ml_ops.md +0 -0
  150. {pyroid-0.3.0 → pyroid-0.7.0}/docs/api/text_nlp_ops.md +0 -0
  151. {pyroid-0.3.0 → pyroid-0.7.0}/docs/guides/getting_started.md +0 -0
  152. {pyroid-0.3.0 → pyroid-0.7.0}/docs/guides/index.md +0 -0
  153. {pyroid-0.3.0 → pyroid-0.7.0}/docs/guides/performance.md +0 -0
  154. {pyroid-0.3.0 → pyroid-0.7.0}/examples/async_examples.py +0 -0
  155. {pyroid-0.3.0 → pyroid-0.7.0}/examples/data_examples.py +0 -0
  156. {pyroid-0.3.0 → pyroid-0.7.0}/examples/dataframe_examples.py +0 -0
  157. {pyroid-0.3.0 → pyroid-0.7.0}/examples/image_examples.py +0 -0
  158. {pyroid-0.3.0 → pyroid-0.7.0}/examples/io_examples.py +0 -0
  159. {pyroid-0.3.0 → pyroid-0.7.0}/examples/math_examples.py +0 -0
  160. {pyroid-0.3.0 → pyroid-0.7.0}/examples/ml_examples.py +0 -0
  161. {pyroid-0.3.0 → pyroid-0.7.0}/examples/optimized_async_example.py +0 -0
  162. {pyroid-0.3.0 → pyroid-0.7.0}/examples/requirements.txt +0 -0
  163. {pyroid-0.3.0 → pyroid-0.7.0}/examples/string_examples.py +0 -0
  164. {pyroid-0.3.0 → pyroid-0.7.0}/examples/test_async_file.txt +0 -0
  165. {pyroid-0.3.0 → pyroid-0.7.0}/examples/text_nlp_examples.py +0 -0
  166. {pyroid-0.3.0 → pyroid-0.7.0}/python/__init__.py +0 -0
  167. {pyroid-0.3.0 → pyroid-0.7.0}/python/pyroid/async_bridge.py +0 -0
  168. {pyroid-0.3.0 → pyroid-0.7.0}/python/pyroid/async_helpers.py +0 -0
  169. {pyroid-0.3.0 → pyroid-0.7.0}/python/pyroid/core/buffer.py +0 -0
  170. {pyroid-0.3.0 → pyroid-0.7.0}/python/pyroid/core/parallel.py +0 -0
  171. {pyroid-0.3.0 → pyroid-0.7.0}/python/pyroid/core/runtime.py +0 -0
  172. {pyroid-0.3.0 → pyroid-0.7.0}/python/pyroid/image/__init__.py +0 -0
  173. {pyroid-0.3.0 → pyroid-0.7.0}/python/pyroid/math/stats.py +0 -0
  174. {pyroid-0.3.0 → pyroid-0.7.0}/python/pyroid/ml/__init__.py +0 -0
  175. {pyroid-0.3.0 → pyroid-0.7.0}/python/pyroid/string/__init__.py +0 -0
  176. {pyroid-0.3.0 → pyroid-0.7.0}/python/tests/__init__.py +0 -0
  177. {pyroid-0.3.0 → pyroid-0.7.0}/python/tests/test_basic.py +0 -0
  178. {pyroid-0.3.0 → pyroid-0.7.0}/src/core/buffer.rs +0 -0
  179. {pyroid-0.3.0 → pyroid-0.7.0}/src/core/config.rs +0 -0
  180. {pyroid-0.3.0 → pyroid-0.7.0}/src/core/conversion.rs +0 -0
  181. {pyroid-0.3.0 → pyroid-0.7.0}/src/core/error.rs +0 -0
  182. {pyroid-0.3.0 → pyroid-0.7.0}/src/core/mod.rs +0 -0
  183. {pyroid-0.3.0 → pyroid-0.7.0}/src/core/parallel.rs +0 -0
  184. {pyroid-0.3.0 → pyroid-0.7.0}/src/core/runtime.rs +0 -0
  185. {pyroid-0.3.0 → pyroid-0.7.0}/src/core/types.rs +0 -0
  186. {pyroid-0.3.0 → pyroid-0.7.0}/src/data/collections.rs +0 -0
  187. {pyroid-0.3.0 → pyroid-0.7.0}/src/data/dataframe.rs +0 -0
  188. {pyroid-0.3.0 → pyroid-0.7.0}/src/data/mod.rs +0 -0
  189. {pyroid-0.3.0 → pyroid-0.7.0}/src/data_ops.rs +0 -0
  190. {pyroid-0.3.0 → pyroid-0.7.0}/src/dataframe_ops.rs +0 -0
  191. {pyroid-0.3.0 → pyroid-0.7.0}/src/image/basic.rs +0 -0
  192. {pyroid-0.3.0 → pyroid-0.7.0}/src/image/mod.rs +0 -0
  193. {pyroid-0.3.0 → pyroid-0.7.0}/src/image_ops.rs +0 -0
  194. {pyroid-0.3.0 → pyroid-0.7.0}/src/io/async_io.rs +0 -0
  195. {pyroid-0.3.0 → pyroid-0.7.0}/src/io/file.rs +0 -0
  196. {pyroid-0.3.0 → pyroid-0.7.0}/src/io/mod.rs +0 -0
  197. {pyroid-0.3.0 → pyroid-0.7.0}/src/io/network.rs +0 -0
  198. {pyroid-0.3.0 → pyroid-0.7.0}/src/io_ops.rs +0 -0
  199. {pyroid-0.3.0 → pyroid-0.7.0}/src/math/matrix.rs +0 -0
  200. {pyroid-0.3.0 → pyroid-0.7.0}/src/math/mod.rs +0 -0
  201. {pyroid-0.3.0 → pyroid-0.7.0}/src/math/stats.rs +0 -0
  202. {pyroid-0.3.0 → pyroid-0.7.0}/src/math/vector.rs +0 -0
  203. {pyroid-0.3.0 → pyroid-0.7.0}/src/math_ops.rs +0 -0
  204. {pyroid-0.3.0 → pyroid-0.7.0}/src/ml/basic.rs +0 -0
  205. {pyroid-0.3.0 → pyroid-0.7.0}/src/ml/mod.rs +0 -0
  206. {pyroid-0.3.0 → pyroid-0.7.0}/src/ml_ops.rs +0 -0
  207. {pyroid-0.3.0 → pyroid-0.7.0}/src/string_ops.rs +0 -0
  208. {pyroid-0.3.0 → pyroid-0.7.0}/src/text/mod.rs +0 -0
  209. {pyroid-0.3.0 → pyroid-0.7.0}/src/text_nlp_ops.rs +0 -0
  210. {pyroid-0.3.0 → pyroid-0.7.0}/src/utils/conversions.rs +0 -0
  211. {pyroid-0.3.0 → pyroid-0.7.0}/src/utils/mod.rs +0 -0
  212. {pyroid-0.3.0 → pyroid-0.7.0}/test_async_file.txt +0 -0
  213. {pyroid-0.3.0 → pyroid-0.7.0}/test_pyroid.py +0 -0
@@ -4,8 +4,6 @@ on:
4
4
  push:
5
5
  tags:
6
6
  - "v*"
7
- repository_dispatch:
8
- types: [publish-pypi]
9
7
  workflow_dispatch:
10
8
  inputs:
11
9
  version:
@@ -119,6 +117,49 @@ jobs:
119
117
  runs-on: ubuntu-latest
120
118
  needs: [linux, windows, macos, sdist]
121
119
  steps:
120
+ - uses: actions/checkout@v4
121
+
122
+ - name: Extract version from tag
123
+ id: get_version
124
+ run: |
125
+ # Extract version from tag (remove 'v' prefix)
126
+ if [[ $GITHUB_REF == refs/tags/v* ]]; then
127
+ VERSION=${GITHUB_REF#refs/tags/v}
128
+ echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
129
+ echo "Extracted version: $VERSION from tag"
130
+ elif [[ -n "${{ github.event.inputs.version }}" ]]; then
131
+ VERSION=${{ github.event.inputs.version }}
132
+ echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
133
+ echo "Using manually provided version: $VERSION"
134
+ else
135
+ echo "No version found in tag or inputs"
136
+ exit 1
137
+ fi
138
+
139
+ - name: Update version in files
140
+ run: |
141
+ VERSION="${{ steps.get_version.outputs.VERSION }}"
142
+ echo "Updating version to $VERSION in all files"
143
+
144
+ # Update pyproject.toml
145
+ sed -i "s/^version = \"[0-9]*\.[0-9]*\.[0-9]*\"/version = \"$VERSION\"/" pyproject.toml
146
+
147
+ # Update Cargo.toml
148
+ sed -i "s/^version = \"[0-9]*\.[0-9]*\.[0-9]*\"/version = \"$VERSION\"/" Cargo.toml
149
+
150
+ # Update python/pyroid/__init__.py
151
+ sed -i "s/__version__ = \"[0-9]*\.[0-9]*\.[0-9]*\"/__version__ = \"$VERSION\"/" python/pyroid/__init__.py
152
+
153
+ # Update setup.py
154
+ sed -i "s/version=\"[0-9]*\.[0-9]*\.[0-9]*\"/version=\"$VERSION\"/" setup.py
155
+
156
+ # Verify updates
157
+ echo "Updated versions:"
158
+ echo "pyproject.toml: $(grep -m 1 "version" pyproject.toml)"
159
+ echo "Cargo.toml: $(grep -m 1 "version" Cargo.toml)"
160
+ echo "python/pyroid/__init__.py: $(grep -m 1 "__version__" python/pyroid/__init__.py)"
161
+ echo "setup.py: $(grep -m 1 "version" setup.py)"
162
+
122
163
  - uses: actions/download-artifact@v4
123
164
  with:
124
165
  merge-multiple: true
@@ -0,0 +1,72 @@
1
+ name: Tests
2
+
3
+ on:
4
+ push:
5
+ pull_request:
6
+ branches: [ main ]
7
+
8
+ jobs:
9
+ rust-tests:
10
+ name: Rust Tests on ${{ matrix.os }}
11
+ runs-on: ${{ matrix.os }}
12
+ strategy:
13
+ matrix:
14
+ os: [ubuntu-latest, windows-latest, macos-latest]
15
+
16
+ steps:
17
+ - uses: actions/checkout@v3
18
+
19
+ - name: Set up Rust
20
+ uses: actions-rs/toolchain@v1
21
+ with:
22
+ toolchain: stable
23
+ profile: minimal
24
+ override: true
25
+
26
+ - name: Install Rust dependencies
27
+ run: |
28
+ cargo --version
29
+
30
+ # Install additional dependencies if needed
31
+ if [ "${{ matrix.os }}" = "ubuntu-latest" ]; then
32
+ sudo apt-get update
33
+ sudo apt-get install -y libssl-dev
34
+ fi
35
+
36
+ - name: Run Rust tests
37
+ run: |
38
+ # Run all Rust tests with verbose output
39
+ cargo test --test test_rust_* -- --nocapture
40
+
41
+ # If any test fails, print more detailed information
42
+ if [ $? -ne 0 ]; then
43
+ echo "Rust tests failed. Running with backtrace enabled..."
44
+ RUST_BACKTRACE=1 cargo test --test test_rust_*
45
+ exit 1
46
+ fi
47
+
48
+ python-tests:
49
+ name: Python Tests on ${{ matrix.os }}
50
+ runs-on: ${{ matrix.os }}
51
+ strategy:
52
+ matrix:
53
+ os: [ubuntu-latest]
54
+ python-version: ['3.11']
55
+
56
+ steps:
57
+ - uses: actions/checkout@v3
58
+
59
+ - name: Set up Python ${{ matrix.python-version }}
60
+ uses: actions/setup-python@v4
61
+ with:
62
+ python-version: ${{ matrix.python-version }}
63
+
64
+ - name: Install dependencies
65
+ run: |
66
+ python -m pip install --upgrade pip
67
+ pip install pytest numpy
68
+
69
+ - name: Run Python implementation tests
70
+ run: |
71
+ # Run only the implementation tests that don't require the Rust extension
72
+ pytest python/tests/test_*_impl.py -v
@@ -4,4 +4,5 @@ target
4
4
  *.pyo
5
5
  *.pyd
6
6
  .venv
7
- .local
7
+ .local
8
+ .DS_Store
@@ -1042,6 +1042,15 @@ version = "1.11.0"
1042
1042
  source = "registry+https://github.com/rust-lang/crates.io-index"
1043
1043
  checksum = "350e9b48cbc6b0e028b0473b114454c6316e57336ee184ceab6e53f72c178b3e"
1044
1044
 
1045
+ [[package]]
1046
+ name = "ppv-lite86"
1047
+ version = "0.2.21"
1048
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1049
+ checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9"
1050
+ dependencies = [
1051
+ "zerocopy",
1052
+ ]
1053
+
1045
1054
  [[package]]
1046
1055
  name = "proc-macro2"
1047
1056
  version = "1.0.94"
@@ -1130,8 +1139,9 @@ dependencies = [
1130
1139
 
1131
1140
  [[package]]
1132
1141
  name = "pyroid"
1133
- version = "0.3.0"
1142
+ version = "0.7.0"
1134
1143
  dependencies = [
1144
+ "base64",
1135
1145
  "criterion",
1136
1146
  "futures",
1137
1147
  "num_cpus",
@@ -1139,6 +1149,7 @@ dependencies = [
1139
1149
  "pyo3",
1140
1150
  "pyo3-asyncio",
1141
1151
  "pyo3-build-config",
1152
+ "rand",
1142
1153
  "rayon",
1143
1154
  "regex",
1144
1155
  "reqwest",
@@ -1161,6 +1172,36 @@ version = "5.2.0"
1161
1172
  source = "registry+https://github.com/rust-lang/crates.io-index"
1162
1173
  checksum = "74765f6d916ee2faa39bc8e68e4f3ed8949b48cccdac59983d287a7cb71ce9c5"
1163
1174
 
1175
+ [[package]]
1176
+ name = "rand"
1177
+ version = "0.8.5"
1178
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1179
+ checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404"
1180
+ dependencies = [
1181
+ "libc",
1182
+ "rand_chacha",
1183
+ "rand_core",
1184
+ ]
1185
+
1186
+ [[package]]
1187
+ name = "rand_chacha"
1188
+ version = "0.3.1"
1189
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1190
+ checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88"
1191
+ dependencies = [
1192
+ "ppv-lite86",
1193
+ "rand_core",
1194
+ ]
1195
+
1196
+ [[package]]
1197
+ name = "rand_core"
1198
+ version = "0.6.4"
1199
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1200
+ checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c"
1201
+ dependencies = [
1202
+ "getrandom 0.2.15",
1203
+ ]
1204
+
1164
1205
  [[package]]
1165
1206
  name = "rayon"
1166
1207
  version = "1.10.0"
@@ -2051,6 +2092,26 @@ dependencies = [
2051
2092
  "synstructure",
2052
2093
  ]
2053
2094
 
2095
+ [[package]]
2096
+ name = "zerocopy"
2097
+ version = "0.8.25"
2098
+ source = "registry+https://github.com/rust-lang/crates.io-index"
2099
+ checksum = "a1702d9583232ddb9174e01bb7c15a2ab8fb1bc6f227aa1233858c351a3ba0cb"
2100
+ dependencies = [
2101
+ "zerocopy-derive",
2102
+ ]
2103
+
2104
+ [[package]]
2105
+ name = "zerocopy-derive"
2106
+ version = "0.8.25"
2107
+ source = "registry+https://github.com/rust-lang/crates.io-index"
2108
+ checksum = "28a6e20d751156648aa063f3800b706ee209a32c0b4d9f24be3d980b01be55ef"
2109
+ dependencies = [
2110
+ "proc-macro2",
2111
+ "quote",
2112
+ "syn",
2113
+ ]
2114
+
2054
2115
  [[package]]
2055
2116
  name = "zerofrom"
2056
2117
  version = "0.1.6"
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "pyroid"
3
- version = "0.3.0"
3
+ version = "0.7.0"
4
4
  edition = "2021"
5
5
  authors = ["Andrew O", "Pyroid Team"]
6
6
  description = "High-performance Rust functions for Python"
@@ -58,6 +58,9 @@ num_cpus = "1.16.0"
58
58
 
59
59
  [dev-dependencies]
60
60
  criterion = "0.5.1"
61
+ rand = "0.8.5"
62
+ base64 = "0.21.7"
63
+ regex = "1.10.3"
61
64
 
62
65
  # Optimize for size in release mode
63
66
  [profile.release]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyroid
3
- Version: 0.3.0
3
+ Version: 0.7.0
4
4
  Classifier: Programming Language :: Python :: 3
5
5
  Classifier: Programming Language :: Python :: 3.8
6
6
  Classifier: Programming Language :: Python :: 3.9
@@ -24,6 +24,8 @@ Project-URL: Documentation, https://github.com/ao/pyroid/blob/main/README.md
24
24
 
25
25
  # 📌 Pyroid: Python on Rust-Powered Steroids
26
26
 
27
+ [![Tests](https://github.com/ao/pyroid/actions/workflows/tests.yml/badge.svg)](https://github.com/ao/pyroid/actions/workflows/tests.yml)
28
+
27
29
  ⚡ Blazing fast Rust-powered utilities to eliminate Python's performance bottlenecks.
28
30
 
29
31
  ## 🔹 Why Pyroid?
@@ -382,6 +384,10 @@ Pyroid offers significant performance improvements over pure Python:
382
384
  - **Zero-copy buffers**: Efficient memory management without copying
383
385
  - **Parallel processing**: Batch processing with adaptive sizing for optimal performance
384
386
 
387
+ For detailed benchmarks and performance comparisons between Pyroid's Rust implementation and Python alternatives, see our [Performance Comparison](docs/performance_comparison.md) document. Our benchmarks show that Pyroid's Rust implementation can be **up to 15,000x faster** than equivalent Python code for certain operations, with performance advantages that scale dramatically with data size.
388
+
389
+ > **Note**: The Python fallback implementations are provided only for development and testing when the Rust components cannot be built. For production use, the Rust implementation is essential to achieve the performance benefits.
390
+
385
391
  ## Building from Source
386
392
 
387
393
  To build pyroid from source, you need:
@@ -408,26 +414,53 @@ pip install -e .
408
414
 
409
415
  For performance-critical applications, consider using the following optimizations:
410
416
 
411
- 1. **Unified Runtime**: Initialize the runtime once at the start of your application
417
+ 1. **Verify Rust Implementation**: Ensure you're using the high-performance Rust implementation
418
+ ```bash
419
+ python check_implementation.py
420
+ ```
421
+
422
+ 2. **Run Python Tests**: Ensure the Python fallback implementations work correctly
423
+ ```bash
424
+ python run_tests.py
425
+ ```
426
+
427
+ 3. **Run Rust Tests**: Ensure the Rust implementations work correctly
428
+ ```bash
429
+ # Run all Rust tests
430
+ cargo test --test test_rust_*
431
+
432
+ # Or run specific module tests
433
+ cargo test --test test_rust_core # Core functionality tests
434
+ cargo test --test test_rust_math # Math operations tests
435
+ cargo test --test test_rust_data # Data operations tests
436
+ cargo test --test test_rust_text # Text operations tests
437
+ cargo test --test test_rust_io # I/O operations tests
438
+ cargo test --test test_rust_image # Image operations tests
439
+ cargo test --test test_rust_impl # ML operations tests
440
+ ```
441
+
442
+ For detailed information about the Rust tests, see [Rust Tests Documentation](docs/rust_tests.md).
443
+
444
+ 2. **Unified Runtime**: Initialize the runtime once at the start of your application
412
445
  ```python
413
446
  from pyroid.core import runtime
414
447
  runtime.init()
415
448
  ```
416
449
 
417
- 2. **Zero-Copy Buffers**: Use zero-copy buffers for large data transfers
450
+ 3. **Zero-Copy Buffers**: Use zero-copy buffers for large data transfers
418
451
  ```python
419
452
  from pyroid.core import buffer
420
453
  zero_copy_buffer = buffer.ZeroCopyBuffer(size)
421
454
  ```
422
455
 
423
- 3. **Parallel Processing**: Use batch processing for CPU-intensive operations
456
+ 4. **Parallel Processing**: Use batch processing for CPU-intensive operations
424
457
  ```python
425
458
  from pyroid.core import parallel
426
459
  processor = parallel.BatchProcessor(adaptive=True)
427
460
  results = processor.map(items, process_function)
428
461
  ```
429
462
 
430
- 4. **Concurrency Control**: Adjust concurrency levels based on your workload
463
+ 5. **Concurrency Control**: Adjust concurrency levels based on your workload
431
464
  ```python
432
465
  client = pyroid.AsyncClient()
433
466
  responses = await client.fetch_many(urls, concurrency=optimal_value)
@@ -1,5 +1,7 @@
1
1
  # 📌 Pyroid: Python on Rust-Powered Steroids
2
2
 
3
+ [![Tests](https://github.com/ao/pyroid/actions/workflows/tests.yml/badge.svg)](https://github.com/ao/pyroid/actions/workflows/tests.yml)
4
+
3
5
  ⚡ Blazing fast Rust-powered utilities to eliminate Python's performance bottlenecks.
4
6
 
5
7
  ## 🔹 Why Pyroid?
@@ -358,6 +360,10 @@ Pyroid offers significant performance improvements over pure Python:
358
360
  - **Zero-copy buffers**: Efficient memory management without copying
359
361
  - **Parallel processing**: Batch processing with adaptive sizing for optimal performance
360
362
 
363
+ For detailed benchmarks and performance comparisons between Pyroid's Rust implementation and Python alternatives, see our [Performance Comparison](docs/performance_comparison.md) document. Our benchmarks show that Pyroid's Rust implementation can be **up to 15,000x faster** than equivalent Python code for certain operations, with performance advantages that scale dramatically with data size.
364
+
365
+ > **Note**: The Python fallback implementations are provided only for development and testing when the Rust components cannot be built. For production use, the Rust implementation is essential to achieve the performance benefits.
366
+
361
367
  ## Building from Source
362
368
 
363
369
  To build pyroid from source, you need:
@@ -384,26 +390,53 @@ pip install -e .
384
390
 
385
391
  For performance-critical applications, consider using the following optimizations:
386
392
 
387
- 1. **Unified Runtime**: Initialize the runtime once at the start of your application
393
+ 1. **Verify Rust Implementation**: Ensure you're using the high-performance Rust implementation
394
+ ```bash
395
+ python check_implementation.py
396
+ ```
397
+
398
+ 2. **Run Python Tests**: Ensure the Python fallback implementations work correctly
399
+ ```bash
400
+ python run_tests.py
401
+ ```
402
+
403
+ 3. **Run Rust Tests**: Ensure the Rust implementations work correctly
404
+ ```bash
405
+ # Run all Rust tests
406
+ cargo test --test test_rust_*
407
+
408
+ # Or run specific module tests
409
+ cargo test --test test_rust_core # Core functionality tests
410
+ cargo test --test test_rust_math # Math operations tests
411
+ cargo test --test test_rust_data # Data operations tests
412
+ cargo test --test test_rust_text # Text operations tests
413
+ cargo test --test test_rust_io # I/O operations tests
414
+ cargo test --test test_rust_image # Image operations tests
415
+ cargo test --test test_rust_impl # ML operations tests
416
+ ```
417
+
418
+ For detailed information about the Rust tests, see [Rust Tests Documentation](docs/rust_tests.md).
419
+
420
+ 2. **Unified Runtime**: Initialize the runtime once at the start of your application
388
421
  ```python
389
422
  from pyroid.core import runtime
390
423
  runtime.init()
391
424
  ```
392
425
 
393
- 2. **Zero-Copy Buffers**: Use zero-copy buffers for large data transfers
426
+ 3. **Zero-Copy Buffers**: Use zero-copy buffers for large data transfers
394
427
  ```python
395
428
  from pyroid.core import buffer
396
429
  zero_copy_buffer = buffer.ZeroCopyBuffer(size)
397
430
  ```
398
431
 
399
- 3. **Parallel Processing**: Use batch processing for CPU-intensive operations
432
+ 4. **Parallel Processing**: Use batch processing for CPU-intensive operations
400
433
  ```python
401
434
  from pyroid.core import parallel
402
435
  processor = parallel.BatchProcessor(adaptive=True)
403
436
  results = processor.map(items, process_function)
404
437
  ```
405
438
 
406
- 4. **Concurrency Control**: Adjust concurrency levels based on your workload
439
+ 5. **Concurrency Control**: Adjust concurrency levels based on your workload
407
440
  ```python
408
441
  client = pyroid.AsyncClient()
409
442
  responses = await client.fetch_many(urls, concurrency=optimal_value)
@@ -0,0 +1,4 @@
1
+ # Minimal requirements for CI testing
2
+ pytest>=7.0.0
3
+ numpy>=1.20.0
4
+ maturin>=1.0.0 # For building Rust extensions
@@ -0,0 +1,65 @@
1
+ # GitHub Actions Workflow Documentation
2
+
3
+ ## Overview
4
+
5
+ This document describes the GitHub Actions workflow for the Pyroid project. The workflow is designed to automate testing and publishing of the package.
6
+
7
+ ## Workflow Components
8
+
9
+ ### 1. Tests Workflow (tests.yml)
10
+
11
+ The tests workflow runs automated tests to ensure code quality and functionality.
12
+
13
+ **Triggers:**
14
+ - Push to any branch
15
+ - Pull requests to main branch
16
+
17
+ **Jobs:**
18
+ - **rust-tests**: Runs Rust tests on Ubuntu, Windows, and macOS
19
+ - **python-tests**: Runs Python implementation tests on Ubuntu
20
+
21
+ ### 2. Publish Workflow (publish.yml)
22
+
23
+ The publish workflow builds and publishes the package to PyPI when a new version is tagged.
24
+
25
+ **Triggers:**
26
+ - Push of tags matching the pattern "v*" (e.g., v0.1.0, v1.2.3)
27
+ - Manual workflow dispatch with version input
28
+
29
+ **Jobs:**
30
+ - **linux**: Builds wheels for Linux
31
+ - **windows**: Builds wheels for Windows
32
+ - **macos**: Builds wheels for macOS (x86_64 and aarch64)
33
+ - **sdist**: Builds source distribution
34
+ - **release**: Collects all artifacts and publishes to PyPI
35
+
36
+ **Version Management:**
37
+ - The version is extracted from the tag name (removing the 'v' prefix)
38
+ - The extracted version is used to update version strings in:
39
+ - pyproject.toml
40
+ - Cargo.toml
41
+ - python/pyroid/__init__.py
42
+ - setup.py
43
+
44
+ ## Release Process
45
+
46
+ To release a new version:
47
+
48
+ 1. Ensure all changes are committed and pushed to the main branch
49
+ 2. Create and push a new tag with the desired version:
50
+ ```
51
+ git tag v1.2.3
52
+ git push origin v1.2.3
53
+ ```
54
+ 3. The publish workflow will automatically:
55
+ - Extract the version from the tag (1.2.3)
56
+ - Update version strings in all relevant files
57
+ - Build wheels for all supported platforms
58
+ - Publish the package to PyPI
59
+
60
+ ## Benefits of This Approach
61
+
62
+ 1. **Simplicity**: The release process is straightforward and easy to understand
63
+ 2. **Manual Control**: Releases are explicitly triggered by creating tags
64
+ 3. **Consistency**: The version is always derived from the tag name
65
+ 4. **Quality Assurance**: Tests run on every push to ensure code quality
@@ -10,6 +10,8 @@ Welcome to the Pyroid documentation! Pyroid is a high-performance Rust-powered l
10
10
  | [API Reference](./api/index.md) | Detailed documentation of all Pyroid functions and classes |
11
11
  | [Examples](../examples/) | Example code demonstrating various Pyroid features |
12
12
  | [Benchmarks](../benchmarks/) | Performance benchmarks comparing Pyroid to other libraries |
13
+ | [Performance Comparison](./performance_comparison.md) | Detailed comparison between Rust and Python implementations |
14
+ | [Rust Tests](./rust_tests.md) | Documentation for the Rust-level tests |
13
15
 
14
16
  ## 🚀 Quick Start
15
17
 
@@ -157,6 +159,38 @@ grayscale_img = img.to_grayscale()
157
159
 
158
160
  MIT
159
161
 
162
+ ## 🧪 Testing
163
+
164
+ Pyroid includes comprehensive test suites at both the Python and Rust levels:
165
+
166
+ ### Python Tests
167
+
168
+ Run the Python tests to ensure the Python API and fallback implementations work correctly:
169
+
170
+ ```bash
171
+ python run_tests.py
172
+ ```
173
+
174
+ ### Rust Tests
175
+
176
+ Run the Rust tests to ensure the core Rust implementations work correctly:
177
+
178
+ ```bash
179
+ # Run all Rust tests
180
+ cargo test --test test_rust_*
181
+
182
+ # Or run specific module tests
183
+ cargo test --test test_rust_core # Core functionality tests
184
+ cargo test --test test_rust_math # Math operations tests
185
+ cargo test --test test_rust_data # Data operations tests
186
+ cargo test --test test_rust_text # Text operations tests
187
+ cargo test --test test_rust_io # I/O operations tests
188
+ cargo test --test test_rust_image # Image operations tests
189
+ cargo test --test test_rust_impl # ML operations tests
190
+ ```
191
+
192
+ For detailed information about the Rust tests, see the [Rust Tests Documentation](./rust_tests.md).
193
+
160
194
  ## 👥 Contributing
161
195
 
162
196
  Contributions are welcome! Please feel free to submit a Pull Request.