Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

meas_date documentation inconsistency #5432

Closed
massich opened this issue Aug 10, 2018 · 5 comments
Closed

meas_date documentation inconsistency #5432

massich opened this issue Aug 10, 2018 · 5 comments

Comments

@massich
Copy link
Contributor

massich commented Aug 10, 2018

In mne.Info, meas_date is a list of two ints.

meas_date : list of int

however, based on _handle_meas_date, raw.info['meas_date'] can have other formats.

def _handle_meas_date(meas_date):
"""Convert meas_date to seconds."""
if meas_date is None:
meas_date = 0
elif not np.isscalar(meas_date):
if len(meas_date) > 1:
meas_date = meas_date[0] + meas_date[1] / 1000000.
else:
meas_date = meas_date[0]
return meas_date

(Also, I find _handle_meas_date naming confusing, plus I don't understand why is a free function. IMHO it should be raw object method. i.e: raw.get_meas_date_in_absolute_seconds but I don't have enough arguments to do a proper assessment)

@larsoner
Copy link
Member

however, based on _handle_meas_date, raw.info['meas_date'] can have other formats.

I think after I/O round trip it is always 2 ints. We probably need to improve our raw readers to make it more consistent. We could add a test to _test_raw_reader to ensure each class did it correctly. Want to take a stab at it?

IMHO it should be raw object method

I guess you could make it an Info method (better than Raw because meas_date exists in Info, which can be in other objects) if you want. However I don't see too much to gain in this case, and it would complicate the git blame of the function/method, so I'm -0 on this.

@agramfort
Copy link
Member

agramfort commented Aug 11, 2018 via email

@massich
Copy link
Contributor Author

massich commented Aug 11, 2018

@agramfort I'm not sure I fully follow your thought here.

@agramfort
Copy link
Member

_handle_meas_date cannot be discovered with tab so easily. Whereas if I have a method in Annotations I just use tab in an instance of annotations and I start seeing a bunch of private functions I should not see. Clear?

@larsoner
Copy link
Member

larsoner commented Nov 7, 2018

I think this is fixed

@larsoner larsoner closed this as completed Nov 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants