Skip to content

Commit

Permalink
Closes #3742: move numeric module to arkouda.numpy (#3743)
Browse files Browse the repository at this point in the history
Co-authored-by: Amanda Potts <ajpotts@users.noreply.github.com>
  • Loading branch information
ajpotts and ajpotts committed Sep 11, 2024
1 parent 95cbb1b commit 337b2e7
Show file tree
Hide file tree
Showing 29 changed files with 2,718 additions and 2,734 deletions.
1 change: 0 additions & 1 deletion arkouda/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
from arkouda.pdarraysetops import *
from arkouda.pdarraycreation import *
from arkouda.pdarraymanipulation import *
from arkouda.numeric import *
from arkouda.groupbyclass import *
from arkouda.strings import *
from arkouda.join import *
Expand Down
5 changes: 2 additions & 3 deletions arkouda/alignment.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@

from arkouda.categorical import Categorical
from arkouda.client import generic_msg
from arkouda.groupbyclass import GroupBy, broadcast, unique
from arkouda.numpy import cumsum, where
from arkouda.numpy.dtypes import bigint
from arkouda.numpy.dtypes import float64 as akfloat64
from arkouda.numpy.dtypes import int64 as akint64
from arkouda.numpy.dtypes import uint64 as akuint64
from arkouda.groupbyclass import GroupBy, broadcast, unique
from arkouda.numeric import cumsum, where
from arkouda.pdarrayclass import create_pdarray, pdarray
from arkouda.pdarraycreation import arange, full, ones, zeros
from arkouda.pdarraysetops import concatenate, in1d
Expand Down Expand Up @@ -236,7 +236,6 @@ def find(query, space, all_occurrences=False, remove_missing=False):

# create a segarray which contains all the indices from query
# in our search space, instead of just the min for each segment

# im not completely convinced there's not a better way to get this given the
# amount of structure but this is not the bottleneck of the computation anymore
min_k_vals = i[g.permutation][less_than]
Expand Down
17 changes: 8 additions & 9 deletions arkouda/array_api/searching_functions.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
from __future__ import annotations

from .array_object import Array
from ._dtypes import _real_numeric_dtypes, _real_floating_dtypes

from typing import Optional, Tuple, Literal, cast

from .manipulation_functions import squeeze, reshape, broadcast_arrays
from typing import Literal, Optional, Tuple, cast

import arkouda as ak
from arkouda.client import generic_msg
from arkouda.pdarrayclass import parse_single_value, create_pdarray, create_pdarrays
from arkouda.numpy import cast as akcast
from arkouda.pdarrayclass import create_pdarray, create_pdarrays, parse_single_value
from arkouda.pdarraycreation import scalar_array
from arkouda.numeric import cast as akcast
import arkouda as ak

from ._dtypes import _real_floating_dtypes, _real_numeric_dtypes
from .array_object import Array
from .manipulation_functions import broadcast_arrays, reshape, squeeze


def argmax(x: Array, /, *, axis: Optional[int] = None, keepdims: bool = False) -> Array:
Expand Down
2 changes: 1 addition & 1 deletion arkouda/array_api/statistical_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
import numpy as np

from arkouda.client import generic_msg
from arkouda.numpy import cast as akcast
from arkouda.numpy.dtypes import dtype as akdtype
from arkouda.numeric import cast as akcast
from arkouda.pdarrayclass import create_pdarray, parse_single_value
from arkouda.pdarraycreation import scalar_array

Expand Down
4 changes: 2 additions & 2 deletions arkouda/categorical.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
from arkouda.groupbyclass import GroupBy, unique
from arkouda.infoclass import information
from arkouda.logger import getArkoudaLogger
from arkouda.numeric import cast as akcast
from arkouda.numeric import where
from arkouda.numpy import cast as akcast
from arkouda.numpy import where
from arkouda.numpy.dtypes import bool_ as akbool
from arkouda.numpy.dtypes import dtype as akdtype
from arkouda.numpy.dtypes import int64 as akint64
Expand Down
6 changes: 3 additions & 3 deletions arkouda/client_dtypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
import numpy as np
from typeguard import typechecked

from arkouda.groupbyclass import GroupBy, broadcast
from arkouda.numpy import cast as akcast
from arkouda.numpy import where
from arkouda.numpy.dtypes import bitType, intTypes, isSupportedInt
from arkouda.numpy.dtypes import uint64 as akuint64
from arkouda.groupbyclass import GroupBy, broadcast
from arkouda.numeric import cast as akcast
from arkouda.numeric import where
from arkouda.pdarrayclass import RegistrationError, pdarray
from arkouda.pdarraycreation import arange, array, create_pdarray, zeros
from arkouda.strings import Strings
Expand Down
14 changes: 7 additions & 7 deletions arkouda/dataframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,18 @@
from arkouda.categorical import Categorical
from arkouda.client import generic_msg, maxTransferBytes
from arkouda.client_dtypes import BitVector, Fields, IPv4
from arkouda.numpy.dtypes import bigint
from arkouda.numpy.dtypes import bool_ as akbool
from arkouda.numpy.dtypes import float64 as akfloat64
from arkouda.numpy.dtypes import int64 as akint64
from arkouda.numpy.dtypes import uint64 as akuint64
from arkouda.groupbyclass import GROUPBY_REDUCTION_TYPES
from arkouda.groupbyclass import GroupBy as akGroupBy
from arkouda.groupbyclass import unique
from arkouda.index import Index, MultiIndex
from arkouda.join import inner_join
from arkouda.numeric import cast as akcast
from arkouda.numeric import cumsum, where
from arkouda.numpy import cast as akcast
from arkouda.numpy import cumsum, where
from arkouda.numpy.dtypes import bigint
from arkouda.numpy.dtypes import bool_ as akbool
from arkouda.numpy.dtypes import float64 as akfloat64
from arkouda.numpy.dtypes import int64 as akint64
from arkouda.numpy.dtypes import uint64 as akuint64
from arkouda.pdarrayclass import RegistrationError, pdarray
from arkouda.pdarraycreation import arange, array, create_pdarray, full, zeros
from arkouda.pdarraysetops import concatenate, in1d, intersect1d
Expand Down
8 changes: 4 additions & 4 deletions arkouda/groupbyclass.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@
from typeguard import typechecked

from arkouda.client import generic_msg
from arkouda.logger import getArkoudaLogger
from arkouda.numpy.dtypes import _val_isinstance_of_union, bigint
from arkouda.numpy.dtypes import float64 as akfloat64
from arkouda.numpy.dtypes import float_scalars
from arkouda.numpy.dtypes import int64 as akint64
from arkouda.numpy.dtypes import int_scalars
from arkouda.numpy.dtypes import uint64 as akuint64
from arkouda.logger import getArkoudaLogger
from arkouda.pdarrayclass import RegistrationError, create_pdarray, is_sorted, pdarray
from arkouda.pdarraycreation import arange, full
from arkouda.random import default_rng
Expand Down Expand Up @@ -262,7 +262,7 @@ def __init__(
dropna: bool = True,
**kwargs,
):
from arkouda.numeric import isnan
from arkouda.numpy import isnan

def drop_na_keys():
if self.dropna is True:
Expand Down Expand Up @@ -1733,8 +1733,8 @@ def sample(
if return_indices is True, return the indices of the sampled values.
Otherwise, return the sample values.
"""
from arkouda.numeric import cast as akcast
from arkouda.numeric import round as akround
from arkouda.numpy import cast as akcast
from arkouda.numpy import round as akround

if frac is not None and n is not None:
raise ValueError("Please enter a value for `frac` OR `n`, not both")
Expand Down
4 changes: 2 additions & 2 deletions arkouda/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
from typeguard import typechecked

from arkouda import Categorical, Strings
from arkouda.groupbyclass import GroupBy, unique
from arkouda.numpy import cast as akcast
from arkouda.numpy.dtypes import bool_ as akbool
from arkouda.numpy.dtypes import float64 as akfloat64
from arkouda.numpy.dtypes import int64 as akint64
from arkouda.groupbyclass import GroupBy, unique
from arkouda.numeric import cast as akcast
from arkouda.pdarrayclass import RegistrationError, pdarray
from arkouda.pdarraycreation import arange, array, create_pdarray, ones
from arkouda.pdarraysetops import argsort, in1d
Expand Down
4 changes: 2 additions & 2 deletions arkouda/join.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
from arkouda.alignment import right_align
from arkouda.categorical import Categorical
from arkouda.client import generic_msg
from arkouda.groupbyclass import GroupBy, broadcast
from arkouda.numpy import cumsum
from arkouda.numpy.dtypes import NUMBER_FORMAT_STRINGS
from arkouda.numpy.dtypes import int64 as akint64
from arkouda.numpy.dtypes import resolve_scalar_dtype
from arkouda.groupbyclass import GroupBy, broadcast
from arkouda.numeric import cumsum
from arkouda.pdarrayclass import create_pdarray, pdarray
from arkouda.pdarraycreation import arange, array, ones, zeros
from arkouda.pdarraysetops import concatenate, in1d
Expand Down
Loading

0 comments on commit 337b2e7

Please sign in to comment.