You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As I've mentioned in #7816 I think it would be more intuitive if users could just set values in the Info dict using simple assignments, e.g. info['meas_date'] = None, instead of setter methods (e.g. info.set_meas_date(None)). This is consistent with values that we currently allow to be set directly, e.g. info["bads"] = [].
This would also allow us to make read-only properties for fields which users should not set manually.
my personal feeling: If everytime someone does something bad you create a
law you end
up with 10 new laws every month and you end up with a non-agile system as
you have
a lot to consider when amending the law. It's the same thing with
software/code. Trying
to prevent you every possible mistake will make you design a monster and
will slow down
all the rest (more code to maintain, more things to test etc.)
I agree with @cbrnr: Using properties would allow us to ensure "correct" usage – without having to invent and apply arbitrary rules. I think it makes sense to have this for the info structure, as it's one of the bits that users actually are expected to touch and modify. It's an API clarification, if you will. I don't think anyone is wanting to expand this to other parts of MNE for now. :)
Hehe, in case you're hoping that I will forget: I won't 😄.
But I won't insist, if you say we don't need it - fine with me. I'd be interested what others think - especially from a user's point of view. Any opinions?
I'd be interested what others think - especially from a user's point of view. Any opinions?
I was going to tag some users here, but I suppose not all of them would even know what this "properties" thing is supposed to be and when and how it would affect their work. If you feel like it, could you maybe write a short example to showcase what it is you mean? Then we could get users' opinions :) (You already have sth in your initial comment here, but its phrasing is IMHO mainly targeted towards developers still!)
Actually I just realized that the only setter method for Info objects is set_montage. So maybe documenting which fields are user-writable is sufficient.
Actually I just realized that the only setter method for Info objects is
set_montage. So maybe documenting which fields are user-writable is
sufficient.
Activity
agramfort commentedon May 24, 2020
cbrnr commentedon May 24, 2020
I totally agree with you - that's why I'd use properties instead of setters.
hoechenberger commentedon May 25, 2020
I agree with @cbrnr: Using properties would allow us to ensure "correct" usage – without having to invent and apply arbitrary rules. I think it makes sense to have this for the
infostructure, as it's one of the bits that users actually are expected to touch and modify. It's an API clarification, if you will. I don't think anyone is wanting to expand this to other parts of MNE for now. :)cbrnr commentedon May 25, 2020
No, this is just about the
Infoobject. Intended changed usage examples:agramfort commentedon May 25, 2020
cbrnr commentedon May 25, 2020
Hehe, in case you're hoping that I will forget: I won't 😄.
But I won't insist, if you say we don't need it - fine with me. I'd be interested what others think - especially from a user's point of view. Any opinions?
hoechenberger commentedon May 26, 2020
I was going to tag some users here, but I suppose not all of them would even know what this "properties" thing is supposed to be and when and how it would affect their work. If you feel like it, could you maybe write a short example to showcase what it is you mean? Then we could get users' opinions :) (You already have sth in your initial comment here, but its phrasing is IMHO mainly targeted towards developers still!)
cbrnr commentedon May 26, 2020
Actually I just realized that the only setter method for
Infoobjects isset_montage. So maybe documenting which fields are user-writable is sufficient.agramfort commentedon May 26, 2020
hoechenberger commentedon May 26, 2020
And still using properties to avoid touching items you're not supposed to touch? Or what do you mean? :)
cbrnr commentedon May 26, 2020
Nope, just document which fields are supposed to be touched and that's it.
hoechenberger commentedon May 26, 2020
Ok, sounds good! Just try to make sure it's, like… really, really in-your-face 😁
cbrnr commentedon May 26, 2020
Yes, the note should be promoted to a warning or something.