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

ENH Stream file merge task #15

Merged
merged 8 commits into from
Apr 4, 2024
Merged

ENH Stream file merge task #15

merged 8 commits into from
Apr 4, 2024

Conversation

valmar
Copy link
Contributor

@valmar valmar commented Apr 2, 2024

Description

This PR introduces a simple native task that merges several streams file into one by concatenating ther content.

Checklist

  • Model for the native task
  • Implementation of the native task

PR Type:

  • New feature/Enhancement

Address issues:

  • NA

Testing

Copy link
Collaborator

@gadorlhiac gadorlhiac left a comment

Choose a reason for hiding this comment

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

Thanks @valmar looks mostly good to me, I left a couple of comments inline. Two additional things:

  • We should probably add validators to the Task model to:
    • Automatically pull the input directory from the output file of indexing (for now just CrystFEL)
    • Set the output file accordingly
  • Also, it is probably best to add a validator here now for the merge Task:
    in_file: Optional[str] = Field(

lute/io/models/sfx_index.py Outdated Show resolved Hide resolved
lute/tasks/sfx_index.py Outdated Show resolved Hide resolved
lute/tasks/sfx_index.py Outdated Show resolved Hide resolved
infile: Path
for infile in stream_file_list:
with open(infile, "rb") as fd:
shutil.copyfileobj(fd, wfd)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Looks good to me. We should remember to pay attention to this when we start having interactions between multiple users. I remember we had some issues copying files and doing operations like this when multiple users were submitting jobs.

lute/io/models/sfx_index.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@gadorlhiac gadorlhiac left a comment

Choose a reason for hiding this comment

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

Thanks @valmar !

@gadorlhiac gadorlhiac merged commit 06128d9 into slac-lcls:dev Apr 4, 2024
1 check passed
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