1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106
|
Description: Minor changes for python3
Author: Alastair McKinstry <mckinsrty@debian.org>
Last-Updated: 2025-06-03
Forwarded: no
2025-06-03:
Updated to use python3 instead of python as executable.
--- a/Test/test_python_CMIP6_CV_bad_data_specs.py
+++ b/Test/test_python_CMIP6_CV_bad_data_specs.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2.7
+#!/usr/bin/python3
# If this example is not executed from the directory containing the
# CMOR code, please first complete the following steps:
#
@@ -28,14 +28,14 @@
error_flag = cmor.dataset_json('Test/CMOR_input_TestTables.json')
table_id = cmor.load_table('CMIP6_6hrLev_bad_specs.json')
time = cmor.axis(table_entry='time1', units='days since 2000-01-01',
- coord_vals=numpy.array(range(1)),
- cell_bounds=numpy.array(range(2)))
+ coord_vals=numpy.array(list(range(1))),
+ cell_bounds=numpy.array(list(range(2))))
latitude = cmor.axis(table_entry='latitude', units='degrees_north',
- coord_vals=numpy.array(range(5)),
- cell_bounds=numpy.array(range(6)))
+ coord_vals=numpy.array(list(range(5))),
+ cell_bounds=numpy.array(list(range(6))))
longitude = cmor.axis(table_entry='longitude', units='degrees_east',
- coord_vals=numpy.array(range(5)),
- cell_bounds=numpy.array(range(6)))
+ coord_vals=numpy.array(list(range(5))),
+ cell_bounds=numpy.array(list(range(6))))
plev3 = cmor.axis(table_entry='plev3', units='Pa',
coord_vals=numpy.array([85000., 50000., 25000.]))
axis_ids = [longitude, latitude, plev3, time]
@@ -57,4 +57,4 @@
self.assertCV("data_specs_version")
if __name__ == '__main__':
- unittest.main()
\ No newline at end of file
+ unittest.main()
--- a/LibCV/PrePARE/PrePARE.py
+++ b/LibCV/PrePARE/PrePARE.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/python3
# -*- coding: utf-8 -*-
#
# Please first complete the following steps:
--- a/configure.ac
+++ b/configure.ac
@@ -125,7 +125,7 @@
if [ test ${with_cdatb} != "-yes" ] ; then
if [ test ${with_cdatb} != "-no" ] ; then
PYTHONEXEC=${with_cdat}/bin/cdat
- MAKEDEPPYTHON="python"
+ MAKEDEPPYTHON="python3"
MAKETESTPYTHON="test_python"
CDATPREFIX="--prefix="${with_cdat}
else
@@ -134,19 +134,19 @@
fi
else
PYTHONEXEC="cdat"
- MAKEDEPPYTHON="python"
+ MAKEDEPPYTHON="python3"
MAKETESTPYTHON="test_python"
fi
AC_ARG_WITH([python],[AS_HELP_STRING([--with-python],[enable support for python put path root (w/o bin/python)])],[],[with_python="no"])
with_pythonb="-"${with_python}
if [ test ${with_pythonb} != "-yes" ] ; then
if [ test ${with_pythonb} != "-no" ] ; then
- PYTHONEXEC=${with_python}/bin/python
- MAKEDEPPYTHON="python"
+ PYTHONEXEC=${with_python}/bin/python3
+ MAKEDEPPYTHON="python3"
fi
else
- PYTHONEXEC="python"
- MAKEDEPPYTHON="python"
+ PYTHONEXEC="python3"
+ MAKEDEPPYTHON="python3"
fi
AC_SUBST(CDATPREFIX)
--- a/Makefile.in
+++ b/Makefile.in
@@ -149,13 +149,13 @@
env TEST_NAME=test_lots_of_variables make test_a_C
# do something Linux-y
endif
-python:
+python3:
@echo "Building Python interface"
LDSHARED=${LDSHARED} ${PYTHONEXEC} -m pip install --no-deps $(srcdir)
test_a_python:
@echo "${OK_COLOR}Testing ${TEST_NAME} ${NO_COLOR}"
${PYTHONEXEC} ${TEST_NAME} ${VERB}
-test_python: python
+test_python: python3
env TEST_NAME=Test/test_non_monotonic_climo_bounds.py make test_a_python
# [missing] env TEST_NAME=Test/test_python_climatology.py make test_a_python
env TEST_NAME=Test/test_python_history.py make test_a_python
|