multi-vector-simulator icon indicating copy to clipboard operation
multi-vector-simulator copied to clipboard

Enable new numpy version >= 1.20

Open smartie2076 opened this issue 4 years ago • 2 comments

When the docker files on the server are updated, the numpy version is also bumped. Locally, we use numpy==1.19.X, but on the server (in the docker file), numpy==1.20.3 is used. This triggers an error message in the EPA, which it receives from the MVS API:

warnings.warn(msg, DeprecationWarning, stacklevel=2)\nDeprecationWarning: `np.complex` is a deprecated alias for the builtin `complex`. To silence this warning, use `complex` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.complex128` here.\nDeprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations\n"

Currently the case with MVS API v1.0.0 (https://mvs-eland.rl-institut.de/). There were no manual updates of the docker files on the server, two days earlier the simulation passed.

smartie2076 avatar Jul 12 '21 11:07 smartie2076

Using numpy==1.20.3 in a local MVS version, the simulation does experience errors:

D:\...\mvs_eland\win_venv\lib\site-packages\pandas\core\internals\construction.py:587: DeprecationWarning: `np.object` is a deprecated alias for the builtin `object`
. To silence this warning, use `object` by itself. Doing this will not modify any behavior and is safe.
Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
  if dtype != object and dtype != np.object:
D:\...\mvs_eland\win_venv\lib\site-packages\pandas\core\indexes\base.py:395: DeprecationWarning: `np.bool` is a deprecated alias for the builtin `bool`. To silence t
his warning, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_` here.
Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
  elif issubclass(data.dtype.type, np.bool) or is_bool_dtype(data):

But it does not terminate the simulation.

smartie2076 avatar Jul 12 '21 11:07 smartie2076

I currently fixed the api with sudo nano fastapi_app/requirements.txt by adding numpy=1.19.4 at the end and then recomposing the docker file: sudo docker-compose up -d --build

smartie2076 avatar Jul 12 '21 18:07 smartie2076