-
Notifications
You must be signed in to change notification settings - Fork 3
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
Complete rewriting of PlanarDiagram::GetSmallGirthMorseCode #14
base: main
Are you sure you want to change the base?
Conversation
Regarding the failed checks: Okay so I am discovering things as I go along, but I've also run |
Thanks for working on this Isaac. I have a superficial comment on your comments, not based on looking at the code. I think we would come to regret intermingling two different styles for variable names. I think it would be best to use the same style for your new variables that is used in the rest of the package. Also that would probably be an easy correction to make at this point, but possibly painful after a few years. |
Thank you Marc for your quick reply! I've changed the style to something more coherent (although it's unclear if I should go for |
I see what you mean. It seems like there is no convention for variables that do not have descriptive names and that the upper case form is much more prevalent for descriptive names. So I think your choice is optimal given the context. |
I've completely rewritten the function
PlanarDiagram::GetSmallGirthMorseCode
in order to improve readability and also address some issues I discovered while reading through the code. In its current state, I'm not sure if this fork should be merged, for reasons I will state further below, but I hope that this can be discussed.The new function(s) are closely related to the previous function. I made the following changes:
get_max_connections
, which finds maximally connected crossings to attach to a partial Morse list, andextend_Morse_list
, which actually adds the next crossing.goto
statement.4 * n_crossings
, which will generally stay reasonably small, I don't think this will greatly affect the ability to reach all possible Morse lists by calling the function several times. Moreover, this guarantees that the function will try starting with every single crossing early on, which I believe reduces the chance of finding the same Morse list several times early on.The reasons that I would like to discuss these changes are the following:
lower_case_with_underscores
for variables. This doesn't match the rest of the code. Should this be changed?goto
twice, in situations where I didn't see a more elegant solution. They should be relatively acceptable uses, since in both cases I used it to break out of nested loops. Once again, I don't know if there are any coding guidelines, but this is something to keep in mind for future development.Sorry for the long request... another much faster fix would be changing the
continue
of 79ce6ff to agoto AttemptEnd
and then addingAttemptEnd: ;
on line 205 (after the code saving the improved Morse list). If that's better, then I can make another pull request with that change. It doesn't address all the issues, but it should correspond to change 4 above.