Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify report access #144

Open
asanin-epfl opened this issue Aug 9, 2021 · 2 comments
Open

Simplify report access #144

asanin-epfl opened this issue Aug 9, 2021 · 2 comments

Comments

@asanin-epfl
Copy link
Contributor

asanin-epfl commented Aug 9, 2021

The problem: Sonata specs force very complicated API to access reports.

When there is a report file, you want to open simply and access its data directly. Sonata specs, and hence bluepysnap, require additional steps:

  1. Point to a simulation config that was used to generate the report.
  2. The simulation config must have the "network" field that points to a Sonata circuit config that was used by the simulation config.
  3. The simulation config must have the "run" field that contains the parameters for simulation. These parameters must be the same in the report file. Otherwise it won't open.
  4. The simulation config must have the "reports" field where the report file, we want to open, is specified.

So, we have to use this:

    sim = Simulation('path/to/simulation/config')
    pop_rep = sim.reports['node-population-name']['report-name']
    t = 2 # 2nd sec of simulation
    id = [45, 67] # node ids
    print(pop_rep.get(id, t, t))

plus complicated configs of simulation and circuit:

{
  "network": "path/to/sonata/circuit/config.json",
  "output": {
    "output_dir": "/path/to/dir/where/report/located"
  },
  "run": {
    // the exact parameters of report otherwise bluepysnap will throw an error
  },
  "format": "HDF5",
  "reports": {
    "report-name": {
      "file_name": "report-filename"
    }
  }
}

sonata circuit config:

{
  // all the required keys like "network", "components" etc.
}

Instead of an easy access API like:

from bluepysnap import Report

report = Report('path/to/report')
t = 2 # 2nd sec of simulation
id = [45, 67] # node ids
print(report[t, id])

The proposition would be to create the easy access API. Currently libsonata offers such. The only
thing it lacks is array indexing of report data BlueBrain/libsonata#153.

cc @mgeplf

@eleftherioszisis
Copy link

Isn't the goal of snap to allow access to datasets from within the circuit context? This is the reason why snap does not allow for example to access the node and edge populations as standalone files. This is the job of libsonata's low level api.

@asanin-epfl
Copy link
Contributor Author

Yes. That's why I mentioned libsonata at the end of my comment. I created this issue for information only as inquired by @mgeplf.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants