This repository was archived by the owner on Feb 26, 2025. It is now read-only.

Description
After some internal discussions, we see that we're frequently given a SONATA file in our apps (e.g.: Brayns) and we need to discover its type (usually either circuit or simulation config) by trying both circuit and simulation loaders in libsonata, catching the potential errors and guessing that if the simulator loader triggers an error, we have been given a circuit config.
While the approach kind of works for valid config files, it may be giving a misleading error to the user in case we have been given an invalid SONATA config file. Also, we need to do this in different applications, which is starting to make us duplicate code in different apps.
Therefore, I wonder if any of the following ideas would make more sense and would help other applications as well:
- Implement a function in libsonata that, given a SONATA file, would return the type of file it is (for example: simulation config, circuit config, node file, report, ...) as an ENUM, a string or similar.
- Migrate SNAP's validator function (circuit_validation) to libsonata (in C++) and implement the equivalent functionality for simulation config.
Any thoughts? Thanks!
@jamesgking @pramodk @jdcourcol @mgeplf