Sign in

    moonbit-chemreport

    A reusable report layer for MoonBit chemical-engineering calculations.

    chemical-engineering
    report
    benchmark
    bundle
    markdown
    html
    json
    Download zip
    Author
    Version
    0.3.1
    License
    Apache-2.0
    Last updated
    last month
    Downloads
    15

    #moonbit-chemreport

    MoonBit chemical-engineering calculations often start in focused packages: reactor sizing, distillation, mass balance, energy balance, property lookup, and equipment checks. moonbit-chemreport provides the report layer that those packages can share: a stable model for inputs, assumptions, formulas, results, warnings, and data sources, plus Markdown, HTML, and JSON exporters.

    The project is intentionally small at the boundary and expandable inside. It is not a process simulator. It is the part a simulator, spreadsheet importer, or operator-facing CLI can call after the numbers are already computed.

    #Core capabilities

    • A reusable ChemReport data model.
    • Constructors for quantities, calculation inputs, assumptions, formulas, results, warnings, and data sources.
    • Markdown export for lab notes, GitHub issues, and handoff documents.
    • HTML export for dashboards and static report previews.
    • JSON export for integration tests, web frontends, and downstream tools.
    • Validation helpers that catch missing and empty report fields and highlight hazard-level warnings.
    • ReportMetrics for completeness counts and ReportBundle for batch validation, aggregate metrics, and combined Markdown/JSON output.
    • Worked examples for mass balance, energy balance, binary distillation, and reactor conversion.
    • Three NIST SRD 69 Antoine-equation benchmark records for water, ethanol, and benzene, each carrying CAS number, temperature range, coefficient values, and source URL.
    • Unit-aware scalar parsing and conversion for common engineering dimensions.
    • Deterministic report comparison, quality policies, CSV summaries, and JSONL.
    • CSV summary import with quoted-field handling, fixed-point quantity arithmetic, ordered provenance ledgers, composable report builders, and bundle selection.
    • Rule-based checks for units, duplicate names, formula variables, and source citations, plus six additional engineering report templates.

    #CLI

    moon run cmd/main

    The CLI prints a Markdown example followed by the cited NIST benchmark bundle. The library benchmark runner measures export workload and output size locally; it does not make hardware-independent performance claims.

    #Quick Start

    moon check --deny-warn moon test --deny-warn moon run cmd/main

    The CLI prints the built-in CSTR mass-balance report as Markdown.

    It also prints the NIST benchmark bundle summary so the repository has a repeatable, source-aware data path that can be exercised without network access.

    #API Sketch

    ///|
    let r = report(
    "CSTR A-101 Mass Balance",
    summary="A stable report record for a reactor inlet/outlet balance.",
    inputs=[
    input(
    "feed flow",
    quantity("100.0", "kmol/h"),
    note="measured at battery limit",
    ),
    ],
    assumptions=[assumption("steady state", "accumulation term is zero")],
    formulas=[formula("A in", "F_A,in = F_feed * z_A", ["F_feed", "z_A"])],
    results=[
    result("A feed", quantity("42.0", "kmol/h"), procedure="100.0 * 0.42"),
    ],
    warnings=[caution("conversion target should be reconciled before scale-up")],
    sources=[source("design basis", "internal design basis document")],
    )

    ///|
    let markdown = r.to_markdown()

    ///|
    let html = r.to_html_document()

    ///|
    let json = r.to_json()

    #Architecture

    • model.mbt: report records and constructors.
    • validate.mbt: consistency checks and blocking issue detection.
    • markdown.mbt: Markdown renderer.
    • html.mbt: HTML fragment/document renderer.
    • json_export.mbt: stable JSON string renderer.
    • metrics.mbt: completeness metrics for one report.
    • bundle.mbt: batch report validation, aggregation, and export.
    • examples.mbt: mass-balance, energy-balance, distillation, and reactor examples.
    • benchmarks.mbt: NIST SRD 69 Antoine benchmark records.
    • units.mbt and scalars.mbt: dimensions, unit catalog, parsing, and conversion.
    • query.mbt, diff.mbt, policy.mbt: discovery, comparison, and quality gates.
    • csv.mbt, benchmark_runner.mbt: tabular interchange and deterministic workloads.
    • csv_import.mbt, quantity_math.mbt, balance.mbt: ingestion, fixed-point arithmetic, and closure checks.
    • builder.mbt, bundle_ops.mbt, rules.mbt: composable construction, batch selection, and quality rules.
    • pipeline.mbt, provenance.mbt, source_audit.mbt: typed rendering, ordered provenance, and source audits.
    • series.mbt, report_index.mbt, archive.mbt: numeric summaries, searchable report indexes, and revision snapshots.
    • bundle_analytics.mbt, bundle_export.mbt, schema.mbt, diff_details.mbt: batch quality summaries, stable exports, schema checks, and readable change risk.
    • cmd/main: simple runnable entry point.

    #Design scope

    The package targets reusable engineering infrastructure. It avoids reimplementing chemical calculations already owned by future domain packages; instead it supplies the common reporting surface those packages need to present assumptions, formulas, warnings, and source traceability in one place.

    Benchmark data is deliberately kept as report fixtures rather than a new property database, so the project complements future chemical calculation packages while keeping the report schema independent.

    #Benchmarks, tests, and CI

    The repository is prepared for the current MoonBit toolchain flow:

    moon fmt --check moon check --deny-warn moon info moon test --deny-warn

    CI installs the current stable MoonBit toolchain and checks formatting, all-target type checking, native compilation, interface drift, and tests on Linux, macOS, and Windows. Benchmark provenance and limitations are documented in docs/benchmarks.md.

    #Source And Maintenance Notes

    All source code in this repository is original for moonbit-chemreport, except for the initial project scaffold generated by moon new and the Apache-2.0 license text. The worked-example numbers are demonstration data, not design advice. The three Antoine coefficient records are source-aware benchmark fixtures transcribed from NIST Chemistry WebBook SRD 69; see docs/benchmarks.md for provenance, ranges, and limitations. The intended maintenance path is to add typed adapters for MoonBit chemical-engineering libraries as those packages appear, while keeping the core report schema stable.

    #License

    Apache-2.0.

    ArchiveError

    pub enum ArchiveError {
    NonIncreasingRevision
    EmptyNote
    } derive(Eq,
    Debug
    )

    Assumption

    pub struct Assumption {
    title : String
    detail : String
    } derive(Eq,
    Debug
    )

    BalanceCheck

    pub struct BalanceCheck {
    status : BalanceStatus
    inlet : String
    outlet : String
    difference : String
    tolerance : String
    } derive(Eq,
    Debug
    )

    BalanceCheck::is_balanced

    fn BalanceCheck::is_balanced(self : BalanceCheck) -> Bool

    BalanceStatus

    pub enum BalanceStatus {
    Balanced
    Unbalanced
    Invalid
    } derive(Eq,
    Debug
    )

    BenchmarkCase

    pub struct BenchmarkCase {
    id : String
    category : String
    report : ChemReport
    } derive(Eq,
    Debug
    )

    BenchmarkResult

    pub struct BenchmarkResult {
    suite : String
    case_count : Int
    iterations : Int
    total_bytes : Int
    publishable_cases : Int
    } derive(Eq,
    Debug
    )

    BenchmarkSuite

    pub struct BenchmarkSuite {
    name : String
    cases : Array[BenchmarkWork]
    } derive(Eq,
    Debug
    )

    BenchmarkSuite::run

    fn BenchmarkSuite::run(self : BenchmarkSuite, iterations : Int) -> BenchmarkResult

    BenchmarkWork

    pub struct BenchmarkWork {
    id : String
    report : ChemReport
    } derive(Eq,
    Debug
    )

    BundleIssue

    pub struct BundleIssue {
    report_index : Int
    issue : ReportIssue
    } derive(Eq,
    Debug
    )

    BundleMetrics

    pub struct BundleMetrics {
    report_count : Int
    publishable_count : Int
    blocking_count : Int
    input_count : Int
    result_count : Int
    source_count : Int
    warning_count : Int
    hazard_count : Int
    } derive(Eq,
    Debug
    )

    BundleSelection

    pub enum BundleSelection {
    AllReports
    PublishableOnly
    NeedsReview
    } derive(Eq,
    Debug
    )

    BundleSummary

    pub struct BundleSummary {
    report_count : Int
    publishable_count : Int
    blocking_count : Int
    input_count : Int
    result_count : Int
    warning_count : Int
    source_count : Int
    } derive(Eq,
    Debug
    )

    ChangeDetail

    pub struct ChangeDetail {
    section : String
    severity : ChangeSeverity
    message : String
    } derive(Eq,
    Debug
    )

    ChangeDetail::is_high_risk

    fn ChangeDetail::is_high_risk(self : ChangeDetail) -> Bool

    ChangeSeverity

    pub enum ChangeSeverity {
    Low
    Medium
    High
    } derive(Eq,
    Debug
    )

    ChemInput

    pub struct ChemInput {
    name : String
    value : Quantity
    note : String
    } derive(Eq,
    Debug
    )

    ChemReport

    pub struct ChemReport {
    title : String
    summary : String
    inputs : Array[ChemInput]
    assumptions : Array[Assumption]
    formulas : Array[Formula]
    results : Array[ChemResult]
    warnings : Array[ReportWarning]
    sources : Array[DataSource]
    } derive(Eq,
    Debug
    )

    ChemReport::check_rules

    fn ChemReport::check_rules(self : ChemReport, rules : Array[RuleKind]) -> Array[RuleIssue]

    ChemReport::find_input

    fn ChemReport::find_input(self : ChemReport, name : String) -> ChemInput?

    ChemReport::find_result

    fn ChemReport::find_result(self : ChemReport, name : String) -> ChemResult?

    ChemReport::has_blocking_issue

    fn ChemReport::has_blocking_issue(self : ChemReport) -> Bool

    ChemReport::is_publishable

    fn ChemReport::is_publishable(self : ChemReport) -> Bool

    ChemReport::metrics

    fn ChemReport::metrics(self : ChemReport) -> ReportMetrics

    ChemReport::section_counts

    fn ChemReport::section_counts(self : ChemReport) -> Array[SectionCount]

    ChemReport::to_html_document

    fn ChemReport::to_html_document(self : ChemReport) -> String

    ChemReport::to_html_fragment

    fn ChemReport::to_html_fragment(self : ChemReport) -> String

    ChemReport::to_json

    fn ChemReport::to_json(self : ChemReport) -> String

    ChemReport::to_markdown

    fn ChemReport::to_markdown(self : ChemReport) -> String

    ChemReport::validate

    fn ChemReport::validate(self : ChemReport) -> Array[ReportIssue]

    ChemReport::warnings_with_severity

    fn ChemReport::warnings_with_severity(self : ChemReport, severity : Severity) -> Array[ReportWarning]

    ChemResult

    pub struct ChemResult {
    name : String
    value : Quantity
    procedure : String
    } derive(Eq,
    Debug
    )

    CsvParseError

    pub enum CsvParseError {
    EmptyCsv
    UnterminatedQuote
    UnexpectedCharacter
    InvalidHeader
    InvalidNumber
    } derive(Eq,
    Debug
    )

    DataSource

    pub struct DataSource {
    label : String
    citation : String
    url : String
    } derive(Eq,
    Debug
    )

    Formula

    pub struct Formula {
    name : String
    expression : String
    variables : Array[String]
    } derive(Eq,
    Debug
    )

    NumericSeries

    pub struct NumericSeries {
    label : String
    unit : String
    values : Array[String]
    } derive(Eq,
    Debug
    )

    NumericSeries::is_monotonic

    fn NumericSeries::is_monotonic(self : NumericSeries) -> Bool

    NumericSeries::statistics

    fn NumericSeries::statistics(self : NumericSeries) -> Result[SeriesStatistics, SeriesError]

    PolicyIssue

    pub struct PolicyIssue {
    code : String
    message : String
    } derive(Eq,
    Debug
    )

    ProvenanceError

    pub enum ProvenanceError {
    InvalidStage
    StageOutOfOrder
    EmptyActor
    EmptyDetail
    } derive(Eq,
    Debug
    )

    ProvenanceEvent

    pub struct ProvenanceEvent {
    stage : String
    actor : String
    detail : String
    } derive(Eq,
    Debug
    )

    ProvenanceLedger

    pub struct ProvenanceLedger {
    report_id : String
    entries : Array[ProvenanceEvent]
    } derive(Eq,
    Debug
    )

    ProvenanceLedger::events

    ProvenanceLedger::is_complete

    fn ProvenanceLedger::is_complete(self : ProvenanceLedger) -> Bool

    ProvenanceLedger::record

    QualityPolicy

    pub struct QualityPolicy {
    min_inputs : Int
    min_formulas : Int
    min_results : Int
    require_source_url : Bool
    reject_hazards : Bool
    } derive(Eq,
    Debug
    )

    QualityPolicy::evaluate

    fn QualityPolicy::evaluate(self : QualityPolicy, report : ChemReport) -> Array[PolicyIssue]

    Quantity

    pub struct Quantity {
    value : String
    unit : String
    } derive(Eq,
    Debug
    )

    QuantityMathError

    pub enum QuantityMathError {
    InvalidNumber
    IncompatibleUnits
    DivideByZero
    } derive(Eq,
    Debug
    )

    RenderError

    pub enum RenderError {
    InvalidReport
    EmptyOutput
    } derive(Eq,
    Debug
    )

    RenderedReport

    pub struct RenderedReport {
    format : ReportFormat
    content : String
    } derive(Eq,
    Debug
    )

    RenderedReport::is_nonempty

    fn RenderedReport::is_nonempty(self : RenderedReport) -> Bool

    ReportArchive

    pub struct ReportArchive {
    id : String
    snapshots : Array[ReportSnapshot]
    } derive(Eq,
    Debug
    )

    ReportArchive::append

    fn ReportArchive::append(self : ReportArchive, value : ReportSnapshot) -> Result[ReportArchive, ArchiveError]

    ReportArchive::history

    ReportArchive::latest

    ReportBuilder

    pub struct ReportBuilder {
    title : String
    summary : String
    inputs : Array[ChemInput]
    assumptions : Array[Assumption]
    formulas : Array[Formula]
    results : Array[ChemResult]
    warnings : Array[ReportWarning]
    sources : Array[DataSource]
    } derive(Eq,
    Debug
    )

    ReportBuilder::add_assumption

    fn ReportBuilder::add_assumption(self : ReportBuilder, value : Assumption) -> ReportBuilder

    ReportBuilder::add_formula

    fn ReportBuilder::add_formula(self : ReportBuilder, value : Formula) -> ReportBuilder

    ReportBuilder::add_input

    fn ReportBuilder::add_input(self : ReportBuilder, value : ChemInput) -> ReportBuilder

    ReportBuilder::add_result

    fn ReportBuilder::add_result(self : ReportBuilder, value : ChemResult) -> ReportBuilder

    ReportBuilder::add_source

    fn ReportBuilder::add_source(self : ReportBuilder, value : DataSource) -> ReportBuilder

    ReportBuilder::add_warning

    fn ReportBuilder::add_warning(self : ReportBuilder, value : ReportWarning) -> ReportBuilder

    ReportBuilder::build

    ReportBundle

    pub struct ReportBundle {
    title : String
    reports : Array[ChemReport]
    } derive(Eq,
    Debug
    )

    ReportBundle::contains_hazard

    fn ReportBundle::contains_hazard(self : ReportBundle) -> Bool

    ReportBundle::find_title

    fn ReportBundle::find_title(self : ReportBundle, title : String) -> ChemReport?

    ReportBundle::has_blocking_issue

    fn ReportBundle::has_blocking_issue(self : ReportBundle) -> Bool

    ReportBundle::merge

    fn ReportBundle::merge(self : ReportBundle, other : ReportBundle) -> ReportBundle

    ReportBundle::metrics

    fn ReportBundle::metrics(self : ReportBundle) -> BundleMetrics

    ReportBundle::publishable_csv

    fn ReportBundle::publishable_csv(self : ReportBundle) -> String

    ReportBundle::reports

    fn ReportBundle::reports(self : ReportBundle) -> Array[ChemReport]

    ReportBundle::review_markdown

    fn ReportBundle::review_markdown(self : ReportBundle) -> String

    ReportBundle::select

    fn ReportBundle::select(self : ReportBundle, selection : BundleSelection) -> Array[ChemReport]

    ReportBundle::summary

    fn ReportBundle::summary(self : ReportBundle) -> BundleSummary

    ReportBundle::summary_markdown

    fn ReportBundle::summary_markdown(self : ReportBundle) -> String

    ReportBundle::titles

    fn ReportBundle::titles(self : ReportBundle) -> Array[String]

    ReportBundle::to_csv

    fn ReportBundle::to_csv(self : ReportBundle) -> String

    ReportBundle::to_json

    fn ReportBundle::to_json(self : ReportBundle) -> String

    ReportBundle::to_jsonl

    fn ReportBundle::to_jsonl(self : ReportBundle) -> String

    ReportBundle::to_markdown

    fn ReportBundle::to_markdown(self : ReportBundle) -> String

    ReportBundle::validate

    fn ReportBundle::validate(self : ReportBundle) -> Array[BundleIssue]

    ReportChange

    pub enum ReportChange {
    TitleChanged
    SummaryChanged
    InputsChanged
    AssumptionsChanged
    FormulasChanged
    ResultsChanged
    WarningsChanged
    SourcesChanged
    } derive(Eq,
    Debug
    )

    ReportFormat

    pub enum ReportFormat {
    Markdown
    Html
    Json
    } derive(Eq,
    Debug
    )

    ReportIndex

    pub struct ReportIndex {
    entries : Array[ReportIndexEntry]
    } derive(Eq,
    Debug
    )

    ReportIndex::add

    fn ReportIndex::add(self : ReportIndex, id : String, report : ChemReport, keywords : Array[String]) -> ReportIndex

    ReportIndex::entries

    ReportIndex::publishable

    fn ReportIndex::publishable(self : ReportIndex) -> Array[ReportIndexEntry]

    ReportIndex::search

    fn ReportIndex::search(self : ReportIndex, term : String) -> Array[ChemReport]

    ReportIndexEntry

    pub struct ReportIndexEntry {
    id : String
    title : String
    keywords : Array[String]
    report : ChemReport
    } derive(Eq,
    Debug
    )

    ReportIssue

    pub struct ReportIssue {
    kind : ReportIssueKind
    message : String
    } derive(Eq,
    Debug
    )

    ReportIssueKind

    pub enum ReportIssueKind {
    MissingTitle
    MissingInput
    MissingResult
    MissingSource
    HazardWarning
    EmptyInputName
    EmptyInputValue
    EmptyResultName
    EmptyResultValue
    EmptySourceCitation
    } derive(Eq,
    Debug
    )

    ReportMetrics

    pub struct ReportMetrics {
    input_count : Int
    assumption_count : Int
    formula_count : Int
    result_count : Int
    warning_count : Int
    source_count : Int
    issue_count : Int
    hazard_count : Int
    } derive(Eq,
    Debug
    )

    ReportSnapshot

    pub struct ReportSnapshot {
    revision : Int
    report : ChemReport
    note : String
    } derive(Eq,
    Debug
    )

    ReportSummaryRow

    pub struct ReportSummaryRow {
    title : String
    input_count : Int
    result_count : Int
    warning_count : Int
    source_count : Int
    publishable : Bool
    } derive(Eq,
    Debug
    )

    ReportWarning

    pub struct ReportWarning {
    severity : Severity
    message : String
    } derive(Eq,
    Debug
    )

    RuleIssue

    pub struct RuleIssue {
    rule : RuleKind
    location : String
    message : String
    } derive(Eq,
    Debug
    )

    RuleKind

    pub enum RuleKind {
    RequiredUnits
    UniqueInputNames
    UniqueResultNames
    FormulaVariables
    SourceCitations
    } derive(Eq,
    Debug
    )

    ScalarError

    pub enum ScalarError {
    EmptyScalar
    InvalidNumber
    UnknownUnit(String)
    IncompatibleUnits(String, String)
    InvalidConversion
    } derive(Eq,
    Debug
    )

    ScalarValue

    pub struct ScalarValue {
    value : String
    unit : String
    } derive(Eq,
    Debug
    )

    Scenario

    pub struct Scenario {
    name : String
    report : ChemReport
    } derive(Eq,
    Debug
    )

    ScenarioSet

    pub struct ScenarioSet {
    name : String
    scenarios : Array[Scenario]
    } derive(Eq,
    Debug
    )

    ScenarioSet::add

    fn ScenarioSet::add(self : ScenarioSet, value : Scenario) -> ScenarioSet

    ScenarioSet::best

    fn ScenarioSet::best(self : ScenarioSet) -> Scenario?

    ScenarioSet::names

    fn ScenarioSet::names(self : ScenarioSet) -> Array[String]

    ScenarioSet::review_required

    fn ScenarioSet::review_required(self : ScenarioSet) -> Array[Scenario]

    ScenarioSet::to_bundle

    fn ScenarioSet::to_bundle(self : ScenarioSet) -> ReportBundle

    SchemaCompatibility

    pub enum SchemaCompatibility {
    Current
    Older
    Unsupported
    } derive(Eq,
    Debug
    )

    SectionCount

    pub struct SectionCount {
    name : String
    count : Int
    } derive(Eq,
    Debug
    )

    SeriesError

    pub enum SeriesError {
    EmptySeries
    InvalidValue
    } derive(Eq,
    Debug
    )

    SeriesStatistics

    pub struct SeriesStatistics {
    minimum : String
    maximum : String
    mean : String
    count : Int
    } derive(Eq,
    Debug
    )

    Severity

    pub enum Severity {
    Info
    Caution
    Hazard
    } derive(Eq,
    Debug
    )

    SourceAudit

    pub struct SourceAudit {
    total : Int
    with_url : Int
    missing_citation : Int
    duplicate_citations : Int
    } derive(Eq,
    Debug
    )

    SourceAudit::is_traceable

    fn SourceAudit::is_traceable(self : SourceAudit) -> Bool

    SourceRegistry

    pub struct SourceRegistry {
    entries : Array[DataSource]
    } derive(Eq,
    Debug
    )

    SourceRegistry::add

    SourceRegistry::add_all

    fn SourceRegistry::add_all(self : SourceRegistry, values : Array[DataSource]) -> SourceRegistry

    SourceRegistry::has_url

    fn SourceRegistry::has_url(self : SourceRegistry, url : String) -> Bool

    SourceRegistry::sources

    SourceRegistry::to_markdown

    fn SourceRegistry::to_markdown(self : SourceRegistry) -> String

    Tolerance

    pub struct Tolerance {
    scaled : Int
    } derive(Eq,
    Debug
    )

    UnitDimension

    pub enum UnitDimension {
    Mass
    Amount
    Volume
    Time
    Temperature
    Energy
    Power
    Pressure
    Dimensionless
    } derive(Eq,
    Debug
    )

    UnitSpec

    pub struct UnitSpec {
    symbol : String
    dimension : UnitDimension
    to_base : String
    offset : String
    } derive(Eq,
    Debug
    )

    add_quantities

    fn add_quantities(left : Quantity, right : Quantity) -> Result[Quantity, QuantityMathError]

    assumption

    fn assumption(title : String, detail : String) -> Assumption

    audit_sources

    fn audit_sources(report : ChemReport) -> SourceAudit

    benchmark_case

    fn benchmark_case(id : String, report : ChemReport) -> BenchmarkWork

    benchmark_suite

    fn benchmark_suite(name : String, cases : Array[BenchmarkWork]) -> BenchmarkSuite

    bundle_selections

    fn bundle_selections() -> Array[BundleSelection]

    caution

    fn caution(message : String) -> ReportWarning

    change_text

    fn change_text(change : ReportChange) -> String

    check_balance

    fn check_balance(inlet : String, outlet : String, tolerance : Tolerance) -> BalanceCheck

    compare_reports

    fn compare_reports(left : ChemReport, right : ChemReport) -> Array[ReportChange]

    compatible_units

    fn compatible_units(left : String, right : String) -> Bool

    convert_scalar

    fn convert_scalar(value : ScalarValue, target : String) -> Result[ScalarValue, ScalarError]

    describe_report_changes

    fn describe_report_changes(left : ChemReport, right : ChemReport) -> Array[ChangeDetail]

    distillation_stage_report

    fn distillation_stage_report() -> ChemReport

    divide_quantity

    fn divide_quantity(value : Quantity, divisor : String) -> Result[Quantity, QuantityMathError]

    drying_report

    fn drying_report() -> ChemReport

    filtration_report

    fn filtration_report() -> ChemReport

    flash_split_report

    fn flash_split_report() -> ChemReport

    formula

    fn formula(name : String, expression : String, variables : Array[String]) -> Formula

    hazard

    fn hazard(message : String) -> ReportWarning

    heat_exchanger_report

    fn heat_exchanger_report() -> ChemReport

    high_risk_changes

    fn high_risk_changes(changes : Array[ChangeDetail]) -> Array[ChangeDetail]

    info

    fn info(message : String) -> ReportWarning

    input

    fn input(name : String, value : Quantity, note? : String) -> ChemInput

    issue

    fn issue(kind : ReportIssueKind, message : String) -> ReportIssue

    known_units

    fn known_units(dimension : UnitDimension) -> Array[UnitSpec]

    mixing_report

    fn mixing_report() -> ChemReport

    nist_benchmark_bundle

    fn nist_benchmark_bundle() -> ReportBundle

    nist_vapor_pressure_benchmarks

    fn nist_vapor_pressure_benchmarks() -> Array[BenchmarkCase]

    numeric_series

    fn numeric_series(label : String, unit : String, values : Array[String]) -> NumericSeries

    parse_report_summary_csv

    fn parse_report_summary_csv(text : String) -> Result[Array[ReportSummaryRow], CsvParseError]

    parse_scalar

    fn parse_scalar(text : String) -> Result[ScalarValue, ScalarError]

    pressure_drop_report

    fn pressure_drop_report() -> ChemReport

    provenance_event

    fn provenance_event(stage : String, actor : String, detail : String) -> ProvenanceEvent

    provenance_ledger

    fn provenance_ledger(report_id : String) -> ProvenanceLedger

    pump_power_report

    fn pump_power_report() -> ChemReport

    quality_policy

    fn quality_policy(min_inputs? : Int, min_formulas? : Int, min_results? : Int, require_source_url? : Bool, reject_hazards? : Bool) -> QualityPolicy

    quantity

    fn quantity(value : String, unit : String) -> Quantity

    quantity_difference

    fn quantity_difference(left : Quantity, right : Quantity) -> Result[Quantity, QuantityMathError]

    quantity_math_errors

    fn quantity_math_errors() -> Array[QuantityMathError]

    reaction_rate_report

    fn reaction_rate_report() -> ChemReport

    render_report

    fn render_report(report : ChemReport, format : ReportFormat) -> Result[RenderedReport, RenderError]

    report

    fn report(title : String, summary? : String, inputs? : Array[ChemInput], assumptions? : Array[Assumption], formulas? : Array[Formula], results? : Array[ChemResult], warnings? : Array[ReportWarning], sources? : Array[DataSource]) -> ChemReport

    report_archive

    fn report_archive(id : String) -> ReportArchive

    report_builder

    fn report_builder(title : String, summary? : String) -> ReportBuilder

    report_bundle

    fn report_bundle(title : String, reports : Array[ChemReport]) -> ReportBundle

    report_formats

    fn report_formats() -> Array[ReportFormat]

    report_index

    fn report_index() -> ReportIndex

    report_schema_version

    fn report_schema_version() -> String

    report_summary_csv

    fn report_summary_csv(reports : Array[ChemReport]) -> String

    reports_jsonl

    fn reports_jsonl(reports : Array[ChemReport]) -> String

    result

    fn result(name : String, value : Quantity, procedure? : String) -> ChemResult

    rule_kinds

    fn rule_kinds() -> Array[RuleKind]

    sample_distillation_report

    fn sample_distillation_report() -> ChemReport

    sample_energy_balance_report

    fn sample_energy_balance_report() -> ChemReport

    sample_mass_balance_report

    fn sample_mass_balance_report() -> ChemReport

    sample_reactor_conversion_report

    fn sample_reactor_conversion_report() -> ChemReport

    scalar

    fn scalar(value : String, unit : String) -> ScalarValue

    scale_quantity

    fn scale_quantity(value : Quantity, factor : String) -> Result[Quantity, QuantityMathError]

    scenario

    fn scenario(name : String, report : ChemReport) -> Scenario

    scenario_set

    fn scenario_set(name : String) -> ScenarioSet

    schema_accepts

    fn schema_accepts(version : String) -> Bool

    schema_compatibility

    fn schema_compatibility(version : String) -> SchemaCompatibility

    schema_versions

    fn schema_versions() -> Array[String]

    snapshot

    fn snapshot(revision : Int, report : ChemReport, note : String) -> ReportSnapshot

    source

    fn source(label : String, citation : String, url? : String) -> DataSource

    source_registry

    fn source_registry() -> SourceRegistry

    stoichiometric_yield_report

    fn stoichiometric_yield_report() -> ChemReport

    subtract_quantities

    fn subtract_quantities(left : Quantity, right : Quantity) -> Result[Quantity, QuantityMathError]

    tolerance

    fn tolerance(value : String) -> Tolerance

    unit_catalog

    fn unit_catalog() -> Array[UnitSpec]

    unit_dimension

    fn unit_dimension(symbol : String) -> UnitDimension?

    unit_spec

    fn unit_spec(symbol : String, dimension : UnitDimension, to_base : String, offset? : String) -> UnitSpec

    warning

    fn warning(severity : Severity, message : String) -> ReportWarning