Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1639 from naylor-b/serialize
Fix for unserializable object failure when running n2
- Loading branch information
Showing
5 changed files
with
64 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import unittest | ||
|
||
import openmdao.api as om | ||
|
||
class BadOptionComp(om.ExplicitComponent): | ||
|
||
def initialize(self): | ||
self.options.declare('bad', recordable=False) | ||
|
||
def setup(self): | ||
self.add_input('x') | ||
self.add_output('y') | ||
|
||
|
||
class SerializeTestCase(unittest.TestCase): | ||
def test_serialize_n2(self): | ||
p = om.Problem() | ||
|
||
p.model.add_subsystem('foo', BadOptionComp(bad=object())) | ||
|
||
p.setup() | ||
p.final_setup() | ||
|
||
om.n2(p, show_browser=False) | ||
|
||
|
||
if __name__ == '__main__': | ||
unittest.main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters