precice / fenics-adapter

preCICE-adapter for the open source computing platform FEniCS
GNU Lesser General Public License v3.0
27 stars 13 forks source link

Adds a warning, if python 3.6.9 is used #134

Closed BenjaminRodenberg closed 3 years ago

BenjaminRodenberg commented 3 years ago

This warns users with python 3.6.8 3.6.9. See https://github.com/precice/fenics-adapter/pull/61 for more details.

This issue was also discussed on discourse. Refer to the video posted under https://precice.discourse.group/t/fenics-adapter-installation/652/5.

IshaanDesai commented 3 years ago

Is this somehow related to https://precice.discourse.group/t/fenics-adapter-installation/652/7 ?

BenjaminRodenberg commented 3 years ago

Is this somehow related to https://precice.discourse.group/t/fenics-adapter-installation/652/7 ?

Yes and no. I think the issue on https://precice.discourse.group/t/fenics-adapter-installation/652/7 was a different one. But this problem is another problem which popped up when trying to run the tests after installing everything from scratch.

For reference. If you try to test the fenics adapter when using python 3.6.8 you might run into something like in this comment. I will also post the snippet from that comment below:

...
  File "/home/ahitrin/src/typing/src/typing2.py", line 885, in __extrahook__
    if issubclass(subclass, scls):
  File "/home/ahitrin/src/typing/src/typing.py", line 1155, in __subclasscheck__
    return super().__subclasscheck__(cls)
  File "/home/ahitrin/src/typing/.3env/lib/python3.6/abc.py", line 209, in __subclasscheck__
    ok = cls.__subclasshook__(subclass)
  File "/home/ahitrin/src/typing/src/typing.py", line 885, in __extrahook__
    if issubclass(subclass, scls):
  File "/home/ahitrin/src/typing/src/typing2.py", line 1155, in __subclasscheck__
    return super().__subclasscheck__(cls)
  File "/home/ahitrin/src/typing/.3env/lib/python3.6/abc.py", line 199, in __subclasscheck__
    if subclass in cls._abc_cache:
  File "/home/ahitrin/src/typing/.3env/lib/python3.6/_weakrefset.py", line 72, in __contains__
    wr = ref(item)
RecursionError: maximum recursion depth exceeded while calling a Python object
IshaanDesai commented 3 years ago

For reference. If you try to test the fenics adapter when using python 3.6.8 you might run into something like in this comment. I will also post the snippet from that comment below:

In https://precice.discourse.group/t/fenics-adapter-installation/652/7 the user is observing exactly the same behavior as the snippet above! I have a strong feeling that the errors are the same. In this comment the user has uploaded a video which shows exactly the same error.

precice-bot commented 3 years ago

This pull request has been mentioned on preCICE Forum on Discourse. There might be relevant details there:

https://precice.discourse.group/t/fenics-adapter-installation/652/8

BenjaminRodenberg commented 3 years ago

For reference. If you try to test the fenics adapter when using python 3.6.8 you might run into something like in this comment. I will also post the snippet from that comment below:

In https://precice.discourse.group/t/fenics-adapter-installation/652/7 the user is observing exactly the same behavior as the snippet above! I have a strong feeling that the errors are the same. In this comment the user has uploaded a video which shows exactly the same error.

Yes. Sorry I did not check the video here. I was only referring to the code snippets in https://precice.discourse.group/t/fenics-adapter-installation/652/3 and https://precice.discourse.group/t/fenics-adapter-installation/652.

I will add a link to the video above in the description of this PR.

BenjaminRodenberg commented 3 years ago

There is a mistake here: The broken python version is 3.6.9. Version 3.6.8 is ok. See results in #61. I will fix this in a moment and update the title of the issue.

HishamSaeed commented 3 years ago

