pyiron / pyiron_base

Core components of the pyiron integrated development environment (IDE) for computational materials science
https://pyiron-base.readthedocs.io
BSD 3-Clause "New" or "Revised" License
21 stars 14 forks source link

Warnings in tests #600

Open jan-janssen opened 2 years ago

jan-janssen commented 2 years ago
  1. Issue with the database class

    /home/runner/work/pyiron_base/pyiron_base/pyiron_base/database/generic.py:758: SADeprecationWarning: The LegacyRow.values() method is deprecated and will be removed in a future release.  Use the Row._mapping attribute, i.e., 'row._mapping.values()'. (deprecated since: 1.4)
    tmp_values = col.values()
  2. Issue with the database class

    /home/runner/work/pyiron_base/pyiron_base/pyiron_base/database/generic.py:760: SADeprecationWarning: The LegacyRow.values() method is deprecated and will be removed in a future release.  Use the Row._mapping attribute, i.e., 'row._mapping.values()'. (deprecated since: 1.4)
    col.values()[timestop_index] and col.values()[timestart_index]
  3. Issue with pytables - I guess there is nothing we can do

    /usr/share/miniconda/envs/test/lib/python3.10/site-packages/tables/__init__.py:24: DeprecationWarning: `np.typeDict` is a deprecated alias for `np.sctypeDict`.
    from .utilsextension import (
  4. Issue with pytables - I guess there is nothing we can do

    /usr/share/miniconda/envs/test/lib/python3.10/site-packages/tables/array.py:241: 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
    (oid, self.atom, self.shape, self._v_chunkshape) = self._open_array()
  5. Issue with pytables - I guess there is nothing we can do

    /usr/share/miniconda/envs/test/lib/python3.10/site-packages/tables/atom.py:1224: DeprecationWarning: tostring() is deprecated. Use tobytes() instead.
    return pickle.loads(array.tostring())
  6. Issue with the hdfio class

    /home/runner/work/pyiron_base/pyiron_base/pyiron_base/generic/hdfio.py:208: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray.
    result = np.array(obj.tolist())
    WARNING - Deprecated data structure! Returned array was converted from dtype='O' to dtype=int64 via `np.array(result.tolist())`.
    Please run rewrite_hdf5() to update this data! To update all your data run update_scripts/pyiron_base_0.3_to_0.4.py
    2021-12-14 20:04:24,316 - pyiron_log - WARNING - Deprecated data structure! Returned array was converted from dtype='O' to dtype=float64 via `np.array(result.tolist())`.
    Please run rewrite_hdf5() to update this data! To update all your data run update_scripts/pyiron_base_0.3_to_0.4.py
    /usr/share/miniconda/envs/test/lib/python3.10/site-packages/numpy/core/numeric.py:2446: DeprecationWarning: elementwise comparison failed; this will raise an error in the future.
    return bool(asarray(a1 == a2).all())
    2021-12-14 20:04:24,326 - pyiron_log - WARNING - Deprecated data structure! Returned array was converted from dtype='O' to dtype=int64 via `np.array(result.tolist())`.
    Please run rewrite_hdf5() to update this data! To update all your data run update_scripts/pyiron_base_0.3_to_0.4.py
    2021-12-14 20:04:24,329 - pyiron_log - WARNING - Deprecated data structure! Returned array was converted from dtype='O' to dtype=float64 via `np.array(result.tolist())`.
    Please run rewrite_hdf5() to update this data! To update all your data run update_scripts/pyiron_base_0.3_to_0.4.py
  7. Issue - I guess this one is expected as we did not instal the required dependencies

    /home/runner/work/pyiron_base/pyiron_base/pyiron_base/generic/util.py:297: ImportWarning: Reduced functionality, since ['PIL', 'nbformat'] could not be imported.
    warnings.warn(self.message, category=ImportWarning)
  8. Issue with the SQL interface

    EXCEPTION in get_items_sql:  (sqlite3.OperationalError) near "Wrong": syntax error
    [SQL: select * from simulation where A Wrong where Clause]
    (Background on this error at: https://sqlalche.me/e/14/e3q8)
    /home/runner/work/pyiron_base/pyiron_base/tests/database/test_no_database_project/test_hdf5/test and call 'python -m pyiron_base.cli wrapper -p /home/runner/work/pyiron_base/pyiron_base/tests/database/test_no_database_project/test_hdf5/test -j 7 ' 
    Traceback (most recent call last):
    File "/usr/share/miniconda/envs/test/lib/python3.10/multiprocessing/process.py", line 315, in _bootstrap
    self.run()
    File "/usr/share/miniconda/envs/test/lib/python3.10/multiprocessing/process.py", line 108, in run
    self._target(*self._args, **self._kwargs)
    File "/home/runner/work/pyiron_base/pyiron_base/pyiron_base/job/generic.py", line 1702, in multiprocess_wrapper
    job_wrap.job.run_static()
    File "/home/runner/work/pyiron_base/pyiron_base/pyiron_base/job/worker.py", line 163, in run_static
    self.run_static_with_database()
    File "/home/runner/work/pyiron_base/pyiron_base/pyiron_base/job/worker.py", line 219, in run_static_with_database
    with open(log_file, "a") as f:
    FileNotFoundError: [Errno 2] No such file or directory: '/home/runner/work/pyiron_base/pyiron_base/tests/job/test_worker/runner_hdf5/runner/worker.log'
  9. Issue inside pandas - I guess there is nothing we can do

    /usr/share/miniconda/envs/test/lib/python3.10/site-packages/pandas/core/generic.py:2703: PerformanceWarning: 
    your performance may suffer as PyTables will pickle object types that it cannot
    map directly to c-types [inferred_type->mixed,key->block1_values] [items->Index(['name', 'array'], dtype='object')]
    pytables.to_hdf(
  10. Issue inside pytables - I guess there is nothing we can do

    /usr/share/miniconda/envs/test/lib/python3.10/site-packages/tables/array.py:241: 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
    (oid, self.atom, self.shape, self._v_chunkshape) = self._open_array()
    /usr/share/miniconda/envs/test/lib/python3.10/site-packages/tables/atom.py:1224: DeprecationWarning: tostring() is deprecated. Use tobytes() instead.
    return pickle.loads(array.tostring())
jan-janssen commented 2 years ago

Following up on https://github.com/pyiron/pyiron_base/issues/553 I collected all the warnings from the tests. Half of them are related to pytables so we can not fix them from our side, but the other half might be interesting to take a look at.

niklassiemer commented 2 years ago
  1. Issue with the hdfio class
/home/runner/work/pyiron_base/pyiron_base/pyiron_base/generic/hdfio.py:208: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray.
  result = np.array(obj.tolist())
WARNING - Deprecated data structure! Returned array was converted from dtype='O' to dtype=int64 via `np.array(result.tolist())`.
Please run rewrite_hdf5() to update this data! To update all your data run update_scripts/pyiron_base_0.3_to_0.4.py
2021-12-14 20:04:24,316 - pyiron_log - WARNING - Deprecated data structure! Returned array was converted from dtype='O' to dtype=float64 via `np.array(result.tolist())`.
Please run rewrite_hdf5() to update this data! To update all your data run update_scripts/pyiron_base_0.3_to_0.4.py
/usr/share/miniconda/envs/test/lib/python3.10/site-packages/numpy/core/numeric.py:2446: DeprecationWarning: elementwise comparison failed; this will raise an error in the future.
  return bool(asarray(a1 == a2).all())
2021-12-14 20:04:24,326 - pyiron_log - WARNING - Deprecated data structure! Returned array was converted from dtype='O' to dtype=int64 via `np.array(result.tolist())`.
Please run rewrite_hdf5() to update this data! To update all your data run update_scripts/pyiron_base_0.3_to_0.4.py
2021-12-14 20:04:24,329 - pyiron_log - WARNING - Deprecated data structure! Returned array was converted from dtype='O' to dtype=float64 via `np.array(result.tolist())`.
Please run rewrite_hdf5() to update this data! To update all your data run update_scripts/pyiron_base_0.3_to_0.4.py

These come from testing the conversion behavior, where I directly test that I get back a numeric array although I stored an dtype=object array. I will try to catch the warnings and test that they are raised.