From ee78df31cce3fd24adddd56351c26f8c7088e96d Mon Sep 17 00:00:00 2001 From: wyq Date: Wed, 24 Jul 2024 22:56:03 +0800 Subject: [PATCH] update array's astype function --- .../java/org/meteoinfo/chart/axis/Axis.java | 14 +-- meteoinfo-lab/milconfig.xml | 16 +-- .../mipylib/numeric/core/_dtype$py.class | Bin 15959 -> 16179 bytes .../pylib/mipylib/numeric/core/_dtype.py | 9 ++ .../pylib/mipylib/numeric/core/_ndarray.py | 23 ++-- .../org/meteoinfo/ndarray/ArrayDouble.java | 18 +++- .../org/meteoinfo/ndarray/ArrayString.java | 102 +++++++++--------- .../org/meteoinfo/ndarray/math/ArrayUtil.java | 70 ++++++++++++ 8 files changed, 169 insertions(+), 83 deletions(-) diff --git a/meteoinfo-chart/src/main/java/org/meteoinfo/chart/axis/Axis.java b/meteoinfo-chart/src/main/java/org/meteoinfo/chart/axis/Axis.java index d94473bd..ef70ac1c 100644 --- a/meteoinfo-chart/src/main/java/org/meteoinfo/chart/axis/Axis.java +++ b/meteoinfo-chart/src/main/java/org/meteoinfo/chart/axis/Axis.java @@ -1624,31 +1624,27 @@ public class Axis extends Artist implements Cloneable { } //Time label - left if (this.drawTickLabel) { - DateTimeFormatter format; if (this instanceof TimeAxis) { TimeAxis tAxis = (TimeAxis) this; if (tAxis.isVarFormat()) { - drawStr = null; + int idx = this.inverse ? this.getTickValues().length - 1 : 0; + LocalDateTime cDate = JDateUtil.fromOADate(this.getTickValues()[idx]); + DateTimeFormatter format = null; switch (tAxis.getTimeUnit()) { case MONTH: format = DateTimeFormatter.ofPattern("yyyy"); - LocalDateTime cdate = JDateUtil.fromOADate(this.getTickValues()[0]); - drawStr = format.format(cdate); break; case DAY: format = DateTimeFormatter.ofPattern("yyyy-MM"); - cdate = JDateUtil.fromOADate(this.getTickValues()[0]); - drawStr = format.format(cdate); break; case HOUR: case MINUTE: case SECOND: format = DateTimeFormatter.ofPattern("yyyy-MM-dd"); - cdate = JDateUtil.fromOADate(this.getTickValues()[0]); - drawStr = format.format(cdate); break; } - if (drawStr != null) { + if (format != null) { + drawStr = format.format(cDate); labx = (float) minx; laby = laby + this.tickSpace; Draw.drawString(g, labx, laby, drawStr, XAlign.LEFT, YAlign.TOP, true); diff --git a/meteoinfo-lab/milconfig.xml b/meteoinfo-lab/milconfig.xml index 1bf2b597..a1700e12 100644 --- a/meteoinfo-lab/milconfig.xml +++ b/meteoinfo-lab/milconfig.xml @@ -1,14 +1,11 @@ - - - + - @@ -16,17 +13,20 @@ + + + - - + + - - + + diff --git a/meteoinfo-lab/pylib/mipylib/numeric/core/_dtype$py.class b/meteoinfo-lab/pylib/mipylib/numeric/core/_dtype$py.class index 0987351dee59bdfe2f6fd83fbe72da9a8d61bfb9..25df6918ce60263d5330cc621f2c82b4e4d97a12 100644 GIT binary patch delta 5354 zcma)AdvH|M89yi4O?F9uo3nYX!42ucn&f5!;gtur@~Y3eg~lO+!mLTiP%LDX210CcBh!MZx%oB}vwl407Mm_8nn2JW{$J*t~Z8Xz8 z!@q_z5nHlg%#A%=zl?Q`X^$=G7&Egcm#wAWyT^FevkhLhj%}nv#YGemp6pz*CD_tNH^srr3vmyB|^j5698 z>s-;XBo>WwmR(tOZ9dz>_R7@L3=!boD%jR$W)cPwrmCagIqkQsIb4Vt7CCA zn$HfiUG!S+1Q!BXM{dt_zMZb{tmJ)k(lfwU^l$Qpv-mDLnl~2mpLunV<@r+1Qt}ol z`=7|aE{m_Gg5fvwb<{Wfd+;`EZ)Wjz{qud7aSV?YUc&QMv#cTP7=JRKZSOx{6z1-} z(-jNn^;eb@aPMk%oH16)w$rrI2fXK54s$b>vxLr-p6A7M+CMoSO|a|2(VS?rE{YRu zwrExFxhe0Sly_~A(5?vDAfv;W7^Ea8yq1jxhQ<&~#0{^>nLJBnp`ntWIx*Cm_?4kC zEOlbIHL=*x&{8J~tch46E_bg9Yvv|{<4c_=v?hLSXcR@8wc=-3ev`}Z$`&J={VtcN zgmjCgkU63oGFMbXdPFUxmLqE9kSiw1!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=C8L!R0`cj@phw6)YIh}>9p>aq**&B*^6ZslScr*R1p`0(F%?&EQiH-X~A^sc`E|J?Z6U(QccW}}y%qZ=T{N4px&$NvvC CA!Q2y diff --git a/meteoinfo-lab/pylib/mipylib/numeric/core/_dtype.py b/meteoinfo-lab/pylib/mipylib/numeric/core/_dtype.py index b8a66647..1c8ed457 100644 --- a/meteoinfo-lab/pylib/mipylib/numeric/core/_dtype.py +++ b/meteoinfo-lab/pylib/mipylib/numeric/core/_dtype.py @@ -7,16 +7,25 @@ __all__ = [ _dtype_dict = dict(byte = JDataType.BYTE, char = JDataType.CHAR, + bool = JDataType.BOOLEAN, boolean = JDataType.BOOLEAN, int = JDataType.INT, + int32 = JDataType.INT, + integer = JDataType.INT, uint = JDataType.UINT, short = JDataType.SHORT, + int16 = JDataType.SHORT, long = JDataType.LONG, + int64 = JDataType.LONG, float = JDataType.FLOAT, + float32 = JDataType.FLOAT, double = JDataType.DOUBLE, + float64 = JDataType.DOUBLE, + str = JDataType.STRING, string = JDataType.STRING, complex = JDataType.COMPLEX, date = JDataType.DATE, + datetime = JDataType.DATE, object = JDataType.OBJECT) class DataType(object): diff --git a/meteoinfo-lab/pylib/mipylib/numeric/core/_ndarray.py b/meteoinfo-lab/pylib/mipylib/numeric/core/_ndarray.py index 97d95ef5..d32e10c9 100644 --- a/meteoinfo-lab/pylib/mipylib/numeric/core/_ndarray.py +++ b/meteoinfo-lab/pylib/mipylib/numeric/core/_ndarray.py @@ -717,17 +717,18 @@ class NDArray(object): if self.dtype == dtype: return self.copy() - if dtype.kind == 'i': - r = NDArray(ArrayUtil.toInteger(self._array)) - elif dtype.kind == 'f': - if dtype.name == 'float': - r = NDArray(ArrayUtil.toFloat(self._array)) - else: - r = NDArray(ArrayUtil.toDouble(self._array)) - elif dtype.kind == 'b': - r = NDArray(ArrayUtil.toBoolean(self._array)) - else: - r = self + # if dtype.kind == 'i': + # r = NDArray(ArrayUtil.toInteger(self._array)) + # elif dtype.kind == 'f': + # if dtype.name == 'float': + # r = NDArray(ArrayUtil.toFloat(self._array)) + # else: + # r = NDArray(ArrayUtil.toDouble(self._array)) + # elif dtype.kind == 'b': + # r = NDArray(ArrayUtil.toBoolean(self._array)) + # else: + # r = self + r = NDArray(ArrayUtil.convertToDataType(self._array, dtype._dtype)) return r @property diff --git a/meteoinfo-ndarray/src/main/java/org/meteoinfo/ndarray/ArrayDouble.java b/meteoinfo-ndarray/src/main/java/org/meteoinfo/ndarray/ArrayDouble.java index a21c5a8d..7c8c1e17 100644 --- a/meteoinfo-ndarray/src/main/java/org/meteoinfo/ndarray/ArrayDouble.java +++ b/meteoinfo-ndarray/src/main/java/org/meteoinfo/ndarray/ArrayDouble.java @@ -32,6 +32,8 @@ */ package org.meteoinfo.ndarray; +import org.meteoinfo.common.util.JDateUtil; + import java.nio.ByteBuffer; import java.nio.DoubleBuffer; import java.time.LocalDateTime; @@ -266,9 +268,13 @@ public class ArrayDouble extends Array { throw new ForbiddenConversionException(); } - public LocalDateTime getDate(Index i) { throw new ForbiddenConversionException(); } + public LocalDateTime getDate(Index i) { + return JDateUtil.fromOADate(storageD[i.currentElement()]); + } - public void setDate(Index i, LocalDateTime value) { throw new ForbiddenConversionException(); } + public void setDate(Index i, LocalDateTime value) { + storageD[i.currentElement()] = JDateUtil.toOADate(value); + } public Object getObject(Index i) { return storageD[i.currentElement()]; @@ -363,9 +369,13 @@ public class ArrayDouble extends Array { throw new ForbiddenConversionException(); } - public LocalDateTime getDate(int index) { throw new ForbiddenConversionException(); } + public LocalDateTime getDate(int index) { + return JDateUtil.fromOADate(storageD[index]); + } - public void setDate(int index, LocalDateTime value) { throw new ForbiddenConversionException(); } + public void setDate(int index, LocalDateTime value) { + storageD[index] = JDateUtil.toOADate(value); + } public Object getObject(int index) { return getDouble(index); diff --git a/meteoinfo-ndarray/src/main/java/org/meteoinfo/ndarray/ArrayString.java b/meteoinfo-ndarray/src/main/java/org/meteoinfo/ndarray/ArrayString.java index ba9722a9..e2ba3373 100644 --- a/meteoinfo-ndarray/src/main/java/org/meteoinfo/ndarray/ArrayString.java +++ b/meteoinfo-ndarray/src/main/java/org/meteoinfo/ndarray/ArrayString.java @@ -191,122 +191,122 @@ public class ArrayString extends Array { } /** - * set the value at the sepcified index. + * set the value at the specified index. */ public void set(Index i, String value) { storage[i.currentElement()] = value; } /** - * not legal, throw ForbiddenConversionException + * get the double value at the specified index. */ public double getDouble(Index i) { - throw new ForbiddenConversionException(); + return Double.parseDouble(storage[i.currentElement()]); } /** - * not legal, throw ForbiddenConversionException + * set the value at the specified index. */ public void setDouble(Index i, double value) { - throw new ForbiddenConversionException(); + storage[i.currentElement()] = String.valueOf(value); } /** - * not legal, throw ForbiddenConversionException + * get the float value at the specified index. */ public float getFloat(Index i) { - throw new ForbiddenConversionException(); + return Float.parseFloat(storage[i.currentElement()]); } /** - * not legal, throw ForbiddenConversionException + * set the value at the specified index. */ public void setFloat(Index i, float value) { - throw new ForbiddenConversionException(); + storage[i.currentElement()] = String.valueOf(value); } /** - * not legal, throw ForbiddenConversionException + * get the long value at the specified index. */ public long getLong(Index i) { - throw new ForbiddenConversionException(); + return Long.parseLong(storage[i.currentElement()]); } /** - * not legal, throw ForbiddenConversionException + * set the value at the specified index. */ public void setLong(Index i, long value) { - throw new ForbiddenConversionException(); + storage[i.currentElement()] = String.valueOf(value); } /** - * not legal, throw ForbiddenConversionException + * get the integer value at the specified index. */ public int getInt(Index i) { - throw new ForbiddenConversionException(); + return Integer.parseInt(storage[i.currentElement()]); } /** - * not legal, throw ForbiddenConversionException + * set the value at the specified index. */ public void setInt(Index i, int value) { - throw new ForbiddenConversionException(); + storage[i.currentElement()] = String.valueOf(value); } /** - * not legal, throw ForbiddenConversionException + * get the short value at the specified index. */ public short getShort(Index i) { - throw new ForbiddenConversionException(); + return Short.parseShort(storage[i.currentElement()]); } /** - * not legal, throw ForbiddenConversionException + * set the value at the specified index. */ public void setShort(Index i, short value) { - throw new ForbiddenConversionException(); + storage[i.currentElement()] = String.valueOf(value); } /** - * not legal, throw ForbiddenConversionException + * get the byte value at the specified index. */ public byte getByte(Index i) { - throw new ForbiddenConversionException(); + return Byte.parseByte(storage[i.currentElement()]); } /** - * not legal, throw ForbiddenConversionException + * set the value at the specified index. */ public void setByte(Index i, byte value) { - throw new ForbiddenConversionException(); + storage[i.currentElement()] = String.valueOf(value); } /** - * not legal, throw ForbiddenConversionException + * get the boolean value at the specified index. */ public boolean getBoolean(Index i) { - throw new ForbiddenConversionException(); + return Boolean.parseBoolean(storage[i.currentElement()]); } /** - * not legal, throw ForbiddenConversionException + * set the value at the specified index. */ public void setBoolean(Index i, boolean value) { - throw new ForbiddenConversionException(); + storage[i.currentElement()] = String.valueOf(value); } /** - * not legal, throw ForbiddenConversionException + * get the char value at the specified index. */ public char getChar(Index i) { - throw new ForbiddenConversionException(); + return storage[i.currentElement()].charAt(0); } /** - * not legal, throw ForbiddenConversionException + * set the value at the specified index. */ public void setChar(Index i, char value) { - throw new ForbiddenConversionException(); + storage[i.currentElement()] = String.valueOf(value); } public String getString(Index i) { @@ -339,67 +339,67 @@ public class ArrayString extends Array { // package private : mostly for iterators public double getDouble(int index) { - throw new ForbiddenConversionException(); + return Double.parseDouble(storage[index]); } public void setDouble(int index, double value) { - throw new ForbiddenConversionException(); + storage[index] = String.valueOf(value); } public float getFloat(int index) { - throw new ForbiddenConversionException(); + return Float.parseFloat(storage[index]); } public void setFloat(int index, float value) { - throw new ForbiddenConversionException(); + storage[index] = String.valueOf(value); } public long getLong(int index) { - throw new ForbiddenConversionException(); + return Long.parseLong(storage[index]); } public void setLong(int index, long value) { - throw new ForbiddenConversionException(); + storage[index] = String.valueOf(value); } public int getInt(int index) { - throw new ForbiddenConversionException(); + return Integer.parseInt(storage[index]); } public void setInt(int index, int value) { - throw new ForbiddenConversionException(); + storage[index] = String.valueOf(value); } public short getShort(int index) { - throw new ForbiddenConversionException(); + return Short.parseShort(storage[index]); } public void setShort(int index, short value) { - throw new ForbiddenConversionException(); + storage[index] = String.valueOf(value);; } public byte getByte(int index) { - throw new ForbiddenConversionException(); + return Byte.parseByte(storage[index]); } public void setByte(int index, byte value) { - throw new ForbiddenConversionException(); + storage[index] = String.valueOf(value); } public char getChar(int index) { - throw new ForbiddenConversionException(); + return storage[index].charAt(0); } public void setChar(int index, char value) { - throw new ForbiddenConversionException(); + storage[index] = String.valueOf(value); } public boolean getBoolean(int index) { - throw new ForbiddenConversionException(); + return Boolean.parseBoolean(storage[index]); } public void setBoolean(int index, boolean value) { - throw new ForbiddenConversionException(); + storage[index] = String.valueOf(value); } public String getString(int index) { @@ -411,11 +411,11 @@ public class ArrayString extends Array { } public Complex getComplex(int index) { - throw new ForbiddenConversionException(); + return Complex.parse(storage[index]); } public void setComplex(int index, Complex value) { - throw new ForbiddenConversionException(); + storage[index] = value.toString(); } public LocalDateTime getDate(int index) { throw new ForbiddenConversionException(); } diff --git a/meteoinfo-ndarray/src/main/java/org/meteoinfo/ndarray/math/ArrayUtil.java b/meteoinfo-ndarray/src/main/java/org/meteoinfo/ndarray/math/ArrayUtil.java index b9ae9cab..aa756411 100644 --- a/meteoinfo-ndarray/src/main/java/org/meteoinfo/ndarray/math/ArrayUtil.java +++ b/meteoinfo-ndarray/src/main/java/org/meteoinfo/ndarray/math/ArrayUtil.java @@ -1900,6 +1900,76 @@ public class ArrayUtil { } } + /** + * Convert array to another data type + * @param a The input array + * @param dataType The data type to be converted + * @return Converted array + */ + public static Array convertToDataType(Array a, DataType dataType) { + if (a.getDataType() == dataType) { + return a; + } else { + Array r = Array.factory(dataType, a.getShape()); + IndexIterator iterA = a.getIndexIterator(); + IndexIterator iterR = r.getIndexIterator(); + switch (dataType) { + case BYTE: + while (iterR.hasNext()) { + iterR.setByteNext(iterA.getByteNext()); + } + break; + case BOOLEAN: + while (iterR.hasNext()) { + iterR.setBooleanNext(iterA.getBooleanNext()); + } + break; + case SHORT: + while (iterR.hasNext()) { + iterR.setShortNext(iterA.getShortNext()); + } + break; + case INT: + while (iterR.hasNext()) { + iterR.setIntNext(iterA.getIntNext()); + } + break; + case LONG: + while (iterR.hasNext()) { + iterR.setLongNext(iterA.getLongNext()); + } + break; + case FLOAT: + while (iterR.hasNext()) { + iterR.setFloatNext(iterA.getFloatNext()); + } + break; + case DOUBLE: + while (iterR.hasNext()) { + iterR.setDoubleNext(iterA.getDoubleNext()); + } + break; + case COMPLEX: + while (iterR.hasNext()) { + iterR.setComplexNext(iterA.getComplexNext()); + } + break; + case STRING: + while (iterR.hasNext()) { + iterR.setStringNext(iterA.getStringNext()); + } + break; + case DATE: + while (iterR.hasNext()) { + iterR.setDateNext(iterA.getDateNext()); + } + break; + } + + return r; + } + } + /** * Convert array to integer type *