openworm / tracker-commons

Compilation of information and code bases related to open-source trackers for C. elegans
11 stars 12 forks source link

Zip file support should insist on `.zip` as the file name extension #82

Closed Ichoran closed 8 years ago

Ichoran commented 8 years ago

If WCON supports zipped files with the extension .wcon, standard file system tools will not realize that they can actually unzip the file. Thus, .zip should be mandatory for zip support.

(I do not believe that there are any valid JSON files which are also valid zip files, so I don't think we have to worry about ambiguity, but if .zip is used if and only if it's a zip file, that isn't ever an issue.)

Ichoran commented 8 years ago

@MichaelCurrie - When you get back, I'd like your input on this. Thanks!

JimHokanson commented 8 years ago

@Ichoran I agree. Not having .zip would needlessly complicate JSON parsers (I think ...).

MichaelCurrie commented 8 years ago

Requiring .zip if fine by me. I will add that to the Python parser. May I suggest that we say the parsers should optionally warn if zip files don't end in ".wcon.zip"? That would be the most descriptive extension IMO.

Ichoran commented 8 years ago

Sure, sounds reasonable. Maybe don't specify the behavior of the parser, just recommend that the extension be ".wcon.zip". Our parsers can warn. Some parsers might not have a convenient way to supply a warning. (Actually, come to think of it, the Scala parser doesn't presently have any good way to return a warning.) Printing a warning to stdout is not terribly useful. It requires someone to actually be watching, which usually won't be the case, hopefully. You almost never want to care very much about a single file (unless it fails to load), so success/failure are kind of the only two meaningful options a lot of the time. If there is something like a warning, it needs to be accessible programatically.

MichaelCurrie commented 8 years ago

Added to Python parser by 2f7ff7a0895cab257a0c63ec531e948cebbf9d41

Ichoran commented 8 years ago

Only Scala and Python have zip file support now, and both are fixed, so this issue is resolved.