Skip to content

Commit

Permalink
move scripts to python3
Browse files Browse the repository at this point in the history
The python executable (i.e., Python version 2) is no longer available on
modern versions of Ubuntu and other distributions.
  • Loading branch information
tukss committed Sep 15, 2022
1 parent 2d46487 commit 9ac9baa
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion post_processing/convert_full3d_to_nc.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

#
# Copyright (C) 2019 by the authors of the RAYLEIGH code.
Expand Down
2 changes: 1 addition & 1 deletion post_processing/convert_full3d_to_vtu.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

#
# Copyright (C) 2018 by the authors of the RAYLEIGH code.
Expand Down
2 changes: 1 addition & 1 deletion pre_processing/rayleigh_spectral_input.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

#
# Copyright (C) 2018 by the authors of the RAYLEIGH code.
Expand Down
8 changes: 4 additions & 4 deletions tests/generic_input/run_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ cd script
../../../pre_processing/rayleigh_spectral_input.py -ar 0.35 -sd 1.0 -nt 64 -nr 48 -o bench_t_init \
-e 'import numpy as np; x = 2*radius - rmin - rmax; rmax*rmin/radius - rmin + 210*0.1*(1 - 3*x*x + 3*(x**4) - x**6)*(np.sin(theta)**4)*np.cos(4*phi)/np.sqrt(17920*np.pi)'
# then we use a custom python script using rayleigh_spectral_input.py as a module to write the magnetic initial conditions
PYTHONPATH=../../../pre_processing:$PYTHONPATH python generate_magnetic_input.py
PYTHONPATH=../../../pre_processing:$PYTHONPATH python3 generate_magnetic_input.py
# finally we run Rayleigh
mpirun -np 4 $RAYLEIGH_TEST_MPI_PARAMS ../../../bin/rayleigh.dbg
../../../post_processing/convert_full3d_to_vtu.py
Expand Down Expand Up @@ -46,16 +46,16 @@ cd ..

# then a case that generates a sparse radial generic input file
cd radial_sparse
PYTHONPATH=../../../pre_processing:$PYTHONPATH python generate_input.py
PYTHONPATH=../../../pre_processing:$PYTHONPATH python3 generate_input.py
mpirun -np 4 $RAYLEIGH_TEST_MPI_PARAMS ../../../bin/rayleigh.dbg
cd ..

# finally a version that generates a dense radial generic input file
cd radial_dense
PYTHONPATH=../../../pre_processing:$PYTHONPATH python generate_input.py
PYTHONPATH=../../../pre_processing:$PYTHONPATH python3 generate_input.py
mpirun -np 4 $RAYLEIGH_TEST_MPI_PARAMS ../../../bin/rayleigh.dbg
cd ..

# after both versions have run, we test the output for errors
PYTHONPATH=../../post_processing:../../pre_processing:$PYTHONPATH python test_output.py
PYTHONPATH=../../post_processing:../../pre_processing:$PYTHONPATH python3 test_output.py

2 changes: 1 addition & 1 deletion tests/generic_input/test_output.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

from rayleigh_diagnostics import Spherical_3D_multi, Shell_Slices
from rayleigh_spectral_input import SpectralInput, radial_extents
Expand Down

0 comments on commit 9ac9baa

Please sign in to comment.