fly-ruler 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 (191) hide show
  1. fly_ruler-0.1.0/LICENSE +21 -0
  2. fly_ruler-0.1.0/PKG-INFO +42 -0
  3. fly_ruler-0.1.0/README.md +11 -0
  4. fly_ruler-0.1.0/pyproject.toml +83 -0
  5. fly_ruler-0.1.0/python/fly_ruler_core/__init__.py +123 -0
  6. fly_ruler-0.1.0/python/fly_ruler_core/_core.pyi +1947 -0
  7. fly_ruler-0.1.0/python/fly_ruler_core/api/__init__.py +53 -0
  8. fly_ruler-0.1.0/python/fly_ruler_core/api/declarations.py +433 -0
  9. fly_ruler-0.1.0/python/fly_ruler_core/api/definitions.py +297 -0
  10. fly_ruler-0.1.0/python/fly_ruler_core/api/math_namespace.py +1177 -0
  11. fly_ruler-0.1.0/python/fly_ruler_core/api/resource_namespace.py +127 -0
  12. fly_ruler-0.1.0/python/fly_ruler_core/api/shape.py +137 -0
  13. fly_ruler-0.1.0/python/fly_ruler_core/artifacts/__init__.py +241 -0
  14. fly_ruler-0.1.0/python/fly_ruler_core/artifacts/io.py +271 -0
  15. fly_ruler-0.1.0/python/fly_ruler_core/artifacts/store.py +687 -0
  16. fly_ruler-0.1.0/python/fly_ruler_core/backend_spec.py +329 -0
  17. fly_ruler-0.1.0/python/fly_ruler_core/backends.py +67 -0
  18. fly_ruler-0.1.0/python/fly_ruler_core/basic.py +18 -0
  19. fly_ruler-0.1.0/python/fly_ruler_core/codegen/__init__.py +4 -0
  20. fly_ruler-0.1.0/python/fly_ruler_core/codegen/capabilities.py +224 -0
  21. fly_ruler-0.1.0/python/fly_ruler_core/codegen/casadi/__init__.py +16 -0
  22. fly_ruler-0.1.0/python/fly_ruler_core/codegen/casadi/builder.py +207 -0
  23. fly_ruler-0.1.0/python/fly_ruler_core/codegen/casadi/functions.py +267 -0
  24. fly_ruler-0.1.0/python/fly_ruler_core/codegen/casadi/native.py +144 -0
  25. fly_ruler-0.1.0/python/fly_ruler_core/codegen/casadi/project.py +453 -0
  26. fly_ruler-0.1.0/python/fly_ruler_core/codegen/casadi/templates/cpp_project/CMakeLists.txt.jinja2 +22 -0
  27. fly_ruler-0.1.0/python/fly_ruler_core/codegen/casadi/templates/cpp_project/README.md.jinja2 +17 -0
  28. fly_ruler-0.1.0/python/fly_ruler_core/codegen/casadi/templates/cpp_project/flyruler_model.cpp.jinja2 +112 -0
  29. fly_ruler-0.1.0/python/fly_ruler_core/codegen/casadi/templates/cpp_project/flyruler_model.hpp.jinja2 +66 -0
  30. fly_ruler-0.1.0/python/fly_ruler_core/codegen/casadi/templates/cpp_project/smoke.cpp.jinja2 +26 -0
  31. fly_ruler-0.1.0/python/fly_ruler_core/codegen/casadi/templates/native_python/CMakeLists.txt.jinja2 +60 -0
  32. fly_ruler-0.1.0/python/fly_ruler_core/codegen/casadi/templates/native_python/wrapper.cpp.jinja2 +331 -0
  33. fly_ruler-0.1.0/python/fly_ruler_core/codegen/casadi/templates/px4_module/README.md.jinja2 +25 -0
  34. fly_ruler-0.1.0/python/fly_ruler_core/codegen/casadi/templates/px4_module/module.cpp.jinja2 +66 -0
  35. fly_ruler-0.1.0/python/fly_ruler_core/codegen/casadi/templates/px4_module/module_CMakeLists.txt.jinja2 +14 -0
  36. fly_ruler-0.1.0/python/fly_ruler_core/codegen/casadi/templates/px4_module/root_CMakeLists.txt.jinja2 +4 -0
  37. fly_ruler-0.1.0/python/fly_ruler_core/codegen/errors.py +44 -0
  38. fly_ruler-0.1.0/python/fly_ruler_core/codegen/program.py +30 -0
  39. fly_ruler-0.1.0/python/fly_ruler_core/codegen/python/__init__.py +7 -0
  40. fly_ruler-0.1.0/python/fly_ruler_core/codegen/python/casadi_lowering.py +719 -0
  41. fly_ruler-0.1.0/python/fly_ruler_core/codegen/python/expression_program.py +248 -0
  42. fly_ruler-0.1.0/python/fly_ruler_core/codegen/python/generator.py +1392 -0
  43. fly_ruler-0.1.0/python/fly_ruler_core/codegen/python/numpy_lowering.py +618 -0
  44. fly_ruler-0.1.0/python/fly_ruler_core/codegen/python/resources.py +163 -0
  45. fly_ruler-0.1.0/python/fly_ruler_core/codegen/python/templates/__init__.py +35 -0
  46. fly_ruler-0.1.0/python/fly_ruler_core/codegen/python/templates/block_functions.jinja2 +28 -0
  47. fly_ruler-0.1.0/python/fly_ruler_core/codegen/python/templates/discrete_fn.jinja2 +48 -0
  48. fly_ruler-0.1.0/python/fly_ruler_core/codegen/python/templates/jacobian_functions.jinja2 +89 -0
  49. fly_ruler-0.1.0/python/fly_ruler_core/codegen/python/templates/module.py.jinja2 +50 -0
  50. fly_ruler-0.1.0/python/fly_ruler_core/codegen/python/templates/numpy_index_helpers.jinja2 +12 -0
  51. fly_ruler-0.1.0/python/fly_ruler_core/codegen/python/templates/payload_loader.jinja2 +29 -0
  52. fly_ruler-0.1.0/python/fly_ruler_core/codegen/python/templates/resource_init.jinja2 +78 -0
  53. fly_ruler-0.1.0/python/fly_ruler_core/codegen/python/templates/so3_helpers.jinja2 +84 -0
  54. fly_ruler-0.1.0/python/fly_ruler_core/codegen/python/templates/so3_projected_sum.jinja2 +30 -0
  55. fly_ruler-0.1.0/python/fly_ruler_core/codegen/python/templates/so3_rkmk_sum.jinja2 +28 -0
  56. fly_ruler-0.1.0/python/fly_ruler_core/codegen/python/templates/system_functions.jinja2 +200 -0
  57. fly_ruler-0.1.0/python/fly_ruler_core/codegen/python/templates/unpack_pack.jinja2 +52 -0
  58. fly_ruler-0.1.0/python/fly_ruler_core/compiler/__init__.py +3 -0
  59. fly_ruler-0.1.0/python/fly_ruler_core/compiler/compiler.py +1056 -0
  60. fly_ruler-0.1.0/python/fly_ruler_core/compiler/model_loading.py +210 -0
  61. fly_ruler-0.1.0/python/fly_ruler_core/integrator/__init__.py +7 -0
  62. fly_ruler-0.1.0/python/fly_ruler_core/integrator/tableau.py +353 -0
  63. fly_ruler-0.1.0/python/fly_ruler_core/jax_runtime.py +103 -0
  64. fly_ruler-0.1.0/python/fly_ruler_core/payloads.py +246 -0
  65. fly_ruler-0.1.0/python/fly_ruler_core/progress.py +262 -0
  66. fly_ruler-0.1.0/python/fly_ruler_core/py.typed +0 -0
  67. fly_ruler-0.1.0/python/fly_ruler_core/runtime/__init__.py +76 -0
  68. fly_ruler-0.1.0/python/fly_ruler_core/runtime/backend.py +633 -0
  69. fly_ruler-0.1.0/python/fly_ruler_core/runtime/batch.py +498 -0
  70. fly_ruler-0.1.0/python/fly_ruler_core/runtime/functions.py +115 -0
  71. fly_ruler-0.1.0/python/fly_ruler_core/runtime/model.py +845 -0
  72. fly_ruler-0.1.0/python/fly_ruler_core/runtime/native.py +170 -0
  73. fly_ruler-0.1.0/python/fly_ruler_core/runtime/variable.py +449 -0
  74. fly_ruler-0.1.0/python/fly_ruler_core/targets.py +116 -0
  75. fly_ruler-0.1.0/python/fly_ruler_std/__init__.py +12 -0
  76. fly_ruler-0.1.0/python/fly_ruler_std/blocks/__init__.py +0 -0
  77. fly_ruler-0.1.0/python/fly_ruler_std/blocks/actuator/__init__.py +5 -0
  78. fly_ruler-0.1.0/python/fly_ruler_std/blocks/actuator/simple.py +157 -0
  79. fly_ruler-0.1.0/python/fly_ruler_std/blocks/continous/__init__.py +20 -0
  80. fly_ruler-0.1.0/python/fly_ruler_std/blocks/continous/derivative.py +56 -0
  81. fly_ruler-0.1.0/python/fly_ruler_std/blocks/continous/integrator.py +67 -0
  82. fly_ruler-0.1.0/python/fly_ruler_std/blocks/continous/state_space.py +86 -0
  83. fly_ruler-0.1.0/python/fly_ruler_std/blocks/continous/transfer_funtion.py +67 -0
  84. fly_ruler-0.1.0/python/fly_ruler_std/blocks/continous/zero_pole.py +67 -0
  85. fly_ruler-0.1.0/python/fly_ruler_std/blocks/discrete/__init__.py +6 -0
  86. fly_ruler-0.1.0/python/fly_ruler_std/blocks/discrete/delay.py +103 -0
  87. fly_ruler-0.1.0/python/fly_ruler_std/blocks/discrete/memory.py +87 -0
  88. fly_ruler-0.1.0/python/fly_ruler_std/blocks/physics/__init__.py +35 -0
  89. fly_ruler-0.1.0/python/fly_ruler_std/blocks/physics/gravity.py +145 -0
  90. fly_ruler-0.1.0/python/fly_ruler_std/blocks/physics/ground_contact.py +398 -0
  91. fly_ruler-0.1.0/python/fly_ruler_std/blocks/physics/rigid_body_6dof.py +373 -0
  92. fly_ruler-0.1.0/python/fly_ruler_std/blocks/wind/__init__.py +13 -0
  93. fly_ruler-0.1.0/python/fly_ruler_std/blocks/wind/dryden.py +335 -0
  94. fly_ruler-0.1.0/python/fly_ruler_std/blocks/wind/steady.py +163 -0
  95. fly_ruler-0.1.0/python/fly_ruler_std/libs/__init__.py +0 -0
  96. fly_ruler-0.1.0/python/fly_ruler_std/libs/atmosphere.py +96 -0
  97. fly_ruler-0.1.0/python/fly_ruler_std/libs/coordinates.py +330 -0
  98. fly_ruler-0.1.0/python/fly_ruler_std/libs/linear_system/__init__.py +72 -0
  99. fly_ruler-0.1.0/python/fly_ruler_std/libs/linear_system/analysis.py +425 -0
  100. fly_ruler-0.1.0/python/fly_ruler_std/libs/linear_system/canonical.py +219 -0
  101. fly_ruler-0.1.0/python/fly_ruler_std/libs/linear_system/design.py +401 -0
  102. fly_ruler-0.1.0/python/fly_ruler_std/libs/linear_system/transform.py +120 -0
  103. fly_ruler-0.1.0/python/fly_ruler_std/libs/rotation.py +698 -0
  104. fly_ruler-0.1.0/python/fly_ruler_std/libs/units.py +570 -0
  105. fly_ruler-0.1.0/python/fly_ruler_std/py.typed +0 -0
  106. fly_ruler-0.1.0/python/fly_ruler_std/runtime/__init__.py +0 -0
  107. fly_ruler-0.1.0/python/fly_ruler_std/runtime/debugger/__init__.py +1 -0
  108. fly_ruler-0.1.0/python/fly_ruler_std/runtime/linearize/__init__.py +11 -0
  109. fly_ruler-0.1.0/python/fly_ruler_std/runtime/linearize/result.py +82 -0
  110. fly_ruler-0.1.0/python/fly_ruler_std/runtime/linearize/solver.py +389 -0
  111. fly_ruler-0.1.0/python/fly_ruler_std/runtime/linearize/spec.py +64 -0
  112. fly_ruler-0.1.0/python/fly_ruler_std/runtime/loop/__init__.py +24 -0
  113. fly_ruler-0.1.0/python/fly_ruler_std/runtime/loop/context.py +59 -0
  114. fly_ruler-0.1.0/python/fly_ruler_std/runtime/loop/helpers.py +69 -0
  115. fly_ruler-0.1.0/python/fly_ruler_std/runtime/loop/runner.py +434 -0
  116. fly_ruler-0.1.0/python/fly_ruler_std/runtime/loop/task.py +159 -0
  117. fly_ruler-0.1.0/python/fly_ruler_std/runtime/record/__init__.py +13 -0
  118. fly_ruler-0.1.0/python/fly_ruler_std/runtime/record/async_recorder.py +305 -0
  119. fly_ruler-0.1.0/python/fly_ruler_std/runtime/record/layout.py +240 -0
  120. fly_ruler-0.1.0/python/fly_ruler_std/runtime/record/loader.py +445 -0
  121. fly_ruler-0.1.0/python/fly_ruler_std/runtime/record/recorder.py +244 -0
  122. fly_ruler-0.1.0/python/fly_ruler_std/runtime/record/types.py +24 -0
  123. fly_ruler-0.1.0/python/fly_ruler_std/runtime/trim/__init__.py +20 -0
  124. fly_ruler-0.1.0/python/fly_ruler_std/runtime/trim/result.py +46 -0
  125. fly_ruler-0.1.0/python/fly_ruler_std/runtime/trim/solver.py +493 -0
  126. fly_ruler-0.1.0/python/fly_ruler_std/runtime/trim/spec.py +124 -0
  127. fly_ruler-0.1.0/rust/Cargo.lock +788 -0
  128. fly_ruler-0.1.0/rust/Cargo.toml +26 -0
  129. fly_ruler-0.1.0/rust/clippy.toml +1 -0
  130. fly_ruler-0.1.0/rust/src/compiler/artifact.rs +75 -0
  131. fly_ruler-0.1.0/rust/src/compiler/check/connections.rs +58 -0
  132. fly_ruler-0.1.0/rust/src/compiler/check/expr_helpers.rs +78 -0
  133. fly_ruler-0.1.0/rust/src/compiler/check/expr_helpers_tests.rs +298 -0
  134. fly_ruler-0.1.0/rust/src/compiler/check/expr_refs.rs +122 -0
  135. fly_ruler-0.1.0/rust/src/compiler/check/facts.rs +24 -0
  136. fly_ruler-0.1.0/rust/src/compiler/check/op_dims.rs +168 -0
  137. fly_ruler-0.1.0/rust/src/compiler/check/ops.rs +56 -0
  138. fly_ruler-0.1.0/rust/src/compiler/check/outputs.rs +61 -0
  139. fly_ruler-0.1.0/rust/src/compiler/check/ports.rs +15 -0
  140. fly_ruler-0.1.0/rust/src/compiler/check/state_updates.rs +144 -0
  141. fly_ruler-0.1.0/rust/src/compiler/check/tests.rs +572 -0
  142. fly_ruler-0.1.0/rust/src/compiler/check.rs +67 -0
  143. fly_ruler-0.1.0/rust/src/compiler/diagnostics.rs +183 -0
  144. fly_ruler-0.1.0/rust/src/compiler/execution_slice.rs +258 -0
  145. fly_ruler-0.1.0/rust/src/compiler/jacobian.rs +394 -0
  146. fly_ruler-0.1.0/rust/src/compiler/layout.rs +693 -0
  147. fly_ruler-0.1.0/rust/src/compiler/lower.rs +514 -0
  148. fly_ruler-0.1.0/rust/src/compiler/materialize.rs +513 -0
  149. fly_ruler-0.1.0/rust/src/compiler/plan.rs +555 -0
  150. fly_ruler-0.1.0/rust/src/compiler/route.rs +245 -0
  151. fly_ruler-0.1.0/rust/src/compiler/schedule.rs +399 -0
  152. fly_ruler-0.1.0/rust/src/compiler/test_utils.rs +143 -0
  153. fly_ruler-0.1.0/rust/src/compiler.rs +25 -0
  154. fly_ruler-0.1.0/rust/src/error.rs +449 -0
  155. fly_ruler-0.1.0/rust/src/ffi/authoring.rs +1017 -0
  156. fly_ruler-0.1.0/rust/src/ffi/block_interface.rs +217 -0
  157. fly_ruler-0.1.0/rust/src/ffi/builder.rs +1534 -0
  158. fly_ruler-0.1.0/rust/src/ffi/compiled.rs +1224 -0
  159. fly_ruler-0.1.0/rust/src/ffi/diagnostic.rs +58 -0
  160. fly_ruler-0.1.0/rust/src/ffi/errors.rs +44 -0
  161. fly_ruler-0.1.0/rust/src/ffi/runtime.rs +1069 -0
  162. fly_ruler-0.1.0/rust/src/ffi/utils.rs +576 -0
  163. fly_ruler-0.1.0/rust/src/ffi.rs +22 -0
  164. fly_ruler-0.1.0/rust/src/ids.rs +23 -0
  165. fly_ruler-0.1.0/rust/src/ir/analysis.rs +145 -0
  166. fly_ruler-0.1.0/rust/src/ir/expr.rs +154 -0
  167. fly_ruler-0.1.0/rust/src/ir/interface.rs +189 -0
  168. fly_ruler-0.1.0/rust/src/ir/kind.rs +73 -0
  169. fly_ruler-0.1.0/rust/src/ir/metadata.rs +736 -0
  170. fly_ruler-0.1.0/rust/src/ir/ops.rs +709 -0
  171. fly_ruler-0.1.0/rust/src/ir/port.rs +93 -0
  172. fly_ruler-0.1.0/rust/src/ir/query.rs +315 -0
  173. fly_ruler-0.1.0/rust/src/ir/serde_helpers.rs +128 -0
  174. fly_ruler-0.1.0/rust/src/ir/system.rs +386 -0
  175. fly_ruler-0.1.0/rust/src/ir.rs +45 -0
  176. fly_ruler-0.1.0/rust/src/lib.rs +72 -0
  177. fly_ruler-0.1.0/rust/src/model/entity/block.rs +136 -0
  178. fly_ruler-0.1.0/rust/src/model/entity/port.rs +240 -0
  179. fly_ruler-0.1.0/rust/src/model/entity/system.rs +159 -0
  180. fly_ruler-0.1.0/rust/src/model/entity.rs +10 -0
  181. fly_ruler-0.1.0/rust/src/model/ids.rs +2 -0
  182. fly_ruler-0.1.0/rust/src/model/path.rs +281 -0
  183. fly_ruler-0.1.0/rust/src/model/topology/builder.rs +452 -0
  184. fly_ruler-0.1.0/rust/src/model/topology/connect.rs +187 -0
  185. fly_ruler-0.1.0/rust/src/model/topology/iter.rs +36 -0
  186. fly_ruler-0.1.0/rust/src/model/topology/path.rs +44 -0
  187. fly_ruler-0.1.0/rust/src/model/topology/query.rs +346 -0
  188. fly_ruler-0.1.0/rust/src/model/topology/tests.rs +1656 -0
  189. fly_ruler-0.1.0/rust/src/model/topology.rs +14 -0
  190. fly_ruler-0.1.0/rust/src/model/types.rs +567 -0
  191. fly_ruler-0.1.0/rust/src/model.rs +15 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 windlx
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,42 @@
1
+ Metadata-Version: 2.4
2
+ Name: fly-ruler
3
+ Version: 0.1.0
4
+ Requires-Dist: casadi>=3.8.1
5
+ Requires-Dist: filelock>=4.0.8
6
+ Requires-Dist: jinja2>=3.1.6
7
+ Requires-Dist: numpy>=2.5.3
8
+ Requires-Dist: polars>=1.44.2
9
+ Requires-Dist: pydantic>=2.13.5
10
+ Requires-Dist: pybind11>=3.1.0
11
+ Requires-Dist: rich>=15.0.0
12
+ Requires-Dist: scipy>=1.18.1
13
+ Requires-Dist: typer>=0.27.2
14
+ Requires-Dist: jax>=0.11.2 ; extra == 'all'
15
+ Requires-Dist: jax>=0.11.2 ; extra == 'jax'
16
+ Requires-Dist: jax[cuda12]>=0.11.2 ; extra == 'jax-cuda12'
17
+ Requires-Dist: jax[cuda13]>=0.11.2 ; extra == 'jax-cuda13'
18
+ Provides-Extra: all
19
+ Provides-Extra: jax
20
+ Provides-Extra: jax-cuda12
21
+ Provides-Extra: jax-cuda13
22
+ License-File: LICENSE
23
+ Summary: FlyRuler aircraft modeling and simulation core and standard library
24
+ Author: windlx
25
+ License-Expression: MIT
26
+ Requires-Python: >=3.12
27
+ Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
28
+ Project-URL: Issues, https://github.com/WindLX/FlyRuler/issues
29
+ Project-URL: Source, https://github.com/WindLX/FlyRuler
30
+
31
+ # fly-ruler
32
+
33
+ 飞行器建模、编译、仿真与分析的 Python 包,包含 `fly_ruler_core`、`fly_ruler_std` 和原生 Rust 扩展。保留类型声明、`py.typed` 与代码生成模板。
34
+
35
+ Graph 与 Plot 是同版本的独立二进制工具,通过 GitHub Release 的安装脚本安装;Python wheel 不包含它们。使用与维护说明见主仓文档:[core](../../docs/guide/components/core.md)、[std](../../docs/guide/components/std.md)、[Graph](../../docs/guide/components/graph.md)与[Plot](../../docs/guide/components/plot.md)。
36
+
37
+ 示例是主要教学入口:先看 [`examples/mainline/hybrid_system.py`](examples/mainline/hybrid_system.py) 的十步闭环,再按主题读 [`examples/core/`](examples/core/) 与 [`examples/std/`](examples/std/)。每个脚本都在模块 docstring 与行内注释里写清运行方式、参数含义和预期结果;目录总览见 [`examples/README.md`](examples/README.md),`just test-examples` 会把它们按目录跑一遍。
38
+
39
+ 源码开发运行 `just setup-dev`,随后 `just check`、`just test`;`just build` 直接用 Maturin 构建本机 wheel。Linux 发行由版本 tag 流水线在 manylinux 2.28 中构建;Graph/Plot 在各自目录执行 `just build`。
40
+
41
+ 版本号只由 `just set-version X.Y.Z` 统一写入 Python 包、Rust crate、两个锁文件、Graph/Plot 前端配置与两个 README 的安装示例;`just version` 只读盘点这些来源,`just check` 会校验它们一致。发布步骤见主仓 [`RELEASING.md`](../../RELEASING.md)。
42
+
@@ -0,0 +1,11 @@
1
+ # fly-ruler
2
+
3
+ 飞行器建模、编译、仿真与分析的 Python 包,包含 `fly_ruler_core`、`fly_ruler_std` 和原生 Rust 扩展。保留类型声明、`py.typed` 与代码生成模板。
4
+
5
+ Graph 与 Plot 是同版本的独立二进制工具,通过 GitHub Release 的安装脚本安装;Python wheel 不包含它们。使用与维护说明见主仓文档:[core](../../docs/guide/components/core.md)、[std](../../docs/guide/components/std.md)、[Graph](../../docs/guide/components/graph.md)与[Plot](../../docs/guide/components/plot.md)。
6
+
7
+ 示例是主要教学入口:先看 [`examples/mainline/hybrid_system.py`](examples/mainline/hybrid_system.py) 的十步闭环,再按主题读 [`examples/core/`](examples/core/) 与 [`examples/std/`](examples/std/)。每个脚本都在模块 docstring 与行内注释里写清运行方式、参数含义和预期结果;目录总览见 [`examples/README.md`](examples/README.md),`just test-examples` 会把它们按目录跑一遍。
8
+
9
+ 源码开发运行 `just setup-dev`,随后 `just check`、`just test`;`just build` 直接用 Maturin 构建本机 wheel。Linux 发行由版本 tag 流水线在 manylinux 2.28 中构建;Graph/Plot 在各自目录执行 `just build`。
10
+
11
+ 版本号只由 `just set-version X.Y.Z` 统一写入 Python 包、Rust crate、两个锁文件、Graph/Plot 前端配置与两个 README 的安装示例;`just version` 只读盘点这些来源,`just check` 会校验它们一致。发布步骤见主仓 [`RELEASING.md`](../../RELEASING.md)。
@@ -0,0 +1,83 @@
1
+ [project]
2
+ name = "fly-ruler"
3
+ version = "0.1.0"
4
+ description = "FlyRuler aircraft modeling and simulation core and standard library"
5
+ license = "MIT"
6
+ license-files = ["LICENSE"]
7
+ authors = [{name = "windlx"}]
8
+ readme = "README.md"
9
+ requires-python = ">=3.12"
10
+ dependencies = [
11
+ "casadi>=3.8.1",
12
+ "filelock>=4.0.8",
13
+ "jinja2>=3.1.6",
14
+ "numpy>=2.5.3",
15
+ "polars>=1.44.2",
16
+ "pydantic>=2.13.5",
17
+ "pybind11>=3.1.0",
18
+ "rich>=15.0.0",
19
+ "scipy>=1.18.1",
20
+ "typer>=0.27.2",
21
+ ]
22
+
23
+ [project.urls]
24
+ Source = "https://github.com/WindLX/FlyRuler"
25
+ Issues = "https://github.com/WindLX/FlyRuler/issues"
26
+
27
+ [project.optional-dependencies]
28
+ jax = ["jax>=0.11.2"]
29
+ jax-cuda12 = ["jax[cuda12]>=0.11.2"]
30
+ jax-cuda13 = ["jax[cuda13]>=0.11.2"]
31
+ all = ["jax>=0.11.2"]
32
+
33
+ [build-system]
34
+ requires = ["maturin>=1.15.0,<2.0"]
35
+ build-backend = "maturin"
36
+
37
+ [tool.maturin]
38
+ manifest-path = "rust/Cargo.toml"
39
+ module-name = "fly_ruler_core._core"
40
+ python-source = "python"
41
+ python-packages = ["fly_ruler_core", "fly_ruler_std"]
42
+ exclude = [
43
+ "graph/**",
44
+ "plot/**",
45
+ "scripts/**",
46
+ "tests/**",
47
+ "examples/**",
48
+ "build/**",
49
+ "third-party/**",
50
+ "python/**/AGENTS.md",
51
+ "python/**/__pycache__/**",
52
+ "python/**/*.pyc",
53
+ ]
54
+ include = [
55
+ "python/fly_ruler_core/**/*.jinja2",
56
+ "python/**/*.pyi",
57
+ "python/fly_ruler_core/py.typed",
58
+ "python/fly_ruler_std/py.typed",
59
+ ]
60
+
61
+ [tool.uv]
62
+ cache-keys = [
63
+ { file = "pyproject.toml" },
64
+ { file = "rust/**/*.rs" },
65
+ { file = "rust/Cargo.toml" },
66
+ { file = "rust/Cargo.lock" },
67
+ { file = ".cargo/config.toml" },
68
+ ]
69
+
70
+ [tool.ruff]
71
+ line-length = 88
72
+ target-version = "py312"
73
+
74
+ [tool.ruff.lint]
75
+ select = ["E", "F", "I", "B", "SIM"]
76
+
77
+ [tool.ruff.format]
78
+ quote-style = "double"
79
+
80
+ [tool.pytest.ini_options]
81
+ testpaths = ["tests/core", "tests/std", "tests/release"]
82
+ python_files = ["test_*.py"]
83
+ addopts = "-ra -q"
@@ -0,0 +1,123 @@
1
+ """FlyRuler Core:飞行器建模与仿真的 Rust 内核与 Python 绑定。
2
+
3
+ Signal-first 公共 API:`@fr.block` / `@fr.system` 加表达式 IR,经
4
+ `PyIrBuilder` 由 `Compiler.compile()` 编译为后端模型。
5
+ """
6
+
7
+ from . import backends, targets
8
+ from ._core import (
9
+ PyBlockHandle as BlockHandle,
10
+ )
11
+ from ._core import (
12
+ PyIrBuilder,
13
+ )
14
+ from ._core import (
15
+ PySignal as Signal,
16
+ )
17
+ from ._core import (
18
+ PySubsystemHandle as SubsystemHandle,
19
+ )
20
+ from .api import (
21
+ BlockDefinition,
22
+ SystemDefinition,
23
+ block,
24
+ connect,
25
+ constrain,
26
+ dstate,
27
+ dynamics,
28
+ effects,
29
+ export,
30
+ input,
31
+ jacobian,
32
+ next_step,
33
+ output,
34
+ param,
35
+ state,
36
+ system,
37
+ )
38
+ from .api.math_namespace import math
39
+ from .api.resource_namespace import resource
40
+ from .artifacts import Artifact, ArtifactCachePolicy, ArtifactFile
41
+ from .backend_spec import Backend
42
+ from .basic import Dimension, DType, ManifoldType, SO3Integrator, SO3Representation
43
+ from .compiler import Compiler, CompilerSpec
44
+ from .jax_runtime import JaxRuntimePolicy, configure_jax_runtime
45
+ from .progress import (
46
+ CompilationEvent,
47
+ CompilationReport,
48
+ CompilationVerbosity,
49
+ )
50
+ from .runtime import (
51
+ BatchModel,
52
+ BatchVariableView,
53
+ BuildValue,
54
+ CasadiArray,
55
+ CasadiModel,
56
+ CompiledModel,
57
+ JaxArray,
58
+ NativeModel,
59
+ NumpyArray,
60
+ RuntimeInput,
61
+ VariableInfo,
62
+ VariableView,
63
+ )
64
+
65
+ __all__ = [
66
+ # 类型别名
67
+ "Dimension",
68
+ "DType",
69
+ "ManifoldType",
70
+ "SO3Representation",
71
+ "SO3Integrator",
72
+ # 编译器
73
+ "CompilerSpec",
74
+ "Compiler",
75
+ "CompiledModel",
76
+ "CasadiModel",
77
+ "NativeModel",
78
+ "BatchModel",
79
+ "BatchVariableView",
80
+ "Backend",
81
+ "Artifact",
82
+ "ArtifactFile",
83
+ "ArtifactCachePolicy",
84
+ "CompilationEvent",
85
+ "CompilationReport",
86
+ "CompilationVerbosity",
87
+ "JaxRuntimePolicy",
88
+ "configure_jax_runtime",
89
+ "backends",
90
+ "targets",
91
+ # 构建器
92
+ "PyIrBuilder",
93
+ # 信号优先的公开 API
94
+ "Signal",
95
+ "BlockHandle",
96
+ "BlockDefinition",
97
+ "SubsystemHandle",
98
+ "SystemDefinition",
99
+ "block",
100
+ "system",
101
+ "input",
102
+ "jacobian",
103
+ "state",
104
+ "dstate",
105
+ "param",
106
+ "output",
107
+ "effects",
108
+ "dynamics",
109
+ "next_step",
110
+ "constrain",
111
+ "export",
112
+ "connect",
113
+ "math",
114
+ "resource",
115
+ # 类型
116
+ "NumpyArray",
117
+ "JaxArray",
118
+ "CasadiArray",
119
+ "BuildValue",
120
+ "RuntimeInput",
121
+ "VariableInfo",
122
+ "VariableView",
123
+ ]