scientific-computing-system 1.0.0 → 2.2.0

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 (430) hide show
  1. package/CHANGELOG.md +284 -0
  2. package/LICENSE +0 -0
  3. package/README.md +89 -218
  4. package/SECURITY.md +0 -0
  5. package/bin/scs.js +12 -2
  6. package/index.js +115 -1
  7. package/package.json +45 -1
  8. package/.binder/postBuild +0 -9
  9. package/.binder/requirements.txt +0 -10
  10. package/.gitattributes +0 -35
  11. package/.github/CODEOWNERS +0 -4
  12. package/.github/FUNDING.yml +0 -3
  13. package/.github/ISSUE_TEMPLATE/bug_report.md +0 -50
  14. package/.github/ISSUE_TEMPLATE/config.yml +0 -8
  15. package/.github/ISSUE_TEMPLATE/feature_request.md +0 -28
  16. package/.github/PULL_REQUEST_TEMPLATE.md +0 -29
  17. package/.github/dependabot.yml +0 -32
  18. package/.github/labeler.yml +0 -50
  19. package/.github/workflows/benchmarks.yml +0 -97
  20. package/.github/workflows/bot-reviewer.yml +0 -58
  21. package/.github/workflows/changelog.yml +0 -130
  22. package/.github/workflows/cli-package-smoke.yml +0 -45
  23. package/.github/workflows/codeql.yml +0 -55
  24. package/.github/workflows/npm-publish.yml +0 -33
  25. package/.github/workflows/p08-cancel-noncanonical-runs.yml +0 -41
  26. package/.github/workflows/pr-automation.yml +0 -78
  27. package/.github/workflows/public-external-validation-p08-v2-glm.yml +0 -161
  28. package/.github/workflows/public-external-validation-p08-v2-recovery-merge-gate.yml +0 -72
  29. package/.github/workflows/public-external-validation-p08-v2-recovery-merge.yml +0 -113
  30. package/.github/workflows/public-external-validation-p08-v2-run-recovery-anatomy-gate.yml +0 -57
  31. package/.github/workflows/public-external-validation-p08-v2-run-recovery-merge-gate.yml +0 -63
  32. package/.github/workflows/public-external-validation-p08-v2-run-recovery-merge.yml +0 -89
  33. package/.github/workflows/public-external-validation-p08-v2-run-recovery.yml +0 -182
  34. package/.github/workflows/public-external-validation-p08-v3-glm-gate.yml +0 -67
  35. package/.github/workflows/public-external-validation-p08-v4-recovery-glm-gate.yml +0 -78
  36. package/.github/workflows/public-external-validation-p08-v4-recovery-glm.yml +0 -248
  37. package/.github/workflows/public-external-validation-p08-v5-run-recovery-glm-gate.yml +0 -66
  38. package/.github/workflows/public-external-validation-p08-v5-run-recovery-glm.yml +0 -218
  39. package/.github/workflows/pypi-registry-smoke.yml +0 -116
  40. package/.github/workflows/release.yml +0 -359
  41. package/.github/workflows/tests.yml +0 -250
  42. package/.github/workflows/tmp-compassion-raw-acquire.yml +0 -63
  43. package/.github/workflows/wsl-science-runner-smoke.yml +0 -45
  44. package/.pre-commit-config.yaml +0 -48
  45. package/CITATION.cff +0 -29
  46. package/CODE_OF_CONDUCT.md +0 -25
  47. package/CONTRIBUTING.md +0 -275
  48. package/ROADMAP.md +0 -155
  49. package/assets/logo.svg +0 -38
  50. package/assets/social_preview.png +0 -0
  51. package/benchmarks/results.json +0 -43
  52. package/benchmarks/robust_runner.py +0 -118
  53. package/benchmarks/run_benchmarks.py +0 -394
  54. package/cliff.toml +0 -100
  55. package/dashboard/app.py +0 -224
  56. package/docs/ARCHITECTURE.md +0 -252
  57. package/docs/CASE_STUDY_HUBBLE.md +0 -78
  58. package/docs/CASE_STUDY_QUANTUM_ML.md +0 -79
  59. package/docs/api.md +0 -133
  60. package/docs/assets/icon.svg +0 -17
  61. package/docs/assets/logo.svg +0 -38
  62. package/docs/benchmarks.md +0 -62
  63. package/docs/cookbook.md +0 -930
  64. package/docs/getting-started.md +0 -185
  65. package/docs/index.md +0 -111
  66. package/docs/maintenance.md +0 -61
  67. package/docs/ml_reference.md +0 -92
  68. package/docs/research-workflows.md +0 -82
  69. package/docs/stylesheets/extra.css +0 -122
  70. package/docs/tour_of_numerical_methods.md +0 -330
  71. package/docs/tutorials/core_demo.md +0 -35
  72. package/docs/tutorials/data_analysis_demo.md +0 -43
  73. package/docs/tutorials/diffeq_demo.md +0 -48
  74. package/docs/tutorials/fft2_demo.md +0 -67
  75. package/docs/tutorials/graph_demo.md +0 -45
  76. package/docs/tutorials/hypothesis_demo.md +0 -44
  77. package/docs/tutorials/hypothesis_tests_demo.md +0 -170
  78. package/docs/tutorials/hypothesis_with_stats_demo.md +0 -80
  79. package/docs/tutorials/knowledge_demo.md +0 -114
  80. package/docs/tutorials/linalg_demo.md +0 -103
  81. package/docs/tutorials/math_utils_demo.md +0 -46
  82. package/docs/tutorials/ml_advanced_demo.md +0 -96
  83. package/docs/tutorials/ml_and_viz_demo.md +0 -93
  84. package/docs/tutorials/ml_demo.md +0 -70
  85. package/docs/tutorials/modeling_demo.md +0 -82
  86. package/docs/tutorials/montecarlo_demo.md +0 -42
  87. package/docs/tutorials/nlp_attention_demo.md +0 -107
  88. package/docs/tutorials/nlp_bpe_demo.md +0 -103
  89. package/docs/tutorials/nlp_mini_gpt_demo.md +0 -110
  90. package/docs/tutorials/nlp_viz.md +0 -76
  91. package/docs/tutorials/numerical_integration_demo.md +0 -65
  92. package/docs/tutorials/optimization_demo.md +0 -106
  93. package/docs/tutorials/pandas_io_demo.md +0 -160
  94. package/docs/tutorials/pca_demo.md +0 -87
  95. package/docs/tutorials/probability_demo.md +0 -48
  96. package/docs/tutorials/quantum_demo.md +0 -31
  97. package/docs/tutorials/quick_start.md +0 -44
  98. package/docs/tutorials/scientific_demo.md +0 -46
  99. package/docs/tutorials/signals_demo.md +0 -167
  100. package/docs/tutorials/stats_demo.md +0 -94
  101. package/docs/tutorials/stiff_ode_demo.md +0 -84
  102. package/docs/tutorials/time_series_demo.md +0 -145
  103. package/examples/core_demo.py +0 -40
  104. package/examples/data_analysis_demo.py +0 -60
  105. package/examples/diffeq_demo.py +0 -34
  106. package/examples/discovery_pipeline_demo.py +0 -57
  107. package/examples/ensemble_showcase.py +0 -81
  108. package/examples/fft2_demo.py +0 -32
  109. package/examples/graph_demo.py +0 -49
  110. package/examples/hypothesis_custom_generator.py +0 -121
  111. package/examples/hypothesis_demo.py +0 -48
  112. package/examples/hypothesis_tests_demo.py +0 -52
  113. package/examples/hypothesis_with_stats_demo.py +0 -43
  114. package/examples/interpolate_demo.py +0 -57
  115. package/examples/knowledge_demo.py +0 -100
  116. package/examples/linalg_demo.py +0 -61
  117. package/examples/math_utils_demo.py +0 -53
  118. package/examples/ml_and_viz_demo.py +0 -47
  119. package/examples/modeling_demo.py +0 -110
  120. package/examples/montecarlo_demo.py +0 -41
  121. package/examples/nlp_attention_demo.py +0 -168
  122. package/examples/nlp_bpe_demo.py +0 -79
  123. package/examples/nlp_mini_gpt_demo.py +0 -76
  124. package/examples/nlp_viz_demo.py +0 -98
  125. package/examples/numerical_integration_demo.py +0 -60
  126. package/examples/optimization_demo.py +0 -34
  127. package/examples/pca_demo.py +0 -124
  128. package/examples/pde_demo.py +0 -65
  129. package/examples/plot_demo.py +0 -84
  130. package/examples/plotting_notebook.ipynb +0 -87
  131. package/examples/probability_demo.py +0 -39
  132. package/examples/quantum_demo.py +0 -42
  133. package/examples/scientific_demo.py +0 -49
  134. package/examples/signals_demo.py +0 -86
  135. package/examples/stats_demo.py +0 -40
  136. package/examples/tour_of_numerical_methods.ipynb +0 -497
  137. package/mkdocs.yml +0 -159
  138. package/pyproject.toml +0 -288
  139. package/requirements-dev.lock +0 -427
  140. package/requirements-dev.txt +0 -39
  141. package/requirements.lock +0 -6
  142. package/requirements.txt +0 -13
  143. package/scripts/build_gif.py +0 -111
  144. package/scripts/build_video.py +0 -214
  145. package/scripts/cleanup_deployments.py +0 -173
  146. package/scripts/crop_readme_png.py +0 -40
  147. package/scripts/make_pi_dashboard.py +0 -316
  148. package/scripts/make_pi_gif.py +0 -138
  149. package/scripts/publish.py +0 -203
  150. package/scripts/render_promo.mjs +0 -93
  151. package/scripts/render_readme.py +0 -211
  152. package/scripts/render_readme_sections.py +0 -168
  153. package/scripts/verify_cli_install.py +0 -99
  154. package/scripts/verify_cookbook.py +0 -601
  155. package/scripts/verify_d1_numerics.py +0 -504
  156. package/scripts/verify_d2_edge_cases.py +0 -442
  157. package/scripts/verify_d4_hypothesis.py +0 -337
  158. package/scripts/verify_ml_reference.py +0 -160
  159. package/scripts/verify_pypi_release.py +0 -97
  160. package/scripts/verify_release_integrity.py +0 -194
  161. package/src/cds/__init__.py +0 -132
  162. package/src/cds/__main__.py +0 -8
  163. package/src/cds/_version.py +0 -11
  164. package/src/cds/bayes/__init__.py +0 -25
  165. package/src/cds/bayes/conjugate.py +0 -560
  166. package/src/cds/cli/__init__.py +0 -104
  167. package/src/cds/cli/__main__.py +0 -8
  168. package/src/cds/cli/_handlers.py +0 -323
  169. package/src/cds/cli/_parser.py +0 -155
  170. package/src/cds/cli/_style.py +0 -208
  171. package/src/cds/cli/_system_info.py +0 -71
  172. package/src/cds/core/__init__.py +0 -5
  173. package/src/cds/core/_numeric.py +0 -92
  174. package/src/cds/core/models.py +0 -166
  175. package/src/cds/data_analysis/__init__.py +0 -30
  176. package/src/cds/data_analysis/dataset.py +0 -122
  177. package/src/cds/data_analysis/loader.py +0 -75
  178. package/src/cds/data_analysis/pandas_io.py +0 -108
  179. package/src/cds/data_analysis/transform.py +0 -36
  180. package/src/cds/data_analysis/viz.py +0 -88
  181. package/src/cds/data_io/__init__.py +0 -27
  182. package/src/cds/data_io/streaming.py +0 -314
  183. package/src/cds/diffeq/__init__.py +0 -37
  184. package/src/cds/diffeq/_implicit.py +0 -349
  185. package/src/cds/diffeq/solvers.py +0 -312
  186. package/src/cds/diffeq/symplectic.py +0 -225
  187. package/src/cds/fractals/__init__.py +0 -34
  188. package/src/cds/fractals/sets.py +0 -356
  189. package/src/cds/genetics/__init__.py +0 -22
  190. package/src/cds/genetics/sequence.py +0 -199
  191. package/src/cds/graph/__init__.py +0 -31
  192. package/src/cds/graph/algorithms.py +0 -399
  193. package/src/cds/hypothesis/__init__.py +0 -51
  194. package/src/cds/hypothesis/evaluator.py +0 -311
  195. package/src/cds/hypothesis/generator.py +0 -275
  196. package/src/cds/hypothesis/mining.py +0 -314
  197. package/src/cds/infotheory/__init__.py +0 -25
  198. package/src/cds/infotheory/measures.py +0 -276
  199. package/src/cds/interpolate/__init__.py +0 -156
  200. package/src/cds/knowledge/__init__.py +0 -45
  201. package/src/cds/knowledge/graph.py +0 -489
  202. package/src/cds/knowledge/notes.py +0 -231
  203. package/src/cds/knowledge/retrieval.py +0 -339
  204. package/src/cds/math_utils/__init__.py +0 -46
  205. package/src/cds/math_utils/calculus.py +0 -40
  206. package/src/cds/math_utils/linalg.py +0 -496
  207. package/src/cds/math_utils/special.py +0 -167
  208. package/src/cds/math_utils/svd.py +0 -261
  209. package/src/cds/ml/__init__.py +0 -60
  210. package/src/cds/ml/boosting.py +0 -304
  211. package/src/cds/ml/clustering.py +0 -190
  212. package/src/cds/ml/decomposition.py +0 -172
  213. package/src/cds/ml/ensemble.py +0 -152
  214. package/src/cds/ml/linear_models.py +0 -225
  215. package/src/cds/ml/metrics.py +0 -227
  216. package/src/cds/ml/model_selection.py +0 -150
  217. package/src/cds/ml/naive_bayes.py +0 -179
  218. package/src/cds/ml/neighbors.py +0 -162
  219. package/src/cds/ml/neural.py +0 -204
  220. package/src/cds/ml/preprocessing.py +0 -131
  221. package/src/cds/ml/tree.py +0 -228
  222. package/src/cds/ml/voting.py +0 -175
  223. package/src/cds/modeling/__init__.py +0 -44
  224. package/src/cds/modeling/_base.py +0 -210
  225. package/src/cds/modeling/_nodes.py +0 -526
  226. package/src/cds/modeling/expression.py +0 -81
  227. package/src/cds/modeling/fitting.py +0 -477
  228. package/src/cds/modeling/model.py +0 -134
  229. package/src/cds/modeling/solver.py +0 -187
  230. package/src/cds/montecarlo/__init__.py +0 -24
  231. package/src/cds/montecarlo/markov.py +0 -112
  232. package/src/cds/montecarlo/methods.py +0 -294
  233. package/src/cds/nlp/__init__.py +0 -170
  234. package/src/cds/nlp/attention.py +0 -285
  235. package/src/cds/nlp/autograd/__init__.py +0 -70
  236. package/src/cds/nlp/autograd/_grad.py +0 -120
  237. package/src/cds/nlp/autograd/ops.py +0 -133
  238. package/src/cds/nlp/autograd/tensor.py +0 -298
  239. package/src/cds/nlp/bpe.py +0 -449
  240. package/src/cds/nlp/data.py +0 -70
  241. package/src/cds/nlp/embed.py +0 -190
  242. package/src/cds/nlp/layers.py +0 -259
  243. package/src/cds/nlp/model.py +0 -456
  244. package/src/cds/nlp/optim.py +0 -163
  245. package/src/cds/nlp/training.py +0 -167
  246. package/src/cds/nlp/viz.py +0 -254
  247. package/src/cds/numerical_integration/__init__.py +0 -31
  248. package/src/cds/numerical_integration/quadrature.py +0 -480
  249. package/src/cds/optimization/__init__.py +0 -26
  250. package/src/cds/optimization/_metaheuristics.py +0 -287
  251. package/src/cds/optimization/constrained.py +0 -212
  252. package/src/cds/optimization/minimize.py +0 -425
  253. package/src/cds/pde/__init__.py +0 -266
  254. package/src/cds/plot/__init__.py +0 -49
  255. package/src/cds/plot/_backend.py +0 -32
  256. package/src/cds/plot/charts.py +0 -462
  257. package/src/cds/probability/__init__.py +0 -65
  258. package/src/cds/probability/_advanced.py +0 -283
  259. package/src/cds/probability/distributions.py +0 -236
  260. package/src/cds/probability/extra_distributions.py +0 -199
  261. package/src/cds/provenance/__init__.py +0 -25
  262. package/src/cds/provenance/manifest.py +0 -355
  263. package/src/cds/py.typed +0 -0
  264. package/src/cds/quantum/__init__.py +0 -51
  265. package/src/cds/quantum/circuit.py +0 -122
  266. package/src/cds/quantum/multi_qubit.py +0 -310
  267. package/src/cds/quantum/simulator.py +0 -53
  268. package/src/cds/scientific/__init__.py +0 -34
  269. package/src/cds/scientific/constants.py +0 -35
  270. package/src/cds/scientific/formulas.py +0 -116
  271. package/src/cds/sensitivity.py +0 -204
  272. package/src/cds/signals/__init__.py +0 -59
  273. package/src/cds/signals/filters.py +0 -449
  274. package/src/cds/signals/processing.py +0 -224
  275. package/src/cds/signals/stft.py +0 -177
  276. package/src/cds/signals/wavelet.py +0 -146
  277. package/src/cds/stats/__init__.py +0 -99
  278. package/src/cds/stats/_distributions.py +0 -102
  279. package/src/cds/stats/bootstrap.py +0 -188
  280. package/src/cds/stats/descriptive.py +0 -172
  281. package/src/cds/stats/hypothesis_tests.py +0 -294
  282. package/src/cds/stats/nonparametric.py +0 -141
  283. package/src/cds/stats/power.py +0 -290
  284. package/src/cds/stats/regression.py +0 -51
  285. package/src/cds/stats/time_series.py +0 -420
  286. package/src/cds/tools/__init__.py +0 -29
  287. package/src/cds/tools/adapters.py +0 -218
  288. package/src/cds/tools/registry.py +0 -181
  289. package/src/cds/uncertainty/__init__.py +0 -17
  290. package/src/cds/uncertainty/propagation.py +0 -233
  291. package/src/cds/units/__init__.py +0 -45
  292. package/src/cds/units/core.py +0 -199
  293. package/src/cds/validation/__init__.py +0 -41
  294. package/src/cds/validation/adequacy.py +0 -157
  295. package/src/cds/validation/checks.py +0 -485
  296. package/src/cds/validation/report.py +0 -50
  297. package/src/cds/wavelets/__init__.py +0 -5
  298. package/src/cds/wavelets/haar.py +0 -219
  299. package/src/cds/workflow/__init__.py +0 -77
  300. package/src/cds/workflow/engine.py +0 -116
  301. package/src/cds/workflow/gates.py +0 -120
  302. package/src/cds/workflow/orchestrator.py +0 -431
  303. package/src/cds/workflow/selection.py +0 -454
  304. package/src/cds/workflow/tooling.py +0 -155
  305. package/src/cds/workflow/types.py +0 -107
  306. package/tests/__init__.py +0 -0
  307. package/tests/conftest.py +0 -109
  308. package/tests/test_advanced_fitting.py +0 -247
  309. package/tests/test_audit_completion_coverage.py +0 -183
  310. package/tests/test_audit_guard_coverage.py +0 -115
  311. package/tests/test_audit_hardening.py +0 -138
  312. package/tests/test_audit_hardening_coverage.py +0 -111
  313. package/tests/test_bayes_v2.py +0 -208
  314. package/tests/test_benchmarks.py +0 -111
  315. package/tests/test_bootstrap.py +0 -135
  316. package/tests/test_cli.py +0 -51
  317. package/tests/test_cli_color.py +0 -114
  318. package/tests/test_cli_extended.py +0 -239
  319. package/tests/test_cli_system_info.py +0 -36
  320. package/tests/test_constrained_opt.py +0 -174
  321. package/tests/test_core.py +0 -273
  322. package/tests/test_data_analysis.py +0 -146
  323. package/tests/test_data_analysis_lazy_bridge.py +0 -68
  324. package/tests/test_data_analysis_pandas_io.py +0 -119
  325. package/tests/test_data_io.py +0 -149
  326. package/tests/test_dataset.py +0 -91
  327. package/tests/test_diffeq.py +0 -186
  328. package/tests/test_diffeq_implicit.py +0 -173
  329. package/tests/test_domain_validation.py +0 -66
  330. package/tests/test_edge_misc_numerical.py +0 -666
  331. package/tests/test_edge_ml_quantum_linalg.py +0 -191
  332. package/tests/test_edge_nlp.py +0 -229
  333. package/tests/test_edge_quantum_evaluator_cli.py +0 -601
  334. package/tests/test_edge_stats_optimization_signals.py +0 -406
  335. package/tests/test_extra_distributions.py +0 -206
  336. package/tests/test_fft2.py +0 -67
  337. package/tests/test_fitting_bootstrap.py +0 -202
  338. package/tests/test_fractals.py +0 -387
  339. package/tests/test_genetics.py +0 -159
  340. package/tests/test_graph.py +0 -380
  341. package/tests/test_hardening_privacy_provenance.py +0 -306
  342. package/tests/test_hypothesis.py +0 -216
  343. package/tests/test_hypothesis_engine.py +0 -59
  344. package/tests/test_hypothesis_mining.py +0 -247
  345. package/tests/test_hypothesis_tests.py +0 -277
  346. package/tests/test_infotheory.py +0 -302
  347. package/tests/test_interpolate.py +0 -189
  348. package/tests/test_knowledge.py +0 -1149
  349. package/tests/test_layering.py +0 -112
  350. package/tests/test_linalg_extended.py +0 -179
  351. package/tests/test_linalg_qr_cholesky.py +0 -68
  352. package/tests/test_markov.py +0 -155
  353. package/tests/test_math_utils.py +0 -157
  354. package/tests/test_ml_boosting.py +0 -148
  355. package/tests/test_ml_clustering.py +0 -92
  356. package/tests/test_ml_ensemble.py +0 -103
  357. package/tests/test_ml_knn.py +0 -95
  358. package/tests/test_ml_linreg.py +0 -70
  359. package/tests/test_ml_logreg.py +0 -84
  360. package/tests/test_ml_metrics.py +0 -125
  361. package/tests/test_ml_model_selection.py +0 -108
  362. package/tests/test_ml_naive_bayes.py +0 -183
  363. package/tests/test_ml_pca.py +0 -98
  364. package/tests/test_ml_preprocessing.py +0 -104
  365. package/tests/test_ml_tree.py +0 -89
  366. package/tests/test_ml_viz.py +0 -58
  367. package/tests/test_ml_voting.py +0 -219
  368. package/tests/test_modeling.py +0 -726
  369. package/tests/test_modeling_fit_validation.py +0 -46
  370. package/tests/test_montecarlo.py +0 -245
  371. package/tests/test_multi_qubit.py +0 -466
  372. package/tests/test_nlp_attention.py +0 -335
  373. package/tests/test_nlp_autograd.py +0 -435
  374. package/tests/test_nlp_bpe.py +0 -463
  375. package/tests/test_nlp_embed.py +0 -240
  376. package/tests/test_nlp_layers.py +0 -276
  377. package/tests/test_nlp_model.py +0 -172
  378. package/tests/test_nlp_training.py +0 -262
  379. package/tests/test_nlp_viz.py +0 -188
  380. package/tests/test_numerical_integration.py +0 -374
  381. package/tests/test_numerical_invariants.py +0 -768
  382. package/tests/test_numerical_oracles.py +0 -241
  383. package/tests/test_optimization.py +0 -139
  384. package/tests/test_optimization_metaheuristics.py +0 -221
  385. package/tests/test_pde.py +0 -294
  386. package/tests/test_plot_charts.py +0 -247
  387. package/tests/test_plot_lazy.py +0 -48
  388. package/tests/test_power.py +0 -226
  389. package/tests/test_probability.py +0 -274
  390. package/tests/test_probability_advanced.py +0 -226
  391. package/tests/test_property_invariants.py +0 -277
  392. package/tests/test_provenance.py +0 -215
  393. package/tests/test_provenance_audit_hardening.py +0 -45
  394. package/tests/test_public_api.py +0 -75
  395. package/tests/test_quantum.py +0 -195
  396. package/tests/test_release_contract.py +0 -105
  397. package/tests/test_retrieval.py +0 -255
  398. package/tests/test_scientific.py +0 -185
  399. package/tests/test_selection_audit_hardening.py +0 -55
  400. package/tests/test_sensitivity.py +0 -59
  401. package/tests/test_sensitivity_global.py +0 -73
  402. package/tests/test_signals.py +0 -146
  403. package/tests/test_signals_filters.py +0 -460
  404. package/tests/test_special_invariants.py +0 -222
  405. package/tests/test_special_numerics.py +0 -44
  406. package/tests/test_statistical_audit.py +0 -75
  407. package/tests/test_stats.py +0 -206
  408. package/tests/test_stats_audit_coverage.py +0 -17
  409. package/tests/test_stats_nonparametric.py +0 -87
  410. package/tests/test_stats_time_series.py +0 -352
  411. package/tests/test_stft.py +0 -208
  412. package/tests/test_streaming_analytics.py +0 -128
  413. package/tests/test_svd.py +0 -170
  414. package/tests/test_symplectic.py +0 -200
  415. package/tests/test_tool_adapters.py +0 -197
  416. package/tests/test_tools_registry.py +0 -132
  417. package/tests/test_uncertainty.py +0 -171
  418. package/tests/test_units.py +0 -139
  419. package/tests/test_validation.py +0 -100
  420. package/tests/test_validation_adequacy.py +0 -129
  421. package/tests/test_validation_advanced.py +0 -110
  422. package/tests/test_wavelet.py +0 -170
  423. package/tests/test_wavelets_v2.py +0 -119
  424. package/tests/test_workflow.py +0 -173
  425. package/tests/test_workflow_gates.py +0 -144
  426. package/tests/test_workflow_orchestrator.py +0 -516
  427. package/tests/test_workflow_orchestrator_blocked_review.py +0 -95
  428. package/tests/test_workflow_selection.py +0 -312
  429. package/tests/test_workflow_selection_coverage.py +0 -114
  430. package/tests/test_workflow_tooling.py +0 -190
