scientific-computing-system 1.0.0 → 2.2.1
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 +365 -0
- package/LICENSE +0 -0
- package/README.md +146 -217
- package/SECURITY.md +32 -6
- 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,7 @@
|
|
|
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://
|
|
11
|
+
<a href="https://www.npmjs.com/package/scientific-computing-system"><img src="https://img.shields.io/npm/v/scientific-computing-system.svg" alt="npm version"></a>
|
|
12
12
|
<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
13
|
<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
14
|
<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 +18,193 @@
|
|
|
18
18
|
</p>
|
|
19
19
|
|
|
20
20
|
<p align="center">
|
|
21
|
-
<
|
|
22
|
-
<a href="https://github.
|
|
23
|
-
<a href="
|
|
24
|
-
<a href="
|
|
25
|
-
<a href="
|
|
21
|
+
<b>Docs</b> ·
|
|
22
|
+
<a href="https://furox-art.github.io/scientific-computing-system/getting-started/">Getting Started</a> ·
|
|
23
|
+
<a href="https://furox-art.github.io/scientific-computing-system/api/">API Reference</a> ·
|
|
24
|
+
<a href="https://furox-art.github.io/scientific-computing-system/cookbook/">Cookbook</a> ·
|
|
25
|
+
<a href="https://furox-art.github.io/scientific-computing-system/benchmarks/">Benchmarks</a> ·
|
|
26
|
+
<b>Project</b> ·
|
|
27
|
+
<a href="https://github.com/Furox-Art/scientific-computing-system/blob/main/CHANGELOG.md">Changelog</a> ·
|
|
28
|
+
<a href="https://github.com/Furox-Art/scientific-computing-system/blob/main/CONTRIBUTING.md">Contributing</a> ·
|
|
29
|
+
<a href="https://github.com/Furox-Art/scientific-computing-system/blob/main/SECURITY.md">Security</a> ·
|
|
30
|
+
<a href="https://github.com/Furox-Art/scientific-computing-system/blob/main/CODE_OF_CONDUCT.md">Code of Conduct</a> ·
|
|
31
|
+
<a href="https://github.com/Furox-Art/scientific-computing-system/blob/main/CITATION.cff">Citation</a> ·
|
|
32
|
+
<a href="https://github.com/Furox-Art/scientific-computing-system/blob/main/paper.md">Paper (JOSS)</a> ·
|
|
33
|
+
<a href="https://github.com/Furox-Art/scientific-computing-system/discussions">Discussions</a> ·
|
|
34
|
+
<a href="https://github.com/Furox-Art/scientific-computing-system/issues">Issues</a>
|
|
26
35
|
</p>
|
|
27
36
|
|
|
28
|
-
|
|
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.
|
|
29
38
|
|
|
30
|
-
|
|
39
|
+
Download counts: [PyPI stats](https://pypi.org/project/scientific-computing-system/)
|
|
31
40
|
|
|
32
|
-
|
|
41
|
+
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
42
|
|
|
34
|
-
|
|
43
|
+
The import name is **`cds`** (the distribution is `scientific-computing-system`). The zero-dependency core needs nothing but the standard library. The sibling NumPy build of this work is [`scientific-computing-system-2.0`](https://github.com/Furox-Art/scientific-computing-system-2.0); related projects are listed in [docs/related.md](docs/related.md).
|
|
35
44
|
|
|
36
|
-
|
|
45
|
+
## Install
|
|
37
46
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
cds
|
|
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:
|
|
47
|
-
|
|
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.
|
|
58
|
-
|
|
59
|
-
## Architecture
|
|
60
|
-
|
|
61
|
-
The current CLI groups the system into five layers:
|
|
47
|
+
| Channel | Command | What you get |
|
|
48
|
+
|---|---|---|
|
|
49
|
+
| **PyPI** (the library) | `pip install scientific-computing-system` | The actual Python package. Zero runtime dependencies. This is what you want. |
|
|
50
|
+
| **npm** (a launcher shim) | `npm i -g scientific-computing-system` | A thin Node wrapper that runs `python -m cds`. It ships no Python and needs the Python distribution installed so that `python -m cds` resolves. |
|
|
62
51
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
data data_analysis / streaming I/O / knowledge
|
|
69
|
-
```
|
|
52
|
+
Both channels are published at the same version. They are **not** equally
|
|
53
|
+
verifiable: the PyPI release carries a PEP 740 provenance attestation, while the
|
|
54
|
+
currently published npm release does not. Prefer PyPI for anything
|
|
55
|
+
security-sensitive — [SECURITY.md](SECURITY.md#distribution-channels-and-provenance)
|
|
56
|
+
has the per-channel comparison.
|
|
70
57
|
|
|
71
|
-
|
|
58
|
+
## What's inside
|
|
72
59
|
|
|
73
|
-
|
|
60
|
+
`src/cds/` holds **34 subpackages plus `causal.py` and `sensitivity.py`**. That is
|
|
61
|
+
35 public feature modules — the `cds` CLI entry point is the 36th subpackage —
|
|
62
|
+
exporting **505 names** (342 functions, 163 classes), all pure standard library.
|
|
63
|
+
`tests/test_readme_surface.py` derives these numbers from the package, so they
|
|
64
|
+
cannot drift silently.
|
|
74
65
|
|
|
75
|
-
| Area | Modules |
|
|
66
|
+
| Area | Modules | What you get |
|
|
76
67
|
|---|---|---|
|
|
77
|
-
|
|
|
78
|
-
|
|
|
79
|
-
|
|
|
80
|
-
|
|
|
81
|
-
| Optimization | `cds.optimization` | Gradient
|
|
82
|
-
| Statistics | `cds.stats`, `cds.probability`, `cds.bayes` |
|
|
83
|
-
| Monte Carlo | `cds.montecarlo` | Monte
|
|
84
|
-
|
|
|
85
|
-
|
|
|
86
|
-
|
|
|
87
|
-
|
|
|
88
|
-
|
|
|
89
|
-
|
|
|
90
|
-
|
|
|
91
|
-
| Validation | `cds.validation` |
|
|
92
|
-
|
|
|
93
|
-
|
|
|
94
|
-
|
|
|
95
|
-
| Knowledge | `cds.knowledge` |
|
|
96
|
-
|
|
|
97
|
-
|
|
|
98
|
-
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
68
|
+
| Core models | `cds.core` | Shared `Domain`, `Hypothesis`, `HypothesisStatus` types |
|
|
69
|
+
| Linear algebra & calculus | `cds.math_utils`, `cds.interpolate` | SVD, QR, Cholesky, LU, power iteration, derivatives, integrals |
|
|
70
|
+
| ODE / PDE | `cds.diffeq`, `cds.pde` | Euler, RK4, adaptive RK45, implicit stiff methods, symplectic integrators; 1-D heat & wave equations |
|
|
71
|
+
| Quadrature | `cds.numerical_integration` | Trapezoid, Simpson 1/3 & 3/8, Romberg, Gauss-Legendre, adaptive Simpson, 2-D tensor rules |
|
|
72
|
+
| Optimization | `cds.optimization` | Gradient descent, Newton, Adam, Nelder-Mead, annealing, constrained search |
|
|
73
|
+
| Statistics | `cds.stats`, `cds.probability`, `cds.bayes` | Descriptive stats, regression, t/chi-square/ANOVA, effect sizes, nonparametric ranks, time series, multiple testing, Bayesian conjugate updates |
|
|
74
|
+
| Monte Carlo | `cds.montecarlo` | π estimation, Monte-Carlo integration, random walks |
|
|
75
|
+
| Machine learning | `cds.ml` | MLP, k-NN, k-means, CART, random forest, boosting, PCA (educational, not production) |
|
|
76
|
+
| Signal processing | `cds.signals`, `cds.wavelets` | DFT/FFT/IFFT, convolution, Butterworth design, STFT, Haar DWT |
|
|
77
|
+
| Quantum | `cds.quantum` | Single & multi-qubit state-vector circuits, Bell/GHZ states, entanglement |
|
|
78
|
+
| Graphs | `cds.graph` | BFS, DFS, Dijkstra shortest paths, Kruskal MST, topological sort, cycle detection |
|
|
79
|
+
| Scientific domains | `cds.scientific`, `cds.genetics`, `cds.fractals`, `cds.infotheory` | Physical constants & formulas, DNA analysis & alignment, fractal sets, entropy/divergence/mutual information |
|
|
80
|
+
| Symbolic modeling | `cds.modeling` | Expression trees, symbolic differentiation, LaTeX export, `MathModel` systems, root finding, fitting |
|
|
81
|
+
| Uncertainty & sensitivity | `cds.uncertainty`, `cds.sensitivity` | Analytic + correlated Monte-Carlo propagation, local & variance-based global sensitivity, identifiability |
|
|
82
|
+
| Validation & causality | `cds.validation`, `cds.causal` | Cross-method checks, drift/OOD reports, assumption-gated causal estimators |
|
|
83
|
+
| Units | `cds.units` | SI quantities, conversions, dimensional compatibility checks |
|
|
84
|
+
| Workflow & provenance | `cds.workflow`, `cds.provenance` | Approval-gated orchestration, run manifests, hashes, checkpoints |
|
|
85
|
+
| Data | `cds.data_analysis`, `cds.data_io` | CSV/tabular analysis, streaming I/O, optional HDF5/NetCDF |
|
|
86
|
+
| Knowledge & hypothesis | `cds.knowledge`, `cds.hypothesis` | Concept graphs, research notes, structured hypothesis generation & evaluation |
|
|
87
|
+
| NLP (educational) | `cds.nlp` | BPE, embeddings, attention, autograd, MiniGPT |
|
|
88
|
+
| Plotting | `cds.plot` | Optional matplotlib helpers (`[plot]` extra) |
|
|
89
|
+
| Backend adapters | `cds.tools` | Lazy discovery for NumPy/SciPy/statsmodels/scikit-learn/SymPy/Z3 |
|
|
90
|
+
|
|
91
|
+
The authoritative per-module list is the [API reference](https://furox-art.github.io/scientific-computing-system/api/).
|
|
92
|
+
|
|
93
|
+
!!! note "`cds modules` is a curated subset"
|
|
94
|
+
`cds modules` prints 26 entries. It is **not** the full catalog: it omits
|
|
95
|
+
`bayes`, `causal`, `core`, `fractals`, `genetics`, `infotheory`, `interpolate`,
|
|
96
|
+
`pde`, and `wavelets`. Use the [API reference](https://furox-art.github.io/scientific-computing-system/api/)
|
|
97
|
+
or `src/cds/` for the complete set.
|
|
98
|
+
|
|
99
|
+
### Runnable examples and the dashboard
|
|
100
|
+
|
|
101
|
+
- **[`examples/`](examples/)** — 35 runnable scripts and notebooks (33 `.py`, 2
|
|
102
|
+
`.ipynb`), each self-contained and dependency-free unless noted. Every tutorial
|
|
103
|
+
page in the docs has a matching example.
|
|
104
|
+
- **[`dashboard/app.py`](dashboard/app.py)** — a Streamlit dashboard:
|
|
105
|
+
`cds dashboard`, or `pip install "scientific-computing-system[dashboard]"`.
|
|
106
|
+
|
|
107
|
+
## Quick Start
|
|
110
108
|
|
|
111
109
|
```bash
|
|
112
110
|
pip install scientific-computing-system
|
|
113
111
|
```
|
|
114
112
|
|
|
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
113
|
```python
|
|
114
|
+
from cds.math_utils import svd
|
|
115
|
+
from cds.diffeq import solve_system
|
|
157
116
|
from cds.stats import linear_regression
|
|
158
|
-
from cds.signals import fft_radix2
|
|
159
|
-
from cds.quantum import bell_state, is_entangled
|
|
160
|
-
|
|
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)
|
|
164
|
-
|
|
165
|
-
print(fit.slope)
|
|
166
|
-
print(spectrum)
|
|
167
|
-
print(is_entangled(state))
|
|
168
|
-
```
|
|
169
117
|
|
|
170
|
-
|
|
118
|
+
# 1. SVD — result is an SVDResult, not a tuple
|
|
119
|
+
result = svd([[1.0, 2.0], [3.0, 4.0]])
|
|
120
|
+
print("singular_values =", [round(v, 6) for v in result.singular_values])
|
|
171
121
|
|
|
172
|
-
```python
|
|
173
|
-
from cds.modeling import Variable, solve_equation
|
|
174
122
|
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
```
|
|
123
|
+
# 2. Damped harmonic oscillator: y'' = -y - 0.1 y'
|
|
124
|
+
def rhs(t, y):
|
|
125
|
+
return [y[1], -y[0] - 0.1 * y[1]]
|
|
179
126
|
|
|
180
|
-
### Scientific constants
|
|
181
127
|
|
|
182
|
-
|
|
183
|
-
|
|
128
|
+
t, y = solve_system(rhs, 0.0, [1.0, 0.0], 50.0, dt=0.01)
|
|
129
|
+
print("final t =", round(t[-1], 2), "| final y =", [round(v, 8) for v in y[-1]])
|
|
184
130
|
|
|
185
|
-
|
|
186
|
-
|
|
131
|
+
# 3. Least-squares line fit
|
|
132
|
+
fit = linear_regression([1.0, 2.0, 3.0, 4.0, 5.0], [2.1, 3.9, 6.2, 7.8, 10.1])
|
|
133
|
+
print(f"slope = {fit.slope:.4f} | intercept = {fit.intercept:.4f} | r^2 = {fit.r_squared:.4f}")
|
|
187
134
|
```
|
|
188
135
|
|
|
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**.
|
|
203
|
-
|
|
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:
|
|
136
|
+
Real output (executed verbatim; pasted from an actual run):
|
|
209
137
|
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
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.
|
|
138
|
+
```text
|
|
139
|
+
singular_values = [5.464986, 0.365966]
|
|
140
|
+
final t = 50.0 | final y = [0.07638443, 0.0264785]
|
|
141
|
+
slope = 1.9900 | intercept = 0.0500 | r^2 = 0.9973
|
|
142
|
+
```
|
|
231
143
|
|
|
232
|
-
|
|
144
|
+
## CLI
|
|
145
|
+
|
|
146
|
+
The package installs a `cds` command with 13 subcommands:
|
|
147
|
+
|
|
148
|
+
| Command | Purpose |
|
|
149
|
+
|---|---|
|
|
150
|
+
| `cds --help` | Full command list |
|
|
151
|
+
| `cds modules` | Curated module catalog (see the caveat above) |
|
|
152
|
+
| `cds info` | Version, module status, health summary |
|
|
153
|
+
| `cds constants` | Table of physical constants |
|
|
154
|
+
| `cds calc <formula>` | Quick physics calculation (`ke`, `gravity`, `wave`, `gas`) |
|
|
155
|
+
| `cds stats <numbers>` | Descriptive statistics for a comma-separated list |
|
|
156
|
+
| `cds sample <dist>` | Draw samples from a probability distribution |
|
|
157
|
+
| `cds integrate <fn>` | Integrate a built-in function over `[a, b]` |
|
|
158
|
+
| `cds hypothesis <q>` | Generate scientific hypotheses for a question |
|
|
159
|
+
| `cds prompt` | Prompt text for a custom hypothesis generator |
|
|
160
|
+
| `cds benchmark` | Run the built-in benchmarks |
|
|
161
|
+
| `cds plot <numbers>` | ASCII plot, or PNG with `--file` when `[plot]` is installed |
|
|
162
|
+
| `cds dashboard` | Launch the Streamlit dashboard (needs `[dashboard]`) |
|
|
163
|
+
|
|
164
|
+
```console
|
|
165
|
+
$ cds --version
|
|
166
|
+
System version 2.2.1
|
|
167
|
+
$ cds constants # physical constants table
|
|
168
|
+
```
|
|
233
169
|
|
|
234
|
-
##
|
|
170
|
+
## Optional extras
|
|
235
171
|
|
|
236
|
-
The
|
|
172
|
+
The core is zero-dependency. Everything below is opt-in:
|
|
237
173
|
|
|
238
174
|
```bash
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
175
|
+
pip install "scientific-computing-system[scientific]" # NumPy, SciPy, statsmodels, scikit-learn, SymPy, Z3
|
|
176
|
+
pip install "scientific-computing-system[io]" # HDF5 + NetCDF
|
|
177
|
+
pip install "scientific-computing-system[plot]" # matplotlib
|
|
178
|
+
pip install "scientific-computing-system[pandas]" # DataFrame bridge: cds.data_analysis.pandas_io
|
|
179
|
+
pip install "scientific-computing-system[dashboard]" # Streamlit dashboard
|
|
242
180
|
```
|
|
243
181
|
|
|
244
|
-
|
|
182
|
+
## The catch
|
|
245
183
|
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
184
|
+
Pure Python is slower than NumPy on dense numerics: the committed benchmark
|
|
185
|
+
artifact records 100×100 matrix multiplication at 0.0696 s against NumPy's
|
|
186
|
+
0.000060 s, about **1155× slower**. Those numbers are from one CI run whose
|
|
187
|
+
platform, CPU, and library versions were not recorded, so treat them as
|
|
188
|
+
order-of-magnitude only — [docs/benchmarks.md](docs/benchmarks.md) states exactly
|
|
189
|
+
what that artifact does and does not support, and
|
|
190
|
+
[docs/why-pure-python.md](docs/why-pure-python.md) covers when to reach for
|
|
191
|
+
NumPy or the 2.0 build instead.
|
|
251
192
|
|
|
252
|
-
|
|
193
|
+
## Contributing
|
|
253
194
|
|
|
254
|
-
```
|
|
255
|
-
.\.venv\Scripts\Activate.ps1
|
|
195
|
+
```bash
|
|
256
196
|
pip install -e ".[dev]"
|
|
257
|
-
pytest
|
|
197
|
+
pytest # CI also enforces 100% blended coverage (statement + branch)
|
|
198
|
+
mkdocs serve # docs at http://127.0.0.1:8000/
|
|
258
199
|
```
|
|
259
200
|
|
|
260
|
-
|
|
261
|
-
|
|
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
|
|
268
|
-
|
|
269
|
-
## Relationship to scientific-computing-system-2.0
|
|
270
|
-
|
|
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.
|
|
201
|
+
Issues and PRs welcome; see [CONTRIBUTING.md](CONTRIBUTING.md) and
|
|
202
|
+
[CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md).
|
|
272
203
|
|
|
273
204
|
## License
|
|
274
205
|
|
|
275
|
-
MIT — see [
|
|
276
|
-
|
|
277
|
-
## Contact
|
|
278
|
-
|
|
279
|
-
Maintainer: [@Furox-Art](https://github.com/Furox-Art)
|
|
206
|
+
MIT — see [LICENSE](LICENSE).
|
|
280
207
|
|
|
281
|
-
|
|
208
|
+
Cite via [`CITATION.cff`](CITATION.cff). [`codemeta.json`](codemeta.json) carries
|
|
209
|
+
the same metadata in codemeta form, and [`paper.md`](paper.md) /
|
|
210
|
+
[`paper.bib`](paper.bib) are the JOSS manuscript.
|
package/SECURITY.md
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
| Version | Supported | Notes |
|
|
6
6
|
|---|---|---|
|
|
7
|
-
| 2.
|
|
8
|
-
| < 2.
|
|
7
|
+
| 2.2.x | Yes | Current stable release line |
|
|
8
|
+
| < 2.2 | No | Superseded by the 2.2 release line unless a specific security advisory states otherwise |
|
|
9
9
|
|
|
10
10
|
Security fixes target the current stable release line. Older release lines should not be assumed to receive backports unless an advisory explicitly says so.
|
|
11
11
|
|
|
@@ -23,18 +23,44 @@ You may also contact the maintainer directly. Reports should include the affecte
|
|
|
23
23
|
|
|
24
24
|
`scientific-computing-system` is a local-first, pure-Python scientific-computing library distributed through PyPI. The core package has no required runtime dependencies. Optional scientific backends are loaded only when explicitly requested.
|
|
25
25
|
|
|
26
|
+
It is also published to npm as `scientific-computing-system`, but that package is a **Node launcher shim only** — it contains no Python, resolves an interpreter (`python`/`python3`/`py`), and runs `python -m cds`. npm users must install the Python distribution so that `python -m cds` resolves; the launcher never looks for a `cds` console script on `PATH`. The two registries carry **different provenance guarantees**; see [Distribution channels and provenance](#distribution-channels-and-provenance).
|
|
27
|
+
|
|
26
28
|
### In Scope
|
|
27
29
|
|
|
28
30
|
| Threat | Mitigation |
|
|
29
31
|
|---|---|
|
|
30
|
-
| **Supply chain: malicious or substituted
|
|
31
|
-
| **
|
|
32
|
+
| **Supply chain: malicious or substituted PyPI artifact** | The release workflow is the sole PyPI publish authority. It builds wheel + sdist on a GitHub-hosted runner, verifies package metadata/version, installs the built wheel, smoke-tests the installed CLI, generates GitHub artifact attestation for those exact runner-local files, and publishes through PyPI Trusted Publishing (OIDC). PyPI serves a PEP 740 provenance bundle for both artifacts. |
|
|
33
|
+
| **Supply chain: malicious or substituted npm artifact** | The npm workflow is the sole npm publish authority and gates on the registry version-existence check, a `npm pack --dry-run` tarball allowlist, and npm/Python version lockstep. **Provenance depends on the publish mode:** the OIDC path publishes with `--provenance` and yields a Sigstore attestation; the token fallback path cannot mint one and deliberately publishes without it. See below for the status of the currently published npm release. |
|
|
34
|
+
| **Registry drift** | Public PyPI is treated as the distribution registry for the library. The release integrity check requires exactly one wheel and one sdist on PyPI and requires the matching GitHub Release to contain no wheel/sdist assets. A registry-policy workflow rechecks the public PyPI package and removes accidental distribution assets from GitHub Releases. |
|
|
32
35
|
| **Dependency vulnerabilities** | The core has no required runtime dependencies. Development/test/docs lock files are audited in CI with `pip-audit`; optional backends are isolated behind extras and lazy loading. |
|
|
33
36
|
| **Code execution from package install** | The build backend is `hatchling`; there is no `setup.py` execution and package versioning is static in `pyproject.toml` plus `src/cds/_version.py`. |
|
|
34
37
|
| **Unexpected scientific-tool loading** | Optional tools are selected through an explicit registry/capability layer and are not imported into the zero-dependency core unless requested. |
|
|
35
38
|
| **Untrusted CLI input** | The CLI uses `argparse`-based typed/explicit parsing and does not evaluate arbitrary Python expressions. |
|
|
36
39
|
| **Scientific workflow overclaiming** | The research orchestrator is fail-closed: blocked methods, missing tools, denied approvals, incomplete execution, validation failures, and unresolved method suitability prevent an unqualified final conclusion. |
|
|
37
40
|
|
|
41
|
+
### Distribution channels and provenance
|
|
42
|
+
|
|
43
|
+
| | PyPI `scientific-computing-system` | npm `scientific-computing-system` |
|
|
44
|
+
|---|---|---|
|
|
45
|
+
| Contents | the library (wheel + sdist) | `index.js`, `bin/scs.js`, `LICENSE`, `README.md`, `CHANGELOG.md`, `SECURITY.md` — **no Python** |
|
|
46
|
+
| Requires the other channel | no | yes; `scs` needs the Python distribution installed so that `python -m cds` resolves — it does **not** look for a `cds` console script on `PATH` |
|
|
47
|
+
| Publish authentication | Trusted Publishing (OIDC) | OIDC trusted publishing is implemented and is the default; a token fallback exists |
|
|
48
|
+
| Attestation on the currently published release | **not on 2.2.0** — that release predates Trusted Publishing on this path and PyPI serves zero PEP 740 bundles for it; **yes from 2.2.1**, published via Trusted Publishing | **no** — the published 2.2.0 went out in token mode, which cannot produce a Sigstore attestation |
|
|
49
|
+
|
|
50
|
+
The npm release published as 2.2.0 was produced by a manual dispatch with
|
|
51
|
+
`use_token_fallback=true`. A long-lived registry token has no build identity to
|
|
52
|
+
attest, so npm's `--provenance` flag cannot be honoured on that path; the
|
|
53
|
+
workflow omits the flag and prints a notice instead of publishing something that
|
|
54
|
+
looks attested and is not. `npm view <pkg>` reports a legacy `dist.signatures`
|
|
55
|
+
value for it, which is npm's own transport signing and **not** a build
|
|
56
|
+
provenance attestation; the npm attestations endpoint returns 404 for this
|
|
57
|
+
package at this version.
|
|
58
|
+
|
|
59
|
+
**Practical consequence:** for anything security-sensitive, install from PyPI
|
|
60
|
+
and verify the PEP 740 provenance bundle against the SHA-256 digests PyPI
|
|
61
|
+
publishes. Do not rely on the npm channel for supply-chain assurance until a
|
|
62
|
+
release is published through the OIDC path.
|
|
63
|
+
|
|
38
64
|
### Optional Backend Boundary
|
|
39
65
|
|
|
40
66
|
Optional backends such as SciPy, statsmodels, scikit-learn, SymPy, Z3, h5py, and netCDF4 have their own parser, file-format, numerical, and security behavior. CDS does not make those libraries safe for adversarial input.
|
|
@@ -59,9 +85,9 @@ In particular, `sympy_verify_identity()` passes caller-provided symbolic strings
|
|
|
59
85
|
|
|
60
86
|
## Security Best Practices for Users
|
|
61
87
|
|
|
62
|
-
1. **Pin the package version** in reproducible environments, for example `scientific-computing-system==
|
|
88
|
+
1. **Pin the package version** in reproducible environments, for example `pip install "scientific-computing-system==X.Y.Z"` with the exact release you have evaluated, rather than an unconstrained range. Deliberately no concrete version is written here: a pinned example goes stale at the next release and readers copy it regardless, so take the number from the [release notes](https://github.com/Furox-Art/scientific-computing-system/releases) for the release you are deploying, and record it in your own lockfile or constraints file.
|
|
63
89
|
2. **Install only the optional extras you need.** Fewer third-party packages reduce supply-chain and compatibility surface.
|
|
64
|
-
3. **Verify provenance for high-assurance use.** Compare the PyPI wheel/sdist SHA-256 digests with the subjects recorded by the GitHub release workflow's artifact attestation.
|
|
90
|
+
3. **Verify provenance for high-assurance use.** Compare the PyPI wheel/sdist SHA-256 digests with the subjects recorded by the GitHub release workflow's artifact attestation, or fetch the PEP 740 provenance bundle from PyPI. There is currently **no** equivalent attestation for the npm package — see [Distribution channels and provenance](#distribution-channels-and-provenance).
|
|
65
91
|
4. **Treat optional backend inputs as backend inputs.** Do not pass hostile symbolic expressions or untrusted scientific files without the validation/sandboxing appropriate to SymPy, HDF5, NetCDF, or the relevant backend.
|
|
66
92
|
5. **Keep the environment current.** Review dependency updates and run vulnerability auditing against the exact environment deployed.
|
|
67
93
|
6. **Do not use the library as the sole validation layer for safety-critical conclusions.** Independent domain validation remains necessary.
|
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
|
+
}
|