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

Add __init__ method to BaseUI for setting up pyTACS options/comm #187

Merged
merged 8 commits into from
Feb 22, 2023

Conversation

A-CGray
Copy link
Contributor

@A-CGray A-CGray commented Feb 22, 2023

Previously, all pyTACS classes had the same boilerplate code in their __init__ methods for setting up their MPI communicators and options dictionaries. This PR moves that code into the __init__ method of the BaseUI class which is inherited by all pyTACS classes, reducing repeated code.

@A-CGray A-CGray requested a review from timryanb February 22, 2023 17:09
@A-CGray
Copy link
Contributor Author

A-CGray commented Feb 22, 2023

Thanks for those fixes @timryanb. Out of interest, is there a specific reason you prefer calling TACSProblem.__init__ over super().__init__?

@timryanb
Copy link
Collaborator

timryanb commented Feb 22, 2023

Thanks for those fixes @timryanb. Out of interest, is there a specific reason you prefer calling TACSProblem.__init__ over super().__init__?

I think the first is a little more explicit than the super approach. Makes it clearer what class method is being called.

It's also consistent with other locations in the code, like here: https://github.com/smdogroup/tacs/blob/master/tacs/problems/static.py#L401

@timryanb timryanb merged commit 401e975 into master Feb 22, 2023
@timryanb timryanb deleted the baseInit branch February 22, 2023 18:55
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