package/README.md CHANGED
@@ -8,7 +8,6 @@
8
8
 
9
9
  <p align="center">
10
10
  <a href="https://pypi.org/project/scientific-computing-system/"><img src="https://img.shields.io/pypi/v/scientific-computing-system.svg" alt="PyPI version"></a>
11
- <a href="https://pypi.org/project/scientific-computing-system/"><img src="https://img.shields.io/pypi/dm/scientific-computing-system.svg" alt="PyPI downloads"></a>
12
11
  <a href="https://www.python.org/downloads/"><img src="https://img.shields.io/badge/python-3.10+-green.svg" alt="Python 3.10+"></a>
13
12
  <a href="https://codecov.io/gh/Furox-Art/scientific-computing-system"><img src="https://codecov.io/gh/Furox-Art/scientific-computing-system/branch/main/graph/badge.svg" alt="codecov"></a>
14
13
  <a href="https://github.com/Furox-Art/scientific-computing-system/actions/workflows/tests.yml"><img src="https://github.com/Furox-Art/scientific-computing-system/actions/workflows/tests.yml/badge.svg" alt="CI"></a>
@@ -18,264 +17,136 @@
18
17
  </p>
19
18
 
20
19
  <p align="center">
21
- <a href="https://furox-art.github.io/scientific-computing-system/">Documentation</a> ·
22
- <a href="https://github.com/Furox-Art/scientific-computing-system/releases">Releases</a> ·
23
- <a href="docs/tutorials/">Tutorials</a> ·
24
- <a href="examples/">Examples</a> ·
25
- <a href="SECURITY.md">Security</a>
20
+ <b>Docs</b> ·
21
+ <a href="https://furox-art.github.io/scientific-computing-system/getting-started/">Getting Started</a> ·
22
+ <a href="https://furox-art.github.io/scientific-computing-system/api/">API Reference</a> ·
23
+ <a href="https://furox-art.github.io/scientific-computing-system/cookbook/">Cookbook</a> ·
24
+ <a href="https://furox-art.github.io/scientific-computing-system/benchmarks/">Benchmarks</a> ·
25
+ <b>Project</b> ·
26
+ <a href="https://github.com/Furox-Art/scientific-computing-system/blob/main/CHANGELOG.md">Changelog</a> ·
27
+ <a href="https://github.com/Furox-Art/scientific-computing-system/blob/main/CONTRIBUTING.md">Contributing</a> ·
28
+ <a href="https://github.com/Furox-Art/scientific-computing-system/blob/main/SECURITY.md">Security</a> ·
29
+ <a href="https://github.com/Furox-Art/scientific-computing-system/blob/main/CODE_OF_CONDUCT.md">Code of Conduct</a> ·
30
+ <a href="https://github.com/Furox-Art/scientific-computing-system/blob/main/CITATION.cff">Citation</a> ·
31
+ <a href="https://github.com/Furox-Art/scientific-computing-system/discussions">Discussions</a> ·
32
+ <a href="https://github.com/Furox-Art/scientific-computing-system/issues">Issues</a>
26
33
  </p>
27
34
 
28
- ---
35
+ Download counts: [PyPI stats](https://pypi.org/project/scientific-computing-system/)
29
36
 
30
- ## Current system
37
+ I wrote this because NumPy and SciPy are incredible, but they're also 20 years old and carry two decades of design decisions that don't always make sense anymore.
31
38
 
32
- **Current package line: 2.0.0.**
39
+ This is a from-scratch rethinking of what scientific computing in Python could look like if we started today. No C extensions, no Fortran legacy, no dependency hell. Just Python, type hints, and algorithms that are actually readable.
33
40
 
34
- CDS keeps a **zero-runtime-dependency pure-Python core** while extending the original readable, from-scratch numerical platform into a broader scientific workflow system. The current codebase combines computational methods with explicit validation, uncertainty propagation, sensitivity analysis, dimensional analysis, provenance, approval-gated workflow orchestration, scalable local data I/O, and optional adapters to established scientific libraries.
41
+ This repository is the front door. The NumPy build is [scientific-computing-system-2.0](https://github.com/Furox-Art/scientific-computing-system-2.0), not a second project. Beside it: [axiomize](https://github.com/Furox-Art/axiomize) for units and Model IR, [quantum-reasoning-skill](https://github.com/Furox-Art/quantum-reasoning-skill) for the reasoning skill, and [plan-auditor](https://github.com/Furox-Art/plan-auditor) for a fail-closed agent check. Install this package from PyPI. npm is no longer published.
35
42
 
36
- The core is intended to remain inspectable: algorithms can be read, tested, modified, and used without requiring NumPy, SciPy, BLAS, compiled extensions, or a separate runtime stack. Optional integrations are loaded only when requested.
43
+ The import name is **`cds`** (the distribution is `scientific-computing-system`). The zero-dependency core needs nothing but the standard library.
37
44
 
38
- ```bash
39
- pip install scientific-computing-system
40
- cds info
41
- cds modules
42
- ```
43
-
44
- ## What 2.0 adds
45
-
46
- The 2.0 codebase is not only a collection of numerical algorithms. It now has explicit layers for scientific assurance and reproducibility:
45
+ ## What's inside
47
46
 
48
- - **Scientific validation** — structured checks, cross-method verification, and final-audit support.
49
- - **Uncertainty** — analytic and correlated Monte Carlo uncertainty propagation.
50
- - **Sensitivity analysis** — dependency-free local parameter sensitivity analysis.
51
- - **Units and dimensional analysis** — SI units, conversions, and dimension-aware checks.
52
- - **Workflow orchestration** — approval-gated scientific workflows rather than silent expensive or consequential execution.
53
- - **Provenance** — run manifests, hashes, tool versions, decisions, and checkpoints for reproducibility.
54
- - **Research-data I/O** — memory-bounded streaming plus optional HDF5 and NetCDF backends.
55
- - **Scientific tool adapters** — lazy capability discovery and normalized optional adapters for NumPy/SciPy, statsmodels, scikit-learn, SymPy, and Z3.
56
- - **Modeling and fitting** — symbolic models, equation solving, numerical fitting, diagnostics, and validation paths.
57
- - **Structured hypothesis generation** — falsifiable scientific hypotheses that can be connected to the rest of the computational stack.
47
+ 34 subpackages under `src/cds/`. Run `cds modules` for the live list.
58
48
 
59
- ## Architecture
60
-
61
- The current CLI groups the system into five layers:
62
-
63
- ```text
64
- compute quantum / signals / math / ODE-PDE / integration
65
- analysis stats / probability / ML / modeling / sensitivity
66
- assurance validation / uncertainty / units / provenance
67
- orchestration workflow / optional scientific tools
68
- data data_analysis / streaming I/O / knowledge
69
- ```
70
-
71
- This separation is deliberate: numerical execution, scientific interpretation, verification, orchestration, and data handling are related but not treated as the same concern.
72
-
73
- ## Module map
74
-
75
- | Area | Modules | Main capabilities |
49
+ | Area | Modules | What you get |
76
50
  |---|---|---|
77
- | Quantum | `cds.quantum` | Single- and multi-qubit circuits, Bell/GHZ states, measurement and entanglement utilities |
78
- | Signals | `cds.signals`, `cds.wavelets` | DFT/FFT, convolution, filters, spectral tools, STFT and wavelet operations |
79
- | Mathematics | `cds.math_utils`, `cds.numerical_integration` | Linear algebra, decompositions, calculus, quadrature and numerical utilities |
80
- | Dynamics | `cds.diffeq` | Explicit, adaptive, stiff and symplectic ODE methods plus PDE-related utilities |
81
- | Optimization | `cds.optimization` | Gradient/Newton/Adam methods, Nelder-Mead, annealing and constrained search |
82
- | Statistics | `cds.stats`, `cds.probability`, `cds.bayes` | Inference, regression, statistical tests, distributions, sampling and Bayesian utilities |
83
- | Monte Carlo | `cds.montecarlo` | Monte Carlo integration, simulation, random walks and MCMC utilities |
84
- | Modeling | `cds.modeling` | Symbolic models, equation solving, parameter fitting and model-oriented workflows |
85
- | Machine learning | `cds.ml` | Classical estimators, preprocessing, validation, PCA and readable ML implementations |
86
- | Scientific domains | `cds.scientific`, `cds.genetics`, `cds.fractals`, `cds.infotheory` | Physical constants/formulas, genetics helpers, fractals and information-theory utilities |
87
- | Data | `cds.data_analysis`, `cds.data_io` | Tabular analysis, normalization, visualization helpers, streaming and optional HDF5/NetCDF I/O |
88
- | Units | `cds.units` | SI quantities, conversions and dimensional analysis |
89
- | Uncertainty | `cds.uncertainty` | Analytic and correlated Monte Carlo uncertainty propagation |
90
- | Sensitivity | `cds.sensitivity` | Local parameter sensitivity analysis without mandatory external dependencies |
91
- | Validation | `cds.validation` | Scientific checks, cross-method verification and final audit |
92
- | Workflow | `cds.workflow` | Approval-gated scientific workflow orchestration |
93
- | Provenance | `cds.provenance` | Run manifests, hashes, tool versions, decisions and checkpoints |
94
- | Tools | `cds.tools` | Lazy optional scientific backends and normalized SciPy/SymPy/Z3-style adapters |
95
- | Knowledge | `cds.knowledge` | Knowledge graphs, concept mapping, notes and retrieval |
96
- | Hypotheses | `cds.hypothesis` | Structured, falsifiable scientific hypothesis generation |
97
- | NLP | `cds.nlp` | Educational tokenizer, embeddings, attention, autograd and MiniGPT components |
98
- | Graphs | `cds.graph` | Traversal, shortest paths, spanning trees and topological operations |
99
- | Plotting | `cds.plot` | Optional matplotlib-based scientific plots |
100
-
101
- Run the installed package for the authoritative live module list:
102
-
103
- ```bash
104
- cds modules
105
- ```
106
-
107
- ## Installation profiles
108
-
109
- ### Pure-Python core
51
+ | Linear algebra & calculus | `cds.math_utils`, `cds.interpolate` | SVD, QR, Cholesky, LU, power iteration, derivatives, integrals |
52
+ | ODE / PDE | `cds.diffeq`, `cds.pde` | Euler, RK4, adaptive RK45, implicit stiff methods, symplectic integrators; 1-D heat & wave equations |
53
+ | Quadrature | `cds.numerical_integration` | Trapezoid, Simpson 1/3 & 3/8, Romberg, Gauss-Legendre, adaptive Simpson, 2-D tensor rules |
54
+ | Optimization | `cds.optimization` | Gradient descent, Newton, Adam, Nelder-Mead, simulated annealing, constrained search |
55
+ | Statistics | `cds.stats`, `cds.probability` | Descriptive stats, regression, t/chi-square/ANOVA, effect sizes, nonparametric ranks, time series (ACF/PACF, KPSS, Ljung-Box, decomposition), multiple testing |
56
+ | Bayesian | `cds.bayes` | Conjugate updates, credible intervals, Bayes factors |
57
+ | Monte Carlo | `cds.montecarlo` | π estimation, Monte-Carlo integration, random walks |
58
+ | Machine learning | `cds.ml` | MLP, k-NN, k-means, CART trees, random forest, boosting, PCA, scalers (educational, not production) |
59
+ | Signal processing | `cds.signals`, `cds.wavelets` | DFT/FFT/IFFT, convolution, Butterworth design, STFT, Haar DWT |
60
+ | Quantum | `cds.quantum` | Single & multi-qubit state-vector circuits, Bell/GHZ states, entanglement |
61
+ | Scientific domains | `cds.scientific`, `cds.genetics`, `cds.fractals`, `cds.infotheory` | Physical constants & formulas, DNA analysis, fractals, entropy/divergence |
62
+ | Symbolic modeling | `cds.modeling` | Expression trees, symbolic differentiation, LaTeX export, `MathModel` systems, root finding, fitting |
63
+ | Uncertainty & sensitivity | `cds.uncertainty`, `cds.sensitivity` | Analytic + correlated Monte-Carlo propagation, local & variance-based global sensitivity, identifiability |
64
+ | Validation & causality | `cds.validation`, `cds.causal` | Cross-method checks, drift/OOD reports, assumption-gated causal estimators |
65
+ | Units & dimensional analysis | `cds.units` | SI quantities, conversions, dimension compatibility checks |
66
+ | Workflow & provenance | `cds.workflow`, `cds.provenance` | Approval-gated orchestration, run manifests, hashes, checkpoints |
67
+ | Data | `cds.data_analysis`, `cds.data_io` | CSV/tabular analysis, streaming I/O, optional HDF5/NetCDF |
68
+ | Knowledge & hypothesis | `cds.knowledge`, `cds.hypothesis` | Concept graphs, research notes, structured hypothesis generation & evaluation |
69
+ | NLP (educational) | `cds.nlp` | BPE, embeddings, attention, autograd, MiniGPT |
70
+ | Plotting | `cds.plot` | Optional matplotlib helpers (`[plot]` extra) |
71
+ | Backend adapters | `cds.tools` | Lazy discovery for NumPy/SciPy/statsmodels/scikit-learn/SymPy/Z3 |
72
+
73
+ ## Quick Start
110
74
 
111
75
  ```bash
112
76
  pip install scientific-computing-system
113
77
  ```
114
78
 
115
- The base package has **zero runtime dependencies**.
116
-
117
- ### Scientific reference backends
118
-
119
- ```bash
120
- pip install "scientific-computing-system[scientific]"
121
- ```
122
-
123
- This enables optional NumPy, SciPy, statsmodels, scikit-learn, SymPy, and Z3-backed tooling used through the capability/adaptor layer.
124
-
125
- ### Research data I/O
126
-
127
- ```bash
128
- pip install "scientific-computing-system[io]"
129
- ```
130
-
131
- Adds optional HDF5 and NetCDF support while keeping core streaming/CSV functionality dependency-free.
132
-
133
- ### Plotting
134
-
135
- ```bash
136
- pip install "scientific-computing-system[plot]"
137
- ```
138
-
139
- ### Dashboard
140
-
141
- ```bash
142
- pip install "scientific-computing-system[dashboard]"
143
- cds dashboard
144
- ```
145
-
146
- ### Everything
147
-
148
- ```bash
149
- pip install "scientific-computing-system[all]"
150
- ```
151
-
152
- ## Quick examples
153
-
154
- ### Numerical computing
155
-
156
79
  ```python
80
+ from cds.math_utils import svd
81
+ from cds.diffeq import solve_system
157
82
  from cds.stats import linear_regression
158
- from cds.signals import fft_radix2
159
- from cds.quantum import bell_state, is_entangled
160
83
 
161
- fit = linear_regression([1, 2, 3], [2.1, 3.9, 6.2])
162
- spectrum = fft_radix2([complex(i) for i in range(8)])
163
- state = bell_state(0)
84
+ # 1. SVD — result is an SVDResult, not a tuple
85
+ result = svd([[1.0, 2.0], [3.0, 4.0]])
86
+ print("singular_values =", [round(v, 6) for v in result.singular_values])
164
87
 
165
- print(fit.slope)
166
- print(spectrum)
167
- print(is_entangled(state))
168
- ```
169
88
 
170
- ### Mathematical modeling
89
+ # 2. Damped harmonic oscillator: y'' = -y - 0.1 y'
90
+ def rhs(t, y):
91
+ return [y[1], -y[0] - 0.1 * y[1]]
171
92
 
172
- ```python
173
- from cds.modeling import Variable, solve_equation
174
-
175
- x = Variable("x")
176
- result = solve_equation(x**2 - 2, variable="x", x0=1.0)
177
- print(result.x)
178
- ```
179
-
180
- ### Scientific constants
181
93
 
182
- ```python
183
- from cds.scientific import get_constant, kinetic_energy
94
+ t, y = solve_system(rhs, 0.0, [1.0, 0.0], 50.0, dt=0.01)
95
+ print("final t =", round(t[-1], 2), "| final y =", [round(v, 8) for v in y[-1]])
184
96
 
185
- print(get_constant("c"))
186
- print(kinetic_energy(10, 5))
97
+ # 3. Least-squares line fit
98
+ fit = linear_regression([1.0, 2.0, 3.0, 4.0, 5.0], [2.1, 3.9, 6.2, 7.8, 10.1])
99
+ print(f"slope = {fit.slope:.4f} | intercept = {fit.intercept:.4f} | r^2 = {fit.r_squared:.4f}")
187
100
  ```
188
101
 
189
- ## Scientific assurance
190
-
191
- CDS 2.0 separates a computed result from the evidence supporting that result. Depending on the workflow, the package can combine:
192
-
193
- 1. explicit inputs and assumptions;
194
- 2. unit/dimensional checks;
195
- 3. numerical or statistical computation;
196
- 4. uncertainty propagation;
197
- 5. parameter sensitivity analysis;
198
- 6. independent or cross-method validation;
199
- 7. provenance capture;
200
- 8. a final workflow/audit decision.
201
-
202
- The goal is not to claim that every result is automatically correct. The goal is to make the path from input to result **inspectable, reproducible, and falsifiable**.
102
+ Real output (executed verbatim; pasted from an actual run):
203
103
 
204
- ## Optional scientific backends
205
-
206
- The core package does not silently require external numerical libraries. Optional backends exist for cases where an independent reference implementation or specialized solver is useful.
207
-
208
- The current optional scientific extra includes:
209
-
210
- - NumPy
211
- - SciPy
212
- - statsmodels
213
- - scikit-learn
214
- - SymPy
215
- - Z3
216
-
217
- Availability is discovered lazily through `cds.tools`; the dependency-free core remains usable when those packages are absent.
218
-
219
- ## Why a pure-Python core?
220
-
221
- CDS makes a different trade-off from high-performance scientific libraries. Its priority is readability, portability, inspectability, and cross-domain composition.
222
-
223
- Use CDS when you want to:
224
-
225
- - inspect an algorithm rather than treat it as a compiled black box;
226
- - teach or learn numerical/scientific methods from readable source;
227
- - prototype across multiple scientific domains under one package;
228
- - build reproducible local workflows with explicit validation and provenance;
229
- - run a lightweight scientific stack where binary dependencies are undesirable;
230
- - compare a pure-Python implementation with optional established scientific backends.
104
+ ```text
105
+ singular_values = [5.464986, 0.365966]
106
+ final t = 50.0 | final y = [0.07638443, 0.0264785]
107
+ slope = 1.9900 | intercept = 0.0500 | r^2 = 0.9973
108
+ ```
231
109
 
232
- For very large array workloads, production HPC, GPU-heavy computation, or specialized high-performance solvers, use the appropriate NumPy/SciPy/JAX/PyTorch/domain-specific stack directly or through an optional integration where appropriate.
110
+ A CLI ships with the package:
233
111
 
234
- ## Development and validation
112
+ ```console
113
+ $ cds --version
114
+ System version 2.2.0
115
+ $ cds modules # live module catalog
116
+ $ cds constants # physical constants table
117
+ ```
235
118
 
236
- The repository uses automated testing, strict typing and CI across supported Python versions/platforms. The live CI badges and workflow files are the authoritative source for current test counts and status; the README intentionally avoids hard-coding test totals that quickly become stale.
119
+ Full docs: [furox-art.github.io/scientific-computing-system](https://furox-art.github.io/scientific-computing-system/).
237
120
 
238
- ```bash
239
- git clone https://github.com/Furox-Art/scientific-computing-system.git
240
- cd scientific-computing-system
241
- python -m venv .venv
242
- ```
121
+ ## Optional extras
243
122
 
244
- macOS/Linux:
123
+ The core is zero-dependency. Everything below is opt-in:
245
124
 
246
125
  ```bash
247
- source .venv/bin/activate
248
- pip install -e ".[dev]"
249
- pytest
126
+ pip install "scientific-computing-system[scientific]" # NumPy, SciPy, statsmodels, scikit-learn, SymPy, Z3
127
+ pip install "scientific-computing-system[io]" # HDF5 + NetCDF
128
+ pip install "scientific-computing-system[plot]" # matplotlib
129
+ pip install "scientific-computing-system[dashboard]" # Streamlit dashboard
250
130
  ```
251
131
 
252
- Windows PowerShell:
132
+ ## Common use cases
253
133
 
254
- ```powershell
255
- .\.venv\Scripts\Activate.ps1
256
- pip install -e ".[dev]"
257
- pytest
258
- ```
134
+ - Learn and inspect **numerical methods in pure Python** without compiled extensions.
135
+ - Prototype **scientific computing** workflows with transparent implementations.
136
+ - Explore **ODE/PDE solvers**, numerical integration, optimization, Monte Carlo, signal processing, and linear algebra.
137
+ - Run **statistics, uncertainty quantification, sensitivity analysis, dimensional analysis, and reproducible research** workflows.
138
+ - Teach or audit algorithms where readable source code matters more than raw NumPy/SciPy performance.
259
139
 
260
- ## Documentation and examples
140
+ ## The catch
261
141
 
262
- - [`examples/`](examples/) — runnable scientific examples
263
- - [`docs/`](docs/) — documentation, tutorials, benchmarks and research workflows
264
- - [`CHANGELOG.md`](CHANGELOG.md) — historical release record
265
- - [`CONTRIBUTING.md`](CONTRIBUTING.md) — contribution workflow
266
- - [`SECURITY.md`](SECURITY.md) — security policy and trust boundaries
267
- - [`CITATION.cff`](CITATION.cff) — citation metadata
142
+ Pure Python is slower than NumPy on dense numerics. On this machine's benchmark run, 100×100 matrix multiplication took ~0.05 s versus ~0.0001 s for NumPy — roughly **580× slower**. That is the price of readable source. See [docs/benchmarks.md](https://github.com/Furox-Art/scientific-computing-system/blob/main/docs/benchmarks.md) for the full measurements, their provenance, and the hardware they came from.
268
143
 
269
- ## Relationship to scientific-computing-system-2.0
144
+ The trade-off buys you something real: you can read every algorithm, follow every step, and change anything without compiling C.
270
145
 
271
- This repository is the **pure-Python, zero-runtime-dependency CDS line**. The separate [`scientific-computing-system-2.0`](https://github.com/Furox-Art/scientific-computing-system-2.0) project deliberately makes the opposite performance trade-off: it builds on NumPy/SciPy/pandas/matplotlib and adds compiled/GPU acceleration and a broader production-oriented scientific Python stack.
146
+ I use it for prototyping, for teaching, and for cases where I need to know exactly what the computer is doing. For production number crunching, I still reach for NumPy — or the companion project [`scientific-computing-system-2.0`](https://github.com/Furox-Art/scientific-computing-system-2.0), which takes the opposite trade-off on NumPy/SciPy.
272
147
 
273
148
  ## License
274
149
 
275
- MIT — see [`LICENSE`](LICENSE).
276
-
277
- ## Contact
278
-
279
- Maintainer: [@Furox-Art](https://github.com/Furox-Art)
150
+ MIT — see [LICENSE](LICENSE).
280
151
 
281
- For bugs and feature requests, use the repository issue tracker. Security vulnerabilities should be reported through the process in [`SECURITY.md`](SECURITY.md), not as public issues.
152
+ If you use this in published work, please cite it via [`CITATION.cff`](CITATION.cff).
package/SECURITY.md CHANGED
File without changes
package/bin/scs.js CHANGED
@@ -1,2 +1,12 @@
1
- #!/usr/bin/env node
2
- require('../index.js').runSCS(process.argv.slice(2));
1
+ #!/usr/bin/env node
2
+ /**
3
+ * `scs` console shim.
4
+ *
5
+ * Resolves the launcher relative to this file rather than the process CWD so
6
+ * the shim works when invoked through an npx-installed symlink from any
7
+ * directory.
8
+ */
9
+
10
+ 'use strict';
11
+
12
+ require('../index.js').runSCS(process.argv.slice(2));
package/index.js CHANGED
@@ -1 +1,115 @@
1
- const { spawn } = require('child_process'); function runSCS(args) { const python = process.platform === 'win32' ? 'python' : 'python3'; const proc = spawn(python, ['-m', 'scs.cli', ...args], { stdio: 'inherit', cwd: __dirname }); proc.on('close', (code) =; } module.exports = { runSCS }; if (require.main === module) { runSCS(process.argv.slice(2)); }
1
+ /**
2
+ * Node entry point for the Scientific Computing System CLI.
3
+ *
4
+ * This module is a thin, dependency-free launcher. It locates a Python
5
+ * interpreter and forwards every argument to the package's own CLI, which is
6
+ * the single authoritative implementation:
7
+ *
8
+ * python -m cds [args...]
9
+ *
10
+ * Two rules are enforced by `npm test` (npm.test.mjs) and by CI:
11
+ *
12
+ * 1. The interpreter invocation must target the `cds` module. The PyPI
13
+ * distribution is named `scientific-computing-system`, but its *import*
14
+ * name is `cds` (see pyproject.toml `[tool.hatch.build.targets.wheel]`
15
+ * -> `packages = ["src/cds"]`). An earlier revision of this file spawned
16
+ * `python -m scs.cli`, a module that has never existed in any release;
17
+ * every `npx scs ...` invocation therefore died with ModuleNotFoundError.
18
+ * 2. The child's exit status must be propagated. Swallowing it would make
19
+ * `scs` report success for failing scientific runs, which is worse than
20
+ * not shipping a Node wrapper at all.
21
+ */
22
+
23
+ 'use strict';
24
+
25
+ const { spawn, spawnSync } = require('node:child_process');
26
+
27
+ /** Argument orders to try when resolving a Python interpreter. */
28
+ const PYTHON_CANDIDATES = process.platform === 'win32'
29
+ ? ['python', 'python3', 'py']
30
+ : ['python3', 'python'];
31
+
32
+ /**
33
+ * Resolve the first interpreter that actually runs.
34
+ *
35
+ * `spawn` alone cannot be used for discovery: if the binary is missing, the
36
+ * error surfaces asynchronously *after* the caller has already been handed a
37
+ * child object. Probing with `spawnSync` keeps resolution synchronous and lets
38
+ * the launcher produce one actionable message instead of an ENOENT event.
39
+ *
40
+ * @param {string[]} [extraArgs] Arguments used only to prove the interpreter works.
41
+ * @returns {string|null} The resolved interpreter, or null when none work.
42
+ */
43
+ function resolvePython(extraArgs) {
44
+ const args = extraArgs || ['--version'];
45
+ for (const candidate of PYTHON_CANDIDATES) {
46
+ const probe = spawnSync(candidate, args, { stdio: 'ignore' });
47
+ if (!probe.error && probe.status === 0) {
48
+ return candidate;
49
+ }
50
+ }
51
+ return null;
52
+ }
53
+
54
+ /**
55
+ * Build the argument vector handed to the Python CLI.
56
+ *
57
+ * Kept exported (and pure) so the contract test can assert the module target
58
+ * without spawning a subprocess.
59
+ *
60
+ * @param {string[]} [args] CLI arguments forwarded from Node.
61
+ * @returns {string[]} The `python -m cds ...` argument vector.
62
+ */
63
+ function buildPythonArgs(args) {
64
+ return ['-m', 'cds'].concat(args || []);
65
+ }
66
+
67
+ /**
68
+ * Run the Scientific Computing System CLI.
69
+ *
70
+ * @param {string[]} [args] CLI arguments forwarded from Node.
71
+ * @returns {number} The child's exit code (1 when no interpreter was found).
72
+ */
73
+ function runSCS(args) {
74
+ const python = resolvePython();
75
+ if (python === null) {
76
+ process.stderr.write(
77
+ 'scientific-computing-system: no usable Python interpreter found.\n' +
78
+ 'Tried: ' + PYTHON_CANDIDATES.join(', ') + '\n' +
79
+ 'Install Python 3.10 or newer, or invoke the CLI directly with ' +
80
+ '`python -m cds` after `pip install scientific-computing-system`.\n'
81
+ );
82
+ return 1;
83
+ }
84
+
85
+ const child = spawn(python, buildPythonArgs(args), {
86
+ stdio: 'inherit',
87
+ cwd: __dirname,
88
+ });
89
+
90
+ child.on('error', (error) => {
91
+ process.stderr.write(
92
+ 'scientific-computing-system: failed to start `' + python + '`: ' + error.message + '\n'
93
+ );
94
+ process.exitCode = 1;
95
+ });
96
+
97
+ // Propagate the child's exit status verbatim. `127` mirrors the shell
98
+ // convention for "command could not be executed".
99
+ child.on('exit', (code, signal) => {
100
+ if (signal) {
101
+ process.stderr.write('scientific-computing-system: terminated by signal ' + signal + '\n');
102
+ process.exitCode = 1;
103
+ return;
104
+ }
105
+ process.exitCode = code === null ? 127 : code;
106
+ });
107
+
108
+ return child.pid === undefined ? 1 : 0;
109
+ }
110
+
111
+ module.exports = { runSCS, buildPythonArgs, resolvePython, PYTHON_CANDIDATES };
112
+
113
+ if (require.main === module) {
114
+ runSCS(process.argv.slice(2));
115
+ }
package/package.json CHANGED
@@ -1 +1,45 @@
1
- {"name":"scientific-computing-system","version":"1.0.0","description":"Cognitive Discovery System - pure Python scientific computing","main":"index.js","bin":{"scs":"./bin/scs.js"},"scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"keywords":["scientific-computing","quantum","machine-learning","statistics","ode-solvers"],"author":"Furox-Art","license":"MIT","repository":{"type":"git","url":"git+https://github.com/Furox-Art/scientific-computing-system.git"},"bugs":{"url":"https://github.com/Furox-Art/scientific-computing-system/issues"},"homepage":"https://github.com/Furox-Art/scientific-computing-system#readme"}
1
+ {
2
+ "name": "scientific-computing-system",
3
+ "version": "2.2.0",
4
+ "description": "Scientific Computing System launcher - a thin Node wrapper that forwards to the pure-Python `cds` CLI. This npm package ships NO Python code: it requires the Python distribution to be installed (`pip install scientific-computing-system`), otherwise `scs` exits non-zero with an actionable message.",
5
+ "main": "index.js",
6
+ "bin": {
7
+ "scs": "./bin/scs.js"
8
+ },
9
+ "files": [
10
+ "index.js",
11
+ "bin/scs.js",
12
+ "LICENSE",
13
+ "README.md",
14
+ "CHANGELOG.md",
15
+ "SECURITY.md"
16
+ ],
17
+ "scripts": {
18
+ "check": "node --check index.js && node --check bin/scs.js",
19
+ "pretest": "npm run check",
20
+ "test": "node --test npm.test.js",
21
+ "lint": "npm run check"
22
+ },
23
+ "keywords": [
24
+ "scientific-computing",
25
+ "quantum",
26
+ "machine-learning",
27
+ "statistics",
28
+ "ode-solvers",
29
+ "cli",
30
+ "launcher"
31
+ ],
32
+ "author": "Furox-Art",
33
+ "license": "MIT",
34
+ "engines": {
35
+ "node": ">=18"
36
+ },
37
+ "repository": {
38
+ "type": "git",
39
+ "url": "git+https://github.com/Furox-Art/scientific-computing-system.git"
40
+ },
41
+ "bugs": {
42
+ "url": "https://github.com/Furox-Art/scientific-computing-system/issues"
43
+ },
44
+ "homepage": "https://github.com/Furox-Art/scientific-computing-system#readme"
45
+ }
package/.binder/postBuild DELETED
@@ -1,9 +0,0 @@
1
- #!/usr/bin/env bash
2
- # Runs after Binder builds the environment. Installs the package itself
3
- # (and its declared runtime deps) so the demo notebooks can `import cds`.
4
- # We install without the dashboard extras to keep the image lean; the tour
5
- # notebooks only use the pure-Python numerical/quantum modules.
6
- set -euo pipefail
7
-
8
- python -m pip install --no-input -e .
9
- echo "✅ cds installed in Binder image"
@@ -1,10 +0,0 @@
1
- # Binder image dependencies.
2
- #
3
- # The CDS package itself is installed by .binder/postBuild (editable, from the
4
- # repo checkout). This file only lists the extras the demo notebooks pull in at
5
- # runtime that are NOT already declared in pyproject.toml's core dependencies:
6
- # - matplotlib : the "Tour of Numerical Methods" notebooks render plots inline
7
- #
8
- # Keep intentionally minimal — Binder memory/time is constrained, and CDS's
9
- # pitch is "no heavy dependencies". This list must stay short.
10
- matplotlib>=3.7
package/.gitattributes DELETED
@@ -1,35 +0,0 @@
1
- # Linguist overrides for GitHub language statistics.
2
- #
3
- # `scripts/render_promo.mjs` is a local build/render helper (generates the
4
- # promo image), not part of the published package. Marking it as
5
- # `linguist-generated` keeps the repository listed as pure Python, which
6
- # matches the project's "pure Python scientific computing" positioning.
7
-
8
- scripts/render_promo.mjs linguist-generated=true
9
-
10
- # Line-ending normalization. Normalize all text to LF in the repo so the
11
- # same blob checks out identically on every platform; Git still hands the
12
- # working copy the OS-preferred ending via core.autocrlf where configured.
13
- # This prevents the "LF will be replaced by CRLF" warnings and the noisy
14
- # whole-file diffs that pure line-ending flips cause.
15
- * text=auto eol=lf
16
-
17
- # Windows-only scripts keep their native CRLF.
18
- *.bat text eol=crlf
19
- *.cmd text eol=crlf
20
- *.ps1 text eol=crlf
21
-
22
- # Binary assets — never normalize, never diff as text.
23
- *.png binary
24
- *.jpg binary
25
- *.jpeg binary
26
- *.gif binary
27
- *.webp binary
28
- *.ico binary
29
- *.pdf binary
30
- *.mp4 binary
31
- *.webm binary
32
- *.zip binary
33
- *.gz binary
34
- *.whl binary
35
- *.sqlite binary
@@ -1,4 +0,0 @@
1
- # CODEOWNERS file
2
- # See https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners
3
-
4
- * @Furox-Art
@@ -1,3 +0,0 @@
1
- # These are supported funding model platforms
2
-
3
- github: [Furox-Art]