Skip to content

Commit

Permalink
Make sure numpy >= 1.16.0 is installed for fast pickling support (ray…
Browse files Browse the repository at this point in the history
…-project#6486)

* Make sure numpy >= 1.16.0 is installed

* Works for 1.15.4

* lint

* formatting

* update

* put check into the right place

* lint
  • Loading branch information
pcmoritz authored and edoakes committed Dec 15, 2019
1 parent 1c389fc commit 93157e0
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
10 changes: 10 additions & 0 deletions python/ray/parameter.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

import logging

import numpy as np
from packaging import version

import ray.ray_constants as ray_constants


Expand Down Expand Up @@ -207,3 +210,10 @@ def _check_usage(self):
if self.redirect_output is not None:
raise DeprecationWarning(
"The redirect_output argument is deprecated.")

if self.use_pickle:
assert (version.parse(
np.__version__) >= version.parse("1.16.0")), (
"numpy >= 1.16.0 required for use_pickle=True support. "
"You can use ray.init(use_pickle=False) for older numpy "
"versions, but this may be removed in future versions.")
3 changes: 3 additions & 0 deletions python/ray/serialization.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function

import hashlib
import io
import logging
import time

import pyarrow
import pyarrow.plasma as plasma

import ray.cloudpickle as pickle
from ray import ray_constants, JobID
import ray.utils
Expand Down
2 changes: 1 addition & 1 deletion python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ def find_version(*filepath):


requires = [
"numpy >= 1.14",
"numpy >= 1.16",
"filelock",
"jsonschema",
"funcsigs",
Expand Down

0 comments on commit 93157e0

Please sign in to comment.