Skip to content

Version 7 roadmap #1197

Description

@eivindjahren

Current main branch of resdata will eventually become version 7.0.0.

Major overarching changes:

  • Removed all code that is giving a deprecation warning.
  • 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.

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status
    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions