@@ -1133,18 +1133,18 @@ def get_minimum_required_stake(self) -> Balance:
1133
1133
def get_metagraph_info (
1134
1134
self ,
1135
1135
netuid : int ,
1136
- field_indices : Optional [list ["SelectiveMetagraphIndex" ]] = None ,
1136
+ field_indices : Optional [list [Union [ "SelectiveMetagraphIndex" , int ] ]] = None ,
1137
1137
block : Optional [int ] = None ,
1138
1138
) -> Optional [MetagraphInfo ]:
1139
1139
"""
1140
1140
Retrieves full or partial metagraph information for the specified subnet (netuid).
1141
1141
1142
1142
Arguments:
1143
- netuid (int) : The NetUID of the subnet to query.
1144
- field_indices (Optional[list[SelectiveMetagraphIndex]]) : An optional list of SelectiveMetagraphIndex values
1145
- specifying which fields to retrieve. If not provided, all available fields will be returned.
1146
- block (Optional[int]): The block number at which to query the data. If not specified, the current block or
1147
- one determined via reuse_block or block_hash will be used.
1143
+ netuid: The NetUID of the subnet to query.
1144
+ field_indices: An optional list of SelectiveMetagraphIndex values specifying which fields to retrieve. If
1145
+ not provided, all available fields will be returned.
1146
+ block: The block number at which to query the data. If not specified, the current block or one determined
1147
+ via reuse_block or block_hash will be used.
1148
1148
1149
1149
Returns:
1150
1150
Optional[MetagraphInfo]: A MetagraphInfo object containing the requested subnet data, or None if the subnet
@@ -1162,9 +1162,12 @@ def get_metagraph_info(
1162
1162
1163
1163
if field_indices :
1164
1164
if isinstance (field_indices , list ) and all (
1165
- isinstance (f , SelectiveMetagraphIndex ) for f in field_indices
1165
+ isinstance (f , ( SelectiveMetagraphIndex , int ) ) for f in field_indices
1166
1166
):
1167
- indexes = [f .value for f in field_indices ]
1167
+ indexes = [
1168
+ f .value if isinstance (f , SelectiveMetagraphIndex ) else f
1169
+ for f in field_indices
1170
+ ]
1168
1171
else :
1169
1172
raise ValueError (
1170
1173
"`field_indices` must be a list of SelectiveMetagraphIndex items."
0 commit comments