biocore / wetlab-assistant

BSD 3-Clause "New" or "Revised" License
0 stars 2 forks source link

overwrite results #8

Open sjanssen2 opened 7 years ago

sjanssen2 commented 7 years ago

The system does not warn when overwriting an existing file. I think we should have a 'force' option that is unset by default for the case that we really want to overwrite something.

qiyunzhu commented 7 years ago

@sjanssen2 I found this is how argparse does the job. In the very beginning I implemented a homebrew solution that will warn the user if they want to overwrite an existing file. Later I thought: 1) from the user's angle, they may prefer to perform no additional actions (e.g., rename or move the old output file, or specify a new file name). 2) On the other hand, the output file is not going to be placed in archive. The user will immediately copy and paste the entire output file into an Excel spreadsheet, which is in turn the final "mapping file".

josenavas commented 7 years ago

@qiyunzhu Just FYI, click is a really good library for parsing parameters.

qiyunzhu commented 7 years ago

@josenavas Thanks! We used click in the WGS-HGT project. It is indeed more robust than argparse.

wasade commented 7 years ago

argparse is also broken as it is not posix compliant. click actually ships with a py3 compatible implementation of python2's optparse.

On Wed, Nov 2, 2016 at 12:53 PM, Qiyun Zhu notifications@github.com wrote:

@josenavas https://github.com/josenavas Thanks! We used click in the WGS-HGT https://github.com/biocore/WGS-HGT project. It is indeed more robust than argparse.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/biocore/wetlab-assistant/issues/8#issuecomment-257979558, or mute the thread https://github.com/notifications/unsubscribe-auth/AAc8styNcdbvL926aKnAap0Fuj-98jv8ks5q6OorgaJpZM4KmZ6F .

mortonjt commented 7 years ago

Hmm. I didn't know that ...

On Nov 7, 2016 9:40 PM, "Daniel McDonald" notifications@github.com wrote:

argparse is also broken as it is not posix compliant. click actually ships with a py3 compatible implementation of python2's optparse.

On Wed, Nov 2, 2016 at 12:53 PM, Qiyun Zhu notifications@github.com wrote:

@josenavas https://github.com/josenavas Thanks! We used click in the WGS-HGT https://github.com/biocore/WGS-HGT project. It is indeed more robust than argparse.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/biocore/wetlab-assistant/issues/8# issuecomment-257979558, or mute the thread https://github.com/notifications/unsubscribe-auth/ AAc8styNcdbvL926aKnAap0Fuj-98jv8ks5q6OorgaJpZM4KmZ6F .

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/biocore/wetlab-assistant/issues/8#issuecomment-259050691, or mute the thread https://github.com/notifications/unsubscribe-auth/AD_a3bXIq6QqHWj-K5BzfOPq-4F2zoy1ks5q8AtOgaJpZM4KmZ6F .

wasade commented 7 years ago

I lied, sorry, but reasons are outlined here:

http://click.pocoo.org/5/why/#why-not-argparse

On Mon, Nov 7, 2016 at 9:51 PM, Jamie Morton notifications@github.com wrote:

Hmm. I didn't know that ...

On Nov 7, 2016 9:40 PM, "Daniel McDonald" notifications@github.com wrote:

argparse is also broken as it is not posix compliant. click actually ships with a py3 compatible implementation of python2's optparse.

On Wed, Nov 2, 2016 at 12:53 PM, Qiyun Zhu notifications@github.com wrote:

@josenavas https://github.com/josenavas Thanks! We used click in the WGS-HGT https://github.com/biocore/WGS-HGT project. It is indeed more robust than argparse.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/biocore/wetlab-assistant/issues/8# issuecomment-257979558, or mute the thread https://github.com/notifications/unsubscribe-auth/ AAc8styNcdbvL926aKnAap0Fuj-98jv8ks5q6OorgaJpZM4KmZ6F .

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/biocore/wetlab-assistant/issues/8# issuecomment-259050691, or mute the thread https://github.com/notifications/unsubscribe- auth/AD_a3bXIq6QqHWj-K5BzfOPq-4F2zoy1ks5q8AtOgaJpZM4KmZ6F .

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/biocore/wetlab-assistant/issues/8#issuecomment-259052004, or mute the thread https://github.com/notifications/unsubscribe-auth/AAc8sj3M8IDCBvsF9vVmjVBKmvOoOND9ks5q8A34gaJpZM4KmZ6F .

mortonjt commented 7 years ago

Yup. Click is definitely more preferable than argparse. But @qiyunzhu was under pressure to get something out quickly, and something easy to use. I mean really easy - no installation required. This works out of the box without installing any packages.

Like @josenavas mentioned before, we'll deprecate this and move into labadmin.

qiyunzhu commented 7 years ago

@wasade Good to know! Thanks!