Skip to content

Conversation

@brendanjohnharris
Copy link

@brendanjohnharris brendanjohnharris commented Dec 9, 2024

This PR does two key things:

  1. Adds an events field to the File type to support loading _events.tsv files as DataFrames
  2. Updates compatability requirements for newer Julia versions

Docs and tests have also been added where relevant, and helper functions like sessions to access fields without using . syntax.

Non-whitespace changes

Copy link
Contributor

@darrencl darrencl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for submitting this PR! This is definitely useful and I am happy to know that someone actually use this tool! 😄

I am guilty for not checking this sooner as I have not been actively using Julia myself recently – I apologise for that.

Overall, this looks good to me, but I just have 1 question & possible change request in the comment.

get_metadata_path(path), dicttype=OrderedDict{String,Any}
)
events = !load_events ? DataFrame() : CSV.read(
get_events_path(path),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I understand correctly, get_events_path(path) could return nothing if for some reason the corresponding _events.tsv doesn't exist.

If that's the case, the CSV.read(nothing) will raise MethodError: no method matching joinpath(::Nothing), which could be unhelpful for user.

I suggest raising a more useful error in get_events_path(path) that indicates joinpath(this_dirname, fname_without_ext * "_events.tsv") couldn't be found.

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

Successfully merging this pull request may close these issues.

2 participants