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.
- package/CHANGELOG.md +284 -0
- package/LICENSE +0 -0
- package/README.md +89 -218
- package/SECURITY.md +0 -0
- package/bin/scs.js +12 -2
- package/index.js +115 -1
- package/package.json +45 -1
- package/.binder/postBuild +0 -9
- package/.binder/requirements.txt +0 -10
- package/.gitattributes +0 -35
- package/.github/CODEOWNERS +0 -4
- package/.github/FUNDING.yml +0 -3
- package/.github/ISSUE_TEMPLATE/bug_report.md +0 -50
- package/.github/ISSUE_TEMPLATE/config.yml +0 -8
- package/.github/ISSUE_TEMPLATE/feature_request.md +0 -28
- package/.github/PULL_REQUEST_TEMPLATE.md +0 -29
- package/.github/dependabot.yml +0 -32
- package/.github/labeler.yml +0 -50
- package/.github/workflows/benchmarks.yml +0 -97
- package/.github/workflows/bot-reviewer.yml +0 -58
- package/.github/workflows/changelog.yml +0 -130
- package/.github/workflows/cli-package-smoke.yml +0 -45
- package/.github/workflows/codeql.yml +0 -55
- package/.github/workflows/npm-publish.yml +0 -33
- package/.github/workflows/p08-cancel-noncanonical-runs.yml +0 -41
- package/.github/workflows/pr-automation.yml +0 -78
- package/.github/workflows/public-external-validation-p08-v2-glm.yml +0 -161
- package/.github/workflows/public-external-validation-p08-v2-recovery-merge-gate.yml +0 -72
- package/.github/workflows/public-external-validation-p08-v2-recovery-merge.yml +0 -113
- package/.github/workflows/public-external-validation-p08-v2-run-recovery-anatomy-gate.yml +0 -57
- package/.github/workflows/public-external-validation-p08-v2-run-recovery-merge-gate.yml +0 -63
- package/.github/workflows/public-external-validation-p08-v2-run-recovery-merge.yml +0 -89
- package/.github/workflows/public-external-validation-p08-v2-run-recovery.yml +0 -182
- package/.github/workflows/public-external-validation-p08-v3-glm-gate.yml +0 -67
- package/.github/workflows/public-external-validation-p08-v4-recovery-glm-gate.yml +0 -78
- package/.github/workflows/public-external-validation-p08-v4-recovery-glm.yml +0 -248
- package/.github/workflows/public-external-validation-p08-v5-run-recovery-glm-gate.yml +0 -66
- package/.github/workflows/public-external-validation-p08-v5-run-recovery-glm.yml +0 -218
- package/.github/workflows/pypi-registry-smoke.yml +0 -116
- package/.github/workflows/release.yml +0 -359
- package/.github/workflows/tests.yml +0 -250
- package/.github/workflows/tmp-compassion-raw-acquire.yml +0 -63
- package/.github/workflows/wsl-science-runner-smoke.yml +0 -45
- package/.pre-commit-config.yaml +0 -48
- package/CITATION.cff +0 -29
- package/CODE_OF_CONDUCT.md +0 -25
- package/CONTRIBUTING.md +0 -275
- package/ROADMAP.md +0 -155
- package/assets/logo.svg +0 -38
- package/assets/social_preview.png +0 -0
- package/benchmarks/results.json +0 -43
- package/benchmarks/robust_runner.py +0 -118
- package/benchmarks/run_benchmarks.py +0 -394
- package/cliff.toml +0 -100
- package/dashboard/app.py +0 -224
- package/docs/ARCHITECTURE.md +0 -252
- package/docs/CASE_STUDY_HUBBLE.md +0 -78
- package/docs/CASE_STUDY_QUANTUM_ML.md +0 -79
- package/docs/api.md +0 -133
- package/docs/assets/icon.svg +0 -17
- package/docs/assets/logo.svg +0 -38
- package/docs/benchmarks.md +0 -62
- package/docs/cookbook.md +0 -930
- package/docs/getting-started.md +0 -185
- package/docs/index.md +0 -111
- package/docs/maintenance.md +0 -61
- package/docs/ml_reference.md +0 -92
- package/docs/research-workflows.md +0 -82
- package/docs/stylesheets/extra.css +0 -122
- package/docs/tour_of_numerical_methods.md +0 -330
- package/docs/tutorials/core_demo.md +0 -35
- package/docs/tutorials/data_analysis_demo.md +0 -43
- package/docs/tutorials/diffeq_demo.md +0 -48
- package/docs/tutorials/fft2_demo.md +0 -67
- package/docs/tutorials/graph_demo.md +0 -45
- package/docs/tutorials/hypothesis_demo.md +0 -44
- package/docs/tutorials/hypothesis_tests_demo.md +0 -170
- package/docs/tutorials/hypothesis_with_stats_demo.md +0 -80
- package/docs/tutorials/knowledge_demo.md +0 -114
- package/docs/tutorials/linalg_demo.md +0 -103
- package/docs/tutorials/math_utils_demo.md +0 -46
- package/docs/tutorials/ml_advanced_demo.md +0 -96
- package/docs/tutorials/ml_and_viz_demo.md +0 -93
- package/docs/tutorials/ml_demo.md +0 -70
- package/docs/tutorials/modeling_demo.md +0 -82
- package/docs/tutorials/montecarlo_demo.md +0 -42
- package/docs/tutorials/nlp_attention_demo.md +0 -107
- package/docs/tutorials/nlp_bpe_demo.md +0 -103
- package/docs/tutorials/nlp_mini_gpt_demo.md +0 -110
- package/docs/tutorials/nlp_viz.md +0 -76
- package/docs/tutorials/numerical_integration_demo.md +0 -65
- package/docs/tutorials/optimization_demo.md +0 -106
- package/docs/tutorials/pandas_io_demo.md +0 -160
- package/docs/tutorials/pca_demo.md +0 -87
- package/docs/tutorials/probability_demo.md +0 -48
- package/docs/tutorials/quantum_demo.md +0 -31
- package/docs/tutorials/quick_start.md +0 -44
- package/docs/tutorials/scientific_demo.md +0 -46
- package/docs/tutorials/signals_demo.md +0 -167
- package/docs/tutorials/stats_demo.md +0 -94
- package/docs/tutorials/stiff_ode_demo.md +0 -84
- package/docs/tutorials/time_series_demo.md +0 -145
- package/examples/core_demo.py +0 -40
- package/examples/data_analysis_demo.py +0 -60
- package/examples/diffeq_demo.py +0 -34
- package/examples/discovery_pipeline_demo.py +0 -57
- package/examples/ensemble_showcase.py +0 -81
- package/examples/fft2_demo.py +0 -32
- package/examples/graph_demo.py +0 -49
- package/examples/hypothesis_custom_generator.py +0 -121
- package/examples/hypothesis_demo.py +0 -48
- package/examples/hypothesis_tests_demo.py +0 -52
- package/examples/hypothesis_with_stats_demo.py +0 -43
- package/examples/interpolate_demo.py +0 -57
- package/examples/knowledge_demo.py +0 -100
- package/examples/linalg_demo.py +0 -61
- package/examples/math_utils_demo.py +0 -53
- package/examples/ml_and_viz_demo.py +0 -47
- package/examples/modeling_demo.py +0 -110
- package/examples/montecarlo_demo.py +0 -41
- package/examples/nlp_attention_demo.py +0 -168
- package/examples/nlp_bpe_demo.py +0 -79
- package/examples/nlp_mini_gpt_demo.py +0 -76
- package/examples/nlp_viz_demo.py +0 -98
- package/examples/numerical_integration_demo.py +0 -60
- package/examples/optimization_demo.py +0 -34
- package/examples/pca_demo.py +0 -124
- package/examples/pde_demo.py +0 -65
- package/examples/plot_demo.py +0 -84
- package/examples/plotting_notebook.ipynb +0 -87
- package/examples/probability_demo.py +0 -39
- package/examples/quantum_demo.py +0 -42
- package/examples/scientific_demo.py +0 -49
- package/examples/signals_demo.py +0 -86
- package/examples/stats_demo.py +0 -40
- package/examples/tour_of_numerical_methods.ipynb +0 -497
- package/mkdocs.yml +0 -159
- package/pyproject.toml +0 -288
- package/requirements-dev.lock +0 -427
- package/requirements-dev.txt +0 -39
- package/requirements.lock +0 -6
- package/requirements.txt +0 -13
- package/scripts/build_gif.py +0 -111
- package/scripts/build_video.py +0 -214
- package/scripts/cleanup_deployments.py +0 -173
- package/scripts/crop_readme_png.py +0 -40
- package/scripts/make_pi_dashboard.py +0 -316
- package/scripts/make_pi_gif.py +0 -138
- package/scripts/publish.py +0 -203
- package/scripts/render_promo.mjs +0 -93
- package/scripts/render_readme.py +0 -211
- package/scripts/render_readme_sections.py +0 -168
- package/scripts/verify_cli_install.py +0 -99
- package/scripts/verify_cookbook.py +0 -601
- package/scripts/verify_d1_numerics.py +0 -504
- package/scripts/verify_d2_edge_cases.py +0 -442
- package/scripts/verify_d4_hypothesis.py +0 -337
- package/scripts/verify_ml_reference.py +0 -160
- package/scripts/verify_pypi_release.py +0 -97
- package/scripts/verify_release_integrity.py +0 -194
- package/src/cds/__init__.py +0 -132
- package/src/cds/__main__.py +0 -8
- package/src/cds/_version.py +0 -11
- package/src/cds/bayes/__init__.py +0 -25
- package/src/cds/bayes/conjugate.py +0 -560
- package/src/cds/cli/__init__.py +0 -104
- package/src/cds/cli/__main__.py +0 -8
- package/src/cds/cli/_handlers.py +0 -323
- package/src/cds/cli/_parser.py +0 -155
- package/src/cds/cli/_style.py +0 -208
- package/src/cds/cli/_system_info.py +0 -71
- package/src/cds/core/__init__.py +0 -5
- package/src/cds/core/_numeric.py +0 -92
- package/src/cds/core/models.py +0 -166
- package/src/cds/data_analysis/__init__.py +0 -30
- package/src/cds/data_analysis/dataset.py +0 -122
- package/src/cds/data_analysis/loader.py +0 -75
- package/src/cds/data_analysis/pandas_io.py +0 -108
- package/src/cds/data_analysis/transform.py +0 -36
- package/src/cds/data_analysis/viz.py +0 -88
- package/src/cds/data_io/__init__.py +0 -27
- package/src/cds/data_io/streaming.py +0 -314
- package/src/cds/diffeq/__init__.py +0 -37
- package/src/cds/diffeq/_implicit.py +0 -349
- package/src/cds/diffeq/solvers.py +0 -312
- package/src/cds/diffeq/symplectic.py +0 -225
- package/src/cds/fractals/__init__.py +0 -34
- package/src/cds/fractals/sets.py +0 -356
- package/src/cds/genetics/__init__.py +0 -22
- package/src/cds/genetics/sequence.py +0 -199
- package/src/cds/graph/__init__.py +0 -31
- package/src/cds/graph/algorithms.py +0 -399
- package/src/cds/hypothesis/__init__.py +0 -51
- package/src/cds/hypothesis/evaluator.py +0 -311
- package/src/cds/hypothesis/generator.py +0 -275
- package/src/cds/hypothesis/mining.py +0 -314
- package/src/cds/infotheory/__init__.py +0 -25
- package/src/cds/infotheory/measures.py +0 -276
- package/src/cds/interpolate/__init__.py +0 -156
- package/src/cds/knowledge/__init__.py +0 -45
- package/src/cds/knowledge/graph.py +0 -489
- package/src/cds/knowledge/notes.py +0 -231
- package/src/cds/knowledge/retrieval.py +0 -339
- package/src/cds/math_utils/__init__.py +0 -46
- package/src/cds/math_utils/calculus.py +0 -40
- package/src/cds/math_utils/linalg.py +0 -496
- package/src/cds/math_utils/special.py +0 -167
- package/src/cds/math_utils/svd.py +0 -261
- package/src/cds/ml/__init__.py +0 -60
- package/src/cds/ml/boosting.py +0 -304
- package/src/cds/ml/clustering.py +0 -190
- package/src/cds/ml/decomposition.py +0 -172
- package/src/cds/ml/ensemble.py +0 -152
- package/src/cds/ml/linear_models.py +0 -225
- package/src/cds/ml/metrics.py +0 -227
- package/src/cds/ml/model_selection.py +0 -150
- package/src/cds/ml/naive_bayes.py +0 -179
- package/src/cds/ml/neighbors.py +0 -162
- package/src/cds/ml/neural.py +0 -204
- package/src/cds/ml/preprocessing.py +0 -131
- package/src/cds/ml/tree.py +0 -228
- package/src/cds/ml/voting.py +0 -175
- package/src/cds/modeling/__init__.py +0 -44
- package/src/cds/modeling/_base.py +0 -210
- package/src/cds/modeling/_nodes.py +0 -526
- package/src/cds/modeling/expression.py +0 -81
- package/src/cds/modeling/fitting.py +0 -477
- package/src/cds/modeling/model.py +0 -134
- package/src/cds/modeling/solver.py +0 -187
- package/src/cds/montecarlo/__init__.py +0 -24
- package/src/cds/montecarlo/markov.py +0 -112
- package/src/cds/montecarlo/methods.py +0 -294
- package/src/cds/nlp/__init__.py +0 -170
- package/src/cds/nlp/attention.py +0 -285
- package/src/cds/nlp/autograd/__init__.py +0 -70
- package/src/cds/nlp/autograd/_grad.py +0 -120
- package/src/cds/nlp/autograd/ops.py +0 -133
- package/src/cds/nlp/autograd/tensor.py +0 -298
- package/src/cds/nlp/bpe.py +0 -449
- package/src/cds/nlp/data.py +0 -70
- package/src/cds/nlp/embed.py +0 -190
- package/src/cds/nlp/layers.py +0 -259
- package/src/cds/nlp/model.py +0 -456
- package/src/cds/nlp/optim.py +0 -163
- package/src/cds/nlp/training.py +0 -167
- package/src/cds/nlp/viz.py +0 -254
- package/src/cds/numerical_integration/__init__.py +0 -31
- package/src/cds/numerical_integration/quadrature.py +0 -480
- package/src/cds/optimization/__init__.py +0 -26
- package/src/cds/optimization/_metaheuristics.py +0 -287
- package/src/cds/optimization/constrained.py +0 -212
- package/src/cds/optimization/minimize.py +0 -425
- package/src/cds/pde/__init__.py +0 -266
- package/src/cds/plot/__init__.py +0 -49
- package/src/cds/plot/_backend.py +0 -32
- package/src/cds/plot/charts.py +0 -462
- package/src/cds/probability/__init__.py +0 -65
- package/src/cds/probability/_advanced.py +0 -283
- package/src/cds/probability/distributions.py +0 -236
- package/src/cds/probability/extra_distributions.py +0 -199
- package/src/cds/provenance/__init__.py +0 -25
- package/src/cds/provenance/manifest.py +0 -355
- package/src/cds/py.typed +0 -0
- package/src/cds/quantum/__init__.py +0 -51
- package/src/cds/quantum/circuit.py +0 -122
- package/src/cds/quantum/multi_qubit.py +0 -310
- package/src/cds/quantum/simulator.py +0 -53
- package/src/cds/scientific/__init__.py +0 -34
- package/src/cds/scientific/constants.py +0 -35
- package/src/cds/scientific/formulas.py +0 -116
- package/src/cds/sensitivity.py +0 -204
- package/src/cds/signals/__init__.py +0 -59
- package/src/cds/signals/filters.py +0 -449
- package/src/cds/signals/processing.py +0 -224
- package/src/cds/signals/stft.py +0 -177
- package/src/cds/signals/wavelet.py +0 -146
- package/src/cds/stats/__init__.py +0 -99
- package/src/cds/stats/_distributions.py +0 -102
- package/src/cds/stats/bootstrap.py +0 -188
- package/src/cds/stats/descriptive.py +0 -172
- package/src/cds/stats/hypothesis_tests.py +0 -294
- package/src/cds/stats/nonparametric.py +0 -141
- package/src/cds/stats/power.py +0 -290
- package/src/cds/stats/regression.py +0 -51
- package/src/cds/stats/time_series.py +0 -420
- package/src/cds/tools/__init__.py +0 -29
- package/src/cds/tools/adapters.py +0 -218
- package/src/cds/tools/registry.py +0 -181
- package/src/cds/uncertainty/__init__.py +0 -17
- package/src/cds/uncertainty/propagation.py +0 -233
- package/src/cds/units/__init__.py +0 -45
- package/src/cds/units/core.py +0 -199
- package/src/cds/validation/__init__.py +0 -41
- package/src/cds/validation/adequacy.py +0 -157
- package/src/cds/validation/checks.py +0 -485
- package/src/cds/validation/report.py +0 -50
- package/src/cds/wavelets/__init__.py +0 -5
- package/src/cds/wavelets/haar.py +0 -219
- package/src/cds/workflow/__init__.py +0 -77
- package/src/cds/workflow/engine.py +0 -116
- package/src/cds/workflow/gates.py +0 -120
- package/src/cds/workflow/orchestrator.py +0 -431
- package/src/cds/workflow/selection.py +0 -454
- package/src/cds/workflow/tooling.py +0 -155
- package/src/cds/workflow/types.py +0 -107
- package/tests/__init__.py +0 -0
- package/tests/conftest.py +0 -109
- package/tests/test_advanced_fitting.py +0 -247
- package/tests/test_audit_completion_coverage.py +0 -183
- package/tests/test_audit_guard_coverage.py +0 -115
- package/tests/test_audit_hardening.py +0 -138
- package/tests/test_audit_hardening_coverage.py +0 -111
- package/tests/test_bayes_v2.py +0 -208
- package/tests/test_benchmarks.py +0 -111
- package/tests/test_bootstrap.py +0 -135
- package/tests/test_cli.py +0 -51
- package/tests/test_cli_color.py +0 -114
- package/tests/test_cli_extended.py +0 -239
- package/tests/test_cli_system_info.py +0 -36
- package/tests/test_constrained_opt.py +0 -174
- package/tests/test_core.py +0 -273
- package/tests/test_data_analysis.py +0 -146
- package/tests/test_data_analysis_lazy_bridge.py +0 -68
- package/tests/test_data_analysis_pandas_io.py +0 -119
- package/tests/test_data_io.py +0 -149
- package/tests/test_dataset.py +0 -91
- package/tests/test_diffeq.py +0 -186
- package/tests/test_diffeq_implicit.py +0 -173
- package/tests/test_domain_validation.py +0 -66
- package/tests/test_edge_misc_numerical.py +0 -666
- package/tests/test_edge_ml_quantum_linalg.py +0 -191
- package/tests/test_edge_nlp.py +0 -229
- package/tests/test_edge_quantum_evaluator_cli.py +0 -601
- package/tests/test_edge_stats_optimization_signals.py +0 -406
- package/tests/test_extra_distributions.py +0 -206
- package/tests/test_fft2.py +0 -67
- package/tests/test_fitting_bootstrap.py +0 -202
- package/tests/test_fractals.py +0 -387
- package/tests/test_genetics.py +0 -159
- package/tests/test_graph.py +0 -380
- package/tests/test_hardening_privacy_provenance.py +0 -306
- package/tests/test_hypothesis.py +0 -216
- package/tests/test_hypothesis_engine.py +0 -59
- package/tests/test_hypothesis_mining.py +0 -247
- package/tests/test_hypothesis_tests.py +0 -277
- package/tests/test_infotheory.py +0 -302
- package/tests/test_interpolate.py +0 -189
- package/tests/test_knowledge.py +0 -1149
- package/tests/test_layering.py +0 -112
- package/tests/test_linalg_extended.py +0 -179
- package/tests/test_linalg_qr_cholesky.py +0 -68
- package/tests/test_markov.py +0 -155
- package/tests/test_math_utils.py +0 -157
- package/tests/test_ml_boosting.py +0 -148
- package/tests/test_ml_clustering.py +0 -92
- package/tests/test_ml_ensemble.py +0 -103
- package/tests/test_ml_knn.py +0 -95
- package/tests/test_ml_linreg.py +0 -70
- package/tests/test_ml_logreg.py +0 -84
- package/tests/test_ml_metrics.py +0 -125
- package/tests/test_ml_model_selection.py +0 -108
- package/tests/test_ml_naive_bayes.py +0 -183
- package/tests/test_ml_pca.py +0 -98
- package/tests/test_ml_preprocessing.py +0 -104
- package/tests/test_ml_tree.py +0 -89
- package/tests/test_ml_viz.py +0 -58
- package/tests/test_ml_voting.py +0 -219
- package/tests/test_modeling.py +0 -726
- package/tests/test_modeling_fit_validation.py +0 -46
- package/tests/test_montecarlo.py +0 -245
- package/tests/test_multi_qubit.py +0 -466
- package/tests/test_nlp_attention.py +0 -335
- package/tests/test_nlp_autograd.py +0 -435
- package/tests/test_nlp_bpe.py +0 -463
- package/tests/test_nlp_embed.py +0 -240
- package/tests/test_nlp_layers.py +0 -276
- package/tests/test_nlp_model.py +0 -172
- package/tests/test_nlp_training.py +0 -262
- package/tests/test_nlp_viz.py +0 -188
- package/tests/test_numerical_integration.py +0 -374
- package/tests/test_numerical_invariants.py +0 -768
- package/tests/test_numerical_oracles.py +0 -241
- package/tests/test_optimization.py +0 -139
- package/tests/test_optimization_metaheuristics.py +0 -221
- package/tests/test_pde.py +0 -294
- package/tests/test_plot_charts.py +0 -247
- package/tests/test_plot_lazy.py +0 -48
- package/tests/test_power.py +0 -226
- package/tests/test_probability.py +0 -274
- package/tests/test_probability_advanced.py +0 -226
- package/tests/test_property_invariants.py +0 -277
- package/tests/test_provenance.py +0 -215
- package/tests/test_provenance_audit_hardening.py +0 -45
- package/tests/test_public_api.py +0 -75
- package/tests/test_quantum.py +0 -195
- package/tests/test_release_contract.py +0 -105
- package/tests/test_retrieval.py +0 -255
- package/tests/test_scientific.py +0 -185
- package/tests/test_selection_audit_hardening.py +0 -55
- package/tests/test_sensitivity.py +0 -59
- package/tests/test_sensitivity_global.py +0 -73
- package/tests/test_signals.py +0 -146
- package/tests/test_signals_filters.py +0 -460
- package/tests/test_special_invariants.py +0 -222
- package/tests/test_special_numerics.py +0 -44
- package/tests/test_statistical_audit.py +0 -75
- package/tests/test_stats.py +0 -206
- package/tests/test_stats_audit_coverage.py +0 -17
- package/tests/test_stats_nonparametric.py +0 -87
- package/tests/test_stats_time_series.py +0 -352
- package/tests/test_stft.py +0 -208
- package/tests/test_streaming_analytics.py +0 -128
- package/tests/test_svd.py +0 -170
- package/tests/test_symplectic.py +0 -200
- package/tests/test_tool_adapters.py +0 -197
- package/tests/test_tools_registry.py +0 -132
- package/tests/test_uncertainty.py +0 -171
- package/tests/test_units.py +0 -139
- package/tests/test_validation.py +0 -100
- package/tests/test_validation_adequacy.py +0 -129
- package/tests/test_validation_advanced.py +0 -110
- package/tests/test_wavelet.py +0 -170
- package/tests/test_wavelets_v2.py +0 -119
- package/tests/test_workflow.py +0 -173
- package/tests/test_workflow_gates.py +0 -144
- package/tests/test_workflow_orchestrator.py +0 -516
- package/tests/test_workflow_orchestrator_blocked_review.py +0 -95
- package/tests/test_workflow_selection.py +0 -312
- package/tests/test_workflow_selection_coverage.py +0 -114
- 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
|
-
<
|
|
22
|
-
<a href="https://github.
|
|
23
|
-
<a href="
|
|
24
|
-
<a href="
|
|
25
|
-
<a href="
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
|
78
|
-
|
|
|
79
|
-
|
|
|
80
|
-
|
|
|
81
|
-
|
|
|
82
|
-
|
|
|
83
|
-
| Monte Carlo | `cds.montecarlo` | Monte
|
|
84
|
-
|
|
|
85
|
-
|
|
|
86
|
-
|
|
|
87
|
-
|
|
|
88
|
-
|
|
|
89
|
-
| Uncertainty | `cds.uncertainty` | Analytic
|
|
90
|
-
|
|
|
91
|
-
|
|
|
92
|
-
| Workflow | `cds.workflow` | Approval-gated
|
|
93
|
-
|
|
|
94
|
-
|
|
|
95
|
-
|
|
|
96
|
-
|
|
|
97
|
-
|
|
|
98
|
-
|
|
99
|
-
|
|
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
|
-
|
|
162
|
-
|
|
163
|
-
|
|
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
|
-
|
|
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
|
-
|
|
183
|
-
|
|
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
|
-
|
|
186
|
-
|
|
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
|
-
|
|
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
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
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
|
-
|
|
110
|
+
A CLI ships with the package:
|
|
233
111
|
|
|
234
|
-
|
|
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
|
-
|
|
119
|
+
Full docs: [furox-art.github.io/scientific-computing-system](https://furox-art.github.io/scientific-computing-system/).
|
|
237
120
|
|
|
238
|
-
|
|
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
|
-
|
|
123
|
+
The core is zero-dependency. Everything below is opt-in:
|
|
245
124
|
|
|
246
125
|
```bash
|
|
247
|
-
|
|
248
|
-
pip install -
|
|
249
|
-
|
|
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
|
-
|
|
132
|
+
## Common use cases
|
|
253
133
|
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
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
|
-
##
|
|
140
|
+
## The catch
|
|
261
141
|
|
|
262
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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 [
|
|
276
|
-
|
|
277
|
-
## Contact
|
|
278
|
-
|
|
279
|
-
Maintainer: [@Furox-Art](https://github.com/Furox-Art)
|
|
150
|
+
MIT — see [LICENSE](LICENSE).
|
|
280
151
|
|
|
281
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
{
|
|
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"
|
package/.binder/requirements.txt
DELETED
|
@@ -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
|
package/.github/CODEOWNERS
DELETED
package/.github/FUNDING.yml
DELETED