Skip to content
This repository has been archived by the owner on Jun 21, 2022. It is now read-only.

Commit

Permalink
numpy.divmod is too new for some systems
Browse files Browse the repository at this point in the history
  • Loading branch information
jpivarski committed Jun 17, 2018
1 parent cc87b52 commit d399d6c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,5 @@ install:
- "python --version"

build_script:
- "pip install numpy meta --user"
- "pip install numpy --user"
- "python setup.py test"
7 changes: 6 additions & 1 deletion awkward/jagged.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,12 @@ def __setitem__(self, where, what):
buf[startpos:stoppos] = what

elif len(starts) != 0:
startposes, offsets = numpy.divmod(starts, self._dtype.itemsize)
if hasattr(numpy, "divmod"):
startposes, offsets = numpy.divmod(starts, self._dtype.itemsize)
else:
startposes = numpy.floor_divide(starts, self._dtype.itemsize)
offsets = numpy.remainder(starts, self._dtype.itemsize)

stopposes = numpy.floor_divide(stops, self._dtype.itemsize)

if isinstance(what, JaggedArray):
Expand Down

0 comments on commit d399d6c

Please sign in to comment.