Skip to content

Commit daa2b7c

Browse files
sort variables in operations
1 parent 0141bc4 commit daa2b7c

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

pina/domain/operation_interface.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,10 @@ def variables(self):
4343
:return: All the variables defined in ``__init__`` in order.
4444
:rtype: list[str]
4545
"""
46-
return self.geometries[0].variables
46+
variables = []
47+
for geom in self.geometries:
48+
variables += geom.variables
49+
return sorted(list(set(variables)))
4750

4851
@abstractmethod
4952
def is_inside(self, point, check_border=False):

pina/domain/union_domain.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,6 @@ def sample_modes(self):
3939
set([geom.sample_modes for geom in self.geometries])
4040
)
4141

42-
@property
43-
def variables(self):
44-
variables = []
45-
for geom in self.geometries:
46-
variables += geom.variables
47-
return list(set(variables))
48-
4942
def is_inside(self, point, check_border=False):
5043
"""
5144
Check if a point is inside the ``Union`` domain.

0 commit comments

Comments
 (0)