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

Log and write subprocess output as produced. #485

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

blowekamp
Copy link
Collaborator

The prior implemenation would wait until the process had completed before producing any outputs to the file or to the log. This improvement reports the standard output and error as each line is being produced.

Addresses (eg: #1)

Depends on (eg: #1)

Changes

  • List of changes
  • Breaking changes
  • Changes to configurations

This PR doesn't introduce any:

  • Binary files
  • Temporary files, auto-generated files
  • Secret keys
  • Local debugging print statements
  • Unwanted comments (e.g: # Gets user from environment for code os.environ['user'] )

This PR contains valid:

  • tests

The prior implemenation would wait until the process had completed
before producing any outputs to the file or to the log. This
improvement reports the standard output and error as each line is
being produced.
@blowekamp blowekamp requested a review from philipmac November 5, 2024 14:17
@@ -92,7 +90,7 @@ def convert_if_int16_tiff(file_path: FilePath) -> None:
str(tif_8_bit),
]
utils.log(f"Generated cmd {cmd}")
FilePath.run(cmd, log_fp)
FilePath.run(cmd, log_fp, env={"IMOD_OUTPUT_FORMAT": "TIF"})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh, cool

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The important things added is the usage of pipes with streaming output so that the output of the process can be seen live or if the task is killed by slum the partial output would be there.

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.

2 participants