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

Split magnet set object #173

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open

Split magnet set object #173

wants to merge 8 commits into from

Conversation

Edgar-21
Copy link
Contributor

@Edgar-21 Edgar-21 commented Nov 7, 2024

First crack at the class hierarchy disussed a couple weeks back - not sure the best way to handle things that you might want to be part of the init method for both classes? I just left those variables (like logger) in the init for each class. This felt a bit like defining things in two places.

@Edgar-21 Edgar-21 linked an issue Nov 7, 2024 that may be closed by this pull request
@Edgar-21
Copy link
Contributor Author

Edgar-21 commented Nov 7, 2024

tests are passing locally :(

I did make some changes to the tests to accommodate the changes in this PR, maybe the CI is using the old versions of the tests? I'll look more into it soon.

Copy link
Collaborator

@connoramoreno connoramoreno left a comment

Choose a reason for hiding this comment

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

I know this is still in draft stage, but here are some general comments and suggestions

parastell/cubit_io.py Outdated Show resolved Hide resolved
parastell/cubit_io.py Show resolved Hide resolved
parastell/cubit_io.py Show resolved Hide resolved
parastell/cubit_io.py Show resolved Hide resolved
parastell/cubit_io.py Show resolved Hide resolved
Comment on lines +81 to +84
if cubit_io.initialized:
cubit.cmd("new")
else:
cubit_io.init_cubit()
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this necessary? Not sure how/if pytest isolates these tests

Comment on lines +106 to +109
if cubit_io.initialized:
cubit.cmd("new")
else:
cubit_io.init_cubit()
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same question as above

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah, I added these upon realizing that there was leftover stuff from previous tests messing up these tests

Comment on lines +128 to +131
if cubit_io.initialized:
cubit.cmd("new")
else:
cubit_io.init_cubit()
Copy link
Collaborator

Choose a reason for hiding this comment

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

See above

tests/test_magnet_coils.py Show resolved Hide resolved
tests/test_magnet_coils.py Show resolved Hide resolved
@Edgar-21 Edgar-21 marked this pull request as ready for review November 18, 2024 01:56
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.

A couple of comments on the details, but I think we need to get the inheritance issues of the constructor/__init__ right.

self.geom_filename, self.export_dir
)

self.volume_ids = list(range(first_vol_id, last_vol_id + 1))
Copy link
Member

Choose a reason for hiding this comment

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

Are we sure that the volume ids are contiguous? I think there is a cubit command to ensure this.

)


class BuildableMagnetSet(MagnetSet):
Copy link
Member

Choose a reason for hiding this comment

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

Not convinced by this new name... maybe FilamentMagnetSet?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Both versions may have filament data associated with them, as it may be desired to build the magnet surface for radial distance finding. BuildableMagnetSet is not my favorite either, but I've had a hard time coming up with another distinguishing feature. Maybe CadQueryMagnetSet, or ParastellMagnetSet, or MagnetSetFromFilaments? Could have 3 objects in total as well, MagnetSet and MagnetSetFromFilaments and MagnetSetFromGeometry, which inherit from MagnetSet?

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.

Support custom magnet geometries when building dagmc models
3 participants