-
Notifications
You must be signed in to change notification settings - Fork 75
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
Add capability to deal with stations with no identifier from Wyoming #239
Conversation
siphon/simplewebservice/wyoming.py
Outdated
|
||
# If there are only 26 lines, the station doesn't have a name identified | ||
# and we need to insert a record showing this for parsing to proceed. | ||
if len(lines) == 26: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You couldn't instead check:
lines[1].startswith('Station identifier')
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could sure
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just seems like it could change from 26 lines for a variety of reasons.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, but we'll break on all of them 😭
Push coming.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Current check just seems pretty brittle...would be good to check for the exact condition that's missing.
Happy to change it, though I don't really see it being more or less brittle as any other weirdness in the footer will still break things. I'll revise now. |
dd99627
to
d63a2d9
Compare
Ok, not quite as easy as your |
Right, if it's missing then (now accounting for whitespace) |
The whitespace... It would have to have 28 leading whitespaces on the string. Ugly. |
Is there a reason the |
Probably not. Is there any reason that |
That’s fine. But my original suggestion was to look for “Station Identifier” to be missing from Either way is fine, and I don’t want to bike she’d this to death. Just trying to see if I’m missing something. |
I just think this is a bit clearer and they both accomplish the same task with the same complexity as far as I can tell. Tomato vs Tomato? |
Closes #238
Deals with missing lines from the wyoming archive when the station has a number, but no identifier.