vsoch / scif

scientific filesystem: a filesystem organization for scientific software and metadata
https://sci-f.github.io/
Mozilla Public License 2.0
30 stars 12 forks source link

Investigate stream and captured output #59

Closed dkp closed 4 years ago

dkp commented 4 years ago

Great tool! Thanks for creating and maintaining it. I'm wondering if there is a way for scif to provide standard output as it runs my scripts?

Expected behavior: statements generated in a for loop are echoed to standard out as each item gets processed.

Observed behavior: the script runs all the way through, and only when it is finished, the statements are echoed to standard out.

Obviously, this is a minor issue, but it gives me peace of mind to see the outputs are really being generated and it isn't just hanging.

vsoch commented 4 years ago

It’s just how it’s designed - to capture the output we don’t stream but instead capture it and print at the end. If you’d like to take a look at the code I’d be happy to review a PR!

dkp commented 4 years ago

Thanks, I will think about it, but my Python is VERY rudimentary. I appreciate the quick reply.

vsoch commented 4 years ago

If I can make some time tomorrow I’ll think about this too! It’s possible to redirect output with bash so there might be a Python trick. I didn’t know when I was writing it but it’s worth a second look.

dkp commented 4 years ago

Gosh, thanks so much...

vsoch commented 4 years ago

hey @dkp I have a PR for you to test :point_right: https://github.com/vsoch/scif/pull/60 you can either test by installing locally (making sure to remove previous versions) or by using the release candidate container. For both, I put instructions in the description of the PR.

What it should do is to (instead of using process.communicate()) run the process and poll it for a return code, each line grabbing the output to save to return to the user, and also printing to the terminal if quiet is not True. Let me know if this is what you had in mind!

vsoch commented 4 years ago

Fixed with #60

vsoch commented 4 years ago

okay, one final note! The conda recipe was merged this morning, so I've also released 0.0.78 on pypi:

https://pypi.org/project/scif/0.0.78/

Also, the automated builds (as a quick reminder) are going to quay.io - the version with the fix you need is tag 0.0.78 https://quay.io/repository/scif/scif?tab=tags

dkp commented 4 years ago

Many many thanks!

-Dianne


From: Vanessasaurus notifications@github.com Sent: Tuesday, October 15, 2019 6:06 AM To: vsoch/scif scif@noreply.github.com Cc: Patterson, Dianne K - (dkp) dkp@email.arizona.edu; Mention mention@noreply.github.com Subject: Re: [vsoch/scif] Investigate stream and captured output (#59)

okay, one final note! The conda recipe was merged this morning, so I've also released 0.0.78 on pypi:

https://pypi.org/project/scif/0.0.78/

Also, the automated builds (as a quick reminder) are going to quay.io - the version with the fix you need is tag 0.0.78 https://quay.io/repository/scif/scif?tab=tags

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/vsoch/scif/issues/59?email_source=notifications&email_token=AAHLUQEZ57SRRKMUXSJAAL3QOW56TA5CNFSM4JAJULU2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEBIVQJA#issuecomment-542201892, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AAHLUQGO6BZ7DYLJ3TPEOT3QOW56TANCNFSM4JAJULUQ.