Skip to content

Fixes #163; Remove Helix.pitch and Helix.yaw#166

Merged
UnHumbleBen merged 3 commits intodevfrom
issue-163-remove-helix-pitch-and-yaw
Feb 10, 2021
Merged

Fixes #163; Remove Helix.pitch and Helix.yaw#166
UnHumbleBen merged 3 commits intodevfrom
issue-163-remove-helix-pitch-and-yaw

Conversation

@UnHumbleBen
Copy link
Copy Markdown
Collaborator

DO NOT MERGE YET

I still have not implemented a Design method for looking up pitch/yaw/roll values for helices. Should be straightforward, but any name suggestions for the function names? Maybe Design.{pitch/yaw/roll}_of_helix?

The second reason for not merging yet is because I added code in Design.json to allow for compatibility with designs that specified pitch and yaw in individual Helix. It passes all of the old test cases as well as news one I made, but I am concerned about the quality of the implementation so I would like to give @dave-doty an opportunity to review the code.

Completed:

  • Remove Helix.pitch and Helix.yaw
  • Update Design.from_json to be compatible with designs that specified
    pitch and yaw in individual Helix (except when multiple helices in the
    same group have different pitch/yaw values, in which case,
    IllegalDesignError is raised)
  • Updated examples that used pitch and roll
  • Updated unit tests that used pitch/roll
  • Added new unit test to test new Design.from_json

Not Completed:

  • Add Design method for looking up pitch/yaw/roll for helices

Completed:
* Remove Helix.pitch and Helix.yaw
* Update Design.from_json to be compatible with designs that specified
  pitch and yaw in individual Helix (except when multiple helices in the
  same group have different pitch/yaw values, in which case,
  IllegalDesignError is raised)
* Updated examples that used pitch and roll
* Updated unit tests that used pitch/roll
* Added new unit test to test new Design.from_json

Not Completed:
* Add Design method for looking up pitch/yaw/roll for helices
Other changes:
* Add UT to cover remaining cases
* Rewrite logic for pitch yaw lookup
* Refactor Design's from_json into smaller functions
* Change floating_point_tolerance into private variable
@UnHumbleBen UnHumbleBen requested a review from dave-doty February 8, 2021 04:13
@UnHumbleBen
Copy link
Copy Markdown
Collaborator Author

I made the final changes and ready to merge as soon as you approve. Let me know if you see anymore issues. One thing to note is that dev is technically in process of v0.15.2.

This PR would change dev version to v0.16.0. The only commit right now in dev is the one for removing the print statement. Should we just have that commit go under v0.16.0?

@dave-doty
Copy link
Copy Markdown
Member

I made the final changes and ready to merge as soon as you approve. Let me know if you see anymore issues. One thing to note is that dev is technically in process of v0.15.2.

This PR would change dev version to v0.16.0. The only commit right now in dev is the one for removing the print statement. Should we just have that commit go under v0.16.0?

Yes, just have that commit under 0.16. There's no need for a version 0.15.2.

for ((integerized_pitch, integerized_yaw), helix_list) in pitch_yaw_to_helices.items():
new_pitch = group.pitch + integerized_pitch * floating_point_tolerance
new_yaw = group.yaw + integerized_yaw * floating_point_tolerance
for ((helix_pitch, helix_yaw), helix_list) in pitch_yaw_to_helices.items():
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Put in some comments describing which portions of this code we expect to be only needed for backwards compatibility. It's a mix between code that will always be needed for import in v0.16.0 JSON, and code that will only be executed when encountering previous versions (e.g., v0.15.0) that stored pitch and yaw in Helix. Make sure it's easy to tell the difference between those two kinds of code by adding some comments saying when something is there for backward compatibility.

@dave-doty dave-doty self-requested a review February 8, 2021 16:09
Copy link
Copy Markdown
Member

@dave-doty dave-doty left a comment

Choose a reason for hiding this comment

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

Sorry, I accidentally pressed Approve instead of Request Changes last time. There's a couple comments I made requesting changes.

- Add comments to separate backward compatibility code
- Fix typo in documentation string for Design.pitch_of_helix
@UnHumbleBen UnHumbleBen merged commit e322fbe into dev Feb 10, 2021
@UnHumbleBen UnHumbleBen deleted the issue-163-remove-helix-pitch-and-yaw branch February 10, 2021 02:08
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