Repository: BlueBrain/libsonata (language: python)

Issue:
should throw an error if biophysical_neuron_models_dir is missing for biophysical nodes
`it is needed only  for biophysical populations: "Path to the template HOC files defining the E-Model. There must be one defined for biophysical node populations.`


Discussion / hints:
It seems that the error is not thrown in a case in which the populations dict for a given population is empty.
I.e., Assume components is defined (without `biophysical_neuron_models_dir`) as
```json
"components": {
    "morphologies_dir": "$MORPH_DIR",
}
```

then an error is not thrown for this node population named `default` (that will default to `type = 'biophysical'`)
```json
"populations" : {
    "default": {}
}
```
but is for this:
```json
"populations" : {
    "default": {
        "test": "value"
    }
}
```
This came up in SNAP tests. In the spec it's defined that 
>The dictionary associated to each population may be empty if the components properties don’t need to be overridden

Fix patch:
diff --git a/src/config.cpp b/src/config.cpp
index 649fb7e8..53b73e79 100644
--- a/src/config.cpp
+++ b/src/config.cpp
@@ -558,9 +558,6 @@ class CircuitConfig::Parser
             // Iterate over all defined populations
             for (auto it = populationsIt->begin(); it != populationsIt->end(); ++it) {
                 const auto& popData = it.value();
-                if (popData.empty()) {
-                    continue;
-                }
 
                 PopulationProperties& popProperties = output[it.key()];
 


Test patch:
diff --git a/python/tests/test.py b/python/tests/test.py
index 2cc43f45..06e27984 100644
--- a/python/tests/test.py
+++ b/python/tests/test.py
@@ -577,6 +577,30 @@ def test_get_population_properties(self):
         self.assertTrue(edge_prop.biophysical_neuron_models_dir.endswith('biophysical_neuron_models'))
         self.assertEqual(edge_prop.alternate_morphology_formats, {})
 
+
+    def test_biophysical_properties_raises(self):
+        contents = {
+            "manifest": {
+                "$BASE_DIR": "./",
+                },
+            "components": {
+                "morphologies_dir": "some/morph/dir",
+            },
+            "networks": {
+                "nodes": [
+                    {
+                        "nodes_file": "$BASE_DIR/nodes1.h5",
+                        "populations": {
+                            "nodes-A": { }  # nothing overridden;
+                                            # missing biophysical_neuron_models_dir
+                        }
+                    }],
+                "edges": []
+                }
+            }
+        self.assertRaises(SonataError, CircuitConfig, json.dumps(contents), PATH)
+
+
     def test_shadowing_morphs(self):
         contents = {
             "manifest": {