API
Heta Compiler CLI
HetaImporter.heta_version — Function
heta_version()Returns heta-compiler version
HetaImporter.heta_help — Function
heta_help(command::Union{String, Nothing}=nothing)Displays help for heta-compiler CLI
Arguments:
command: command to display. Default isnothingto display general help
HetaImporter.heta_init — Function
heta_init(dir::String; force::Bool=false, silent::Bool=false)Creates template files for Heta-based platform in the specified directory dir
See heta compiler docs for details: https://hetalang.github.io/hetacompiler/cli-references.html#heta-init-command
Arguments:
dir: path to the directory where to create template filesforce: iftruereplace files and directoriessilent: iftrueuse default options without prompt
HetaImporter.heta_build — Function
heta_build(
target_dir::AbstractString;
declaration::String = "platform",
units_check::Bool = false,
log_mode::String = "error",
log_path::String = "build.log",
log_level::String = "info",
debug::Bool = false,
dist_dir::String = "dist",
meta_dir::String = "meta",
source::String = "index.heta",
type::String = "heta",
export_format::Union{String, Nothing} = nothing,
)Builds the models from Heta-based platform
See heta compiler docs for details: https://hetalang.github.io/hetacompiler/cli-references.html#running-heta-build-with-options
Arguments:
target_dir: path to the directory where Heta platform is locateddeclaration: filepath to the platform declaration file. Default is"platform"units_check: if set totrueunits will be checked for the consistencylog_mode: log mode. Default is"error"log_path: path to the log file. Default is"build.log"log_level: log level to display. Default is"info"debug: turn on debug mode. Default isfalsedist_dir: directory path, where to write distributives to. Default is"dist"meta_dir: meta directory path. Default is"meta"source: path to the main heta module. Default is"index.heta"type: type of the source file. Default is"heta"export_format: export the model to the specified format:julia,dynms,{format:SBML,version:L3V1}
Julia File Generation
HetaImporter.build_dynms_file — Function
build_dynms_file(heta_dir; build_dir, kwargs...)Build a Heta platform and write a DynMS JSON file to joinpath(build_dir, DYNMS_MODEL_DIR, DYNMS_MODEL_NAME).
The returned value is the generated DynMS JSON file path.
Arguments:
heta_dir: path to a Heta source directory containing a platform declaration filebuild_dir: directory path where generated files are written. Default isjoinpath(heta_dir, "dist")spaceFilter: filter for namespaces in the Heta model. Can be a string, a vector of symbols, ornothing. Default isnothing- kwargs : other arguments supported by
heta_build
HetaImporter.build_julia_file — Function
build_julia_file(heta_dir; build_dir, ir_format=:julia, kwargs...)Build a Heta platform and write a Julia source file to joinpath(build_dir, JULIA_MODEL_DIR, JULIA_MODEL_NAME).
When ir_format == :julia, heta-compiler writes Julia code directly. When ir_format == :dynms, heta-compiler writes DynMS JSON first; HetaImporter then converts that DynMS IR to readable Julia source.
The returned value is the generated Julia file path.
Arguments:
heta_dir: path to a Heta source directory containing a platform declaration fileir_format: format of the intermediate representation of the model. Default is:juliabuild_dir: directory path where generated files are written. Default isjoinpath(heta_dir, "dist")spaceFilter: filter for namespaces in the Heta model. Can be a string, a vector of symbols, ornothing. Default isnothing- kwargs : other arguments supported by
heta_build
HetaImporter.write_dynms_julia — Function
write_dynms_julia(dynms_json, julia_path)Write readable Julia code generated from DynMS JSON. This is intended for debugging, review, and packages that load generated Julia source.
DynMS Parsing
HetaImporter.parse_dynms_spec — Function
parse_dynms_spec(dynms_json::AbstractString)
parse_dynms_spec(data::AbstractDict)Parse a DynMS JSON file or already-loaded JSON dictionary into a DynMSSpec.
The returned specification contains parsed model definitions, Julia expression trees for mathematical expressions, event definitions, and metadata from the DynMS generator.
HetaImporter.parse_dynms_model — Function
parse_dynms_model(model::AbstractDict)Parse one DynMS model dictionary into a DynMSModelDef.
This is mainly useful when working with a model entry extracted from a DynMS document. For normal use, prefer parse_dynms_spec.