Skip to content

Commit

Permalink
change method name
Browse files Browse the repository at this point in the history
  • Loading branch information
rdemaria committed Sep 28, 2022
1 parent 225f541 commit 2445f8e
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion xobjects/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions xobjects/array.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@


from .typeutils import (
get_a_buffer,
allocate_on_buffer,
Info,
is_integer,
_to_slot_size,
Expand Down Expand Up @@ -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
)

Expand Down
4 changes: 2 additions & 2 deletions xobjects/ref.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
)

Expand Down
4 changes: 2 additions & 2 deletions xobjects/string.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
)

Expand Down
4 changes: 2 additions & 2 deletions xobjects/struct.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
from typing import Callable, Optional

from .typeutils import (
get_a_buffer,
allocate_on_buffer,
dispatch_arg,
Info,
_to_slot_size,
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion xobjects/typeutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
4 changes: 2 additions & 2 deletions xobjects/union.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
)

Expand Down

0 comments on commit 2445f8e

Please sign in to comment.