Skip to content

Commit af38bbf

Browse files
committed
optional condition dict
1 parent 826a827 commit af38bbf

File tree

3 files changed

+17
-17
lines changed

3 files changed

+17
-17
lines changed

src/compas/datastructures/graph/graph.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -622,12 +622,12 @@ def nodes(self, data=False):
622622
else:
623623
yield key, self.node_attributes(key)
624624

625-
def nodes_where(self, conditions, data=False, **kwargs):
625+
def nodes_where(self, conditions=None, data=False, **kwargs):
626626
"""Get nodes for which a certain condition or set of conditions is true.
627627
628628
Parameters
629629
----------
630-
conditions : dict
630+
conditions : dict, optional
631631
A set of conditions in the form of key-value pairs.
632632
The keys should be attribute names. The values can be attribute
633633
values or ranges of attribute values in the form of min/max pairs.
@@ -743,12 +743,12 @@ def edges(self, data=False):
743743
else:
744744
yield u, v
745745

746-
def edges_where(self, conditions, data=False, **kwargs):
746+
def edges_where(self, conditions=None, data=False, **kwargs):
747747
"""Get edges for which a certain condition or set of conditions is true.
748748
749749
Parameters
750750
----------
751-
conditions : dict
751+
conditions : dict, optional
752752
A set of conditions in the form of key-value pairs.
753753
The keys should be attribute names. The values can be attribute
754754
values or ranges of attribute values in the form of min/max pairs.

src/compas/datastructures/halfedge/halfedge.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -625,7 +625,7 @@ def vertices_where(self, conditions=None, data=False, **kwargs):
625625
626626
Parameters
627627
----------
628-
conditions : dict
628+
conditions : dict, optional
629629
A set of conditions in the form of key-value pairs.
630630
The keys should be attribute names. The values can be attribute
631631
values or ranges of attribute values in the form of min/max pairs.
@@ -726,12 +726,12 @@ def vertices_where_predicate(self, predicate, data=False):
726726
else:
727727
yield key
728728

729-
def edges_where(self, conditions, data=False, **kwargs):
729+
def edges_where(self, conditions=None, data=False, **kwargs):
730730
"""Get edges for which a certain condition or set of conditions is true.
731731
732732
Parameters
733733
----------
734-
conditions : dict
734+
conditions : dict, optional
735735
A set of conditions in the form of key-value pairs.
736736
The keys should be attribute names. The values can be attribute
737737
values or ranges of attribute values in the form of min/max pairs.
@@ -813,12 +813,12 @@ def edges_where_predicate(self, predicate, data=False):
813813
else:
814814
yield key
815815

816-
def faces_where(self, conditions, data=False, **kwargs):
816+
def faces_where(self, conditions=None, data=False, **kwargs):
817817
"""Get faces for which a certain condition or set of conditions is true.
818818
819819
Parameters
820820
----------
821-
conditions : dict
821+
conditions : dict, optional
822822
A set of conditions in the form of key-value pairs.
823823
The keys should be attribute names. The values can be attribute
824824
values or ranges of attribute values in the form of min/max pairs.

src/compas/datastructures/halfface/halfface.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -715,12 +715,12 @@ def cells(self, data=False):
715715
else:
716716
yield cell, self.cell_attributes(cell)
717717

718-
def vertices_where(self, conditions, data=False, **kwargs):
718+
def vertices_where(self, conditions=None, data=False, **kwargs):
719719
"""Get vertices for which a certain condition or set of conditions is true.
720720
721721
Parameters
722722
----------
723-
conditions : dict
723+
conditions : dict, optional
724724
A set of conditions in the form of key-value pairs.
725725
The keys should be attribute names. The values can be attribute
726726
values or ranges of attribute values in the form of min/max pairs.
@@ -816,12 +816,12 @@ def vertices_where_predicate(self, predicate, data=False):
816816
else:
817817
yield key
818818

819-
def edges_where(self, conditions, data=False, **kwargs):
819+
def edges_where(self, conditions=None, data=False, **kwargs):
820820
"""Get edges for which a certain condition or set of conditions is true.
821821
822822
Parameters
823823
----------
824-
conditions : dict
824+
conditions : dict, optional
825825
A set of conditions in the form of key-value pairs.
826826
The keys should be attribute names. The values can be attribute
827827
values or ranges of attribute values in the form of min/max pairs.
@@ -901,12 +901,12 @@ def edges_where_predicate(self, predicate, data=False):
901901
else:
902902
yield key
903903

904-
def faces_where(self, conditions, data=False, **kwargs):
904+
def faces_where(self, conditions=None, data=False, **kwargs):
905905
"""Get faces for which a certain condition or set of conditions is true.
906906
907907
Parameters
908908
----------
909-
conditions : dict
909+
conditions : dict, optional
910910
A set of conditions in the form of key-value pairs.
911911
The keys should be attribute names. The values can be attribute
912912
values or ranges of attribute values in the form of min/max pairs.
@@ -986,12 +986,12 @@ def faces_where_predicate(self, predicate, data=False):
986986
else:
987987
yield fkey
988988

989-
def cells_where(self, conditions, data=False, **kwargs):
989+
def cells_where(self, conditions=None, data=False, **kwargs):
990990
"""Get cells for which a certain condition or set of conditions is true.
991991
992992
Parameters
993993
----------
994-
conditions : dict
994+
conditions : dict, optional
995995
A set of conditions in the form of key-value pairs.
996996
The keys should be attribute names. The values can be attribute
997997
values or ranges of attribute values in the form of min/max pairs.

0 commit comments

Comments
 (0)