コード例 #1
0
ファイル: grids.py プロジェクト: mherkazandjian/amuse
 def __getitem__(self, index):
     normalized_index= indexing.normalize_slices(self.shape,index)
     combined_index = indexing.combine_indices(self._private.indices, normalized_index)
     if indexing.number_of_dimensions_after_index(self._original_set().number_of_dimensions(), combined_index) == 0:
         return GridPoint(combined_index, self._original_set())
     else:
         return SubGrid(self._original_set(), combined_index)
コード例 #2
0
 def get_values_in_store(self, indices, attributes, by_key=True):
     normalized_indices = indexing.normalize_slices(self.shape, indices)
     combined_index = indexing.combine_indices(self._private.indices,
                                               normalized_indices)
     result = self._private.grid.get_values_in_store(
         combined_index, attributes)
     return result
コード例 #3
0
 def set_values_in_store_async(self,
                               indices,
                               attributes,
                               values,
                               by_key=True):
     normalized_indices = indexing.normalize_slices(self.shape, indices)
     combined_index = indexing.combine_indices(self._private.indices,
                                               normalized_indices)
     return self._private.grid.set_values_in_store_async(
         combined_index, attributes, values)
コード例 #4
0
 def __getitem__(self, index):
     normalized_index= indexing.normalize_slices(self.shape,index)
     combined_index = indexing.combine_indices(self._private.indices, normalized_index)
     return new_subgrid_from_index(self._original_set(), combined_index)
コード例 #5
0
ファイル: grids.py プロジェクト: mherkazandjian/amuse
 def set_values_in_store_async(self, indices, attributes, values, by_key = True):
     normalized_indices = indexing.normalize_slices(self.shape,indices)
     combined_index = indexing.combine_indices(self._private.indices, normalized_indices)
     return self._private.grid.set_values_in_store_async(combined_index, attributes, values)
コード例 #6
0
ファイル: grids.py プロジェクト: mherkazandjian/amuse
 def get_values_in_store(self, indices, attributes, by_key = True):
     normalized_indices = indexing.normalize_slices(self.shape,indices)
     combined_index = indexing.combine_indices(self._private.indices, normalized_indices)
     result = self._private.grid.get_values_in_store(combined_index, attributes)
     return result
コード例 #7
0
ファイル: grids.py プロジェクト: Ingwar/amuse
 def __getitem__(self, index):
     normalized_index= indexing.normalize_slices(self.shape,index)
     combined_index = indexing.combine_indices(self._private.indices, normalized_index)
     return new_subgrid_from_index(self._original_set(), combined_index)