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

Make Cubit installation optional #195

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

Make Cubit installation optional #195

wants to merge 7 commits into from

Conversation

connoramoreno
Copy link
Collaborator

This branch isolates the use of Cubit within ParaStell such that it becomes an optional dependency. Cubit import occurs in a single location, the init_cubit function of the cubit_utils.py script (formerly named cubit_io.py), which is called only in functions using Cubit. As the radial distance utility is completely dependent on Cubit, no major modifications were made to that script. In addition, tests are modified to test Cubit functionality only if installed, including test_parastell.py.

mesh_volume_skeleton,
get_last_id,
)
from . import cubit_utils
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'd like to note (for reviewers) that cubit_utils is imported separately here for its initialized variable. If initialized is imported into the namespace of magnet_coils, changes to the variable do not persist when modified by calls to the imported functions

@connoramoreno
Copy link
Collaborator Author

I would also like to note that all tests indeed pass (other than those skipped) when Cubit is removed from PYTHONPATH

def get_last_id(entity):
"""Returns the ID of the most recently created entity of a given type.

Arguments:
Copy link
Contributor

Choose a reason for hiding this comment

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

might be nice to list valid strings here for anyone who is not familiar with the entity types in cubit.

@Edgar-21
Copy link
Contributor

Do we want to update the example parastell_cad_to_dagmc_example.py to not use cubit at all? Right now it calls cubit to make a volumetric mesh of the magnets.

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