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

Support comma-separated list of files as input #10

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

yarong-lifemap
Copy link

No description provided.

@oferze
Copy link
Contributor

oferze commented Apr 21, 2023

@arose @JonStargaryen @bioinsilico @buzzcrackle any progress with this? the PR looks good

Copy link
Member

@dsehnal dsehnal left a comment

Choose a reason for hiding this comment

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

Sorry this flew under the radar.

Comment on lines +113 to +115
files.forEach(async file => {
await renderFile(file);
});
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
files.forEach(async file => {
await renderFile(file);
});
for (const file in files) {
await renderFile(file);
});

Need a normal loop here so the await does what it's supposed to. What you did would execute all the renders in parallel which you don't really want as this is a single threaded environment and you would also likely run out of memory if the input list was really long.

});
}

async function renderFile(filePath: string) {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
async function renderFile(filePath: string) {
async function renderFile(filePath: string, renderer: ImageRenderer) {

and declare const renderer = new ImageRenderer(args.width, args.height, args.format, args.plddt, new FocusFirstResidue()); in the main function. This will reuse the renderer for all the renders and should work out of the box sinde the render function always calls this.canvas3d.clear(); at the end.

@yarong-lifemap
Copy link
Author

@arose @JonStargaryen @bioinsilico @buzzcrackle can you please revisit this?

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.

3 participants