universal-physics-tensor 10.0.0 → 12.0.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/README.md +39 -36
- package/bin/upt.mjs +13 -1
- package/data/applied-cases.json +1892 -0
- package/data/applied-cases.schema.json +194 -0
- package/data/atlas/atlas.json +25 -25
- package/data/atlas/atlas.jsonld +1 -1
- package/data/atlas/diffusion.json +6 -6
- package/data/atlas/oscillators.json +7 -7
- package/data/atlas/waves.json +14 -14
- package/data/atlas/witness-results.json +11 -11
- package/data/bridge-catalog.json +389 -230
- package/data/bridge-catalog.schema.json +45 -7
- package/data/units.json +6 -25
- package/dist/atlas/applicability.d.ts.map +1 -1
- package/dist/atlas/applicability.js +21 -15
- package/dist/atlas/applicability.js.map +1 -1
- package/dist/atlas/benchmark/hybrid-retrieval.d.ts +9 -1
- package/dist/atlas/benchmark/hybrid-retrieval.d.ts.map +1 -1
- package/dist/atlas/benchmark/hybrid-retrieval.js +15 -13
- package/dist/atlas/benchmark/hybrid-retrieval.js.map +1 -1
- package/dist/atlas/benchmark/loader.js +2 -2
- package/dist/atlas/benchmark/loader.js.map +1 -1
- package/dist/atlas/benchmark/stats.d.ts +2 -2
- package/dist/atlas/benchmark/stats.d.ts.map +1 -1
- package/dist/atlas/benchmark/stats.js +9 -15
- package/dist/atlas/benchmark/stats.js.map +1 -1
- package/dist/atlas/catalog-formal-ref.d.ts +26 -3
- package/dist/atlas/catalog-formal-ref.d.ts.map +1 -1
- package/dist/atlas/catalog-formal-ref.js +52 -5
- package/dist/atlas/catalog-formal-ref.js.map +1 -1
- package/dist/atlas/chain-pipeline.d.ts.map +1 -1
- package/dist/atlas/chain-pipeline.js +7 -8
- package/dist/atlas/chain-pipeline.js.map +1 -1
- package/dist/atlas/diffusion/bridges-closure.d.ts +0 -4
- package/dist/atlas/diffusion/bridges-closure.d.ts.map +1 -1
- package/dist/atlas/diffusion/bridges-closure.js +8 -12
- package/dist/atlas/diffusion/bridges-closure.js.map +1 -1
- package/dist/atlas/diffusion/bridges.d.ts.map +1 -1
- package/dist/atlas/diffusion/bridges.js +27 -39
- package/dist/atlas/diffusion/bridges.js.map +1 -1
- package/dist/atlas/diffusion/dimensions.d.ts +6 -14
- package/dist/atlas/diffusion/dimensions.d.ts.map +1 -1
- package/dist/atlas/diffusion/dimensions.js +8 -16
- package/dist/atlas/diffusion/dimensions.js.map +1 -1
- package/dist/atlas/diffusion/models.d.ts +3 -3
- package/dist/atlas/diffusion/models.d.ts.map +1 -1
- package/dist/atlas/diffusion/models.js +5 -10
- package/dist/atlas/diffusion/models.js.map +1 -1
- package/dist/atlas/diffusion/numerics.d.ts +16 -4
- package/dist/atlas/diffusion/numerics.d.ts.map +1 -1
- package/dist/atlas/diffusion/numerics.js +38 -24
- package/dist/atlas/diffusion/numerics.js.map +1 -1
- package/dist/atlas/link-prediction.d.ts +106 -3
- package/dist/atlas/link-prediction.d.ts.map +1 -1
- package/dist/atlas/link-prediction.js +212 -66
- package/dist/atlas/link-prediction.js.map +1 -1
- package/dist/atlas/oscillators/bridges-coarse.d.ts.map +1 -1
- package/dist/atlas/oscillators/bridges-coarse.js +7 -11
- package/dist/atlas/oscillators/bridges-coarse.js.map +1 -1
- package/dist/atlas/oscillators/bridges-exact.d.ts.map +1 -1
- package/dist/atlas/oscillators/bridges-exact.js +6 -7
- package/dist/atlas/oscillators/bridges-exact.js.map +1 -1
- package/dist/atlas/oscillators/bridges-limits.d.ts +3 -16
- package/dist/atlas/oscillators/bridges-limits.d.ts.map +1 -1
- package/dist/atlas/oscillators/bridges-limits.js +23 -34
- package/dist/atlas/oscillators/bridges-limits.js.map +1 -1
- package/dist/atlas/oscillators/dimensions.d.ts +9 -21
- package/dist/atlas/oscillators/dimensions.d.ts.map +1 -1
- package/dist/atlas/oscillators/dimensions.js +9 -21
- package/dist/atlas/oscillators/dimensions.js.map +1 -1
- package/dist/atlas/oscillators/limit-witnesses.d.ts +2 -2
- package/dist/atlas/oscillators/limit-witnesses.d.ts.map +1 -1
- package/dist/atlas/oscillators/limit-witnesses.js +17 -15
- package/dist/atlas/oscillators/limit-witnesses.js.map +1 -1
- package/dist/atlas/oscillators/models.d.ts.map +1 -1
- package/dist/atlas/oscillators/models.js +2 -6
- package/dist/atlas/oscillators/models.js.map +1 -1
- package/dist/atlas/oscillators/pendulum-motion.d.ts +29 -6
- package/dist/atlas/oscillators/pendulum-motion.d.ts.map +1 -1
- package/dist/atlas/oscillators/pendulum-motion.js +60 -40
- package/dist/atlas/oscillators/pendulum-motion.js.map +1 -1
- package/dist/atlas/oscillators/phase-translation.d.ts +0 -11
- package/dist/atlas/oscillators/phase-translation.d.ts.map +1 -1
- package/dist/atlas/oscillators/phase-translation.js +3 -4
- package/dist/atlas/oscillators/phase-translation.js.map +1 -1
- package/dist/atlas/oscillators/position-translation.d.ts +68 -7
- package/dist/atlas/oscillators/position-translation.d.ts.map +1 -1
- package/dist/atlas/oscillators/position-translation.js +123 -12
- package/dist/atlas/oscillators/position-translation.js.map +1 -1
- package/dist/atlas/oscillators/rejections.d.ts +0 -2
- package/dist/atlas/oscillators/rejections.d.ts.map +1 -1
- package/dist/atlas/oscillators/rejections.js +0 -7
- package/dist/atlas/oscillators/rejections.js.map +1 -1
- package/dist/atlas/physjs-entries.generated.d.ts +35 -25
- package/dist/atlas/physjs-entries.generated.d.ts.map +1 -1
- package/dist/atlas/physjs-entries.generated.js +37 -25
- package/dist/atlas/physjs-entries.generated.js.map +1 -1
- package/dist/atlas/physjs-ref.d.ts +34 -31
- package/dist/atlas/physjs-ref.d.ts.map +1 -1
- package/dist/atlas/physjs-ref.js +55 -53
- package/dist/atlas/physjs-ref.js.map +1 -1
- package/dist/atlas/physjs-reviewed.d.ts +1 -1
- package/dist/atlas/physjs-reviewed.js +15 -15
- package/dist/atlas/physjs-reviewed.js.map +1 -1
- package/dist/atlas/poster/statements.d.ts +0 -19
- package/dist/atlas/poster/statements.d.ts.map +1 -1
- package/dist/atlas/poster/statements.js +1 -1
- package/dist/atlas/poster/statements.js.map +1 -1
- package/dist/atlas/proof-target.d.ts +1 -1
- package/dist/atlas/proof-target.js +1 -1
- package/dist/atlas/proof-target.js.map +1 -1
- package/dist/atlas/regime.d.ts +1 -1
- package/dist/atlas/regime.d.ts.map +1 -1
- package/dist/atlas/regime.js +1 -1
- package/dist/atlas/regime.js.map +1 -1
- package/dist/atlas/text-overlap.d.ts +23 -0
- package/dist/atlas/text-overlap.d.ts.map +1 -0
- package/dist/atlas/text-overlap.js +41 -0
- package/dist/atlas/text-overlap.js.map +1 -0
- package/dist/atlas/waves/bridges-closure.d.ts.map +1 -1
- package/dist/atlas/waves/bridges-closure.js +2 -6
- package/dist/atlas/waves/bridges-closure.js.map +1 -1
- package/dist/atlas/waves/bridges.d.ts.map +1 -1
- package/dist/atlas/waves/bridges.js +32 -48
- package/dist/atlas/waves/bridges.js.map +1 -1
- package/dist/atlas/waves/models.d.ts +5 -6
- package/dist/atlas/waves/models.d.ts.map +1 -1
- package/dist/atlas/waves/models.js +7 -13
- package/dist/atlas/waves/models.js.map +1 -1
- package/dist/atlas/waves/numerics.d.ts.map +1 -1
- package/dist/atlas/waves/numerics.js +10 -3
- package/dist/atlas/waves/numerics.js.map +1 -1
- package/dist/atlas/witness-numeric.d.ts +30 -0
- package/dist/atlas/witness-numeric.d.ts.map +1 -1
- package/dist/atlas/witness-numeric.js +53 -0
- package/dist/atlas/witness-numeric.js.map +1 -1
- package/dist/atlas/witness-specs.d.ts.map +1 -1
- package/dist/atlas/witness-specs.js +19 -0
- package/dist/atlas/witness-specs.js.map +1 -1
- package/dist/atlas/witness-symbolic.d.ts +75 -3
- package/dist/atlas/witness-symbolic.d.ts.map +1 -1
- package/dist/atlas/witness-symbolic.js +116 -10
- package/dist/atlas/witness-symbolic.js.map +1 -1
- package/dist/bridges/catalog-load.d.ts.map +1 -1
- package/dist/bridges/catalog-load.js +13 -8
- package/dist/bridges/catalog-load.js.map +1 -1
- package/dist/bridges/catalog-types.d.ts +26 -2
- package/dist/bridges/catalog-types.d.ts.map +1 -1
- package/dist/bridges/catalog-types.js +11 -1
- package/dist/bridges/catalog-types.js.map +1 -1
- package/dist/bridges/evaluation-errors.d.ts +31 -1
- package/dist/bridges/evaluation-errors.d.ts.map +1 -1
- package/dist/bridges/evaluation-errors.js +20 -2
- package/dist/bridges/evaluation-errors.js.map +1 -1
- package/dist/bridges/evaluator-inputs.d.ts.map +1 -1
- package/dist/bridges/evaluator-inputs.js +7 -5
- package/dist/bridges/evaluator-inputs.js.map +1 -1
- package/dist/bridges/evaluators.d.ts.map +1 -1
- package/dist/bridges/evaluators.js +27 -12
- package/dist/bridges/evaluators.js.map +1 -1
- package/dist/bridges/expr-parse.d.ts +11 -0
- package/dist/bridges/expr-parse.d.ts.map +1 -1
- package/dist/bridges/expr-parse.js +14 -5
- package/dist/bridges/expr-parse.js.map +1 -1
- package/dist/bridges/holds.d.ts +35 -3
- package/dist/bridges/holds.d.ts.map +1 -1
- package/dist/bridges/holds.js +117 -23
- package/dist/bridges/holds.js.map +1 -1
- package/dist/bridges/notices.d.ts.map +1 -1
- package/dist/bridges/notices.js +5 -5
- package/dist/bridges/notices.js.map +1 -1
- package/dist/bridges/relation-eval.d.ts +4 -4
- package/dist/bridges/relation-eval.d.ts.map +1 -1
- package/dist/bridges/relation-eval.js +15 -16
- package/dist/bridges/relation-eval.js.map +1 -1
- package/dist/bridges/sensitivity.d.ts.map +1 -1
- package/dist/bridges/sensitivity.js +3 -3
- package/dist/bridges/sensitivity.js.map +1 -1
- package/dist/bridges/validity.d.ts +33 -0
- package/dist/bridges/validity.d.ts.map +1 -0
- package/dist/bridges/validity.js +67 -0
- package/dist/bridges/validity.js.map +1 -0
- package/dist/canonical/entries/atomic.js +1 -3
- package/dist/canonical/entries/atomic.js.map +1 -1
- package/dist/canonical/entries/condensed-matter.d.ts.map +1 -1
- package/dist/canonical/entries/condensed-matter.js +4 -5
- package/dist/canonical/entries/condensed-matter.js.map +1 -1
- package/dist/canonical/entries/dimensional-classics.d.ts.map +1 -1
- package/dist/canonical/entries/dimensional-classics.js +3 -4
- package/dist/canonical/entries/dimensional-classics.js.map +1 -1
- package/dist/canonical/entries/electromagnetism.d.ts.map +1 -1
- package/dist/canonical/entries/electromagnetism.js +4 -10
- package/dist/canonical/entries/electromagnetism.js.map +1 -1
- package/dist/canonical/entries/fluids-waves.d.ts.map +1 -1
- package/dist/canonical/entries/fluids-waves.js +3 -7
- package/dist/canonical/entries/fluids-waves.js.map +1 -1
- package/dist/canonical/entries/mechanics.d.ts.map +1 -1
- package/dist/canonical/entries/mechanics.js +4 -6
- package/dist/canonical/entries/mechanics.js.map +1 -1
- package/dist/canonical/entries/nonmonomial.d.ts.map +1 -1
- package/dist/canonical/entries/nonmonomial.js +9 -17
- package/dist/canonical/entries/nonmonomial.js.map +1 -1
- package/dist/canonical/entries/relativity.d.ts.map +1 -1
- package/dist/canonical/entries/relativity.js +6 -6
- package/dist/canonical/entries/relativity.js.map +1 -1
- package/dist/canonical/entries/thermo-nuclear-cosmo.d.ts.map +1 -1
- package/dist/canonical/entries/thermo-nuclear-cosmo.js +6 -10
- package/dist/canonical/entries/thermo-nuclear-cosmo.js.map +1 -1
- package/dist/canonical/fixed-points.d.ts +94 -0
- package/dist/canonical/fixed-points.d.ts.map +1 -0
- package/dist/canonical/fixed-points.js +81 -0
- package/dist/canonical/fixed-points.js.map +1 -0
- package/dist/canonical/linkage.d.ts.map +1 -1
- package/dist/canonical/linkage.js +25 -44
- package/dist/canonical/linkage.js.map +1 -1
- package/dist/canonical/normal-form.d.ts.map +1 -1
- package/dist/canonical/normal-form.js +5 -11
- package/dist/canonical/normal-form.js.map +1 -1
- package/dist/canonical/structural.d.ts +21 -21
- package/dist/canonical/structural.d.ts.map +1 -1
- package/dist/canonical/structural.js +40 -19
- package/dist/canonical/structural.js.map +1 -1
- package/dist/cases/catalog-checks.d.ts +10 -0
- package/dist/cases/catalog-checks.d.ts.map +1 -0
- package/dist/cases/catalog-checks.js +241 -0
- package/dist/cases/catalog-checks.js.map +1 -0
- package/dist/cases/catalog.d.ts +83 -0
- package/dist/cases/catalog.d.ts.map +1 -0
- package/dist/cases/catalog.js +118 -0
- package/dist/cases/catalog.js.map +1 -0
- package/dist/cases/engine.d.ts +13 -0
- package/dist/cases/engine.d.ts.map +1 -0
- package/dist/cases/engine.js +179 -0
- package/dist/cases/engine.js.map +1 -0
- package/dist/cases/index.d.ts.map +1 -1
- package/dist/cases/index.js +5 -7
- package/dist/cases/index.js.map +1 -1
- package/dist/cases/methods.d.ts +215 -0
- package/dist/cases/methods.d.ts.map +1 -0
- package/dist/cases/methods.js +743 -0
- package/dist/cases/methods.js.map +1 -0
- package/dist/cases/quadrature.d.ts +7 -9
- package/dist/cases/quadrature.d.ts.map +1 -1
- package/dist/cases/quadrature.js +28 -32
- package/dist/cases/quadrature.js.map +1 -1
- package/dist/cases/types.d.ts +12 -0
- package/dist/cases/types.d.ts.map +1 -1
- package/dist/cases/types.js.map +1 -1
- package/dist/cli/args.d.ts +25 -1
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +30 -8
- package/dist/cli/args.js.map +1 -1
- package/dist/cli/bindings.d.ts.map +1 -1
- package/dist/cli/bindings.js +5 -4
- package/dist/cli/bindings.js.map +1 -1
- package/dist/cli/command.d.ts +11 -1
- package/dist/cli/command.d.ts.map +1 -1
- package/dist/cli/command.js.map +1 -1
- package/dist/cli/commands/_atlas-map.d.ts +0 -9
- package/dist/cli/commands/_atlas-map.d.ts.map +1 -1
- package/dist/cli/commands/_atlas-map.js +8 -18
- package/dist/cli/commands/_atlas-map.js.map +1 -1
- package/dist/cli/commands/_atlas-route.d.ts.map +1 -1
- package/dist/cli/commands/_atlas-route.js +6 -2
- package/dist/cli/commands/_atlas-route.js.map +1 -1
- package/dist/cli/commands/_discovery-opts.d.ts +1 -0
- package/dist/cli/commands/_discovery-opts.d.ts.map +1 -1
- package/dist/cli/commands/_discovery-opts.js +9 -9
- package/dist/cli/commands/_discovery-opts.js.map +1 -1
- package/dist/cli/commands/atlas.d.ts.map +1 -1
- package/dist/cli/commands/atlas.js +8 -5
- package/dist/cli/commands/atlas.js.map +1 -1
- package/dist/cli/commands/audit.d.ts.map +1 -1
- package/dist/cli/commands/audit.js +8 -1
- package/dist/cli/commands/audit.js.map +1 -1
- package/dist/cli/commands/axes.d.ts.map +1 -1
- package/dist/cli/commands/axes.js +20 -1
- package/dist/cli/commands/axes.js.map +1 -1
- package/dist/cli/commands/confront.d.ts.map +1 -1
- package/dist/cli/commands/confront.js +8 -14
- package/dist/cli/commands/confront.js.map +1 -1
- package/dist/cli/commands/derive.d.ts.map +1 -1
- package/dist/cli/commands/derive.js +22 -22
- package/dist/cli/commands/derive.js.map +1 -1
- package/dist/cli/commands/discover.d.ts.map +1 -1
- package/dist/cli/commands/discover.js +122 -73
- package/dist/cli/commands/discover.js.map +1 -1
- package/dist/cli/commands/eval.d.ts.map +1 -1
- package/dist/cli/commands/eval.js +1 -0
- package/dist/cli/commands/eval.js.map +1 -1
- package/dist/cli/commands/evaluate.d.ts.map +1 -1
- package/dist/cli/commands/evaluate.js +67 -39
- package/dist/cli/commands/evaluate.js.map +1 -1
- package/dist/cli/commands/explain.d.ts.map +1 -1
- package/dist/cli/commands/explain.js +24 -3
- package/dist/cli/commands/explain.js.map +1 -1
- package/dist/cli/commands/ground.d.ts.map +1 -1
- package/dist/cli/commands/ground.js +7 -1
- package/dist/cli/commands/ground.js.map +1 -1
- package/dist/cli/commands/map.d.ts.map +1 -1
- package/dist/cli/commands/map.js +84 -11
- package/dist/cli/commands/map.js.map +1 -1
- package/dist/cli/commands/metric.d.ts.map +1 -1
- package/dist/cli/commands/metric.js +12 -9
- package/dist/cli/commands/metric.js.map +1 -1
- package/dist/cli/commands/path.d.ts +10 -0
- package/dist/cli/commands/path.d.ts.map +1 -1
- package/dist/cli/commands/path.js +25 -3
- package/dist/cli/commands/path.js.map +1 -1
- package/dist/cli/commands/probe.d.ts.map +1 -1
- package/dist/cli/commands/probe.js +59 -16
- package/dist/cli/commands/probe.js.map +1 -1
- package/dist/cli/commands/regime.d.ts.map +1 -1
- package/dist/cli/commands/regime.js +1 -0
- package/dist/cli/commands/regime.js.map +1 -1
- package/dist/cli/commands/retrieve.d.ts.map +1 -1
- package/dist/cli/commands/retrieve.js +1 -0
- package/dist/cli/commands/retrieve.js.map +1 -1
- package/dist/cli/commands/search.d.ts.map +1 -1
- package/dist/cli/commands/search.js +1 -0
- package/dist/cli/commands/search.js.map +1 -1
- package/dist/cli/commands/symbolic.d.ts.map +1 -1
- package/dist/cli/commands/symbolic.js +19 -28
- package/dist/cli/commands/symbolic.js.map +1 -1
- package/dist/cli/commands/testplan.d.ts.map +1 -1
- package/dist/cli/commands/testplan.js +4 -2
- package/dist/cli/commands/testplan.js.map +1 -1
- package/dist/cli/determination.d.ts +1 -0
- package/dist/cli/determination.d.ts.map +1 -1
- package/dist/cli/determination.js.map +1 -1
- package/dist/cli/expr-print.d.ts +0 -2
- package/dist/cli/expr-print.d.ts.map +1 -1
- package/dist/cli/expr-print.js +7 -31
- package/dist/cli/expr-print.js.map +1 -1
- package/dist/cli/flag-help.d.ts +1 -0
- package/dist/cli/flag-help.d.ts.map +1 -1
- package/dist/cli/flag-help.js +1 -0
- package/dist/cli/flag-help.js.map +1 -1
- package/dist/cli/graphs.d.ts +2 -0
- package/dist/cli/graphs.d.ts.map +1 -1
- package/dist/cli/graphs.js +1 -0
- package/dist/cli/graphs.js.map +1 -1
- package/dist/cli/main.d.ts +8 -0
- package/dist/cli/main.d.ts.map +1 -1
- package/dist/cli/main.js +19 -3
- package/dist/cli/main.js.map +1 -1
- package/dist/cli/numeric-flag.d.ts +12 -0
- package/dist/cli/numeric-flag.d.ts.map +1 -0
- package/dist/cli/numeric-flag.js +44 -0
- package/dist/cli/numeric-flag.js.map +1 -0
- package/dist/cli/output.d.ts +28 -0
- package/dist/cli/output.d.ts.map +1 -1
- package/dist/cli/output.js +23 -0
- package/dist/cli/output.js.map +1 -1
- package/dist/cli/record-reach.js +2 -2
- package/dist/cli/record-reach.js.map +1 -1
- package/dist/cli/record-tables.d.ts.map +1 -1
- package/dist/cli/record-tables.js +6 -5
- package/dist/cli/record-tables.js.map +1 -1
- package/dist/cli/record.d.ts +1 -5
- package/dist/cli/record.d.ts.map +1 -1
- package/dist/cli/record.js +9 -8
- package/dist/cli/record.js.map +1 -1
- package/dist/cli/search-index.d.ts.map +1 -1
- package/dist/cli/search-index.js +7 -6
- package/dist/cli/search-index.js.map +1 -1
- package/dist/cli/statuses.d.ts +0 -2
- package/dist/cli/statuses.d.ts.map +1 -1
- package/dist/cli/statuses.js +12 -9
- package/dist/cli/statuses.js.map +1 -1
- package/dist/cli/stored-results.d.ts +7 -0
- package/dist/cli/stored-results.d.ts.map +1 -0
- package/dist/cli/stored-results.js +23 -0
- package/dist/cli/stored-results.js.map +1 -0
- package/dist/cli/version.d.ts +1 -0
- package/dist/cli/version.d.ts.map +1 -1
- package/dist/cli/version.js +8 -5
- package/dist/cli/version.js.map +1 -1
- package/dist/cli-api.d.ts +36 -5
- package/dist/cli-api.d.ts.map +1 -1
- package/dist/cli-api.js +30 -4
- package/dist/cli-api.js.map +1 -1
- package/dist/composition/algebraic-equivalence.d.ts +43 -0
- package/dist/composition/algebraic-equivalence.d.ts.map +1 -0
- package/dist/composition/algebraic-equivalence.js +115 -0
- package/dist/composition/algebraic-equivalence.js.map +1 -0
- package/dist/composition/axes.d.ts +0 -6
- package/dist/composition/axes.d.ts.map +1 -1
- package/dist/composition/axes.js +6 -6
- package/dist/composition/axes.js.map +1 -1
- package/dist/composition/axis-audit.d.ts +47 -20
- package/dist/composition/axis-audit.d.ts.map +1 -1
- package/dist/composition/axis-audit.js +82 -9
- package/dist/composition/axis-audit.js.map +1 -1
- package/dist/composition/bridge-analysis.d.ts +17 -0
- package/dist/composition/bridge-analysis.d.ts.map +1 -1
- package/dist/composition/bridge-analysis.js +102 -55
- package/dist/composition/bridge-analysis.js.map +1 -1
- package/dist/composition/canonical-compare.d.ts +40 -0
- package/dist/composition/canonical-compare.d.ts.map +1 -1
- package/dist/composition/canonical-compare.js +122 -24
- package/dist/composition/canonical-compare.js.map +1 -1
- package/dist/composition/canonical-graph.d.ts +3 -3
- package/dist/composition/canonical-graph.d.ts.map +1 -1
- package/dist/composition/canonical-graph.js +11 -38
- package/dist/composition/canonical-graph.js.map +1 -1
- package/dist/composition/canonical-json.js +2 -2
- package/dist/composition/canonical-json.js.map +1 -1
- package/dist/composition/catalog-graph.d.ts.map +1 -1
- package/dist/composition/catalog-graph.js +2 -5
- package/dist/composition/catalog-graph.js.map +1 -1
- package/dist/composition/chain-candidate.d.ts +8 -0
- package/dist/composition/chain-candidate.d.ts.map +1 -1
- package/dist/composition/chain-candidate.js +9 -2
- package/dist/composition/chain-candidate.js.map +1 -1
- package/dist/composition/chain-match.d.ts +6 -3
- package/dist/composition/chain-match.d.ts.map +1 -1
- package/dist/composition/chain-match.js +4 -1
- package/dist/composition/chain-match.js.map +1 -1
- package/dist/composition/chain-result.d.ts.map +1 -1
- package/dist/composition/chain-result.js +2 -14
- package/dist/composition/chain-result.js.map +1 -1
- package/dist/composition/compose-symbolic.d.ts.map +1 -1
- package/dist/composition/compose-symbolic.js +3 -2
- package/dist/composition/compose-symbolic.js.map +1 -1
- package/dist/composition/compose.d.ts.map +1 -1
- package/dist/composition/compose.js +13 -5
- package/dist/composition/compose.js.map +1 -1
- package/dist/composition/composition-recovery.d.ts.map +1 -1
- package/dist/composition/composition-recovery.js +4 -7
- package/dist/composition/composition-recovery.js.map +1 -1
- package/dist/composition/consequence.d.ts +15 -5
- package/dist/composition/consequence.d.ts.map +1 -1
- package/dist/composition/consequence.js +6 -4
- package/dist/composition/consequence.js.map +1 -1
- package/dist/composition/discovery.d.ts +129 -9
- package/dist/composition/discovery.d.ts.map +1 -1
- package/dist/composition/discovery.js +171 -67
- package/dist/composition/discovery.js.map +1 -1
- package/dist/composition/edge.d.ts +21 -2
- package/dist/composition/edge.d.ts.map +1 -1
- package/dist/composition/edge.js +23 -1
- package/dist/composition/edge.js.map +1 -1
- package/dist/composition/enumerate.d.ts.map +1 -1
- package/dist/composition/enumerate.js +18 -3
- package/dist/composition/enumerate.js.map +1 -1
- package/dist/composition/evaluate-relation.d.ts +35 -11
- package/dist/composition/evaluate-relation.d.ts.map +1 -1
- package/dist/composition/evaluate-relation.js +60 -39
- package/dist/composition/evaluate-relation.js.map +1 -1
- package/dist/composition/explain.d.ts +3 -12
- package/dist/composition/explain.d.ts.map +1 -1
- package/dist/composition/explain.js +7 -20
- package/dist/composition/explain.js.map +1 -1
- package/dist/composition/expr-eval.d.ts +1 -1
- package/dist/composition/expr-eval.d.ts.map +1 -1
- package/dist/composition/expr-eval.js +6 -15
- package/dist/composition/expr-eval.js.map +1 -1
- package/dist/composition/expr-simplify.d.ts +26 -14
- package/dist/composition/expr-simplify.d.ts.map +1 -1
- package/dist/composition/expr-simplify.js +64 -72
- package/dist/composition/expr-simplify.js.map +1 -1
- package/dist/composition/formula-shape.d.ts +23 -4
- package/dist/composition/formula-shape.d.ts.map +1 -1
- package/dist/composition/formula-shape.js +57 -17
- package/dist/composition/formula-shape.js.map +1 -1
- package/dist/composition/graph-structure.d.ts +98 -0
- package/dist/composition/graph-structure.d.ts.map +1 -0
- package/dist/composition/graph-structure.js +167 -0
- package/dist/composition/graph-structure.js.map +1 -0
- package/dist/composition/graph-viz-svg.d.ts.map +1 -1
- package/dist/composition/graph-viz-svg.js +1 -1
- package/dist/composition/graph-viz-svg.js.map +1 -1
- package/dist/composition/graph-viz.d.ts.map +1 -1
- package/dist/composition/graph-viz.js +8 -37
- package/dist/composition/graph-viz.js.map +1 -1
- package/dist/composition/grounding.d.ts.map +1 -1
- package/dist/composition/grounding.js +19 -7
- package/dist/composition/grounding.js.map +1 -1
- package/dist/composition/identifiability.d.ts +91 -4
- package/dist/composition/identifiability.d.ts.map +1 -1
- package/dist/composition/identifiability.js +363 -6
- package/dist/composition/identifiability.js.map +1 -1
- package/dist/composition/index.d.ts +8 -4
- package/dist/composition/index.d.ts.map +1 -1
- package/dist/composition/index.js +3 -2
- package/dist/composition/index.js.map +1 -1
- package/dist/composition/mathts-quiet.d.ts +7 -8
- package/dist/composition/mathts-quiet.d.ts.map +1 -1
- package/dist/composition/mathts-quiet.js +7 -16
- package/dist/composition/mathts-quiet.js.map +1 -1
- package/dist/composition/mathts-scalar-symbols.d.ts.map +1 -1
- package/dist/composition/mathts-scalar-symbols.js +2 -1
- package/dist/composition/mathts-scalar-symbols.js.map +1 -1
- package/dist/composition/own-equation-magnitude.d.ts +95 -0
- package/dist/composition/own-equation-magnitude.d.ts.map +1 -0
- package/dist/composition/own-equation-magnitude.js +270 -0
- package/dist/composition/own-equation-magnitude.js.map +1 -0
- package/dist/composition/probe/backend-protocol.d.ts +3 -0
- package/dist/composition/probe/backend-protocol.d.ts.map +1 -1
- package/dist/composition/probe/backend-protocol.js.map +1 -1
- package/dist/composition/probe/candidate-store.d.ts +1 -0
- package/dist/composition/probe/candidate-store.d.ts.map +1 -1
- package/dist/composition/probe/candidate-store.js +1 -0
- package/dist/composition/probe/candidate-store.js.map +1 -1
- package/dist/composition/probe/corpus.d.ts +8 -4
- package/dist/composition/probe/corpus.d.ts.map +1 -1
- package/dist/composition/probe/corpus.js +23 -12
- package/dist/composition/probe/corpus.js.map +1 -1
- package/dist/composition/probe/dataset.d.ts +18 -0
- package/dist/composition/probe/dataset.d.ts.map +1 -1
- package/dist/composition/probe/dataset.js +95 -50
- package/dist/composition/probe/dataset.js.map +1 -1
- package/dist/composition/probe/experiment-design.d.ts +7 -1
- package/dist/composition/probe/experiment-design.d.ts.map +1 -1
- package/dist/composition/probe/experiment-design.js +44 -24
- package/dist/composition/probe/experiment-design.js.map +1 -1
- package/dist/composition/probe/falsify.d.ts +2 -0
- package/dist/composition/probe/falsify.d.ts.map +1 -1
- package/dist/composition/probe/falsify.js +2 -0
- package/dist/composition/probe/falsify.js.map +1 -1
- package/dist/composition/probe/fit.d.ts +7 -0
- package/dist/composition/probe/fit.d.ts.map +1 -1
- package/dist/composition/probe/fit.js +46 -22
- package/dist/composition/probe/fit.js.map +1 -1
- package/dist/composition/probe/frontier.d.ts.map +1 -1
- package/dist/composition/probe/frontier.js +33 -15
- package/dist/composition/probe/frontier.js.map +1 -1
- package/dist/composition/probe/generator.d.ts +30 -1
- package/dist/composition/probe/generator.d.ts.map +1 -1
- package/dist/composition/probe/generator.js +58 -36
- package/dist/composition/probe/generator.js.map +1 -1
- package/dist/composition/probe/index.d.ts +14 -0
- package/dist/composition/probe/index.d.ts.map +1 -1
- package/dist/composition/probe/index.js +6 -0
- package/dist/composition/probe/index.js.map +1 -1
- package/dist/composition/probe/limits.d.ts +25 -1
- package/dist/composition/probe/limits.d.ts.map +1 -1
- package/dist/composition/probe/limits.js +53 -11
- package/dist/composition/probe/limits.js.map +1 -1
- package/dist/composition/probe/pipeline.d.ts +5 -0
- package/dist/composition/probe/pipeline.d.ts.map +1 -1
- package/dist/composition/probe/pipeline.js +73 -24
- package/dist/composition/probe/pipeline.js.map +1 -1
- package/dist/composition/probe/power-law.d.ts +121 -0
- package/dist/composition/probe/power-law.d.ts.map +1 -0
- package/dist/composition/probe/power-law.js +251 -0
- package/dist/composition/probe/power-law.js.map +1 -0
- package/dist/composition/probe/problem.d.ts +8 -4
- package/dist/composition/probe/problem.d.ts.map +1 -1
- package/dist/composition/probe/problem.js +177 -49
- package/dist/composition/probe/problem.js.map +1 -1
- package/dist/composition/probe/report.js +1 -1
- package/dist/composition/probe/report.js.map +1 -1
- package/dist/composition/probe/residual.d.ts +7 -1
- package/dist/composition/probe/residual.d.ts.map +1 -1
- package/dist/composition/probe/residual.js +10 -7
- package/dist/composition/probe/residual.js.map +1 -1
- package/dist/composition/probe/run-manifest.d.ts +1 -0
- package/dist/composition/probe/run-manifest.d.ts.map +1 -1
- package/dist/composition/probe/run-manifest.js.map +1 -1
- package/dist/composition/probe/scalar-search.d.ts +50 -0
- package/dist/composition/probe/scalar-search.d.ts.map +1 -0
- package/dist/composition/probe/scalar-search.js +169 -0
- package/dist/composition/probe/scalar-search.js.map +1 -0
- package/dist/composition/probe/scoring.d.ts +1 -0
- package/dist/composition/probe/scoring.d.ts.map +1 -1
- package/dist/composition/probe/scoring.js.map +1 -1
- package/dist/composition/probe/structure.d.ts +82 -17
- package/dist/composition/probe/structure.d.ts.map +1 -1
- package/dist/composition/probe/structure.js +129 -55
- package/dist/composition/probe/structure.js.map +1 -1
- package/dist/composition/probe/study.d.ts +31 -9
- package/dist/composition/probe/study.d.ts.map +1 -1
- package/dist/composition/probe/study.js +235 -184
- package/dist/composition/probe/study.js.map +1 -1
- package/dist/composition/probe/t-tail.d.ts +16 -0
- package/dist/composition/probe/t-tail.d.ts.map +1 -0
- package/dist/composition/probe/t-tail.js +29 -0
- package/dist/composition/probe/t-tail.js.map +1 -0
- package/dist/composition/probe/types.d.ts +3 -0
- package/dist/composition/probe/types.d.ts.map +1 -1
- package/dist/composition/probe/types.js.map +1 -1
- package/dist/composition/proposed-bridges.d.ts +52 -12
- package/dist/composition/proposed-bridges.d.ts.map +1 -1
- package/dist/composition/proposed-bridges.js +107 -60
- package/dist/composition/proposed-bridges.js.map +1 -1
- package/dist/composition/quantity-clusters.d.ts +48 -0
- package/dist/composition/quantity-clusters.d.ts.map +1 -0
- package/dist/composition/quantity-clusters.js +98 -0
- package/dist/composition/quantity-clusters.js.map +1 -0
- package/dist/composition/rational-exponent.d.ts +40 -0
- package/dist/composition/rational-exponent.d.ts.map +1 -0
- package/dist/composition/rational-exponent.js +65 -0
- package/dist/composition/rational-exponent.js.map +1 -0
- package/dist/composition/representative-values.d.ts +22 -0
- package/dist/composition/representative-values.d.ts.map +1 -1
- package/dist/composition/representative-values.js +29 -0
- package/dist/composition/representative-values.js.map +1 -1
- package/dist/composition/retrodiction.d.ts +15 -0
- package/dist/composition/retrodiction.d.ts.map +1 -1
- package/dist/composition/retrodiction.js +12 -4
- package/dist/composition/retrodiction.js.map +1 -1
- package/dist/composition/user-equation.d.ts +1 -0
- package/dist/composition/user-equation.d.ts.map +1 -1
- package/dist/composition/user-equation.js +3 -2
- package/dist/composition/user-equation.js.map +1 -1
- package/dist/core/assignment.d.ts +19 -0
- package/dist/core/assignment.d.ts.map +1 -0
- package/dist/core/assignment.js +19 -0
- package/dist/core/assignment.js.map +1 -0
- package/dist/core/compare.d.ts +32 -0
- package/dist/core/compare.d.ts.map +1 -0
- package/dist/core/compare.js +46 -0
- package/dist/core/compare.js.map +1 -0
- package/dist/core/constants.d.ts +42 -41
- package/dist/core/constants.d.ts.map +1 -1
- package/dist/core/constants.js +71 -51
- package/dist/core/constants.js.map +1 -1
- package/dist/core/data-file.d.ts +7 -0
- package/dist/core/data-file.d.ts.map +1 -1
- package/dist/core/data-file.js +17 -0
- package/dist/core/data-file.js.map +1 -1
- package/dist/core/format.d.ts +36 -0
- package/dist/core/format.d.ts.map +1 -0
- package/dist/core/format.js +39 -0
- package/dist/core/format.js.map +1 -0
- package/dist/core/hash.d.ts +14 -0
- package/dist/core/hash.d.ts.map +1 -0
- package/dist/core/hash.js +17 -0
- package/dist/core/hash.js.map +1 -0
- package/dist/core/json-schema.d.ts +2 -0
- package/dist/core/json-schema.d.ts.map +1 -1
- package/dist/core/json-schema.js +14 -13
- package/dist/core/json-schema.js.map +1 -1
- package/dist/core/labeled-tensor.d.ts.map +1 -1
- package/dist/core/labeled-tensor.js +0 -8
- package/dist/core/labeled-tensor.js.map +1 -1
- package/dist/core/mathts-read.d.ts +25 -0
- package/dist/core/mathts-read.d.ts.map +1 -0
- package/dist/core/mathts-read.js +51 -0
- package/dist/core/mathts-read.js.map +1 -0
- package/dist/core/tensor.d.ts.map +1 -1
- package/dist/core/tensor.js +24 -0
- package/dist/core/tensor.js.map +1 -1
- package/dist/core/types.d.ts +5 -5
- package/dist/diff/bridge-ast-gradient.d.ts +27 -23
- package/dist/diff/bridge-ast-gradient.d.ts.map +1 -1
- package/dist/diff/bridge-ast-gradient.js +75 -173
- package/dist/diff/bridge-ast-gradient.js.map +1 -1
- package/dist/diff/bridge-gradient.d.ts +19 -6
- package/dist/diff/bridge-gradient.d.ts.map +1 -1
- package/dist/diff/bridge-gradient.js +19 -11
- package/dist/diff/bridge-gradient.js.map +1 -1
- package/dist/diff/bridge-specs.d.ts.map +1 -1
- package/dist/diff/bridge-specs.js +3 -0
- package/dist/diff/bridge-specs.js.map +1 -1
- package/dist/dimensional/algebra.d.ts +18 -0
- package/dist/dimensional/algebra.d.ts.map +1 -1
- package/dist/dimensional/algebra.js +41 -1
- package/dist/dimensional/algebra.js.map +1 -1
- package/dist/dimensional/ast-builders.d.ts +7 -0
- package/dist/dimensional/ast-builders.d.ts.map +1 -1
- package/dist/dimensional/ast-builders.js +11 -0
- package/dist/dimensional/ast-builders.js.map +1 -1
- package/dist/dimensional/ast-leaves.d.ts +81 -0
- package/dist/dimensional/ast-leaves.d.ts.map +1 -0
- package/dist/dimensional/ast-leaves.js +146 -0
- package/dist/dimensional/ast-leaves.js.map +1 -0
- package/dist/dimensional/ast-types.d.ts +15 -0
- package/dist/dimensional/ast-types.d.ts.map +1 -1
- package/dist/dimensional/ast-types.js.map +1 -1
- package/dist/dimensional/buckingham.d.ts.map +1 -1
- package/dist/dimensional/buckingham.js +15 -27
- package/dist/dimensional/buckingham.js.map +1 -1
- package/dist/dimensional/constant-rows.js +9 -9
- package/dist/dimensional/constant-rows.js.map +1 -1
- package/dist/dimensional/curvature-composite.d.ts +1 -1
- package/dist/dimensional/curvature-composite.js.map +1 -1
- package/dist/dimensional/dimension-inference.d.ts.map +1 -1
- package/dist/dimensional/dimension-inference.js +1 -2
- package/dist/dimensional/dimension-inference.js.map +1 -1
- package/dist/dimensional/errors.d.ts +1 -1
- package/dist/dimensional/errors.d.ts.map +1 -1
- package/dist/dimensional/errors.js +1 -15
- package/dist/dimensional/errors.js.map +1 -1
- package/dist/dimensional/exact-scale.d.ts +24 -11
- package/dist/dimensional/exact-scale.d.ts.map +1 -1
- package/dist/dimensional/exact-scale.js +122 -130
- package/dist/dimensional/exact-scale.js.map +1 -1
- package/dist/dimensional/gauge-field.d.ts.map +1 -1
- package/dist/dimensional/gauge-field.js +2 -2
- package/dist/dimensional/gauge-field.js.map +1 -1
- package/dist/dimensional/hyphen-names.d.ts +12 -2
- package/dist/dimensional/hyphen-names.d.ts.map +1 -1
- package/dist/dimensional/hyphen-names.js +44 -19
- package/dist/dimensional/hyphen-names.js.map +1 -1
- package/dist/dimensional/mathts-unit-delegation.d.ts +29 -0
- package/dist/dimensional/mathts-unit-delegation.d.ts.map +1 -0
- package/dist/dimensional/mathts-unit-delegation.js +187 -0
- package/dist/dimensional/mathts-unit-delegation.js.map +1 -0
- package/dist/dimensional/mathts-unit-wrapper.d.ts +33 -0
- package/dist/dimensional/mathts-unit-wrapper.d.ts.map +1 -0
- package/dist/dimensional/mathts-unit-wrapper.js +190 -0
- package/dist/dimensional/mathts-unit-wrapper.js.map +1 -0
- package/dist/dimensional/metric.d.ts.map +1 -1
- package/dist/dimensional/metric.js +0 -1
- package/dist/dimensional/metric.js.map +1 -1
- package/dist/dimensional/scalar-lowering.d.ts +21 -0
- package/dist/dimensional/scalar-lowering.d.ts.map +1 -0
- package/dist/dimensional/scalar-lowering.js +45 -0
- package/dist/dimensional/scalar-lowering.js.map +1 -0
- package/dist/dimensional/symbolic-constants.d.ts +9 -0
- package/dist/dimensional/symbolic-constants.d.ts.map +1 -1
- package/dist/dimensional/symbolic-constants.js +13 -1
- package/dist/dimensional/symbolic-constants.js.map +1 -1
- package/dist/dimensional/types.d.ts +36 -0
- package/dist/dimensional/types.d.ts.map +1 -1
- package/dist/dimensional/types.js +45 -7
- package/dist/dimensional/types.js.map +1 -1
- package/dist/dimensional/unit-data.d.ts +5 -1
- package/dist/dimensional/unit-data.d.ts.map +1 -1
- package/dist/dimensional/unit-data.js +30 -6
- package/dist/dimensional/unit-data.js.map +1 -1
- package/dist/dimensional/units.d.ts +2 -0
- package/dist/dimensional/units.d.ts.map +1 -1
- package/dist/dimensional/units.js +59 -3
- package/dist/dimensional/units.js.map +1 -1
- package/dist/dimensional/validator.d.ts +2 -0
- package/dist/dimensional/validator.d.ts.map +1 -1
- package/dist/dimensional/validator.js.map +1 -1
- package/dist/index.d.ts +9 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -4
- package/dist/index.js.map +1 -1
- package/dist/numerical/christoffel-flat.d.ts.map +1 -1
- package/dist/numerical/christoffel-flat.js +3 -2
- package/dist/numerical/christoffel-flat.js.map +1 -1
- package/dist/numerical/connection-lowering-helpers.d.ts +3 -1
- package/dist/numerical/connection-lowering-helpers.d.ts.map +1 -1
- package/dist/numerical/connection-lowering-helpers.js +11 -15
- package/dist/numerical/connection-lowering-helpers.js.map +1 -1
- package/dist/numerical/covariant-eikonal.d.ts.map +1 -1
- package/dist/numerical/covariant-eikonal.js +34 -11
- package/dist/numerical/covariant-eikonal.js.map +1 -1
- package/dist/numerical/curvature-lowering-helpers.js +3 -2
- package/dist/numerical/curvature-lowering-helpers.js.map +1 -1
- package/dist/numerical/errors.d.ts.map +1 -1
- package/dist/numerical/errors.js +0 -3
- package/dist/numerical/errors.js.map +1 -1
- package/dist/numerical/finite-difference.d.ts +22 -0
- package/dist/numerical/finite-difference.d.ts.map +1 -0
- package/dist/numerical/finite-difference.js +27 -0
- package/dist/numerical/finite-difference.js.map +1 -0
- package/dist/numerical/geodesic-integrator.d.ts.map +1 -1
- package/dist/numerical/geodesic-integrator.js +22 -14
- package/dist/numerical/geodesic-integrator.js.map +1 -1
- package/dist/numerical/geometrized.d.ts.map +1 -1
- package/dist/numerical/geometrized.js +0 -1
- package/dist/numerical/geometrized.js.map +1 -1
- package/dist/numerical/mathts-engine.d.ts.map +1 -1
- package/dist/numerical/mathts-engine.js +10 -24
- package/dist/numerical/mathts-engine.js.map +1 -1
- package/dist/numerical/metric-inverse.d.ts.map +1 -1
- package/dist/numerical/metric-inverse.js +83 -46
- package/dist/numerical/metric-inverse.js.map +1 -1
- package/dist/numerical/null-ray-integrator.d.ts +2 -1
- package/dist/numerical/null-ray-integrator.d.ts.map +1 -1
- package/dist/numerical/null-ray-integrator.js +12 -12
- package/dist/numerical/null-ray-integrator.js.map +1 -1
- package/dist/numerical/painleve-gullstrand-metric.js +2 -2
- package/dist/numerical/painleve-gullstrand-metric.js.map +1 -1
- package/dist/numerical/pderiv.d.ts.map +1 -1
- package/dist/numerical/pderiv.js +2 -6
- package/dist/numerical/pderiv.js.map +1 -1
- package/dist/numerical/perihelion-finder.d.ts +0 -36
- package/dist/numerical/perihelion-finder.d.ts.map +1 -1
- package/dist/numerical/perihelion-finder.js +41 -87
- package/dist/numerical/perihelion-finder.js.map +1 -1
- package/dist/numerical/quadrature.d.ts.map +1 -1
- package/dist/numerical/quadrature.js +11 -13
- package/dist/numerical/quadrature.js.map +1 -1
- package/dist/numerical/rk4-trajectory.d.ts +10 -0
- package/dist/numerical/rk4-trajectory.d.ts.map +1 -0
- package/dist/numerical/rk4-trajectory.js +37 -0
- package/dist/numerical/rk4-trajectory.js.map +1 -0
- package/dist/numerical/schwarzschild.d.ts +14 -0
- package/dist/numerical/schwarzschild.d.ts.map +1 -0
- package/dist/numerical/schwarzschild.js +17 -0
- package/dist/numerical/schwarzschild.js.map +1 -0
- package/dist/numerical/spacetime-metrics.d.ts +12 -0
- package/dist/numerical/spacetime-metrics.d.ts.map +1 -1
- package/dist/numerical/spacetime-metrics.js +72 -56
- package/dist/numerical/spacetime-metrics.js.map +1 -1
- package/dist/numerical/statistics.d.ts +24 -0
- package/dist/numerical/statistics.d.ts.map +1 -0
- package/dist/numerical/statistics.js +52 -0
- package/dist/numerical/statistics.js.map +1 -0
- package/dist/numerical/strides.d.ts +3 -2
- package/dist/numerical/strides.d.ts.map +1 -1
- package/dist/numerical/strides.js +3 -10
- package/dist/numerical/strides.js.map +1 -1
- package/dist/numerical/tensor-engine.d.ts +21 -0
- package/dist/numerical/tensor-engine.d.ts.map +1 -1
- package/dist/numerical/tensor-engine.js +12 -0
- package/dist/numerical/tensor-engine.js.map +1 -1
- package/dist/relations/regime.d.ts +10 -0
- package/dist/relations/regime.d.ts.map +1 -1
- package/dist/relations/regime.js +18 -1
- package/dist/relations/regime.js.map +1 -1
- package/package.json +9 -12
- package/dist/cases/brownian-sphere.d.ts +0 -68
- package/dist/cases/brownian-sphere.d.ts.map +0 -1
- package/dist/cases/brownian-sphere.js +0 -354
- package/dist/cases/brownian-sphere.js.map +0 -1
- package/dist/cases/damped-resonator.d.ts +0 -23
- package/dist/cases/damped-resonator.d.ts.map +0 -1
- package/dist/cases/damped-resonator.js +0 -224
- package/dist/cases/damped-resonator.js.map +0 -1
- package/dist/cases/kepler-rv.d.ts +0 -13
- package/dist/cases/kepler-rv.d.ts.map +0 -1
- package/dist/cases/kepler-rv.js +0 -172
- package/dist/cases/kepler-rv.js.map +0 -1
- package/dist/cases/lumped-cooling.d.ts +0 -46
- package/dist/cases/lumped-cooling.d.ts.map +0 -1
- package/dist/cases/lumped-cooling.js +0 -261
- package/dist/cases/lumped-cooling.js.map +0 -1
- package/dist/cases/resistor-noise.d.ts +0 -14
- package/dist/cases/resistor-noise.d.ts.map +0 -1
- package/dist/cases/resistor-noise.js +0 -215
- package/dist/cases/resistor-noise.js.map +0 -1
- package/dist/cases/skin-depth.d.ts +0 -21
- package/dist/cases/skin-depth.d.ts.map +0 -1
- package/dist/cases/skin-depth.js +0 -174
- package/dist/cases/skin-depth.js.map +0 -1
package/dist/core/constants.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Canonical CODATA
|
|
2
|
+
* Canonical CODATA 2022 + SI-defined physical constants for UPT.
|
|
3
3
|
*
|
|
4
4
|
* The one owner of every fundamental physical constant used across the
|
|
5
5
|
* numerical, dimensional, and bridge layers; `tests/core/constants-owner.test.ts`
|
|
@@ -9,75 +9,95 @@
|
|
|
9
9
|
* • Exact-SI definitions (`C_SI`, `H_SI`, `K_B_SI`, `E_SI`) where the
|
|
10
10
|
* 2019 SI redefinition fixed their values exactly.
|
|
11
11
|
* • `HBAR_SI` is the exact quotient `H_SI / (2π)`, not the truncated CODATA display.
|
|
12
|
-
* • CODATA
|
|
13
|
-
* • Planck 2018 best estimate for `H0_SI`, in SI through
|
|
12
|
+
* • CODATA 2022 best estimates for measured constants (`G_SI`, `ALPHA`, Planck units).
|
|
13
|
+
* • Planck 2018 best estimate for `H0_SI`, in SI through MathTS
|
|
14
|
+
* `Unit.exactScale('km/s/Mpc')` — the same exact-scale path the unit
|
|
15
|
+
* reader delegates to. This module cannot import `convertValue`
|
|
16
|
+
* (`dimensional/` is tier 1; `core/` is tier 0).
|
|
14
17
|
*
|
|
15
18
|
* This file is the one owner of every value. `PhysicalConstants` in
|
|
16
19
|
* `src/core/types.ts` and the constant registry in
|
|
17
20
|
* `src/dimensional/symbolic-constants.ts` are projections of it, and a test
|
|
18
|
-
* refuses a CODATA literal anywhere else under `src/`.
|
|
19
|
-
* table's: `H0_SI` reads the parsec from `data/units.json` rather than
|
|
20
|
-
* restating it, so the Hubble rate here and `67.4 km/s/Mpc` read through the
|
|
21
|
-
* unit table are one number.
|
|
21
|
+
* refuses a CODATA literal anywhere else under `src/`.
|
|
22
22
|
*
|
|
23
23
|
* @module core/constants
|
|
24
24
|
* @public
|
|
25
25
|
*/
|
|
26
|
-
import {
|
|
26
|
+
import { Unit, exactScaleToNumber } from '@danielsimonjr/mathts-core';
|
|
27
|
+
import * as mathtsConstants from '@danielsimonjr/mathts-functions';
|
|
28
|
+
/**
|
|
29
|
+
* A measured constant's SI value, read from MathTS (CODATA 2022). MathTS is the
|
|
30
|
+
* one source of measured constants; UPT keeps no copy of their decimals. A
|
|
31
|
+
* constant MathTS lacks is a MathTS issue, not a local value.
|
|
32
|
+
*/
|
|
33
|
+
function codata(name) {
|
|
34
|
+
const value = mathtsConstants[name];
|
|
35
|
+
if (typeof value === 'number')
|
|
36
|
+
return value;
|
|
37
|
+
if (typeof value === 'object' && value !== null && typeof value.toNumeric === 'function') {
|
|
38
|
+
const n = value.toNumeric();
|
|
39
|
+
if (typeof n === 'number' && Number.isFinite(n))
|
|
40
|
+
return n;
|
|
41
|
+
}
|
|
42
|
+
throw new Error(`MathTS has no numeric constant ${name}`);
|
|
43
|
+
}
|
|
27
44
|
/** Speed of light in vacuum (m/s). Exact SI definition since 1983. */
|
|
28
45
|
export const C_SI = 299792458;
|
|
29
|
-
/** Rydberg constant R∞ (infinite nuclear mass), CODATA
|
|
30
|
-
export const R_INF_SI =
|
|
31
|
-
/** Newtonian gravitational constant (m³ kg⁻¹ s⁻²). CODATA
|
|
32
|
-
export const G_SI =
|
|
46
|
+
/** Rydberg constant R∞ (infinite nuclear mass), CODATA 2022 (m⁻¹), read from MathTS. */
|
|
47
|
+
export const R_INF_SI = codata('rydberg');
|
|
48
|
+
/** Newtonian gravitational constant (m³ kg⁻¹ s⁻²). CODATA 2022. */
|
|
49
|
+
export const G_SI = codata('gravitationConstant');
|
|
33
50
|
/** Planck constant (J·s). Exact SI definition since 2019. */
|
|
34
51
|
export const H_SI = 6.62607015e-34;
|
|
35
52
|
/**
|
|
36
53
|
* Reduced Planck constant h/(2π) (J·s). Exact, from the 2019 SI definition of
|
|
37
54
|
* h. The CODATA display `1.054571817e-34` is that quotient truncated; it is
|
|
38
|
-
* smaller by a relative `6.127e-10`. Planck units below
|
|
39
|
-
* CODATA
|
|
55
|
+
* smaller by a relative `6.127e-10`. The Planck units below are
|
|
56
|
+
* MathTS's CODATA 2022 values, not recomputed here from {@link HBAR_SI}.
|
|
40
57
|
*/
|
|
41
58
|
export const HBAR_SI = H_SI / (2 * Math.PI);
|
|
42
|
-
/** The CODATA
|
|
59
|
+
/** The CODATA display value of ħ: {@link HBAR_SI} truncated. Kept so the difference is computed, not typed. @internal */
|
|
43
60
|
export const HBAR_CODATA_DISPLAY = 1.054571817e-34;
|
|
44
61
|
/** Boltzmann constant (J/K). Exact SI definition since 2019. */
|
|
45
62
|
export const K_B_SI = 1.380649e-23;
|
|
46
63
|
/** Elementary charge (C). Exact SI definition since 2019. */
|
|
47
64
|
export const E_SI = 1.602176634e-19;
|
|
48
|
-
/** Fine-structure constant α (dimensionless). CODATA
|
|
49
|
-
export const ALPHA =
|
|
50
|
-
/** Vacuum permittivity ε₀ (F/m). CODATA
|
|
51
|
-
export const EPS0_SI =
|
|
65
|
+
/** Fine-structure constant α (dimensionless). CODATA 2022. */
|
|
66
|
+
export const ALPHA = codata('fineStructure');
|
|
67
|
+
/** Vacuum permittivity ε₀ (F/m). CODATA 2022. @internal */
|
|
68
|
+
export const EPS0_SI = codata('electricConstant');
|
|
52
69
|
/** Vacuum permeability μ₀ = 1/(ε₀ c²) (H/m), from ε₀ and the exact c. @internal */
|
|
53
70
|
export const MU0_SI = 1 / (EPS0_SI * C_SI * C_SI);
|
|
54
|
-
/** Stefan–Boltzmann constant σ (W m⁻² K⁻⁴). CODATA
|
|
55
|
-
export const SIGMA_SB_SI =
|
|
56
|
-
/** Planck mass √(ℏc/G) (kg). CODATA
|
|
57
|
-
export const M_P_SI =
|
|
58
|
-
/** Planck length √(ℏG/c³) (m). CODATA
|
|
59
|
-
export const L_P_SI =
|
|
60
|
-
/** Planck time √(ℏG/c⁵) (s). CODATA
|
|
61
|
-
export const T_P_SI =
|
|
62
|
-
/**
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
71
|
+
/** Stefan–Boltzmann constant σ (W m⁻² K⁻⁴). CODATA 2022. @internal */
|
|
72
|
+
export const SIGMA_SB_SI = codata('stefanBoltzmann');
|
|
73
|
+
/** Planck mass √(ℏc/G) (kg). CODATA 2022. */
|
|
74
|
+
export const M_P_SI = codata('planckMass');
|
|
75
|
+
/** Planck length √(ℏG/c³) (m). CODATA 2022. */
|
|
76
|
+
export const L_P_SI = codata('planckLength');
|
|
77
|
+
/** Planck time √(ℏG/c⁵) (s). CODATA 2022. */
|
|
78
|
+
export const T_P_SI = codata('planckTime');
|
|
79
|
+
/**
|
|
80
|
+
* MathTS exact scale of a valueless unit text, rounded once. This is the
|
|
81
|
+
* same pair of calls the delegated unit reader uses (`Unit.exactScale` then
|
|
82
|
+
* `exactScaleToNumber`).
|
|
83
|
+
*/
|
|
84
|
+
function exactScaleNumber(text) {
|
|
85
|
+
const exact = Unit.exactScale(text);
|
|
86
|
+
if (exact === null)
|
|
87
|
+
throw new Error(`MathTS has no exact scale for '${text}'`);
|
|
88
|
+
return exactScaleToNumber(exact);
|
|
70
89
|
}
|
|
71
90
|
/**
|
|
72
91
|
* Hubble parameter H₀ (s⁻¹).
|
|
73
92
|
*
|
|
74
|
-
* Planck 2018 TT,TE,EE+lowE+lensing best estimate: 67.4 km/s/Mpc
|
|
75
|
-
*
|
|
76
|
-
*
|
|
77
|
-
*
|
|
78
|
-
*
|
|
93
|
+
* Planck 2018 TT,TE,EE+lowE+lensing best estimate: 67.4 km/s/Mpc. The
|
|
94
|
+
* conversion to Hz is `Unit.exactScale('km/s/Mpc')` rounded once — the same
|
|
95
|
+
* exact-scale path `convertValue('67.4km/s/Mpc', 'Hz')` delegates to. Calling
|
|
96
|
+
* `convertValue` from this file is a layer-order violation (`core/` cannot
|
|
97
|
+
* import `dimensional/units.ts`).
|
|
98
|
+
* @public
|
|
79
99
|
*/
|
|
80
|
-
export const H0_SI = 67.
|
|
100
|
+
export const H0_SI = 67.4 * exactScaleNumber('km/s/Mpc');
|
|
81
101
|
/**
|
|
82
102
|
* Solar mass (kg). IAU 2015 nominal value rounded to the
|
|
83
103
|
* repo-conventional literal (used by the BE-42 docstring, the
|
|
@@ -100,7 +120,7 @@ export const BCS_GAP_RATIO = (2 * Math.PI) / Math.exp(EULER_GAMMA);
|
|
|
100
120
|
/** Lane-Emden n=3 dimensionless radius used by the white-dwarf mass. */
|
|
101
121
|
export const LANE_EMDEN_OMEGA3 = 2.01824;
|
|
102
122
|
/** Thomson cross section (m²). */
|
|
103
|
-
export const THOMSON_CROSS_SECTION_SI =
|
|
123
|
+
export const THOMSON_CROSS_SECTION_SI = codata('thomsonCrossSection');
|
|
104
124
|
/**
|
|
105
125
|
* Nominal solar gravitational parameter (GM)☉ (m³ s⁻²), IAU 2015 Resolution B3.
|
|
106
126
|
*
|
|
@@ -120,18 +140,18 @@ export const GM_SUN_SI = 1.3271244e20;
|
|
|
120
140
|
*/
|
|
121
141
|
export const M_SUN_IAU_SI = GM_SUN_SI / G_SI;
|
|
122
142
|
/**
|
|
123
|
-
* Electron mass (kg), CODATA
|
|
143
|
+
* Electron mass (kg), CODATA 2022. Added for the v0.11 namespacing
|
|
124
144
|
* gate's criterion-3 pin (λ_T of an electron at the Hawking
|
|
125
145
|
* temperature — see the Adam vet A-5).
|
|
126
146
|
* @public
|
|
127
147
|
*/
|
|
128
|
-
export const M_E_SI =
|
|
148
|
+
export const M_E_SI = codata('electronMass');
|
|
129
149
|
/**
|
|
130
|
-
* Proton mass (kg). CODATA
|
|
150
|
+
* Proton mass (kg). CODATA 2022. Shared by the Eddington evaluator and
|
|
131
151
|
* `upt eval` (`m_p`, `m_proton`). Not the Planck mass `M_P_SI`.
|
|
132
|
-
* @
|
|
152
|
+
* @public
|
|
133
153
|
*/
|
|
134
|
-
export const M_PROTON_SI =
|
|
154
|
+
export const M_PROTON_SI = codata('protonMass');
|
|
135
155
|
/**
|
|
136
156
|
* Avogadro constant (mol⁻¹). Exact in the 2019 SI.
|
|
137
157
|
* @internal
|
|
@@ -143,16 +163,16 @@ export const N_A_SI = 6.02214076e23;
|
|
|
143
163
|
*/
|
|
144
164
|
export const FARADAY_SI = N_A_SI * E_SI;
|
|
145
165
|
/**
|
|
146
|
-
* Wien displacement-law constant b = λ_max·T (m·K). CODATA
|
|
166
|
+
* Wien displacement-law constant b = λ_max·T (m·K). CODATA 2022.
|
|
147
167
|
*
|
|
148
168
|
* @public
|
|
149
169
|
*/
|
|
150
|
-
export const B_WIEN_SI =
|
|
170
|
+
export const B_WIEN_SI = codata('wienDisplacement');
|
|
151
171
|
/**
|
|
152
|
-
* Unified atomic mass unit (kg). CODATA
|
|
172
|
+
* Unified atomic mass unit (kg). CODATA 2022 atomic mass constant.
|
|
153
173
|
* One value for the Chandrasekhar evaluator and the symbolic constant `m_u`.
|
|
154
174
|
* Kept off the package barrel: callers use `m_u` in the symbolic registry.
|
|
155
175
|
* @internal
|
|
156
176
|
*/
|
|
157
|
-
export const M_U_SI =
|
|
177
|
+
export const M_U_SI = codata('atomicMass');
|
|
158
178
|
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/core/constants.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEjD,sEAAsE;AACtE,MAAM,CAAC,MAAM,IAAI,GAAG,SAAS,CAAC;AAC9B,4FAA4F;AAC5F,MAAM,CAAC,MAAM,QAAQ,GAAG,cAAc,CAAC;AAEvC,mEAAmE;AACnE,MAAM,CAAC,MAAM,IAAI,GAAG,WAAW,CAAC;AAEhC,6DAA6D;AAC7D,MAAM,CAAC,MAAM,IAAI,GAAG,cAAc,CAAC;AAEnC;;;;;GAKG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,IAAI,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC,CAAC;AAE5C,8HAA8H;AAC9H,MAAM,CAAC,MAAM,mBAAmB,GAAG,eAAe,CAAC;AAEnD,gEAAgE;AAChE,MAAM,CAAC,MAAM,MAAM,GAAG,YAAY,CAAC;AAEnC,6DAA6D;AAC7D,MAAM,CAAC,MAAM,IAAI,GAAG,eAAe,CAAC;AAEpC,8DAA8D;AAC9D,MAAM,CAAC,MAAM,KAAK,GAAG,eAAe,CAAC;AAErC,2DAA2D;AAC3D,MAAM,CAAC,MAAM,OAAO,GAAG,gBAAgB,CAAC;AAExC,mFAAmF;AACnF,MAAM,CAAC,MAA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for UPT.\n *\n * The one owner of every fundamental physical constant used across the\n * numerical, dimensional, and bridge layers; `tests/core/constants-owner.test.ts`\n * fails on a second copy of any of these decimals elsewhere under `src/`.\n *\n * Values use:\n * • Exact-SI definitions (`C_SI`, `H_SI`, `K_B_SI`, `E_SI`) where the\n * 2019 SI redefinition fixed their values exactly.\n * • `HBAR_SI` is the exact quotient `H_SI / (2π)`, not the truncated CODATA display.\n * • CODATA 2018 best estimates for measured constants (`G_SI`, `ALPHA`, Planck units).\n * • Planck 2018 best estimate for `H0_SI`, in SI through the unit table's parsec.\n *\n * This file is the one owner of every value. `PhysicalConstants` in\n * `src/core/types.ts` and the constant registry in\n * `src/dimensional/symbolic-constants.ts` are projections of it, and a test\n * refuses a CODATA literal anywhere else under `src/`. A unit is the unit\n * table's: `H0_SI` reads the parsec from `data/units.json` rather than\n * restating it, so the Hubble rate here and `67.4 km/s/Mpc` read through the\n * unit table are one number.\n *\n * @module core/constants\n * @public\n */\n\nimport { checkedDataFile } from './data-file.js';\n\n/** Speed of light in vacuum (m/s). Exact SI definition since 1983. */\nexport const C_SI = 299792458;\n/** Rydberg constant R∞ (infinite nuclear mass), CODATA 2018: 10 973 731.568 160(21) m⁻¹. */\nexport const R_INF_SI = 10973731.56816;\n\n/** Newtonian gravitational constant (m³ kg⁻¹ s⁻²). CODATA 2018. */\nexport const G_SI = 6.67430e-11;\n\n/** Planck constant (J·s). Exact SI definition since 2019. */\nexport const H_SI = 6.62607015e-34;\n\n/**\n * Reduced Planck constant h/(2π) (J·s). Exact, from the 2019 SI definition of\n * h. The CODATA display `1.054571817e-34` is that quotient truncated; it is\n * smaller by a relative `6.127e-10`. Planck units below stay the published\n * CODATA 2018 values, which were computed from the truncated display.\n */\nexport const HBAR_SI = H_SI / (2 * Math.PI);\n\n/** The CODATA 2018 display value of ħ: {@link HBAR_SI} truncated. Kept so the difference is computed, not typed. @internal */\nexport const HBAR_CODATA_DISPLAY = 1.054571817e-34;\n\n/** Boltzmann constant (J/K). Exact SI definition since 2019. */\nexport const K_B_SI = 1.380649e-23;\n\n/** Elementary charge (C). Exact SI definition since 2019. */\nexport const E_SI = 1.602176634e-19;\n\n/** Fine-structure constant α (dimensionless). CODATA 2018. */\nexport const ALPHA = 7.2973525693e-3;\n\n/** Vacuum permittivity ε₀ (F/m). CODATA 2018. @internal */\nexport const EPS0_SI = 8.8541878128e-12;\n\n/** Vacuum permeability μ₀ = 1/(ε₀ c²) (H/m), from ε₀ and the exact c. @internal */\nexport const MU0_SI = 1 / (EPS0_SI * C_SI * C_SI);\n\n/** Stefan–Boltzmann constant σ (W m⁻² K⁻⁴). CODATA 2018. @internal */\nexport const SIGMA_SB_SI = 5.670374419e-8;\n\n/** Planck mass √(ℏc/G) (kg). CODATA 2018. */\nexport const M_P_SI = 2.176434e-8;\n\n/** Planck length √(ℏG/c³) (m). CODATA 2018. */\nexport const L_P_SI = 1.616255e-35;\n\n/** Planck time √(ℏG/c⁵) (s). CODATA 2018. */\nexport const T_P_SI = 5.391247e-44;\n\n/** The `scale` of the `symbol` row in `data/units.json`, which must be a plain decimal (metres for a length). */\nfunction unitTableDecimal(symbol: string): number {\n const file = checkedDataFile('units.json') as { readonly units: readonly { readonly symbols: readonly string[]; readonly scale: string }[] };\n const scale = file.units.find((row) => row.symbols.includes(symbol))?.scale;\n const value = scale === undefined ? Number.NaN : Number(scale);\n if (!Number.isFinite(value)) throw new Error(`data/units.json: the '${symbol}' row must state a decimal scale (got ${scale ?? 'no row'})`);\n return value;\n}\n\n/**\n * Hubble parameter H₀ (s⁻¹).\n *\n * Planck 2018 TT,TE,EE+lowE+lensing best estimate: 67.4 km/s/Mpc, converted\n * with the parsec of the unit table (`data/units.json`, 648000/π au), so it is\n * the value `convertValue('67.4km/s/Mpc', 'Hz')` reads: one Hubble rate,\n * 2.1842852410855023e-18 s⁻¹. The unit table is the one place the parsec is\n * written; this module reads it rather than restating it.\n */\nexport const H0_SI = 67.4e3 / (1e6 * unitTableDecimal('pc'));\n\n/**\n * Solar mass (kg). IAU 2015 nominal value rounded to the\n * repo-conventional literal (used by the BE-42 docstring, the\n * bridge-gradient tests, and the v0.8.0 calibration edges).\n * @public\n */\nexport const M_SUN_SI = 1.989e30;\n\n/** Solar mass in kilograms. The same value as {@link M_SUN_SI}. */\nexport const M_SUN_KG = M_SUN_SI;\n\n/** von Klitzing constant R_K = h/e² (ohm). */\nexport const VON_KLITZING_SI = H_SI / (E_SI * E_SI);\n\n/** Josephson constant K_J = 2e/h (Hz/V). */\nexport const JOSEPHSON_CONSTANT_SI = (2 * E_SI) / H_SI;\n\n/** Lorenz number L = (π²/3) (k_B/e)² (W Ω K⁻²). */\nexport const LORENZ_NUMBER_SI = (Math.PI ** 2 / 3) * (K_B_SI / E_SI) ** 2;\n\n/** Euler–Mascheroni constant γ. The BCS gap is π k_B T_c / e^γ; the formula name is `euler_gamma`. */\nexport const EULER_GAMMA = 0.5772156649015329;\n\n/** Weak-coupling BCS gap ratio 2Δ(0)/(k_B T_c) = 2π e^{−γ}. */\nexport const BCS_GAP_RATIO = (2 * Math.PI) / Math.exp(EULER_GAMMA);\n\n/** Lane-Emden n=3 dimensionless radius used by the white-dwarf mass. */\nexport const LANE_EMDEN_OMEGA3 = 2.01824;\n\n/** Thomson cross section (m²). */\nexport const THOMSON_CROSS_SECTION_SI = 6.6524587321e-29;\n\n/**\n * Nominal solar gravitational parameter (GM)☉ (m³ s⁻²), IAU 2015 Resolution B3.\n *\n * The product GM☉ is known to about 10 significant digits, while G alone is\n * known to about 5, so a confrontation that needs GM☉ takes this value rather\n * than `G_SI × M_SUN_SI`: that product is 3.0e-4 too high, five times the VLBI\n * 1σ on the solar-limb deflection. A mass that some evaluator requires in kg\n * is `GM_SUN_SI / G_SI`, which reproduces G·M = GM☉ exactly.\n * @public\n */\nexport const GM_SUN_SI = 1.3271244e20;\n\n/**\n * The solar mass (kg) that reproduces {@link GM_SUN_SI} with {@link G_SI}:\n * the double `GM_SUN_SI / G_SI`. The unit `Msun_iau` and the registry name\n * `Msun_iau` both read this one value.\n * @internal\n */\nexport const M_SUN_IAU_SI = GM_SUN_SI / G_SI;\n\n/**\n * Electron mass (kg), CODATA 2018. Added for the v0.11 namespacing\n * gate's criterion-3 pin (λ_T of an electron at the Hawking\n * temperature — see the Adam vet A-5).\n * @public\n */\nexport const M_E_SI = 9.1093837015e-31;\n\n/**\n * Proton mass (kg). CODATA 2018. Shared by the Eddington evaluator and\n * `upt eval` (`m_p`, `m_proton`). Not the Planck mass `M_P_SI`.\n * @internal\n */\nexport const M_PROTON_SI = 1.67262192369e-27;\n\n/**\n * Avogadro constant (mol⁻¹). Exact in the 2019 SI.\n * @internal\n */\nexport const N_A_SI = 6.02214076e23;\n\n/**\n * Faraday constant (C·mol⁻¹), `N_A * e`.\n * @internal\n */\nexport const FARADAY_SI = N_A_SI * E_SI;\n\n/**\n * Wien displacement-law constant b = λ_max·T (m·K). CODATA 2018.\n *\n * @public\n */\nexport const B_WIEN_SI = 2.897771955e-3;\n\n/**\n * Unified atomic mass unit (kg). CODATA 2018 atomic mass constant.\n * One value for the Chandrasekhar evaluator and the symbolic constant `m_u`.\n * Kept off the package barrel: callers use `m_u` in the symbolic registry.\n * @internal\n */\nexport const M_U_SI = 1.66053906660e-27;\n"]}
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/core/constants.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,EAAE,IAAI,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,KAAK,eAAe,MAAM,iCAAiC,CAAC;AAEnE;;;;GAIG;AACH,SAAS,MAAM,CAAC,IAAY;IAC1B,MAAM,KAAK,GAAa,eAA2C,CAAC,IAAI,CAAC,CAAC;IAC1E,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IAC5C,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,O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AM,CAAC,MAAM,aAAa,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;AAEnE,wEAAwE;AACxE,MAAM,CAAC,MAAM,iBAAiB,GAAG,OAAO,CAAC;AAEzC,kCAAkC;AAClC,MAAM,CAAC,MAAM,wBAAwB,GAAG,MAAM,CAAC,qBAAqB,CAAC,CAAC;AAEtE;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,YAAY,CAAC;AAEtC;;;;;GAKG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,SAAS,GAAG,IAAI,CAAC;AAE7C;;;;;GAKG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,MAAM,CAAC,cAAc,CAAC,CAAC;AAE7C;;;;GAIG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,MAAM,CAAC,YAAY,CAAC,CAAC;AAEhD;;;GAGG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,aAAa,CAAC;AAEpC;;;GAGG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,MAAM,GAAG,IAAI,CAAC;AAExC;;;;GAIG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,MAAM,CAAC,kBAAkB,CAAC,CAAC;AAEpD;;;;;GAKG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,MAAM,CAAC,YAAY,CAAC,CAAC","sourcesContent":["/**\n * Canonical CODATA 2022 + SI-defined physical constants for UPT.\n *\n * The one owner of every fundamental physical constant used across the\n * numerical, dimensional, and bridge layers; `tests/core/constants-owner.test.ts`\n * fails on a second copy of any of these decimals elsewhere under `src/`.\n *\n * Values use:\n * • Exact-SI definitions (`C_SI`, `H_SI`, `K_B_SI`, `E_SI`) where the\n * 2019 SI redefinition fixed their values exactly.\n * • `HBAR_SI` is the exact quotient `H_SI / (2π)`, not the truncated CODATA display.\n * • CODATA 2022 best estimates for measured constants (`G_SI`, `ALPHA`, Planck units).\n * • Planck 2018 best estimate for `H0_SI`, in SI through MathTS\n * `Unit.exactScale('km/s/Mpc')` — the same exact-scale path the unit\n * reader delegates to. This module cannot import `convertValue`\n * (`dimensional/` is tier 1; `core/` is tier 0).\n *\n * This file is the one owner of every value. `PhysicalConstants` in\n * `src/core/types.ts` and the constant registry in\n * `src/dimensional/symbolic-constants.ts` are projections of it, and a test\n * refuses a CODATA literal anywhere else under `src/`.\n *\n * @module core/constants\n * @public\n */\n\nimport { Unit, exactScaleToNumber } from '@danielsimonjr/mathts-core';\nimport * as mathtsConstants from '@danielsimonjr/mathts-functions';\n\n/**\n * A measured constant's SI value, read from MathTS (CODATA 2022). MathTS is the\n * one source of measured constants; UPT keeps no copy of their decimals. A\n * constant MathTS lacks is a MathTS issue, not a local value.\n */\nfunction codata(name: string): number {\n const value: unknown = (mathtsConstants as Record<string, unknown>)[name];\n if (typeof value === 'number') return value;\n if (typeof value === 'object' && value !== null && typeof (value as { toNumeric?: unknown }).toNumeric === 'function') {\n const n = (value as { toNumeric: () => unknown }).toNumeric();\n if (typeof n === 'number' && Number.isFinite(n)) return n;\n }\n throw new Error(`MathTS has no numeric constant ${name}`);\n}\n\n/** Speed of light in vacuum (m/s). Exact SI definition since 1983. */\nexport const C_SI = 299792458;\n/** Rydberg constant R∞ (infinite nuclear mass), CODATA 2022 (m⁻¹), read from MathTS. */\nexport const R_INF_SI = codata('rydberg');\n\n/** Newtonian gravitational constant (m³ kg⁻¹ s⁻²). CODATA 2022. */\nexport const G_SI = codata('gravitationConstant');\n\n/** Planck constant (J·s). Exact SI definition since 2019. */\nexport const H_SI = 6.62607015e-34;\n\n/**\n * Reduced Planck constant h/(2π) (J·s). Exact, from the 2019 SI definition of\n * h. The CODATA display `1.054571817e-34` is that quotient truncated; it is\n * smaller by a relative `6.127e-10`. The Planck units below are\n * MathTS's CODATA 2022 values, not recomputed here from {@link HBAR_SI}.\n */\nexport const HBAR_SI = H_SI / (2 * Math.PI);\n\n/** The CODATA display value of ħ: {@link HBAR_SI} truncated. Kept so the difference is computed, not typed. @internal */\nexport const HBAR_CODATA_DISPLAY = 1.054571817e-34;\n\n/** Boltzmann constant (J/K). Exact SI definition since 2019. */\nexport const K_B_SI = 1.380649e-23;\n\n/** Elementary charge (C). Exact SI definition since 2019. */\nexport const E_SI = 1.602176634e-19;\n\n/** Fine-structure constant α (dimensionless). CODATA 2022. */\nexport const ALPHA = codata('fineStructure');\n\n/** Vacuum permittivity ε₀ (F/m). CODATA 2022. @internal */\nexport const EPS0_SI = codata('electricConstant');\n\n/** Vacuum permeability μ₀ = 1/(ε₀ c²) (H/m), from ε₀ and the exact c. @internal */\nexport const MU0_SI = 1 / (EPS0_SI * C_SI * C_SI);\n\n/** Stefan–Boltzmann constant σ (W m⁻² K⁻⁴). CODATA 2022. @internal */\nexport const SIGMA_SB_SI = codata('stefanBoltzmann');\n\n/** Planck mass √(ℏc/G) (kg). CODATA 2022. */\nexport const M_P_SI = codata('planckMass');\n\n/** Planck length √(ℏG/c³) (m). CODATA 2022. */\nexport const L_P_SI = codata('planckLength');\n\n/** Planck time √(ℏG/c⁵) (s). CODATA 2022. */\nexport const T_P_SI = codata('planckTime');\n\n/**\n * MathTS exact scale of a valueless unit text, rounded once. This is the\n * same pair of calls the delegated unit reader uses (`Unit.exactScale` then\n * `exactScaleToNumber`).\n */\nfunction exactScaleNumber(text: string): number {\n const exact = Unit.exactScale(text);\n if (exact === null) throw new Error(`MathTS has no exact scale for '${text}'`);\n return exactScaleToNumber(exact);\n}\n\n/**\n * Hubble parameter H₀ (s⁻¹).\n *\n * Planck 2018 TT,TE,EE+lowE+lensing best estimate: 67.4 km/s/Mpc. The\n * conversion to Hz is `Unit.exactScale('km/s/Mpc')` rounded once — the same\n * exact-scale path `convertValue('67.4km/s/Mpc', 'Hz')` delegates to. Calling\n * `convertValue` from this file is a layer-order violation (`core/` cannot\n * import `dimensional/units.ts`).\n * @public\n */\nexport const H0_SI = 67.4 * exactScaleNumber('km/s/Mpc');\n\n/**\n * Solar mass (kg). IAU 2015 nominal value rounded to the\n * repo-conventional literal (used by the BE-42 docstring, the\n * bridge-gradient tests, and the v0.8.0 calibration edges).\n * @public\n */\nexport const M_SUN_SI = 1.989e30;\n\n/** Solar mass in kilograms. The same value as {@link M_SUN_SI}. */\nexport const M_SUN_KG = M_SUN_SI;\n\n/** von Klitzing constant R_K = h/e² (ohm). */\nexport const VON_KLITZING_SI = H_SI / (E_SI * E_SI);\n\n/** Josephson constant K_J = 2e/h (Hz/V). */\nexport const JOSEPHSON_CONSTANT_SI = (2 * E_SI) / H_SI;\n\n/** Lorenz number L = (π²/3) (k_B/e)² (W Ω K⁻²). */\nexport const LORENZ_NUMBER_SI = (Math.PI ** 2 / 3) * (K_B_SI / E_SI) ** 2;\n\n/** Euler–Mascheroni constant γ. The BCS gap is π k_B T_c / e^γ; the formula name is `euler_gamma`. */\nexport const EULER_GAMMA = 0.5772156649015329;\n\n/** Weak-coupling BCS gap ratio 2Δ(0)/(k_B T_c) = 2π e^{−γ}. */\nexport const BCS_GAP_RATIO = (2 * Math.PI) / Math.exp(EULER_GAMMA);\n\n/** Lane-Emden n=3 dimensionless radius used by the white-dwarf mass. */\nexport const LANE_EMDEN_OMEGA3 = 2.01824;\n\n/** Thomson cross section (m²). */\nexport const THOMSON_CROSS_SECTION_SI = codata('thomsonCrossSection');\n\n/**\n * Nominal solar gravitational parameter (GM)☉ (m³ s⁻²), IAU 2015 Resolution B3.\n *\n * The product GM☉ is known to about 10 significant digits, while G alone is\n * known to about 5, so a confrontation that needs GM☉ takes this value rather\n * than `G_SI × M_SUN_SI`: that product is 3.0e-4 too high, five times the VLBI\n * 1σ on the solar-limb deflection. A mass that some evaluator requires in kg\n * is `GM_SUN_SI / G_SI`, which reproduces G·M = GM☉ exactly.\n * @public\n */\nexport const GM_SUN_SI = 1.3271244e20;\n\n/**\n * The solar mass (kg) that reproduces {@link GM_SUN_SI} with {@link G_SI}:\n * the double `GM_SUN_SI / G_SI`. The unit `Msun_iau` and the registry name\n * `Msun_iau` both read this one value.\n * @internal\n */\nexport const M_SUN_IAU_SI = GM_SUN_SI / G_SI;\n\n/**\n * Electron mass (kg), CODATA 2022. Added for the v0.11 namespacing\n * gate's criterion-3 pin (λ_T of an electron at the Hawking\n * temperature — see the Adam vet A-5).\n * @public\n */\nexport const M_E_SI = codata('electronMass');\n\n/**\n * Proton mass (kg). CODATA 2022. Shared by the Eddington evaluator and\n * `upt eval` (`m_p`, `m_proton`). Not the Planck mass `M_P_SI`.\n * @public\n */\nexport const M_PROTON_SI = codata('protonMass');\n\n/**\n * Avogadro constant (mol⁻¹). Exact in the 2019 SI.\n * @internal\n */\nexport const N_A_SI = 6.02214076e23;\n\n/**\n * Faraday constant (C·mol⁻¹), `N_A * e`.\n * @internal\n */\nexport const FARADAY_SI = N_A_SI * E_SI;\n\n/**\n * Wien displacement-law constant b = λ_max·T (m·K). CODATA 2022.\n *\n * @public\n */\nexport const B_WIEN_SI = codata('wienDisplacement');\n\n/**\n * Unified atomic mass unit (kg). CODATA 2022 atomic mass constant.\n * One value for the Chandrasekhar evaluator and the symbolic constant `m_u`.\n * Kept off the package barrel: callers use `m_u` in the symbolic registry.\n * @internal\n */\nexport const M_U_SI = codata('atomicMass');\n"]}
|
package/dist/core/data-file.d.ts
CHANGED
|
@@ -10,6 +10,13 @@
|
|
|
10
10
|
* @module core/data-file
|
|
11
11
|
*/
|
|
12
12
|
import { type JsonSchema } from './json-schema.js';
|
|
13
|
+
/**
|
|
14
|
+
* The JSON value in the file at `path`. A file that is not JSON throws a
|
|
15
|
+
* `SyntaxError` whose message starts with `path`, so a bad file is found by
|
|
16
|
+
* its name; a file that cannot be read throws the file-system error as is.
|
|
17
|
+
* @internal
|
|
18
|
+
*/
|
|
19
|
+
export declare function readJsonFile(path: string): unknown;
|
|
13
20
|
/** The schema file of `file`: `units.json` → `units.schema.json`. @internal */
|
|
14
21
|
export declare function schemaFileOf(file: string): string;
|
|
15
22
|
/** The text of `data/<file>`. @internal */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-file.d.ts","sourceRoot":"","sources":["../../src/core/data-file.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAKH,OAAO,EAAkB,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAInE,+EAA+E;AAC/E,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEjD;AAED,2CAA2C;AAC3C,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE7C;AAED,qDAAqD;AACrD,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,CAEnD;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,GAAG,OAAO,CAKrF;AAID,wFAAwF;AACxF,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAGrD"}
|
|
1
|
+
{"version":3,"file":"data-file.d.ts","sourceRoot":"","sources":["../../src/core/data-file.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAKH,OAAO,EAAkB,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAInE;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAQlD;AAED,+EAA+E;AAC/E,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEjD;AAED,2CAA2C;AAC3C,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE7C;AAED,qDAAqD;AACrD,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,CAEnD;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,GAAG,OAAO,CAKrF;AAID,wFAAwF;AACxF,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAGrD"}
|
package/dist/core/data-file.js
CHANGED
|
@@ -14,6 +14,23 @@ import { dirname, join } from 'node:path';
|
|
|
14
14
|
import { fileURLToPath } from 'node:url';
|
|
15
15
|
import { schemaProblems } from './json-schema.js';
|
|
16
16
|
const DATA_DIR = join(dirname(fileURLToPath(import.meta.url)), '../../data');
|
|
17
|
+
/**
|
|
18
|
+
* The JSON value in the file at `path`. A file that is not JSON throws a
|
|
19
|
+
* `SyntaxError` whose message starts with `path`, so a bad file is found by
|
|
20
|
+
* its name; a file that cannot be read throws the file-system error as is.
|
|
21
|
+
* @internal
|
|
22
|
+
*/
|
|
23
|
+
export function readJsonFile(path) {
|
|
24
|
+
const text = readFileSync(path, 'utf8');
|
|
25
|
+
try {
|
|
26
|
+
return JSON.parse(text);
|
|
27
|
+
}
|
|
28
|
+
catch (error) {
|
|
29
|
+
if (error instanceof SyntaxError)
|
|
30
|
+
throw new SyntaxError(`${path}: ${error.message}`, { cause: error });
|
|
31
|
+
throw error;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
17
34
|
/** The schema file of `file`: `units.json` → `units.schema.json`. @internal */
|
|
18
35
|
export function schemaFileOf(file) {
|
|
19
36
|
return file.replace(/\.json$/, '.schema.json');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-file.js","sourceRoot":"","sources":["../../src/core/data-file.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,cAAc,EAAmB,MAAM,kBAAkB,CAAC;AAEnE,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,OAAO,IAAI,CAAC,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,IAAI,CAAC,CAAC;AAC3B,CAAC","sourcesContent":["/**\n * The packaged data files under `data/`, read and checked against their schemas.\n *\n * Every data file the library loads has a schema beside it, named by one\n * convention (`units.json` → `units.schema.json`), and is checked against it\n * with {@link schemaProblems} when it loads, so a malformed file fails at load\n * with every problem listed instead of failing later where a field is read.\n * A file two modules read is parsed and checked once per process.\n *\n * @module core/data-file\n */\n\nimport { readFileSync } from 'node:fs';\nimport { dirname, join } from 'node:path';\nimport { fileURLToPath } from 'node:url';\nimport { schemaProblems, type JsonSchema } from './json-schema.js';\n\nconst DATA_DIR = join(dirname(fileURLToPath(import.meta.url)), '../../data');\n\n/** The schema file of `file`: `units.json` → `units.schema.json`. @internal */\nexport function schemaFileOf(file: string): string {\n return file.replace(/\\.json$/, '.schema.json');\n}\n\n/** The text of `data/<file>`. @internal */\nexport function dataText(file: string): string {\n return readFileSync(join(DATA_DIR, file), 'utf8');\n}\n\n/** The schema of `data/<file>`, parsed. @internal */\nexport function dataSchema(file: string): JsonSchema {\n return JSON.parse(dataText(schemaFileOf(file))) as JsonSchema;\n}\n\n/**\n * `text`, the contents of `data/<file>`, parsed and checked against `schema`.\n * Throws listing every problem. A test passes a broken copy.\n * @internal\n */\nexport function parseDataFile(file: string, text: string, schema: JsonSchema): unknown {\n const value: unknown = JSON.parse(text);\n const problems = schemaProblems(schema, value);\n if (problems.length > 0) throw new Error(`data/${file} does not match data/${schemaFileOf(file)}:\\n${problems.join('\\n')}`);\n return value;\n}\n\nconst checked = new Map<string, unknown>();\n\n/** `data/<file>`, parsed and checked against its schema, once per process. @internal */\nexport function checkedDataFile(file: string): unknown {\n if (!checked.has(file)) checked.set(file, parseDataFile(file, dataText(file), dataSchema(file)));\n return checked.get(file);\n}\n"]}
|
|
1
|
+
{"version":3,"file":"data-file.js","sourceRoot":"","sources":["../../src/core/data-file.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC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,GAAY,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACxC,MAAM,QAAQ,GAAG,cAAc,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IAC/C,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,QAAQ,IAAI,wBAAwB,YAAY,CAAC,IAAI,CAAC,MAAM,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAC5H,OAAO,KAAK,CAAC;AACf,CAAC;AAED,MAAM,OAAO,GAAG,IAAI,GAAG,EAAmB,CAAC;AAE3C,wFAAwF;AACxF,MAAM,UAAU,eAAe,CAAC,IAAY;IAC1C,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC;QAAE,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,aAAa,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC,EAAE,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACjG,OAAO,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AAC3B,CAAC","sourcesContent":["/**\n * The packaged data files under `data/`, read and checked against their schemas.\n *\n * Every data file the library loads has a schema beside it, named by one\n * convention (`units.json` → `units.schema.json`), and is checked against it\n * with {@link schemaProblems} when it loads, so a malformed file fails at load\n * with every problem listed instead of failing later where a field is read.\n * A file two modules read is parsed and checked once per process.\n *\n * @module core/data-file\n */\n\nimport { readFileSync } from 'node:fs';\nimport { dirname, join } from 'node:path';\nimport { fileURLToPath } from 'node:url';\nimport { schemaProblems, type JsonSchema } from './json-schema.js';\n\nconst DATA_DIR = join(dirname(fileURLToPath(import.meta.url)), '../../data');\n\n/**\n * The JSON value in the file at `path`. A file that is not JSON throws a\n * `SyntaxError` whose message starts with `path`, so a bad file is found by\n * its name; a file that cannot be read throws the file-system error as is.\n * @internal\n */\nexport function readJsonFile(path: string): unknown {\n const text = readFileSync(path, 'utf8');\n try {\n return JSON.parse(text) as unknown;\n } catch (error) {\n if (error instanceof SyntaxError) throw new SyntaxError(`${path}: ${error.message}`, { cause: error });\n throw error;\n }\n}\n\n/** The schema file of `file`: `units.json` → `units.schema.json`. @internal */\nexport function schemaFileOf(file: string): string {\n return file.replace(/\\.json$/, '.schema.json');\n}\n\n/** The text of `data/<file>`. @internal */\nexport function dataText(file: string): string {\n return readFileSync(join(DATA_DIR, file), 'utf8');\n}\n\n/** The schema of `data/<file>`, parsed. @internal */\nexport function dataSchema(file: string): JsonSchema {\n return JSON.parse(dataText(schemaFileOf(file))) as JsonSchema;\n}\n\n/**\n * `text`, the contents of `data/<file>`, parsed and checked against `schema`.\n * Throws listing every problem. A test passes a broken copy.\n * @internal\n */\nexport function parseDataFile(file: string, text: string, schema: JsonSchema): unknown {\n const value: unknown = JSON.parse(text);\n const problems = schemaProblems(schema, value);\n if (problems.length > 0) throw new Error(`data/${file} does not match data/${schemaFileOf(file)}:\\n${problems.join('\\n')}`);\n return value;\n}\n\nconst checked = new Map<string, unknown>();\n\n/** `data/<file>`, parsed and checked against its schema, once per process. @internal */\nexport function checkedDataFile(file: string): unknown {\n if (!checked.has(file)) checked.set(file, parseDataFile(file, dataText(file), dataSchema(file)));\n return checked.get(file);\n}\n"]}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The printed forms of a number.
|
|
3
|
+
*
|
|
4
|
+
* A recovered or compared quantity prints through {@link formatQuantity}: a
|
|
5
|
+
* fixed count of significant digits, an integer as an integer. A value a
|
|
6
|
+
* reader may need to reproduce bit for bit prints through
|
|
7
|
+
* {@link formatExact}. A fraction reported as a percentage prints through
|
|
8
|
+
* {@link formatPercent}. The number itself is never rounded by these; only
|
|
9
|
+
* its text is.
|
|
10
|
+
*
|
|
11
|
+
* @module core/format
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* `value` to `digits` significant digits (15 by default, the precision an
|
|
15
|
+
* evaluator input is already passed at; a statistic such as a residual in σ
|
|
16
|
+
* asks for 3), with trailing zeros dropped so an integer stays `1`, not
|
|
17
|
+
* `1.0000e+0`.
|
|
18
|
+
* @internal
|
|
19
|
+
*/
|
|
20
|
+
export declare function formatQuantity(value: number, digits?: number): string;
|
|
21
|
+
/** The shortest decimal that round-trips to the same double (`upt evaluate`'s outputs). @internal */
|
|
22
|
+
export declare function formatExact(value: number): string;
|
|
23
|
+
/** How {@link formatPercent} prints a statistic: significant digits, and a `+` on a positive value when `signed`. @internal */
|
|
24
|
+
export interface PercentDigits {
|
|
25
|
+
readonly significant: number;
|
|
26
|
+
readonly signed?: boolean;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* The fraction `x` as a percentage. A number of `digits` fixes the decimals
|
|
30
|
+
* (`0.1234` → `12.3%`); `{ significant }` prints that many significant digits
|
|
31
|
+
* through {@link formatQuantity} (`-0.437` → `-43.7%`, `1.5` → `150%`), and
|
|
32
|
+
* `signed` adds `+` to a positive value (`+25.7%`; zero stays `0%`).
|
|
33
|
+
* @internal
|
|
34
|
+
*/
|
|
35
|
+
export declare function formatPercent(x: number, digits?: number | PercentDigits): string;
|
|
36
|
+
//# sourceMappingURL=format.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../src/core/format.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,SAAK,GAAG,MAAM,CAEjE;AAED,qGAAqG;AACrG,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEjD;AAED,+HAA+H;AAC/H,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,GAAE,MAAM,GAAG,aAAiB,GAAG,MAAM,CAGnF"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The printed forms of a number.
|
|
3
|
+
*
|
|
4
|
+
* A recovered or compared quantity prints through {@link formatQuantity}: a
|
|
5
|
+
* fixed count of significant digits, an integer as an integer. A value a
|
|
6
|
+
* reader may need to reproduce bit for bit prints through
|
|
7
|
+
* {@link formatExact}. A fraction reported as a percentage prints through
|
|
8
|
+
* {@link formatPercent}. The number itself is never rounded by these; only
|
|
9
|
+
* its text is.
|
|
10
|
+
*
|
|
11
|
+
* @module core/format
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* `value` to `digits` significant digits (15 by default, the precision an
|
|
15
|
+
* evaluator input is already passed at; a statistic such as a residual in σ
|
|
16
|
+
* asks for 3), with trailing zeros dropped so an integer stays `1`, not
|
|
17
|
+
* `1.0000e+0`.
|
|
18
|
+
* @internal
|
|
19
|
+
*/
|
|
20
|
+
export function formatQuantity(value, digits = 15) {
|
|
21
|
+
return String(Number(value.toPrecision(digits)));
|
|
22
|
+
}
|
|
23
|
+
/** The shortest decimal that round-trips to the same double (`upt evaluate`'s outputs). @internal */
|
|
24
|
+
export function formatExact(value) {
|
|
25
|
+
return String(value);
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* The fraction `x` as a percentage. A number of `digits` fixes the decimals
|
|
29
|
+
* (`0.1234` → `12.3%`); `{ significant }` prints that many significant digits
|
|
30
|
+
* through {@link formatQuantity} (`-0.437` → `-43.7%`, `1.5` → `150%`), and
|
|
31
|
+
* `signed` adds `+` to a positive value (`+25.7%`; zero stays `0%`).
|
|
32
|
+
* @internal
|
|
33
|
+
*/
|
|
34
|
+
export function formatPercent(x, digits = 1) {
|
|
35
|
+
if (typeof digits === 'number')
|
|
36
|
+
return `${(100 * x).toFixed(digits)}%`;
|
|
37
|
+
return `${digits.signed === true && x > 0 ? '+' : ''}${formatQuantity(x * 100, digits.significant)}%`;
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=format.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format.js","sourceRoot":"","sources":["../../src/core/format.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH;;;;;;GAMG;AACH,MAAM,UAAU,cAAc,CAAC,KAAa,EAAE,MAAM,GAAG,EAAE;IACvD,OAAO,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;AACnD,CAAC;AAED,qGAAqG;AACrG,MAAM,UAAU,WAAW,CAAC,KAAa;IACvC,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AAQD;;;;;;GAMG;AACH,MAAM,UAAU,aAAa,CAAC,CAAS,EAAE,MAAM,GAA2B,CAAC;IACzE,IAAI,OAAO,MAAM,KAAK,QAAQ;QAAE,OAAO,GAAG,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC;IACvE,OAAO,GAAG,MAAM,CAAC,MAAM,KAAK,IAAI,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,cAAc,CAAC,CAAC,GAAG,GAAG,EAAE,MAAM,CAAC,WAAW,CAAC,GAAG,CAAC;AACxG,CAAC","sourcesContent":["/**\n * The printed forms of a number.\n *\n * A recovered or compared quantity prints through {@link formatQuantity}: a\n * fixed count of significant digits, an integer as an integer. A value a\n * reader may need to reproduce bit for bit prints through\n * {@link formatExact}. A fraction reported as a percentage prints through\n * {@link formatPercent}. The number itself is never rounded by these; only\n * its text is.\n *\n * @module core/format\n */\n\n/**\n * `value` to `digits` significant digits (15 by default, the precision an\n * evaluator input is already passed at; a statistic such as a residual in σ\n * asks for 3), with trailing zeros dropped so an integer stays `1`, not\n * `1.0000e+0`.\n * @internal\n */\nexport function formatQuantity(value: number, digits = 15): string {\n return String(Number(value.toPrecision(digits)));\n}\n\n/** The shortest decimal that round-trips to the same double (`upt evaluate`'s outputs). @internal */\nexport function formatExact(value: number): string {\n return String(value);\n}\n\n/** How {@link formatPercent} prints a statistic: significant digits, and a `+` on a positive value when `signed`. @internal */\nexport interface PercentDigits {\n readonly significant: number;\n readonly signed?: boolean;\n}\n\n/**\n * The fraction `x` as a percentage. A number of `digits` fixes the decimals\n * (`0.1234` → `12.3%`); `{ significant }` prints that many significant digits\n * through {@link formatQuantity} (`-0.437` → `-43.7%`, `1.5` → `150%`), and\n * `signed` adds `+` to a positive value (`+25.7%`; zero stays `0%`).\n * @internal\n */\nexport function formatPercent(x: number, digits: number | PercentDigits = 1): string {\n if (typeof digits === 'number') return `${(100 * x).toFixed(digits)}%`;\n return `${digits.signed === true && x > 0 ? '+' : ''}${formatQuantity(x * 100, digits.significant)}%`;\n}\n"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One SHA-256 digest.
|
|
3
|
+
*
|
|
4
|
+
* The record fingerprints, the PhysJS reviewed-row hashes, the unit-table
|
|
5
|
+
* hash and the canonical-JSON hash all read the same digest; each site used
|
|
6
|
+
* to build its own `createHash('sha256')`. A string is hashed as UTF-8, a
|
|
7
|
+
* `Buffer` as its bytes. Nothing is normalised here: a caller that folds line
|
|
8
|
+
* endings does so before hashing, and says so.
|
|
9
|
+
*
|
|
10
|
+
* @module core/hash
|
|
11
|
+
*/
|
|
12
|
+
/** The SHA-256 of `text` (UTF-8 for a string, raw bytes for a Buffer) as lowercase hex. @internal */
|
|
13
|
+
export declare function sha256Hex(text: string | Buffer): string;
|
|
14
|
+
//# sourceMappingURL=hash.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hash.d.ts","sourceRoot":"","sources":["../../src/core/hash.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAIH,qGAAqG;AACrG,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAEvD"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One SHA-256 digest.
|
|
3
|
+
*
|
|
4
|
+
* The record fingerprints, the PhysJS reviewed-row hashes, the unit-table
|
|
5
|
+
* hash and the canonical-JSON hash all read the same digest; each site used
|
|
6
|
+
* to build its own `createHash('sha256')`. A string is hashed as UTF-8, a
|
|
7
|
+
* `Buffer` as its bytes. Nothing is normalised here: a caller that folds line
|
|
8
|
+
* endings does so before hashing, and says so.
|
|
9
|
+
*
|
|
10
|
+
* @module core/hash
|
|
11
|
+
*/
|
|
12
|
+
import { createHash } from 'node:crypto';
|
|
13
|
+
/** The SHA-256 of `text` (UTF-8 for a string, raw bytes for a Buffer) as lowercase hex. @internal */
|
|
14
|
+
export function sha256Hex(text) {
|
|
15
|
+
return createHash('sha256').update(text).digest('hex');
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=hash.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hash.js","sourceRoot":"","sources":["../../src/core/hash.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,qGAAqG;AACrG,MAAM,UAAU,SAAS,CAAC,IAAqB;IAC7C,OAAO,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AACzD,CAAC","sourcesContent":["/**\n * One SHA-256 digest.\n *\n * The record fingerprints, the PhysJS reviewed-row hashes, the unit-table\n * hash and the canonical-JSON hash all read the same digest; each site used\n * to build its own `createHash('sha256')`. A string is hashed as UTF-8, a\n * `Buffer` as its bytes. Nothing is normalised here: a caller that folds line\n * endings does so before hashing, and says so.\n *\n * @module core/hash\n */\n\nimport { createHash } from 'node:crypto';\n\n/** The SHA-256 of `text` (UTF-8 for a string, raw bytes for a Buffer) as lowercase hex. @internal */\nexport function sha256Hex(text: string | Buffer): string {\n return createHash('sha256').update(text).digest('hex');\n}\n"]}
|
|
@@ -18,6 +18,8 @@
|
|
|
18
18
|
export type JsonSchema = {
|
|
19
19
|
readonly [keyword: string]: unknown;
|
|
20
20
|
};
|
|
21
|
+
/** A JSON object: not an array, not null. The one object guard of the data readers. @internal */
|
|
22
|
+
export declare function isPlainObject(value: unknown): value is Record<string, unknown>;
|
|
21
23
|
/**
|
|
22
24
|
* Every place `value` breaks `schema`, as `$.path: reason` lines. Empty when it conforms.
|
|
23
25
|
* Throws when the schema uses a keyword outside the subset.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"json-schema.d.ts","sourceRoot":"","sources":["../../src/core/json-schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,0EAA0E;AAC1E,MAAM,MAAM,UAAU,GAAG;IAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAA;CAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"json-schema.d.ts","sourceRoot":"","sources":["../../src/core/json-schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,0EAA0E;AAC1E,MAAM,MAAM,UAAU,GAAG;IAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAA;CAAE,CAAC;AAwBjE,iGAAiG;AACjG,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAE9E;AAwHD;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,OAAO,GAAG,MAAM,EAAE,CAI3E"}
|
package/dist/core/json-schema.js
CHANGED
|
@@ -35,13 +35,14 @@ const KEYWORDS = new Set([
|
|
|
35
35
|
'then',
|
|
36
36
|
'else',
|
|
37
37
|
]);
|
|
38
|
-
|
|
38
|
+
/** A JSON object: not an array, not null. The one object guard of the data readers. @internal */
|
|
39
|
+
export function isPlainObject(value) {
|
|
39
40
|
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
40
41
|
}
|
|
41
42
|
function typeMatches(type, value) {
|
|
42
43
|
switch (type) {
|
|
43
44
|
case 'object':
|
|
44
|
-
return
|
|
45
|
+
return isPlainObject(value);
|
|
45
46
|
case 'array':
|
|
46
47
|
return Array.isArray(value);
|
|
47
48
|
case 'string':
|
|
@@ -63,8 +64,8 @@ function resolveRef(root, ref) {
|
|
|
63
64
|
// local definition table and nothing else is resolved.
|
|
64
65
|
const m = /^#\/(\$defs|definitions)\/([^/]+)$/.exec(ref);
|
|
65
66
|
const defs = m === null ? undefined : root[m[1]];
|
|
66
|
-
const target = m === null || !
|
|
67
|
-
if (!
|
|
67
|
+
const target = m === null || !isPlainObject(defs) ? undefined : defs[m[2]];
|
|
68
|
+
if (!isPlainObject(target))
|
|
68
69
|
throw new Error(`json-schema: unresolved $ref '${ref}'`);
|
|
69
70
|
return target;
|
|
70
71
|
}
|
|
@@ -78,11 +79,11 @@ function check(root, schema, value, path, problems) {
|
|
|
78
79
|
check(root, resolveRef(root, schema['$ref']), value, path, problems);
|
|
79
80
|
// `if`/`then`/`else`: the branch whose condition the value meets is checked; the condition's
|
|
80
81
|
// own problems are not reported.
|
|
81
|
-
if (
|
|
82
|
+
if (isPlainObject(schema['if'])) {
|
|
82
83
|
const condition = [];
|
|
83
84
|
check(root, schema['if'], value, path, condition);
|
|
84
85
|
const branch = condition.length === 0 ? schema['then'] : schema['else'];
|
|
85
|
-
if (
|
|
86
|
+
if (isPlainObject(branch))
|
|
86
87
|
check(root, branch, value, path, problems);
|
|
87
88
|
}
|
|
88
89
|
if (schema['type'] !== undefined) {
|
|
@@ -124,22 +125,22 @@ function check(root, schema, value, path, problems) {
|
|
|
124
125
|
if (seen.size !== value.length)
|
|
125
126
|
problems.push(`${path}: items are not unique`);
|
|
126
127
|
}
|
|
127
|
-
if (
|
|
128
|
+
if (isPlainObject(schema['items'])) {
|
|
128
129
|
const items = schema['items'];
|
|
129
130
|
value.forEach((item, i) => check(root, items, item, `${path}[${i}]`, problems));
|
|
130
131
|
}
|
|
131
132
|
else if (Array.isArray(schema['items'])) {
|
|
132
133
|
// A tuple: each position has its own schema; a position past the tuple is unchecked.
|
|
133
134
|
schema['items'].forEach((itemSchema, i) => {
|
|
134
|
-
if (!
|
|
135
|
+
if (!isPlainObject(itemSchema))
|
|
135
136
|
throw new Error(`json-schema: items[${i}] at ${path} is not a schema`);
|
|
136
137
|
if (i < value.length)
|
|
137
138
|
check(root, itemSchema, value[i], `${path}[${i}]`, problems);
|
|
138
139
|
});
|
|
139
140
|
}
|
|
140
141
|
}
|
|
141
|
-
if (
|
|
142
|
-
const properties =
|
|
142
|
+
if (isPlainObject(value)) {
|
|
143
|
+
const properties = isPlainObject(schema['properties']) ? schema['properties'] : {};
|
|
143
144
|
if (Array.isArray(schema['required'])) {
|
|
144
145
|
for (const key of schema['required']) {
|
|
145
146
|
if (!Object.hasOwn(value, key))
|
|
@@ -148,17 +149,17 @@ function check(root, schema, value, path, problems) {
|
|
|
148
149
|
}
|
|
149
150
|
for (const [key, child] of Object.entries(value)) {
|
|
150
151
|
const where = `${path}.${key}`;
|
|
151
|
-
if (
|
|
152
|
+
if (isPlainObject(schema['propertyNames']))
|
|
152
153
|
check(root, schema['propertyNames'], key, `${where} (name)`, problems);
|
|
153
154
|
// Own properties only: a `__proto__` key must not resolve to Object.prototype.
|
|
154
155
|
const declared = Object.hasOwn(properties, key) ? properties[key] : undefined;
|
|
155
|
-
if (
|
|
156
|
+
if (isPlainObject(declared)) {
|
|
156
157
|
check(root, declared, child, where, problems);
|
|
157
158
|
}
|
|
158
159
|
else if (schema['additionalProperties'] === false) {
|
|
159
160
|
problems.push(`${where}: unexpected property`);
|
|
160
161
|
}
|
|
161
|
-
else if (
|
|
162
|
+
else if (isPlainObject(schema['additionalProperties'])) {
|
|
162
163
|
check(root, schema['additionalProperties'], child, where, problems);
|
|
163
164
|
}
|
|
164
165
|
}
|