Skip to content

Commit

Permalink
Update dev to meet probe API in Arbor master. (#100)
Browse files Browse the repository at this point in the history
  • Loading branch information
halfflat authored Apr 30, 2020
1 parent a3a0248 commit 48cad5f
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 10 deletions.
7 changes: 2 additions & 5 deletions benchmarks/engines/busyring/arbor/ring.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ using arb::cell_size_type;
using arb::cell_member_type;
using arb::cell_kind;
using arb::time_type;
using arb::cell_probe_address;
using arb::cell_probe_membrane_voltage;

// Writes voltage trace as a json file.
void write_trace_json(std::string fname, const arb::trace_data<double>& trace);
Expand Down Expand Up @@ -127,12 +127,9 @@ class ring_recipe: public arb::recipe {
}

arb::probe_info get_probe(cell_member_type id) const override {
// Get the appropriate kind for measuring voltage.
cell_probe_address::probe_kind kind = cell_probe_address::membrane_voltage;
// Measure at the soma.
arb::mlocation loc{0, 0.0};

return arb::probe_info{id, kind, cell_probe_address{loc, kind}};
return arb::probe_info{id, 0, cell_probe_membrane_voltage{loc}};
}

private:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ struct rc_cable_recipe: public arb::recipe {
probe_info get_probe(cell_member_type id) const override {
// n probes, centred over CVs.
double pos = probe_x(id.index)/length;
return probe_info{id, 0, cell_probe_address{{0, pos}, cell_probe_address::membrane_voltage}};
return probe_info{id, 0, cell_probe_membrane_voltage{{0, pos}}};
}

util::unique_any get_cell_description(cell_gid_type) const override {
Expand Down Expand Up @@ -128,7 +128,6 @@ int main(int argc, char** argv) {
double t_sample = 0;
sim.add_sampler(all_probes, explicit_schedule({t_end-dt}),
[&voltage,&t_sample](cell_member_type probe_id, probe_tag, std::size_t n, const sample_record* rec) {
std::cout << "probe_id: " << probe_id.gid << ", " << probe_id.index << std::endl;
voltage.at(probe_id.index) = *rec[0].data.as<const double*>();
t_sample = rec[0].time;
});
Expand Down
2 changes: 1 addition & 1 deletion validation/src/arbor-rallpack1/arbor-rallpack1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ struct rc_rallpack1_recipe: public arb::recipe {

probe_info get_probe(cell_member_type id) const override {
double pos = id.index==0? x0: x1;
return probe_info{id, 0, cell_probe_address{{0, pos}, cell_probe_address::membrane_voltage}};
return probe_info{id, 0, cell_probe_membrane_voltage{{0, pos}}};
}

util::unique_any get_cell_description(cell_gid_type) const override {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ struct rc_exp2syn_spike_recipe: public arb::recipe {
}

probe_info get_probe(cell_member_type id) const override {
return probe_info{id, 0, cell_probe_address{soma_centre(), cell_probe_address::membrane_voltage}};
return probe_info{id, 0, cell_probe_membrane_voltage{soma_centre()}};
}

std::vector<event_generator> event_generators(cell_gid_type gid) const override {
Expand Down
2 changes: 1 addition & 1 deletion validation/src/arbor-rc-expsyn/arbor-rc-expsyn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ struct rc_expsyn_recipe: public arb::recipe {
}

probe_info get_probe(cell_member_type id) const override {
return probe_info{id, 0, cell_probe_address{soma_centre(), cell_probe_address::membrane_voltage}};
return probe_info{id, 0, cell_probe_membrane_voltage{soma_centre()}};
}

std::vector<event_generator> event_generators(cell_gid_type) const override {
Expand Down

0 comments on commit 48cad5f

Please sign in to comment.