Remove TimeVector - #1270
Open
eivindjahren wants to merge 12 commits into
Open
Conversation
eivindjahren
force-pushed
the
remove_time_t_vector
branch
from
August 17, 2026 11:58
803dc70 to
e18ddd1
Compare
eivindjahren
force-pushed
the
remove_time_t_vector
branch
from
August 17, 2026 12:02
e18ddd1 to
6f89f72
Compare
eivindjahren
force-pushed
the
remove_time_t_vector
branch
from
August 17, 2026 12:02
6f89f72 to
679f6f5
Compare
There was a problem hiding this comment.
Pull request overview
This pull request removes the Python TimeVector abstraction and replaces time-vector plumbing across the Python/C++ boundary with standard containers (Python lists / NumPy arrays and C++ std::vector). This simplifies the API surface and reduces reliance on the ert/util/time_t_vector type.
Changes:
- Removed
TimeVector(Python implementation + exports) and updated tests to stop constructing/expecting it. - Updated
Summarybindings and core logic to pass times as plain “time_t seconds” arrays/lists, returning NumPydatetime64[s]for allocated time vectors and Python lists for solve results. - Refactored C++ resampling/solve APIs to use
std::vectorinstead oftime_t_vector_type/double_vector_type.
Reviewed changes
Copilot reviewed 20 out of 20 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/util_tests/test_vectors.py | Removes TimeVector unit tests and imports. |
| tests/rd_tests/test_sum.py | Updates resample tests to use tolist() / native lists instead of TimeVector. |
| tests/rd_tests/test_sum_equinor.py | Updates expectations for alloc_time_vector return type and replaces TimeVector.createRegular usage. |
| tests/rd_tests/test_rd_sum.py | Reworks time-range/solve/resample tests to match new return types and adds new coverage around time_range and solve behavior. |
| tests/rd_tests/test_npv.py | Removes TimeVector import. |
| python/resdata/util/util/time_vector.py | Deletes the TimeVector implementation. |
| python/resdata/util/util/init.py | Stops exporting TimeVector. |
| python/resdata/summary/rd_sum.py | Replaces TimeVector-based time handling with list/NumPy friendly conversions; updates time_range, resample, and solve/alloc behaviors. |
| lib/tests/test_rd_sum.cpp | Updates C++ tests to use std::vector<time_t> instead of time_t_vector helpers. |
| lib/resdata/tests/rd_sum_test.cpp | Removes time_t_vector include and updates dependencies accordingly. |
| lib/resdata/tests/rd_make_date_shift.cpp | Removes time_t_vector include; adds <ctime> include. |
| lib/resdata/tests/rd_make_date_no_shift.cpp | Removes time_t_vector include; adds <ctime> include. |
| lib/resdata/tests/rd_grid_copy.cpp | Removes time_t_vector include. |
| lib/resdata/rd_sum.cpp | Changes resample/time allocation/solve APIs to std::vector and iterator-based inputs. |
| lib/resdata/rd_sum_pybind.cpp | Updates pybind bindings for resample/alloc_time_vector/solve_* to use std::vector and NumPy/Python-native outputs. |
| lib/resdata/rd_sum_data.cpp | Refactors internal time/solution allocation to return std::vector instead of *_vector_type. |
| lib/resdata/cwrap_pybind.cpp | Removes Python-side TimeVector type checking/conversion for C++ interop. |
| lib/include/resdata/rd_sum.hpp | Updates public header signatures to std::vector and iterator ranges. |
| lib/include/resdata/rd_sum_data.hpp | Updates public header signatures to std::vector. |
| lib/CMakeLists.txt | Stops generating time_t_vector template header. |
Suppressed comments (1)
python/resdata/summary/rd_sum.py:395
- Like numpy_vector(), pandas_frame() will fail if time_index is a numpy datetime64 array (e.g., from alloc_time_vector()), because CTime() can't convert numpy.datetime64. Consider normalizing each element via .tolist() when available.
time_points = [CTime(t).value() for t in time_index]
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Since alloc_time_vector now returns a np.vector with datetime64, it seems reasonable that we keep it possible to pass these values on as parameters representing time.
eivindjahren
force-pushed
the
remove_time_t_vector
branch
from
August 17, 2026 13:58
cb52fdd to
24d8351
Compare
Copilot stopped reviewing on behalf of
eivindjahren due to an error
August 17, 2026 14:07
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.