Version 7 roadmap
- Dominant language
- C++
- Stars
- 127
- Forks
- 103
- Avg merge
- 2d 5h
- Merged PRs (30d)
- 18
Description
Current main branch of resdata will eventually become version 7.0.0.
Major overarching changes:
----------------------
* Removed all code that is giving a deprecation warning.
* Removed all datatypes in resdata.util.util, this includes
* `DoubleVector`
* `IntVector`
* `TimeVector`
* `StringHash`
* `DoubleHash`
* `IntegerHash`
* `StringList`
* `BoolVector`
* `LookupTable`
* `ThreadPool`
The signature for functions that used these types as parameter or return type has changed to use numpy or builtin types.
See type-hints for specifics. These functions include:
* `resdata.summary.Summary::keys` (now returns `list[str]` instead of `StringList`)
* `resdata.summary.Summary::blocked_production` (now returns a `numpy.vector` instead of `DoubleVector`)
* `resdata.summary.Summary::report_index_list` (now returns a `list[int]` instead of `IntVector`)
* Passing incorrect types will now raise `TypeError` (would sometimes raise `ValueError` before).
* Passing integers that are too large for int32/int64, will raise TypeError rather than wrap.
* bool is not longer automatically converted. This applies to any method that eventually called cwrap.
* `__repr__` results no longer contain address.
Invalid:
```python
grid = Grid(f"{case}.EGRID", apply_mapaxes="yes") # Any object would be converted to bool in version 6
```
Valid:
```python
grid = Grid(f"{case}.EGRID", apply_mapaxes=True) # Version 7 only accepts bool
```
Changes to individual components:
---------------------------------
* Removed the `WellSegment.__len__` function as it broke the expectation that len() would return an int.
* `__repr__` of WellInfo no longer uses "[no name]" when name is "".
* FortIO now requires that the members `FortIO.READ_MODE`, `FortIO.WRITE_MODE`, `FortIO.APPEND_MODE`, `FortIO.READ_AND_WRITE_MODE` is used instead:
invalid:
```python
fort_io = FortIO(summary_path, mode=2)
```
valid:
```python
fort_io = FortIO(summary_path, mode=FortIO.WRITE_MODE)
```
* All dropped `WellConnections` now write a message stderr
* `ResdataFile.iget_restart_sim_days` now raises IndexError when the index is too large rather than returning -1.
* ResdataFile.has_sim_time(t) now returns True when find_sim_time(t) is not None. Before
there was a discrepancy between `has_sim_time` and `find_sim_timeq where
`find_sim_time` worked correctly on non-unified files, but `has_sim_time` did not.
Bug fixes:
--------------
* The `WellSegment.__hash__` function is now compatible with its `__eq__` function. Before, `WellSegment` could not be used in a `set()` reliably because the hash function was not correct.
* `openFortIO` no longer suppresses exceptions
* `ResdataFile.report_steps` and `ResdataFile.num_report_steps`would throw KeyError on files without "SEQNUM". It now returns []/0 as documented.
* Fixed a bug where the ordering of summary keys and files could be ill-defined. This does not effect normal summary keys.
* Fixed a bug where guessing the case-name did not work for formatted files.
Other visible changes, not really part of the public API:
---------------------
* `__repr__` and `__str__` may format numbers as 0 instead of 0.0 and use different scientific formatting for large numbers.
* Often, classes/enums are no longer subclasses of BaseCClass/BaseCEnum, in which case they do not have the functions Classes `free()`, `createPythonObject()`, and `createCReference()` and do not declare `TYPE_NAME`.
* `KeyError` in `WellState __getitem__` and `TypeError` in `addWellFile` have slightly changed messages.
Contributor guide
Research direction
This issue spans resdata.util.util, resdata.summary.Summary, FortIO, ResdataFile, WellSegment, WellInfo, and WellConnections. Start by selecting one concrete roadmap item and reading the affected component and its type hints; use the invalid/valid examples and listed return or exception behavior as the acceptance criteria. Done requires the selected change to match the stated version 7 behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, numpy, python
- Domain
- backend-api-design
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100