When defining custom layer order with __settings__py (the default is alphabetical), there's some string magic going on. E.g.:
order = [
":foo", # Must match the id of layer defined by a python file in this dir (not a subdir)
":bar",
"More Layers", # Must match a subdirectory name
]
Instead, I think we should have a trivial class, e.g. LayerIdentifier, that we can use to remove the magic by giving readers a name instead of just a symbol. The class can perhaps handle some degree of validation? The class can also have a helpful docstring. Instead of checking string.startswith to determine if something is a
What about also a LayerGroupIdentifier class?
order = [
LayerIdentifier("foo"), # Must match the id of layer defined by a python file in this dir (not a subdir)
LayerIdentifier("bar"),
LayerGroupIdentifier("More Layers"), # Must match a subdirectory name
]
When defining custom layer order with
__settings__py
(the default is alphabetical), there's some string magic going on. E.g.:Instead, I think we should have a trivial class, e.g.
LayerIdentifier
, that we can use to remove the magic by giving readers a name instead of just a symbol. The class can perhaps handle some degree of validation? The class can also have a helpful docstring. Instead of checkingstring.startswith
to determine if something is aWhat about also a
LayerGroupIdentifier
class?