Skip to content

Commit f7c47bb

Browse files
RF: rename from_mapping to from_index_mapping
1 parent 109fa92 commit f7c47bb

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

nibabel/cifti2/cifti2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1279,7 +1279,7 @@ def get_axis(self, index):
12791279
axis : cifti2_axes.Axis
12801280
'''
12811281
from . import cifti2_axes
1282-
return cifti2_axes.from_mapping(self.matrix.get_index_map(index))
1282+
return cifti2_axes.from_index_mapping(self.matrix.get_index_map(index))
12831283

12841284
@classmethod
12851285
def from_axes(cls, axes):

nibabel/cifti2/cifti2_axes.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@
114114
import abc
115115

116116

117-
def from_mapping(mim):
117+
def from_index_mapping(mim):
118118
"""
119119
Parses the MatrixIndicesMap to find the appropriate CIfTI2 axis describing the rows or columns
120120
@@ -131,7 +131,7 @@ def from_mapping(mim):
131131
'CIFTI_INDEX_TYPE_SERIES': Series,
132132
'CIFTI_INDEX_TYPE_BRAIN_MODELS': BrainModel,
133133
'CIFTI_INDEX_TYPE_PARCELS': Parcels}
134-
return return_type[mim.indices_map_to_data_type].from_mapping(mim)
134+
return return_type[mim.indices_map_to_data_type].from_index_mapping(mim)
135135

136136

137137
def to_header(axes):
@@ -364,7 +364,7 @@ def from_surface(cls, vertices, nvertex, name='Other'):
364364
nvertices={cifti_name: nvertex})
365365

366366
@classmethod
367-
def from_mapping(cls, mim):
367+
def from_index_mapping(cls, mim):
368368
"""
369369
Creates a new BrainModel axis based on a CIfTI2 dataset
370370
@@ -783,7 +783,7 @@ def from_brain_models(cls, named_brain_models):
783783
return Parcels(all_names, all_voxels, all_vertices, affine, volume_shape, nvertices)
784784

785785
@classmethod
786-
def from_mapping(cls, mim):
786+
def from_index_mapping(cls, mim):
787787
"""
788788
Creates a new Parcels axis based on a CIfTI2 dataset
789789
@@ -1016,7 +1016,7 @@ def __init__(self, name, meta=None):
10161016
check_name, getattr(self, check_name).shape))
10171017

10181018
@classmethod
1019-
def from_mapping(cls, mim):
1019+
def from_index_mapping(cls, mim):
10201020
"""
10211021
Creates a new Scalar axis based on a CIfTI2 dataset
10221022
@@ -1150,7 +1150,7 @@ def __init__(self, name, label, meta=None):
11501150
check_name, getattr(self, check_name).shape))
11511151

11521152
@classmethod
1153-
def from_mapping(cls, mim):
1153+
def from_index_mapping(cls, mim):
11541154
"""
11551155
Creates a new Label axis based on a CIfTI2 dataset
11561156
@@ -1164,7 +1164,7 @@ def from_mapping(cls, mim):
11641164
"""
11651165
tables = [{key: (value.label, value.rgba) for key, value in nm.label_table.items()}
11661166
for nm in mim.named_maps]
1167-
rest = Scalar.from_mapping(mim)
1167+
rest = Scalar.from_index_mapping(mim)
11681168
return Label(rest.name, tables, rest.meta)
11691169

11701170
def to_mapping(self, dim):
@@ -1294,7 +1294,7 @@ def time(self):
12941294
return np.arange(self.size) * self.step + self.start
12951295

12961296
@classmethod
1297-
def from_mapping(cls, mim):
1297+
def from_index_mapping(cls, mim):
12981298
"""
12991299
Creates a new Series axis based on a CIfTI2 dataset
13001300

0 commit comments

Comments
 (0)