Skip to content

Commit bde8e06

Browse files
[Python] Fix LONG64 usage
Add an export of a time series property in the Python example
1 parent 8305d07 commit bde8e06

3 files changed

Lines changed: 20 additions & 2 deletions

File tree

python/example/example.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,24 @@ def serialize_grid(repo: fesapi.DataObjectRepository):
3535
stats.setMinimum(1.1)
3636
continuous_prop.pushBackFloatArray3dOfValuesPlusStatistics(resqml_values.cast(), 1, 1, 3, stats)
3737

38+
# A time series definition
39+
time_series = repo.createTimeSeries("1187d8a0-fa3e-11e5-ac3a-0002a5d5c51b", "Testing time series 1")
40+
time_series.pushBackTimestamp(1409753895)
41+
time_series.pushBackTimestamp(1441289895)
42+
43+
# A continuous property with time series
44+
continuous_prop_time0 = repo.createContinuousProperty(partial_ijk_grid, "18027a00-fa3e-11e5-8255-0002a5d5c51b", "Time Series Property", 1,
45+
fesapi.eml23__IndexableElement_cells, fesapi.resqml20__ResqmlUom_m, fesapi.resqml20__ResqmlPropertyKind_length)
46+
continuous_prop_time0.setTimeSeries(time_series)
47+
continuous_prop_time0.setSingleTimestamp(time_series.getTimestamp(0))
48+
continuous_prop_time0.pushBackFloatArray3dOfValues(resqml_values.cast(), 1, 1, 3)
49+
50+
continuous_prop_time1= repo.createContinuousProperty(partial_ijk_grid, "1ba54340-fa3e-11e5-9534-0002a5d5c51b", "Time Series Property", 1,
51+
fesapi.eml23__IndexableElement_cells, fesapi.resqml20__ResqmlUom_m, fesapi.resqml20__ResqmlPropertyKind_length)
52+
continuous_prop_time1.setTimeSeries(time_series)
53+
continuous_prop_time1.setSingleTimestamp(1441289895)
54+
continuous_prop_time1.pushBackFloatArray3dOfValues(resqml_values.cast(), 1, 1, 3)
55+
3856
# unstructured grid example
3957
unstructured_grid = repo.createUnstructuredGridRepresentation(
4058
"9283cd33-5e52-4110-b7b1-616abde2b303",

swig/swigEml2Include.i

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1773,7 +1773,7 @@ namespace EML2_NS
17731773
*
17741774
* @returns The index of @p timestamp in this time series.
17751775
*/
1776-
uint64_t getTimestampIndex(time_t timestamp, LONG64 yearOffset = 0) const;
1776+
uint64_t getTimestampIndex(time_t timestamp, int64_t yearOffset = 0) const;
17771777

17781778
/**
17791779
* Get the count of timestamps in this time series.

swig/swigResqml2Include.i

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6015,7 +6015,7 @@ namespace RESQML2_NS
60156015
* @param [in] timestamp The single timestamps to associate to this property
60166016
* @param [in] yearOffset Indicates that the dateTime attribute must be translated according to this value.
60176017
*/
6018-
void setSingleTimestamp(time_t timestamp, LONG64 yearOffset = 0);
6018+
void setSingleTimestamp(time_t timestamp, int64_t yearOffset = 0);
60196019

60206020
/**
60216021
* Get a single associated timestamp for this property.

0 commit comments

Comments
 (0)