Skip to content

Commit

Permalink
simplify attribute initiation
Browse files Browse the repository at this point in the history
  • Loading branch information
Naikless committed Dec 14, 2023
1 parent 737710e commit 87ed8fc
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions interfaces/cython/cantera/reactor.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,7 @@ cdef class ReactorBase:
if volume is not None:
self.volume = volume

if node_attr is not None:
self.node_attr = node_attr
else:
self.node_attr = {}
self.node_attr = node_attr or {}

def insert(self, _SolutionBase solution):
"""
Expand Down Expand Up @@ -993,10 +990,7 @@ cdef class WallBase:
self.heat_flux = Q
if velocity is not None:
self.velocity = velocity
if edge_attr is not None:
self.edge_attr = edge_attr
else:
self.edge_attr = {}
self.edge_attr = edge_attr or {}

def _install(self, ReactorBase left, ReactorBase right):
"""
Expand Down Expand Up @@ -1224,10 +1218,7 @@ cdef class FlowDevice:
n = _reactor_counts[self.__class__.__name__]
self.name = '{0}_{1}'.format(self.__class__.__name__, n)

if edge_attr is not None:
self.edge_attr = edge_attr
else:
self.edge_attr = {}
self.edge_attr = edge_attr or {}

self._install(upstream, downstream)

Expand Down

0 comments on commit 87ed8fc

Please sign in to comment.