-
Notifications
You must be signed in to change notification settings - Fork 26
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
Basesolver init function now accepts a comm #30
Conversation
Could you add a quick test for this in |
I'm not sure this would make sense since that would force baseclasses to depend on mpi4py for testing. I suppose we could add a |
It would be nice though because dependencies will break if it doesn't pass. |
After speaking with @nwu63 I will add a test and few other things and finally update the other PRs. |
tests/test_BaseSolver.py
Outdated
import unittest | ||
from baseclasses import BaseSolver | ||
from baseclasses.utils import Error | ||
|
||
|
||
class SOLVER(BaseSolver): | ||
def __init__(self, name, options=None, *args, **kwargs): | ||
def __init__(self, name, options={}, comm=None, *args, **kwargs): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't believe args
and kwargs
are used so those can probably be removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, will remove
baseclasses/__init__.py
Outdated
@@ -1,4 +1,4 @@ | |||
__version__ = "1.2.4" | |||
__version__ = "1.2.5" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think now that we have broken backwards compatibility, we should bump to 1.3.0
at a minimum.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I agree, will bump
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding the tests!
@@ -27,7 +27,15 @@ class AeroSolver(BaseSolver): | |||
""" | |||
|
|||
def __init__( | |||
self, name, category={}, def_options={}, informs={}, options={}, immutableOptions=set(), deprecatedOptions={} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think changing the order will break pyFriction so we should change that as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I will submit PR for the remaining repos that use baseclasses
Purpose
With the additions of
self.comm
in PR #29, then if the user definesself.comm
in a child class before calling the BaseSolver__init__
then self.comm will get overwritten with None.This PR adds a
comm
argument in theBaseSolver.__init__
function. This avoids having to define aself.comm
elsewhere in child classes.It also add a
informs
member variable (with a small test) as well as updates the argument list with a consistent camelCase variable.Type of change
What types of change is it?
Select the appropriate type(s) that describe this PR
Testing
Explain the steps needed to test the new code to verify that it does indeed address the issue and produce the expected behavior.
Checklist
Put an
x
in the boxes that apply.flake8
andblack
to make sure the code adheres to PEP-8 and is consistently formatted