Add python3.x support
This issue has been created to concentrate efforts on the python 3 release of hysop (see associated branch). It is also the time to clean up hysop directory. We need to check if all dependencies have been ported to python3 and port our own incompatibilities using six or alternative modules.
Python3.8 is now installed by default on recent ubuntu images so this will represent our standard python3 environment. We also support python 3.9. Python 3.5 - 3.7 may work but are not supported officially.
Enhancements:
-
Create a docker image with python3, update CI image -
Fix build with gfortran 10+ -
Fix regressions with sympy polynomials -
Fix regressions with h5py -
Fix regressions with gpyfft/clFFT by keeping a reference on all plans -
Hysop cache directory now depends on python version. -
hysop_examples/example_utils.py becomes argparser.py -
Get rid of old var or dict() syntax -
Remove ugly and slow hysop.deps -
Cleanup of hysop base directory and build scripts -
Remove deprecated simulation.should_dump
Syntaxic sugar:
-
Fix print/xrange/iteritems -
Fix unicode strings -
Fix metaclasses -
Fix method generation with exec -
Fix variables named async (new python keyword) -
Remove long and long -
Fix div to truediv, idiv to itruediv and rdiv to rtruediv -
Fix string translate -
Fix broken integer division -
Fix range/map/filter/sorted iterators vs list -
Fix dict.keys(), dict.values() and dict.items() not being subscriptable -
Fix string character escapes -
Fix unhashable types -
Fix new object.new and object.init behaviour -
Fix min, max not ignoring None values -
Fix bytes vs strings -
Remove builtin and future -
Get rid of future-like modules -
Fix python commands in build scripts and shebangs -
Update requirements.txt
Tests:
-
import hysop -
core/arrays/tests/test_array.py -
core/graph/tests/test_graph.py -
fields/tests/test_fields.py -
numerics/tests/test_fft.py -
operator/tests/test_analytic.py -
operator/tests/test_transpose.py -
operator/tests/test_fd_derivative.py -
operator/tests/test_absorption.py -
operator/tests/test_penalization.py -
operator/tests/test_velocity_correction.py -
operator/tests/test_restriction_filter.py -
operator/tests/test_directional_advection.py -
operator/tests/test_directional_diffusion.py -
operator/tests/test_directional_stretching.py -
operator/tests/test_custom_symbolic.py -
operator/tests/test_spectral_derivative.py -
operator/tests/test_spectral_curl.py -
operator/tests/test_diffusion.py -
operator/tests/test_poisson.py -
operator/tests/test_solenoidal_projection.py -
operator/tests/test_poisson_curl.py -
fields/tests/test_cartesian.sh -
core/tests/test_checkpoint.sh
Running examples:
-
analytic/analytic.py -
scalar_diffusion/scalar_diffusion.py -
scalar_advection/scalar_advection.py -
scalar_advection/levelset.py -
multiresolution/scalar_advection.py -
shear_layer/shear_layer.py -
taylor_green/taylor_green.py (python) -
taylor_green/taylor_green.py (opencl) -
bubble/periodic_bubble.py -
bubble/periodic_bubble_levelset.py -
bubble/periodic_bubble_levelset_penalization.py -
bubble/periodic_jet_levelset.py -
particles_above_salt/particles_above_salt_periodic.py -
particles_above_salt/particles_above_salt_symmetrized.py
Validation:
-
Levelset advection: volume is preserved -
Taylor-Green: Enstrophy curves are good
Edited by Jean-Baptiste Keck