marrink-lab / bentopy

Packs stuff in boxes
4 stars 0 forks source link

Implement an implied default compartment when compartment definitions are omitted #27

Open ma3ke opened 2 months ago

ma3ke commented 2 months ago

These two configurations now produce the same behavior.

 {
        "space": {
                "size": [100, 100, 100],
-               "compartments": [
-                       {
-                               "id": "main",
-                               "shape": "spherical"
-                       }
-               ],
                "resolution": 0.5
        },
        "output": {
                "title": "3lyz",
                "dir": "outputs"
        },
        "segments": [
                {
                        "name": "3lyz",
                        "number": 100000,
-                       "compartments": ["main"],
                        "path": "structures/3lyz.pdb"
                }
        ]
 }

In case a "compartments" field is set for any of the segments, an error is thrown describing that the implied "compartments" definition in the "space" section is valid only if no segment has a "compartments" field.