Skip to content

engine: directdata/directconst/directlookups/directsubs blocks 4 simulation tests #348

Closed

Description

@bpowers

Problem

4 simulation integration tests in src/simlin-engine/tests/simulate.rs are #[ignore] because the engine lacks support for Vensim's GET DIRECT family of functions with arrayed data:

  • simulates_directdata_mdl -- requires Excel data support AND dimension equivalences (DimC <-> DimM)
  • simulates_directconst_mdl -- requires arrayed GET DIRECT CONSTANTS (B2* cell-range pattern) and EXCEPT support
  • simulates_directlookups_mdl -- requires arrayed GET DIRECT LOOKUPS with row-oriented addressing
  • simulates_directsubs_mdl -- requires cross-dimension mapping (DimA -> DimB, DimC)

These functions allow Vensim models to load constants, lookup tables, time-series data, and subscript mappings directly from external files (typically Excel or CSV).

Why it matters

GET DIRECT CONSTANTS, GET DIRECT LOOKUPS, GET DIRECT DATA, and GET DIRECT SUBSCRIPT are widely used in Vensim models for parameterization from external data sources. Without these, many real-world models cannot be loaded.

Components affected

  • src/simlin-engine (parser, compiler, VM, external data integration)
  • External data file readers (Excel/CSV parsing)

Possible approach

  1. Implement external file reading (Excel via a crate like calamine, CSV via csv crate)
  2. GET DIRECT CONSTANTS: load scalar/arrayed constants from cell ranges
  3. GET DIRECT LOOKUPS: load lookup tables with row-oriented addressing
  4. GET DIRECT DATA: load time-series data from external files
  5. GET DIRECT SUBSCRIPT: load dimension mappings from external files
  6. Handle dimension equivalences for cross-dimension data loading

Context

Identified during review of 15 ignored simulation tests on the mdl-full-compat branch. The simulates_directdata_mdl test requires the ext_data feature flag.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions