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

Refactor filament data use #151

Merged
merged 9 commits into from
Sep 13, 2024
Merged

Refactor filament data use #151

merged 9 commits into from
Sep 13, 2024

Conversation

connoramoreno
Copy link
Collaborator

@connoramoreno connoramoreno commented Sep 10, 2024

Streamlines and reorganizes use of filament coordinate data as follows:

  • Instantiates a new MagnetCoil class object as filament coordinate data becomes available in the MagnetSet._instantiate_coils method (formerly named MagnetSet._extract_filament_data), rather than store all filament data separately (and redundantly) in the MagnetSet class.
  • For the purpose of filtering coils based on toroidal angle, moves the check of whether each coil lies within the model's toroidal extent to the check_coil_toroidal_extent method of the MagnetCoil class, rather than the _filter_coils method of the MagnetSet class (formerly named MagnetSet._filter_filaments). The MagnetCoil._check_coil_toroidal_extent method is called by the MagnetSet._filter_coils method to subsequently perform the actual filtering.
  • Modifies storage of filament coordinates in the MagnetCoil class such that all coordinates are stored, and only downsampled during actual CAD solid generation. Note that the downsampled coordinates are not stored as part of any class.

Closes #47
Closes #149 (via PR #152)

Copy link
Member

@gonuke gonuke left a comment

Choose a reason for hiding this comment

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

Two little code comments....

In a separate issue/PR we should discuss whether you check the extent of the filament data before building the coil?

parastell/magnet_coils.py Outdated Show resolved Hide resolved
parastell/radial_distance_utils.py Outdated Show resolved Hide resolved
Copy link
Member

@gonuke gonuke left a comment

Choose a reason for hiding this comment

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

@gonuke gonuke merged commit 32b221a into main Sep 13, 2024
3 checks passed
@connoramoreno connoramoreno deleted the filament-data-refactor branch September 13, 2024 13:24
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.

Radial distance utility lightly broken by CadQuery magnets PR Refactor use of filaments for magnet coils
3 participants