Open Remi-Gau opened 2 years ago
Definitely seems warn-worthy.
should I just add a validator in the BIDSStatsModel class ?
I guess those could warn instead of raising exceptions, but if they aren't easy to skip, it will make it annoying to program with this class, as every copy will emit a new warning.
ah true!
so maybe something like validate method on the Edge class?
No, I think it still needs to operate on the whole model, as it needs to know about both nodes and edges. I can see a couple approaches.
check()
method or function that will emit warnings (could have a strict mode to make errors)BIDSStatsModel
that implements the validation. The caller then chooses which to use for parsing.
All nodes mentioned in edges should refer to an existing node, but I am not sure about the other way around: have some nodes that exist but not mentioned in edges and that would thus be ignore when running the model.
Sounds practical from a user perspective to be able to develop some models where not all nodes are used while tweaking things around.
But validation could possibly throw a warning.