Okay, i can see the error with python 3.6.9, if you check the branch add-warning-py3_6_8, when you run python3 setup.py test, it will give a warning for the python version then it will start giving errors


  warnings.warn("It seems like you are using Python version 3.6.9. There is a known bug with this Python version "
/home/hisham/.local/lib/python3.6/site-packages/setuptools/dist.py:454: UserWarning: Normalizing 'v1.1.0+13.gafbc241' to '1.1.0+13.gafbc241'
  warnings.warn(tmpl.format(**locals()))
running test
WARNING: Testing via this command is deprecated and will be removed in a future version. Users looking for a generic test entry point independent of test runner are encouraged to use tox.
running egg_info
writing fenicsprecice.egg-info/PKG-INFO
writing dependency_links to fenicsprecice.egg-info/dependency_links.txt
writing requirements to fenicsprecice.egg-info/requires.txt
writing top-level names to fenicsprecice.egg-info/top_level.txt
reading manifest file 'fenicsprecice.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'fenicsprecice.egg-info/SOURCES.txt'
running build_ext
test_version (tests.integration.test_fenicsprecice.TestAdapter) ... ok
test_checkpoint_mechanism (tests.integration.test_fenicsprecice.TestCheckpointing) ... ERROR
test_update_expression_scalar (tests.integration.test_fenicsprecice.TestExpressionHandling) ... ERROR
test_update_expression_vector (tests.integration.test_fenicsprecice.TestExpressionHandling) ... ERROR
test_scalar_read (tests.integration.test_write_read.TestWriteandReadData) ... ERROR
test_scalar_write (tests.integration.test_write_read.TestWriteandReadData) ... ERROR
test_vector_read (tests.integration.test_write_read.TestWriteandReadData) ... ERROR
test_vector_write (tests.integration.test_write_read.TestWriteandReadData) ... ERROR
test_convert_fenics_to_precice (tests.unit.test_adapter_core.TestAdapterCore) ... ERROR
test_get_coupling_boundary_edges (tests.unit.test_adapter_core.TestAdapterCore) ... ok

======================================================================
ERROR: test_checkpoint_mechanism (tests.integration.test_fenicsprecice.TestCheckpointing)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python3.6/unittest/mock.py", line 1602, in _inner
    return f(*args, **kw)
  File "/home/hisham/Masters/Precice_Work/Solvers_And_Adapters/Fenics/fenics-adapter/tests/integration/test_fenicsprecice.py", line 76, in test_checkpoint_mechanism
    import fenicsprecice
  File "/home/hisham/Masters/Precice_Work/Solvers_And_Adapters/Fenics/fenics-adapter/fenicsprecice/__init__.py", line 9, in <module>
    from .fenicsprecice import Adapter
  File "/home/hisham/Masters/Precice_Work/Solvers_And_Adapters/Fenics/fenics-adapter/fenicsprecice/fenicsprecice.py", line 12, in <module>
    from .expression_core import SegregatedRBFInterpolationExpression, EmptyExpression
  File "/home/hisham/Masters/Precice_Work/Solvers_And_Adapters/Fenics/fenics-adapter/fenicsprecice/expression_core.py", line 7, in <module>
    from scipy.interpolate import Rbf
  File "/home/hisham/.local/lib/python3.6/site-packages/scipy/__init__.py", line 159, in <module>
    from . import fft
  File "/home/hisham/.local/lib/python3.6/site-packages/scipy/fft/__init__.py", line 74, in <module>
    from ._basic import (
  File "/home/hisham/.local/lib/python3.6/site-packages/scipy/fft/_basic.py", line 1, in <module>
    from scipy._lib.uarray import generate_multimethod, Dispatchable
  File "/home/hisham/.local/lib/python3.6/site-packages/scipy/_lib/uarray.py", line 28, in <module>

  File "/usr/lib/python3.6/abc.py", line 209, in __subclasscheck__
    ok = cls.__subclasshook__(subclass)
  File "/usr/lib/python3.6/typing.py", line 884, in __extrahook__
    if issubclass(subclass, scls):
  File "/usr/lib/python3.6/typing.py", line 1154, in __subclasscheck__
    return super().__subclasscheck__(cls)
  File "/usr/lib/python3.6/abc.py", line 209, in __subclasscheck__
    ok = cls.__subclasshook__(subclass)
  File "/usr/lib/python3.6/typing.py", line 884, in __extrahook__
    if issubclass(subclass, scls):
  File "/usr/lib/python3.6/typing.py", line 1154, in __subclasscheck__
    return super().__subclasscheck__(cls)
  File "/usr/lib/python3.6/abc.py", line 199, in __subclasscheck__
    if subclass in cls._abc_cache:
RecursionError: maximum recursion depth exceeded while calling a Python object```

and 8 tests fails
precice-bot commented 3 years ago

This pull request has been mentioned on preCICE Forum on Discourse. There might be relevant details there:

https://precice.discourse.group/t/fenics-adapter-installation/652/10