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

APR 'findHelix' method indices are overloaded, needs comments and subdivision #1270

Open
brownd1978 opened this issue May 22, 2024 · 5 comments
Assignees

Comments

@brownd1978
Copy link
Collaborator

brownd1978 commented May 22, 2024

findHelix overloads integers used both as indices in a triple-nested loop and as flags for various conditions. The logical conditions should be split out as explicit flags. The loops should be refactored into functions, and the intent of this code should be described in comments.

@gianipez
Copy link
Contributor

@matthewstortini was this solved?

@matthewstortini
Copy link
Contributor

matthewstortini commented Jul 11, 2024

@matthewstortini was this solved?

@gianipez Not yet. I wanted to let Ethan finish the changes we are implementing first. Perhaps he can cancel his PR and I can address this problem in his area so that all of the changes can be in one PR.

I am not sure that the module needs to be refactored into functions as much as it may seem when one quickly scrolls through it. All of the logical steps are factorized now. One loop looks ugly mostly because there is a lot of debugging folded in. This debugging was for early development and uses MC info. It will all be removed in the short future.

@kutschke
Copy link
Collaborator

I would like to keep these as separate PRs so that they are reviewable.

Will this work: you fix the problem in this issue, make a PR that is reviewed and merged. Then Ethan can merge/rebase his PR and continue his work. If you do this, do you expect that Ethan will need to resolve extensive merge conflicts?

And to remind you. There are two ways to break out of a doubly nested loop. The strongly preferred way is to encapsulate the double loop in a function and just return from it. If there is a good reason to not do that, then use a goto.

@kutschke
Copy link
Collaborator

@matthewstortini and @gianipez is there anything you would like clarified in my request?

@matthewstortini
Copy link
Contributor

@kutschke I understand, no need for further clarification. Ethan's PR should be very simple and go through fairly quickly (I hope in a day or two). I will not be able to get to this issue until later in the week. Thus, I think Ethan's PR will be through before I make my own anyway.

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

No branches or pull requests

4 participants