Skip to content

Commit 69f7c35

Browse files
authored
add verbose argument to arctern.version (#639)
* add verbose argument to arctern.version * [skip ci] add doc string for arctern.version * [skip ci] add doc string for arctern.version * add verbose argument to arctern_pyspark.version
1 parent 32697b2 commit 69f7c35

File tree

3 files changed

+23
-7
lines changed

3 files changed

+23
-7
lines changed

cpp/src/gis/gis_functions.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ std::shared_ptr<arrow::Array> ST_Envelope_Aggr(
344344
/*************************** AGGREGATE FUNCTIONS ***************************/
345345

346346
std::string GIS_Version() {
347-
const std::string info = "gis version : " + std::string(LIB_VERSION) + "\n" +
347+
const std::string info = "version : " + std::string(LIB_VERSION) + "\n" +
348348
#ifdef USE_GPU
349349
"build type : " + CMAKE_BUILD_TYPE + "/GPU \n" +
350350
#else

python/arctern/_wrapper_func.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1533,8 +1533,18 @@ def fishnet_map_layer(vega, points, weights, transform=True):
15331533
rs = arctern_core_.fishnet_map(vega_string, geos_rs, weights_rs)
15341534
return base64.b64encode(rs.buffers()[1].to_pybytes())
15351535

1536-
def version():
1536+
def version(verbose=False):
15371537
"""
1538-
:return: version of arctern
1538+
Return the information of arctern version.
1539+
1540+
:type verbose: bool
1541+
:param verbose: whether to get other information besides version
1542+
1543+
:rtype: str
1544+
:return: Information of arctern version.
15391545
"""
1540-
return arctern_core_.GIS_Version().decode("utf-8")
1546+
full_version_info = arctern_core_.GIS_Version().decode("utf-8")
1547+
if verbose:
1548+
return full_version_info
1549+
only_versin_info = full_version_info.split("\n")[0]
1550+
return only_versin_info

spark/pyspark/arctern_pyspark/__init__.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,15 @@
1717
from .gis_func import *
1818
from .plot import plot
1919

20-
def version():
20+
def version(verbose=False):
2121
"""
22-
:return: version of arctern_pyspark
22+
Return the information of arctern_pyspark version.
23+
24+
:type verbose: bool
25+
:param verbose: whether to get other information besides version
26+
27+
:rtype: str
28+
:return: Information of arctern_pyspark version.
2329
"""
2430
import arctern
25-
return arctern.version()
31+
return arctern.version(verbose)

0 commit comments

Comments
 (0)