Skip to content

Commit

Permalink
update version and documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Evgeny Metelkin committed Nov 14, 2023
1 parent ef009fa commit 520bf32
Show file tree
Hide file tree
Showing 9 changed files with 158 additions and 23 deletions.
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# Change Log

## 0.7.0 - export interface updates

- supports heta standard of v0.4.4
- Support of SLV26, fix issues with lost events
- set default `filepath` for export formats
- store export files in personal folders
- remove support of deprecated `@Export` class
- `spaceFilter` as regular expression
- check and display empty export
- minor code refactoring
- remove unnecessary lodash dependences
- node support starting from 14
- update and fix deps

## 0.6.20

- support webpack: do not use constructor.name
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@

To read the full documentation, visit the Heta project homepage: <https://hetalang.github.io/#/heta-compiler/>.

See also [Migrate to v0.6](./migrate-to-v0.6) and [Migrate to 0.7](./migrate-to-v0.7).

## Table of contents

- [Introduction](#introduction)
Expand Down
1 change: 1 addition & 0 deletions TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@

## ideas

- anather approach to check heta-compiler new version (for no internet connection)
- deprecated `include` statement
- `#move`, `#moveNS`
- `#deleteNS` action
Expand Down
18 changes: 9 additions & 9 deletions bin/init/index0.heta
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ p1 @Record .= 1;

// exports
#export { format: JSON, filepath: output };
//#export { format: YAML, filepath: output };
//#export { format: XLSX, filepath: table, omitRows: 3, splitByClass: true };
//#export { format: SBML, filepath: sbml, version: L2V4 };
//#export { format: SLV, filepath: model, eventsOff: false };
//#export { format: DBSolve, filepath: dbsolve };
//#export { format: Simbio, filepath: simbio };
//#export { format: Mrgsolve, filepath: mrgsolve };
//#export { format: Matlab, filepath: matlab };
//#export { format: Julia, filepath: julia };
//#export { format: YAML };
//#export { format: XLSX, omitRows: 3, splitByClass: true };
//#export { format: SBML, version: L2V4 };
//#export { format: SLV, eventsOff: false };
//#export { format: DBSolve };
//#export { format: Simbio };
//#export { format: Mrgsolve };
//#export { format: Matlab };
//#export { format: Julia };
18 changes: 9 additions & 9 deletions bin/init/index1.heta
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ p1 @Record .= 1;

// exports
#export { format: JSON, filepath: output };
//#export { format: YAML, filepath: output };
//#export { format: XLSX, filepath: table, omitRows: 3, splitByClass: true };
//#export { format: SBML, filepath: sbml, version: L2V4 };
//#export { format: SLV, filepath: model, eventsOff: false };
//#export { format: DBSolve, filepath: dbsolve };
//#export { format: Simbio, filepath: simbio };
//#export { format: Mrgsolve, filepath: mrgsolve };
//#export { format: Matlab, filepath: matlab };
//#export { format: Julia, filepath: julia };
//#export { format: YAML };
//#export { format: XLSX, omitRows: 3, splitByClass: true };
//#export { format: SBML, version: L2V4 };
//#export { format: SLV, eventsOff: false };
//#export { format: DBSolve };
//#export { format: Simbio };
//#export { format: Mrgsolve };
//#export { format: Matlab };
//#export { format: Julia };
8 changes: 5 additions & 3 deletions export-formats.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,14 @@ The general format for all export actions is the following:
```heta
#export {
format: JSON, // or other supported formats, required
filepath: path/to/output, // Relative or absolute path to generated directory or file
filepath: path/to/output, // Relative or absolute path to generated directory or file, not required
spaceFilter: "regex-expression" // only filtered namespaces will be exported, see RegExp rules
... // other options
};
```

See also [Regular expressions syntax](https://en.wikipedia.org/wiki/Regular_expression).

## JSON

Export to [JSON structure](https://www.json.org/) (array) storing the content of whole platform or selected namespaces (see spaceFilter option).
Expand All @@ -49,7 +51,7 @@ Export to [JSON structure](https://www.json.org/) (array) storing the content of
filepath: output, // save result in file "dist/output.json"
omit: [aux.wiki], // omit aux.wiki properties from components
noUnitsExpr: false, // save units in format UnitsExpr
spaceFilter: [ nameless, another ]
spaceFilter: "nameless|another"
};
```

Expand Down Expand Up @@ -344,7 +346,7 @@ Creation of Matlab files (.m) which represent ODE and code to run ODE.
#export {
format: Matlab,
filepath: matlab_code, // save result in directory "dist/matlab_code"
spaceFilter: (nameless|another_one) // create model based on nameless namespace
spaceFilter: (nameless|another_one) // create two models based on namespaces
};
```

Expand Down
116 changes: 116 additions & 0 deletions migrate-to-v0.7.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
# Migrate from v0.6 to v0.7

Heta compiler of **version 0.7** follows the [Heta standard](/specifications/) of **version 0.4.4**.

To use the newer Heta compiler you should make some updates to thee platform files. To see the other updates see [change log](./CHANGELOG).

See also [Migrate to v0.6](./migrate-to-v0.6).

## Changes in exports

The most critical changes in Heta compiler of version 0.7.x relate to `#export` interface.

### Support of new SLV format (DBSolve)

Previously the Heta compiler generated SLV files of version 25 which was partially compartible with DBSolve Optimum 2020.
There was an issue when DBSolve Optimum 2020 lost the events from the SLV files after reloading the model.

The new Heta compiler v0.7 generates SLV of version 26 by default. If you need the version 25 for previous DBSolve versions compartibility, please clarify it in `export` action: `#export { format: DBSolve, version: "25", filepath: model };`.

### Default filepaths for export

Previously the `filepath` property in `#export` was obligatory. The new version has the default value for each export format.

```heta
...
#export {format: Simbio}; // files will be saved to `./dist/simbio/` directory
#export {format: Simbio, filepath: my-model}; // files will be saved to `./dist/my-model/` directory
```

See more details in documentation [Export formats](./export-formats).

### Another file structure for exports

The Heta compiler v0.7.x stores each export output in separate directory. In previous versions it stored in directories or files.

```heta
...
#export {format: XLSX, filepath: my-model};
// now the file will be saved to ./dist/my-model/output.xlsx
// for v0.6.x it was ./dist/my-model.xlsx
```

### Deprecated @Export class is not longer supported

Currently the export syntax of type `@Export {format: SBML, ...};` is not supported; use always `#export {format: SBML, ...};`.

### RegExp expressions in spaceFilter

The previous format of `#export` action included `spaceFilter` property which clarified namespace name or array of namespaces names to be exported.

```heta
// in heta v0.6.x
#export { format: JSON, filepath: one, spaceFilter: nameless }; // only components from "nameless" space will be exported
#export { format: JSON, filepath: two, spaceFilter: [nameless, another]}; // components from "nameless" and "another" spaces will be exported
#export { format: JSON, filepath: two}; // all components will be exported
```

Starting from Heta compiler v0.7.0 `spaceFilter` is an regular expression which tests the space names to export. See details in [Export formats](./export-formats).

```heta
// in heta v0.7.x
#export { format: JSON, filepath: one, spaceFilter: "^nameless$" }; // only components from "nameless" space will be exported
#export { format: JSON, filepath: two, spaceFilter: "^(nameless|another)$"}; // components from "nameless" and "another" spaces will be exported
#export { format: JSON, filepath: two}; // all components will be exported
```

## Update modeling code

1. **Check** that your platform can be build without errors in the current builder v0.6.x.

*If you use Git you should commit the latest changes before updating formats.*

1. Install the latest version of **Heta compiler**.

```bash
npm install -g heta-compiler
heta -v
# must be v0.7.0 or newer
```
1. If you use declaration file **platform.json** update the property to `builderVersion: ^0.7.0`.

```json
{
"builderVersion": "^0.7.0",
"id": "my-platform",
"notes": "platform notes",
"version": "v0.1.0",
...
}
```

1. If you use `#export` actions of formats `SLV/DBSolve` you should clarify which version of SLV you need.

Use this if you need supporting DBSolve of older versions
```heta
#export {format: DBSolve, version: "25"};
```

Default version of SLV is 26.
```heta
#export {format: DBSolve, version: "26"}; // you can skip version clarification here
```

1. If you use `spaceFilter` then replace the value to the new standard:

`#export { format: SBML, spaceFilter: mm }` will be `#export { format: SBML, spaceFilter: "^mm$" }`

`#export { format: SBML, spaceFilter: [mm, nn] }` will be `#export { format: SBML, spaceFilter: "^(mm|nn)$" }`

`#export { format: SBML }` will be `#export { format: SBML }`

Keep in mind that abstract namespaces will not be exported for such formats as `DBSolve`, `SLV`, `Matlab`, `Mrgsolve`, `Simbio`.

1. Delete __dist__ directory to avoid storing old exports. Try not to delete important files. Storing something important in the dist directory is a bed idea anyway.

1. Check building with `heta build` and make a commit if you use git.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "heta-compiler",
"version": "0.6.20",
"version": "0.7.0",
"description": "Programming platform for Quantitative Systems Pharmacology modeling in NodeJS",
"main": "src/index.js",
"scripts": {
Expand Down

0 comments on commit 520bf32

Please sign in to comment.