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:
grid = Grid(f"{case}.EGRID", apply_mapaxes="yes") # Any object would be converted to bool in version 6
Valid:
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:
fort_io = FortIO(summary_path, mode=2)
valid:
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_timeworked correctly on non-unified files, buthas_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_stepswould 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.
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
DoubleVectorIntVectorTimeVectorStringHashDoubleHashIntegerHashStringListBoolVectorLookupTableThreadPoolThe 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 returnslist[str]instead ofStringList)resdata.summary.Summary::blocked_production(now returns anumpy.vectorinstead ofDoubleVector)resdata.summary.Summary::report_index_list(now returns alist[int]instead ofIntVector)Passing incorrect types will now raise
TypeError(would sometimes raiseValueErrorbefore).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:
Valid:
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_MODEis used instead:invalid:
valid:
WellConnectionsnow write a message stderrResdataFile.iget_restart_sim_daysnow raises IndexError when the index is too large rather than returning -1.there was a discrepancy between
has_sim_timeandfind_sim_timeq wherefind_sim_timeworked correctly on non-unified files, buthas_sim_time` did not.Bug fixes:
WellSegment.__hash__function is now compatible with its__eq__function. Before,WellSegmentcould not be used in aset()reliably because the hash function was not correct.openFortIOno longer suppresses exceptionsResdataFile.report_stepsandResdataFile.num_report_stepswould throw KeyError on files without "SEQNUM". It now returns []/0 as documented.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.free(),createPythonObject(), andcreateCReference()and do not declareTYPE_NAME.KeyErrorinWellState __getitem__andTypeErrorinaddWellFilehave slightly changed messages.