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

How to effectively distinguish sonata file types #243

@jplanasc

Description

@jplanasc

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:

  1. 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.
  2. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions