Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dat/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def cell_kind(self, _):
def cell_description(self, gid):
cid = self.gid_to_cell[gid]
mrf = self.cell_to_morph[cid]
nml = A.neuroml(f'{here}/mrf/{mrf}.nml').morphology(mrf, allow_spherical_root=True)
nml = A.neuroml(f'{here}/mrf/{cid}_{mrf}.nml').morphology(mrf, allow_spherical_root=True)
lbl = A.label_dict()
lbl.append(nml.segments())
lbl.append(nml.named_segments())
Expand Down
12 changes: 9 additions & 3 deletions src/bundle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -257,9 +257,15 @@ fn export_template(lems: &LemsFile, nml: &[String], bundle: &str) -> Result<()>
let doc = node.document().input_text();
match node.tag_name().name() {
"morphology" => {
let id = node
.attribute("id")
.ok_or_else(|| nml2_error!("Morph has no id"))?;
let cell = node
.parent()
.ok_or(nml2_error!("Morphology has no parent"))?;
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that's incorrect. You can have this

<morphology id="m1">
  ...
</morphology>
<cell id="c1">
    <morphology id="m1" />
</cell>
<cell id="c0">
    <morphology id="m1" />
</cell>

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thus you need to duplicate morphologies under mrf, allow references in mrf, or rename ids. Your choice ;)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Horrible. Thanks for spotting... maybe default to a name like 'toplevel_m1' for these?

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the Arbor internal NML2 reader calls them cell morphologies and just plain morphologies.

if cell.tag_name().name() != "cell" {
return Err(nml2_error!("Morphology must have cell as parent"));
}
let morph_id = node.attribute("id").ok_or(nml2_error!("Morph has no id"))?;
let cell_id = cell.attribute("id").ok_or(nml2_error!("Cell has no id"))?;
let id = &format!("{cell_id}_{morph_id}");
trace!("Writing morphology to {bundle}/mrf/{id}");
write(
format!("{bundle}/mrf/{id}.nml"),
Expand Down