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

Skip TBB files from remote stations on read-in #668

Closed
wants to merge 1 commit into from

Conversation

MijnheerD
Copy link
Collaborator

Issue being addressed

When globbing over all TBB files in the directory, it is possible for a bunch of remote station files to be included in the all_tbb_files list. When doing the pattern matching

re.findall(r"CS\d\d\d", tbb_filename)

on those files, the result is an empty list. When then calling the first element, the reader crashes.

Proposed solution

I changed the code to either take the first element of the resulting list, or default to None in case the list is empty. If the station_name is None, the file is assumed to be from a remote station and skipped. Is this desired behavior? Should we explicitly check that the pattern "RS\d\d\d" does appear in the file name and do something else with it?

@MijnheerD
Copy link
Collaborator Author

The changes from this PR have been included in #679

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.

None yet

1 participant