Skip to content

Commit

Permalink
Added check EXT_MORPH_BIOPHYS_CELL_MODEL, just passing on Neuron & Netne
Browse files Browse the repository at this point in the history
  • Loading branch information
pgleeson committed Jun 4, 2024
1 parent 528e08a commit a335c3c
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/main/java/org/neuroml/export/eden/EDENWriter.java
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ public void setSupportedFeatures()
{
sli.addSupportInfo(format, ModelFeature.ABSTRACT_CELL_MODEL, SupportLevelInfo.Level.HIGH);
sli.addSupportInfo(format, ModelFeature.COND_BASED_CELL_MODEL, SupportLevelInfo.Level.HIGH);
sli.addSupportInfo(format, ModelFeature.EXT_MORPH_BIOPHYS_CELL_MODEL, SupportLevelInfo.Level.NONE);
sli.addSupportInfo(format, ModelFeature.SINGLE_COMP_MODEL, SupportLevelInfo.Level.HIGH);
sli.addSupportInfo(format, ModelFeature.NETWORK_MODEL, SupportLevelInfo.Level.HIGH);
sli.addSupportInfo(format, ModelFeature.MULTI_CELL_MODEL, SupportLevelInfo.Level.HIGH);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ public void setSupportedFeatures()
{
sli.addSupportInfo(format, ModelFeature.ABSTRACT_CELL_MODEL, SupportLevelInfo.Level.HIGH);
sli.addSupportInfo(format, ModelFeature.COND_BASED_CELL_MODEL, SupportLevelInfo.Level.HIGH);
sli.addSupportInfo(format, ModelFeature.EXT_MORPH_BIOPHYS_CELL_MODEL, SupportLevelInfo.Level.HIGH);
sli.addSupportInfo(format, ModelFeature.SINGLE_COMP_MODEL, SupportLevelInfo.Level.HIGH);
sli.addSupportInfo(format, ModelFeature.NETWORK_MODEL, SupportLevelInfo.Level.HIGH);
sli.addSupportInfo(format, ModelFeature.MULTI_CELL_MODEL, SupportLevelInfo.Level.HIGH);
Expand Down
1 change: 1 addition & 0 deletions src/main/java/org/neuroml/export/neuron/NeuronWriter.java
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ public void setSupportedFeatures()
{
sli.addSupportInfo(format, ModelFeature.ABSTRACT_CELL_MODEL, SupportLevelInfo.Level.MEDIUM);
sli.addSupportInfo(format, ModelFeature.COND_BASED_CELL_MODEL, SupportLevelInfo.Level.MEDIUM);
sli.addSupportInfo(format, ModelFeature.EXT_MORPH_BIOPHYS_CELL_MODEL, SupportLevelInfo.Level.HIGH);
sli.addSupportInfo(format, ModelFeature.SINGLE_COMP_MODEL, SupportLevelInfo.Level.MEDIUM);
sli.addSupportInfo(format, ModelFeature.NETWORK_MODEL, SupportLevelInfo.Level.LOW);
sli.addSupportInfo(format, ModelFeature.MULTI_CELL_MODEL, SupportLevelInfo.Level.MEDIUM);
Expand Down
10 changes: 9 additions & 1 deletion src/main/java/org/neuroml/export/utils/Utils.java
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,15 @@ public Sim importFile(File simFile) throws LEMSException {
if(run)
{
SupportLevelInfo sli = SupportLevelInfo.getSupportLevelInfo();
sli.checkConversionSupported(Format.LEMS, sim.getLems());
try
{
sli.checkConversionSupported(Format.LEMS, sim.getLems());
}
catch (ModelFeatureSupportException mfse)
{
E.info(mfse.getMessage());
System.exit(-1);
}
sim.run();
IOUtil.saveReportAndTimesFile(sim, lemsFile);
E.info("Finished reading, building, running and displaying LEMS model");
Expand Down
11 changes: 11 additions & 0 deletions src/main/java/org/neuroml/export/utils/support/ModelFeature.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public enum ModelFeature
NETWORK_WITH_ANALOG_CONNS_MODEL("Network model with analog/continuously communicating connections between cells"),
ABSTRACT_CELL_MODEL("Model with abstract (non conductance based) cell(s)"),
COND_BASED_CELL_MODEL("Model with conductance based cell(s)"),
EXT_MORPH_BIOPHYS_CELL_MODEL("Model with conductance based cell(s) with morphology and/or biophysicalProperties outside cell element"),
MULTICOMPARTMENTAL_CELL_MODEL("Model with multicompartmental cell(s)"),
CHANNEL_POPULATIONS_CELL_MODEL("Model with channel populations"),
CHANNEL_DENSITY_ON_SEGMENT("Model with channel density specified per segment (aot segmentGroup)"),
Expand Down Expand Up @@ -106,7 +107,17 @@ private static void analyseSingleComponent(Component component, ArrayList<ModelF

if(component.getComponentType().isOrExtends(NeuroMLElements.CELL_COMP_TYPE))
{
if (component.quietGetChild("morphology")==null)
{
addIfNotPresent(mfs, EXT_MORPH_BIOPHYS_CELL_MODEL);
}
if (component.quietGetChild("biophysicalProperties")==null)
{
addIfNotPresent(mfs, EXT_MORPH_BIOPHYS_CELL_MODEL);
}

Cell cell = Utils.getCellFromComponent(component, lems);

if(cell.getMorphology() != null)
{
if(cell.getMorphology().getSegment().size() > 1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ private SupportLevelInfo()
/* Add info on formats supported in jLEMS */
addSupportInfo(Format.LEMS, ModelFeature.ABSTRACT_CELL_MODEL, SupportLevelInfo.Level.HIGH);
addSupportInfo(Format.LEMS, ModelFeature.COND_BASED_CELL_MODEL, SupportLevelInfo.Level.HIGH);
addSupportInfo(Format.LEMS, ModelFeature.EXT_MORPH_BIOPHYS_CELL_MODEL, SupportLevelInfo.Level.NONE);
addSupportInfo(Format.LEMS, ModelFeature.SINGLE_COMP_MODEL, SupportLevelInfo.Level.HIGH);
addSupportInfo(Format.LEMS, ModelFeature.NETWORK_MODEL, SupportLevelInfo.Level.HIGH);
addSupportInfo(Format.LEMS, ModelFeature.MULTI_CELL_MODEL, SupportLevelInfo.Level.HIGH);
Expand Down Expand Up @@ -135,11 +136,12 @@ public void checkConversionSupported(Format format, Lems lems) throws ModelFeatu
if(!supp.equals(SUPPORTED))
{
passed = false;
report.append("Feature not supported in " + format + ": " + mf + "\n " + myInstance.isSupported(format, mf) + "\n");
report.append("Feature is not supported in " + format + ": " + mf + "\n " + myInstance.isSupported(format, mf) + "\n");
}
}
if(!passed)
{
report.insert(0, "Error! Some features of the model are not supported by that simulator.\n\n");
report.append("\nInfo on supported features:\n" + myInstance);
throw new ModelFeatureSupportException(report.toString());
}
Expand Down

0 comments on commit a335c3c

Please sign in to comment.