Changed
- Entrypoint functions now accept only two arguments namely `_input_consumed` and `results_provided`. Previously three arguments were expected: `_input_consumed`, `_results_consumed` and `results_provided`. Now `_results_consumed` is simply included in `_input_consumed`. The changes renders entrypoint functions agnostic to the origin of their input.
- The component list in the model configuration file must now sit under a key named"components".
- The format for cache files stored in the folder `.hubit_cache` has changed. To convert old cache files see the example code below. Alternatively, clear the `Hubit` cache using the function `hubit.clear_hubit_cache()`.
- Hyphen is no longer an allowed character for index identifiers. For example this model path is no longer valid `segments[IDX_SEG].layers[IDX-LAY]`.
The example code below converts the cache file `old.yml` to `new.yml`. The file name `old.yml` will, more realistically, be named something like `a70300027991e56db5e3b91acf8b68a5.yml`.
python
import re
import yaml
with open("old.yml", "r") as stream:
old_cache_data = yaml.load(stream, Loader=yaml.FullLoader)
Replace ".DIGIT" with "[DIGIT]" in all keys (paths)
with open("new.yml", "w") as handle:
yaml.dump(
{
re.sub(r"\.(\d+)", r"[\1]", path): val
for path, val in old_cache_data.items()
},
handle,
)
All files in the Hubit cache folder `.hubit_cache` should be converted if you want them to be compatible with `Hubit` 0.4.0+.
Added
- Support for subscriptions to other domains (compartments/cells/elements). Now you can easily configure one domain to use a result from other domains as input as well as set up boundary conditions. This new feature is illustrated in the example with connected tanks in `examples/tanks/README.md`. To enable connected domains Hubit now allows
- Components to share the same entrypoint function.
- Components to be scoped using the new field `component.index_scope`.
- Components to consume specific elements in lists.
- Index offsets which enables one domain to refer to e.g. the previous domain.
- Improved performance for cases
- where only some branches in the input data tree are consumed, and
- where branches are not consumed all the way to the leaves.
- Improved model validation.
- Improved documentation for model configuration file format.
Fixed
- Fix broken example (`examples/wall/run_precompute.py`)
- The elements of lists that are leaves in the input data tree can now be referenced and queried.
- Lists of length 1 in the input were erroneously interpreted as a simple value.