From 2445f8e916bc69fe5c374477eed0d488bc8af731 Mon Sep 17 00:00:00 2001 From: Riccardo De Maria Date: Wed, 28 Sep 2022 12:05:23 +0200 Subject: [PATCH] change method name --- xobjects/__init__.py | 2 +- xobjects/array.py | 4 ++-- xobjects/ref.py | 4 ++-- xobjects/string.py | 4 ++-- xobjects/struct.py | 4 ++-- xobjects/typeutils.py | 2 +- xobjects/union.py | 4 ++-- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/xobjects/__init__.py b/xobjects/__init__.py index de86177..a642585 100644 --- a/xobjects/__init__.py +++ b/xobjects/__init__.py @@ -28,7 +28,7 @@ from .specialize_source import specialize_source -from .typeutils import context_default, get_a_buffer +from .typeutils import context_default, allocate_on_buffer from .hybrid_class import JEncoder, HybridClass, MetaHybridClass, ThisClass diff --git a/xobjects/array.py b/xobjects/array.py index c525fac..91b6664 100644 --- a/xobjects/array.py +++ b/xobjects/array.py @@ -9,7 +9,7 @@ from .typeutils import ( - get_a_buffer, + allocate_on_buffer, Info, is_integer, _to_slot_size, @@ -504,7 +504,7 @@ def __init__(self, *args, _context=None, _buffer=None, _offset=None): cls = self.__class__ info = cls._inspect_args(*args) - self._buffer, self._offset = get_a_buffer( + self._buffer, self._offset = allocate_on_buffer( info.size, _context, _buffer, _offset ) diff --git a/xobjects/ref.py b/xobjects/ref.py index 0bcf685..5a4d3ee 100644 --- a/xobjects/ref.py +++ b/xobjects/ref.py @@ -7,7 +7,7 @@ import numpy as np -from .typeutils import Info, dispatch_arg, get_a_buffer, default_conf +from .typeutils import Info, dispatch_arg, allocate_on_buffer, default_conf from .scalar import Int64 from .array import Array @@ -235,7 +235,7 @@ def __init__( args, _ = self._pre_init(*args, **kwargs) - self._buffer, self._offset = get_a_buffer( + self._buffer, self._offset = allocate_on_buffer( cls._size, _context, _buffer, _offset ) diff --git a/xobjects/string.py b/xobjects/string.py index fad2eda..01527d0 100644 --- a/xobjects/string.py +++ b/xobjects/string.py @@ -31,7 +31,7 @@ - consider adding size in the class """ -from .typeutils import get_a_buffer, Info, _to_slot_size, is_integer +from .typeutils import allocate_on_buffer, Info, _to_slot_size, is_integer from .scalar import Int64 from .array import Array @@ -109,7 +109,7 @@ def __init__( ): info = self.__class__._inspect_args(string_or_int) size = info.size - self._buffer, self._offset = get_a_buffer( + self._buffer, self._offset = allocate_on_buffer( size, _context, _buffer, _offset ) diff --git a/xobjects/struct.py b/xobjects/struct.py index eea8576..a850b83 100644 --- a/xobjects/struct.py +++ b/xobjects/struct.py @@ -49,7 +49,7 @@ from typing import Callable, Optional from .typeutils import ( - get_a_buffer, + allocate_on_buffer, dispatch_arg, Info, _to_slot_size, @@ -351,7 +351,7 @@ def __init__( info = cls._inspect_args(*args, **kwargs) self._size = info.size # acquire buffer - self._buffer, self._offset = get_a_buffer( + self._buffer, self._offset = allocate_on_buffer( info.size, _context, _buffer, _offset ) # if dynamic struct store dynamic offsets diff --git a/xobjects/typeutils.py b/xobjects/typeutils.py index 225c544..b5ade9d 100644 --- a/xobjects/typeutils.py +++ b/xobjects/typeutils.py @@ -10,7 +10,7 @@ context_default = ContextCpu() -def get_a_buffer(size, context=None, buffer=None, offset=None): +def allocate_on_buffer(size, context=None, buffer=None, offset=None): if buffer is None: if offset is not None: raise ValueError("Cannot set `offset` without buffer") diff --git a/xobjects/union.py b/xobjects/union.py index 6e9cdc6..6851fbe 100644 --- a/xobjects/union.py +++ b/xobjects/union.py @@ -5,7 +5,7 @@ import numpy as np -from .typeutils import get_a_buffer, Info +from .typeutils import allocate_on_buffer, Info from .scalar import Int64 from .array import Array @@ -127,7 +127,7 @@ def _to_buffer(cls, buffer, offset, value, info=None): def __init__(self, *args, _context=None, _buffer=None, _offset=None): info = self.__class__._inspect_args(*args) - self._buffer, self._offset = get_a_buffer( + self._buffer, self._offset = allocate_on_buffer( info.size, _context, _buffer, _offset )