@@ -734,8 +734,8 @@ def taxonomy_taxon(self, ott_id, include_lineage=False):
734
734
735
735
def studies_find_studies (
736
736
self ,
737
- study_property = None ,
738
- value = None ,
737
+ property_name = None ,
738
+ property_value = None ,
739
739
exact = False ,
740
740
verbose = False ):
741
741
"""
@@ -751,11 +751,12 @@ def studies_find_studies(
751
751
752
752
Parameters
753
753
----------
754
- study_property : string
755
- The property to be searched on. A list of searchable properties is
756
- available from the `studies_properties` function. To find all studies,
757
- omit both the property and the value from your query.
758
- value : string
754
+ property_name : string
755
+ The *study* property to be searched on. A list of searchable
756
+ properties is available from `studies_properties()["study_properties"]`.
757
+ To find all studies, omit both the property and the value from your
758
+ query.
759
+ property_value : string
759
760
The value to be searched. This must be passed as a string, but will be
760
761
converted to the datatype corresponding to the specified searchable
761
762
value. To find all studies, omit both the property and the value from
@@ -776,23 +777,23 @@ def studies_find_studies(
776
777
"matched_studies"
777
778
"""
778
779
payload = {"exact" : exact }
779
- if study_property is None or value is None :
780
- if study_property is not None :
781
- raise ValueError ("If 'study_property ' is specified, 'value ' must be specified as well" )
782
- if value is not None :
783
- raise ValueError ("If 'value ' is specified, 'study_property ' must be specified as well" )
780
+ if property_name is None or property_value is None :
781
+ if property_name is not None :
782
+ raise ValueError ("If 'property_name ' is specified, 'property_value ' must be specified as well" )
783
+ if property_value is not None :
784
+ raise ValueError ("If 'property_value ' is specified, 'property_name ' must be specified as well" )
784
785
else :
785
- payload ["property" ] = study_property
786
- payload ["value" ] = value
786
+ payload ["property" ] = property_name
787
+ payload ["value" ] = property_value
787
788
result = self .request (
788
789
'/studies/find_studies' ,
789
790
payload = payload )
790
791
return result
791
792
792
793
def studies_find_trees (
793
794
self ,
794
- tree_property ,
795
- value ,
795
+ property_name ,
796
+ property_value ,
796
797
exact = False ,
797
798
verbose = False ):
798
799
"""
@@ -807,10 +808,10 @@ def studies_find_trees(
807
808
808
809
Parameters
809
810
----------
810
- tree_property : string
811
- The property to be searched on. A list of searchable properties is
812
- available from the `studies_properties` function .
813
- value : string
811
+ property_name : string
812
+ The *tree* property to be searched on. A list of searchable
813
+ properties is available from `studies_properties()["tree_properties"]` .
814
+ property_value : string
814
815
The value to be searched. This must be passed as a string, but will be
815
816
converted to the datatype corresponding to the specified searchable
816
817
value.
@@ -831,8 +832,8 @@ def studies_find_trees(
831
832
"""
832
833
payload = {
833
834
"exact" : exact ,
834
- "property" : tree_property ,
835
- "value" : value , }
835
+ "property" : property_name ,
836
+ "value" : property_value , }
836
837
result = self .request (
837
838
'/studies/find_trees' ,
838
839
payload = payload )
@@ -1105,33 +1106,33 @@ def taxonomy_taxon(ott_id, include_lineage=False):
1105
1106
)
1106
1107
1107
1108
def studies_find_studies (
1108
- study_property = None ,
1109
- value = None ,
1109
+ property_name = None ,
1110
+ property_value = None ,
1110
1111
exact = False ,
1111
1112
verbose = False ,
1112
1113
):
1113
1114
"""
1114
1115
Forwards to :meth:`OpenTreeService.studies_find_studies()` of the global :class:`OpenTreeService` instance.
1115
1116
"""
1116
1117
return GLOBAL_OPEN_TREE_SERVICE .studies_find_studies (
1117
- study_property = study_property ,
1118
- value = value ,
1118
+ property_name = property_name ,
1119
+ property_value = property_value ,
1119
1120
exact = exact ,
1120
1121
verbose = verbose ,
1121
1122
)
1122
1123
1123
1124
def studies_find_trees (
1124
- study_property ,
1125
- value ,
1125
+ property_name ,
1126
+ property_value ,
1126
1127
exact = False ,
1127
1128
verbose = False ,
1128
1129
):
1129
1130
"""
1130
1131
Forwards to :meth:`OpenTreeService.studies_find_trees()` of the global :class:`OpenTreeService` instance.
1131
1132
"""
1132
1133
return GLOBAL_OPEN_TREE_SERVICE .studies_find_trees (
1133
- study_property = study_property ,
1134
- value = value ,
1134
+ property_name = property_name ,
1135
+ property_value = property_value ,
1135
1136
exact = exact ,
1136
1137
verbose = verbose ,
1137
1138
)
@@ -1293,12 +1294,12 @@ def human_readable_output_inspection(function_name, function_output):
1293
1294
# curl -X POST http://devapi.opentreeoflife.org/v2/studies/find_studies -H "content-type:application/json" -d '{"property":"ot:studyId","value":"pg_719","verbose":true}'
1294
1295
human_readable_output_inspection (
1295
1296
function_name = 'studies_find_studies' ,
1296
- function_output = studies_find_studies (study_property = "ot:studyId" , value = "pg_719" , verbose = True ))
1297
+ function_output = studies_find_studies (property_name = "ot:studyId" , property_value = "pg_719" , verbose = True ))
1297
1298
1298
1299
# curl -X POST http://devapi.opentreeoflife.org/v2/studies/find_trees -H "content-type:application/json" -d '{"property":"ot:ottTaxonName","value":"Garcinia"}'
1299
1300
human_readable_output_inspection (
1300
1301
function_name = 'studies_find_trees' ,
1301
- function_output = studies_find_trees (study_property = "ot:ottTaxonName" , value = "Garcinia" ))
1302
+ function_output = studies_find_trees (property_name = "ot:ottTaxonName" , property_value = "Garcinia" ))
1302
1303
1303
1304
# curl -X POST http://devapi.opentreeoflife.org/v2/studies/properties
1304
1305
human_readable_output_inspection (
0 commit comments