Skip to content

Commit

Permalink
Ensured compatibility with Python 3.12
Browse files Browse the repository at this point in the history
  • Loading branch information
vruusmann committed Apr 7, 2024
1 parent e7f8bdc commit 87b87e0
Show file tree
Hide file tree
Showing 94 changed files with 41 additions and 0 deletions.
34 changes: 34 additions & 0 deletions pmml-python/src/test/java/org/jpmml/python/DumpTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,40 @@ public void python311() throws Exception {
unpicklePandasDtypes("python-3.11_pandas-2.2.0");
}

@Test
public void python312() throws Exception {
unpickle("python-3.12_dill-0.3.6.pkl");

unpickle("python-3.12_joblib-1.3.2.pkl.z");

unpickle("python-3.12_pickle-p2.pkl");
unpickle("python-3.12_pickle-p3.pkl");
unpickle("python-3.12_pickle-p4.pkl");
unpickle("python-3.12_pickle-p5.pkl");

unpickleBuiltinDtypes("python-3.12");

unpickleEnums("python-3.12");

unpickleNumpyArrays("python-3.12_numpy-1.26.2");

unpickleNumpyDtypes("python-3.12_numpy-1.26.2");

unpickleNumpyDatetimeDtypes("python-3.12_numpy-1.26.2");

unpickleNumpyRNGs("python-3.12_numpy-1.26.2");

unpicklePandasSeries("python-3.12_pandas-2.2.0");

unpicklePandasSeriesNA("python-3.12_pandas-2.2.0");

unpicklePandasCategorical("python-3.12_pandas-2.2.0");

unpicklePandasDataFrame("python-3.12_pandas-2.2.0");

unpicklePandasDtypes("python-3.12_pandas-2.2.0");
}

private void unpickleBuiltinDtypes(String prefix) throws IOException {
List<?> dtypes = (List<?>)unpickle(prefix + "_dtypes.pkl");

Expand Down
7 changes: 7 additions & 0 deletions pmml-python/src/test/java/org/jpmml/python/FunctionTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,13 @@ public void python311() throws IOException {
unpickleNumpyFunctions("python-3.11_numpy-1.26.2");
}

@Test
public void python312() throws Exception {
unpickleMathFunctions("python-3.12_math");

unpickleNumpyFunctions("python-3.12_numpy-1.26.2");
}

static
private void unpickleMathFunctions(String prefix) throws IOException {
String[] names = {"acos", "asin", "atan", "atan2", "ceil", "cos", "cosh", "degrees", "exp", "expm1", "fabs", "floor", "hypot", "isnan", "log", "log1p", "log10", "pow", "radians", "sin", "sinh", "sqrt", "tan", "tanh", "trunc"};
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 comments on commit 87b87e0

Please sign in to comment.