python deck: added member add(keyword).

This commit is contained in:
Steinar Foss
2019-10-25 14:11:52 +02:00
parent 390a29d425
commit 576ddd4987
2 changed files with 10 additions and 0 deletions

View File

@@ -35,6 +35,11 @@ namespace {
return deck.getKeyword(index);
}
//This adds a keyword by copy
void addKeyword(Deck& deck, const DeckKeyword kw) {
deck.addKeyword(kw);
}
}
@@ -59,6 +64,7 @@ void python::common::export_Deck(py::module &module) {
} )
.def( "count", &count )
.def( "add", &addKeyword)
;
}

View File

@@ -147,6 +147,10 @@ FIPNUM
si_array = zcorn_kw.get_SI_array()
self.assertAlmostEqual( si_array[0], 1.1 * unit_foot )
self.assertAlmostEqual( si_array[2], 3.3 * unit_foot )
assert( not( "ZCORN" in deck ) )
deck.add( zcorn_kw )
assert( "ZCORN" in deck )