Repository navigation
7.0.0
What's Changed
Major overarching changes:
-
Removed all code that is giving a deprecation warning, this means the following calls need to be changed:
- ResdataGrav.addSurvey() -> ResdataGrav.add_survey()
- ResdataSubsidence.evalGeertsma() -> ResdataSubsidence.eval_geertsma()
- FaultLayer.addSegment() -> FaultLayer.add_segment()
- FaultLayer.getK() -> FaultLayer.get_k()
- FaultLayer.getNeighborCells() -> FaultLayer.get_neighbor_cells()
- FaultLayer.getPolyline() -> FaultLayer.get_polyline()
- FaultLayer.getIJPolyline() -> FaultLayer.get_ij_polyline()
- FaultLayer.numLines() -> FaultLayer.num_lines()
- FaultLayer.processSegments() -> FaultLayer.process_segments()
- Fault.hasLayer() -> Fault.has_layer()
- Fault.addLayer() -> Fault.add_layer()
- Fault.createSegment() -> Fault.create_segment()
- Fault.addRecord() -> Fault.add_record()
- Fault.getName() -> Fault.get_name()
- Fault.getNeighborCells() -> Fault.get_neighbor_cells()
- Fault.getPolyline() -> Fault.get_polyline()
- Fault.getIJPolyline() -> Fault.get_ij_polyline()
- Fault.numLines() -> Fault.num_lines()
- Fault.connectWithPolyline() -> Fault.connect_with_polyline()
- Fault.extendToPolyline() -> Fault.extend_to_polyline()
- Fault.intersectsPolyline() -> Fault.intersects_polyline()
- Fault.intersectsFault() -> Fault.intersects_fault()
- Fault.extendToFault() -> Fault.extend_to_fault()
- Fault.extendToEdge() -> Fault.extend_to_edge()
- Fault.extendToBBox() -> Fault.extend_to_b_box()
- Fault.endJoin() -> Fault.end_join()
- Fault.connectPolylineOnto() -> Fault.connect_polyline_onto()
- Fault.extendPolylineOnto() -> Fault.extend_polyline_onto()
- Fault.intersectFaultRays() -> Fault.intersect_fault_rays()
- Fault.intRay() -> Fault.int_ray()
- Fault.getEndRays() -> Fault.get_end_rays()
- Fault.joinFaults() -> Fault.join_faults()
- FaultBlock.getCentroid() -> FaultBlock.get_centroid()
- FaultBlock.countInside() -> FaultBlock.count_inside()
- FaultBlock.getBlockID() -> FaultBlock.get_block_id()
- FaultBlock.assignToRegion() -> FaultBlock.assign_to_region()
- FaultBlock.getRegionList() -> FaultBlock.get_region_list()
- FaultBlock.addCell() -> FaultBlock.add_cell()
- FaultBlock.getGlobalIndexList() -> FaultBlock.get_global_index_list()
- FaultBlock.getEdgePolygon() -> FaultBlock.get_edge_polygon()
- FaultBlock.containsPolyline() -> FaultBlock.contains_polyline()
- FaultBlock.getNeighbours() -> FaultBlock.get_neighbours()
- FaultBlock.getParentLayer() -> FaultBlock.get_parent_layer()
- FaultBlockLayer.scanKeyword() -> FaultBlockLayer.scan_keyword()
- FaultBlockLayer.loadKeyword() -> FaultBlockLayer.load_keyword()
- FaultBlockLayer.getBlock() -> FaultBlockLayer.get_block()
- FaultBlockLayer.deleteBlock() -> FaultBlockLayer.delete_block()
- FaultBlockLayer.addBlock() -> FaultBlockLayer.add_block()
- FaultBlockLayer.getNextID() -> FaultBlockLayer.get_next_id()
- FaultBlockLayer.getK() -> FaultBlockLayer.get_k()
- FaultBlockLayer.scanLayer() -> FaultBlockLayer.scan_layer()
- FaultBlockLayer.insertBlockContent() -> FaultBlockLayer.insert_block_content()
- FaultBlockLayer.exportKeyword() -> FaultBlockLayer.export_keyword()
- FaultBlockLayer.addFaultBarrier() -> FaultBlockLayer.add_fault_barrier()
- FaultBlockLayer.joinFaults() -> FaultBlockLayer.join_faults()
- FaultBlockLayer.addPolylineBarrier() -> FaultBlockLayer.add_polyline_barrier()
- FaultBlockLayer.getGeoLayer() -> FaultBlockLayer.get_geo_layer()
- FaultBlockLayer.cellContact() -> FaultBlockLayer.cell_contact()
- FaultCollection.getGrid() -> FaultCollection.get_grid()
- FaultCollection.getFault() -> FaultCollection.get_fault()
- FaultCollection.hasFault() -> FaultCollection.has_fault()
- FaultCollection.addFault() -> FaultCollection.add_fault()
- FaultCollection.splitLine() -> FaultCollection.split_line()
- FaultCollection.loadFaults() -> FaultCollection.load_faults()
- FaultLine.tryAppend() -> FaultLine.try_append()
- FaultLine.getK() -> FaultLine.get_k()
- FaultLine.getPolyline() -> FaultLine.get_polyline()
- FaultLine.getIJPolyline() -> FaultLine.get_ij_polyline()
- FaultLine.getNeighborCells() -> FaultLine.get_neighbor_cells()
- FaultLine.startPoint() -> FaultLine.start_point()
- FaultLine.endPoint() -> FaultLine.end_point()
- FaultSegment.getCorners() -> FaultSegment.get_corners()
- FaultSegment.getC1() -> FaultSegment.get_c1()
- FaultSegment.getC2() -> FaultSegment.get_c2()
- SegmentMap.addSegment() -> SegmentMap.add_segment()
- SegmentMap.delSegment() -> SegmentMap.del_segment()
- SegmentMap.popStart() -> SegmentMap.pop_start()
- SegmentMap.popNext() -> SegmentMap.pop_next()
- SegmentMap.printContent() -> SegmentMap.print_content()
- Layer.activeCell() -> Layer.active_cell()
- Layer.updateActive() -> Layer.update_active()
- Layer.bottomBarrier() -> Layer.bottom_barrier()
- Layer.leftBarrier() -> Layer.left_barrier()
- Layer.getNX() -> Layer.get_nx()
- Layer.getNY() -> Layer.get_ny()
- Layer.cellContact() -> Layer.cell_contact()
- Layer.addInterpBarrier() -> Layer.add_interp_barrier()
- Layer.addPolylineBarrier() -> Layer.add_polyline_barrier()
- Layer.addFaultBarrier() -> Layer.add_fault_barrier()
- Layer.addIJBarrier() -> Layer.add_ij_barrier()
- Layer.cellSum() -> Layer.cell_sum()
- Layer.clearCells() -> Layer.clear_cells()
- Layer.updateConnected() -> Layer.update_connected()
- Layer.cellsEqual() -> Layer.cells_equal()
- Layer.countEqual() -> Layer.count_equal()
- Grid.loadFromGrdecl() -> Grid.load_from_grdecl()
- Grid.loadFromFile() -> Grid.load_from_file()
- Grid.dualGrid() -> Grid.dual_grid()
- Grid.getDims() -> Grid.get_dims()
- Grid.getNX() -> Grid.get_nx()
- Grid.getNY() -> Grid.get_ny()
- Grid.getNZ() -> Grid.get_nz()
- Grid.getGlobalSize() -> Grid.get_global_size()
- Grid.getNumActive() -> Grid.get_num_active()
- Grid.getNumActiveFracture() -> Grid.get_num_active_fracture()
- Grid.getBoundingBox2D() -> Grid.get_bounding_box_2d()
- Grid.getName() -> Grid.get_name()
- Grid.validCellGeometry() -> Grid.valid_cell_geometry()
- Grid.getNodePos() -> Grid.get_node_pos()
- Grid.getCellCorner() -> Grid.get_cell_corner()
- Grid.getNodeXYZ() -> Grid.get_node_xyz()
- Grid.getLayerXYZ() -> Grid.get_layer_xyz()
- Grid.findCellXY() -> Grid.find_cell_xy()
- Grid.findCellCornerXY() -> Grid.find_cell_corner_xy()
- Grid.getCellDims() -> Grid.get_cell_dims()
- Grid.getNumLGR() -> Grid.get_num_lgr()
- Grid.createKW() -> Grid.create_kw()
- Grid.create3D() -> Grid.create_3d()
- Grid.compressedKWCopy() -> Grid.compressed_kw_copy()
- Grid.globalKWCopy() -> Grid.global_kw_copy()
- Grid.exportACTNUMKw() -> Grid.export_ACTNUM_kw()
- Grid.createVolumeKeyword() -> Grid.create_volume_keyword()
- GridGenerator.createRectangular() -> GridGenerator.create_rectangular()
- ResdataRegion.selectTrue() -> ResdataRegion.select_true()
- ResdataRegion.selectFalse() -> ResdataRegion.select_false()
- ResdataRegion.selectFromLayer() -> ResdataRegion.select_from_layer()
- ResdataRegion.getActiveList() -> ResdataRegion.get_active_list()
- ResdataRegion.getGlobalList() -> ResdataRegion.get_global_list()
- ResdataRegion.getIJKList() -> ResdataRegion.get_ijk_list()
- ResdataRegion.getName() -> ResdataRegion.get_name()
- ResdataRegion.setName() -> ResdataRegion.set_name()
- ResdataUtil.inspectExtension() -> ResdataUtil.inspect_extension()
- ResdataUtil.reportStep() -> ResdataUtil.report_step()
- FortIO.getPosition() -> FortIO.get_position()
- FortIO.isFortranFile() -> FortIO.is_fortran_file()
- Resdata3DKW.castFromKW() -> Resdata3DKW.cast_from_kw()
- Resdata3DKW.compressedCopy() -> Resdata3DKW.compressed_copy()
- Resdata3DKW.globalCopy() -> Resdata3DKW.global_copy()
- Resdata3DKW.setDefault() -> Resdata3DKW.set_default()
- Resdata3DKW.getDefault() -> Resdata3DKW.get_default()
- ResdataFile.getFileType() -> ResdataFile.get_filetype()
- ResdataFile.blockView() -> ResdataFile.block_view()
- ResdataFile.blockView2() -> ResdataFile.block_view2()
- ResdataFile.restartView() -> ResdataFile.restart_view()
- ResdataFile.getFilename() -> ResdataFile.get_filename()
- ResdataFileView.numKeywords() -> ResdataFileView.num_keywords()
- ResdataFileView.uniqueSize() -> ResdataFileView.unique_size()
- ResdataFileView.blockView2() -> ResdataFileView.block_view2()
- ResdataFileView.blockView() -> ResdataFileView.block_view()
- ResdataFileView.restartView() -> ResdataFileView.restart_view()
- ResdataKW.intKeywords() -> ResdataKW.int_keywords()
- ResdataKW.isNumeric() -> ResdataKW.is_numeric()
- ResdataKW.fortIOSize() -> ResdataKW.fort_io_size()
- ResdataKW.setName() -> ResdataKW.set_name()
- ResdataKW.getName() -> ResdataKW.get_name()
- ResdataKW.getMinMax() -> ResdataKW.get_min_max()
- ResdataKW.getMax() -> ResdataKW.get_max()
- ResdataKW.getMin() -> ResdataKW.get_min()
- ResdataKW.typeName() -> ResdataKW.type_name()
- ResdataKW.numpyView() -> ResdataKW.numpy_view()
- ResdataKW.numpyCopy() -> ResdataKW.numpy_copy()
- ResdataKW.fixUninitialized() -> ResdataKW.fix_uninitialized()
- ResdataKW.firstDifferent() -> ResdataKW.first_different()
- ResdataRestartHead.getReportStep() -> ResdataRestartHead.get_report_step()
- ResdataRestartHead.getSimDate() -> ResdataRestartHead.get_sim_date()
- ResdataRestartHead.getSimDays() -> ResdataRestartHead.get_sim_days()
- ResdataRestartFile.assertHeaders() -> ResdataRestartFile.assert_headers()
- ResdataRestartFile.timeList() -> ResdataRestartFile.time_list()
- ResdataRFT.getWellName() -> ResdataRFT.get_well_name()
- ResdataRFT.getDate() -> ResdataRFT.get_date()
- ResdataRFTFile.getNumWells() -> ResdataRFTFile.get_num_wells()
- ResdataRFTFile.getHeaders() -> ResdataRFTFile.get_headers()
- ResdataCase.loadSummary() -> ResdataCase.load_summary()
- ResdataCase.startTimeEqual() -> ResdataCase.start_time_equal()
- ResdataCase.endTimeEqual() -> ResdataCase.end_time_equal()
- ResdataCase.cmpSummaryVector() -> ResdataCase.cmp_summary_vector()
- ResdataCmp.initCheck() -> ResdataCmp.init_check()
- ResdataCmp.hasSummaryVector() -> ResdataCmp.has_summary_vector()
- ResdataCmp.endTimeEqual() -> ResdataCmp.end_time_equal()
- ResdataCmp.cmpSummaryVector() -> ResdataCmp.cmp_summary_vector()
- ResdataCmp.testKeys() -> ResdataCmp.test_keys()
- ResdataCmp.testWells() -> ResdataCmp.test_wells()
- NPVPriceVector.addItem() -> NPVPriceVector.add_item()
- NPVPriceVector.assertDate() -> NPVPriceVector.assert_date()
- NPVPriceVector.evalDate() -> NPVPriceVector.eval_date()
- ResdataNPV.getExpression() -> ResdataNPV.get_expression()
- ResdataNPV.setExpression() -> ResdataNPV.set_expression()
- ResdataNPV.getKeyList() -> ResdataNPV.get_key_list()
- ResdataNPV.addKey() -> ResdataNPV.add_key()
- ResdataNPV.parseExpression() -> ResdataNPV.parse_expression()
- ResdataNPV.evalNPV() -> ResdataNPV.eval_npv()
- ResdataSMSPECNode.getKey1() -> ResdataSMSPECNode.get_key1()
- ResdataSMSPECNode.getKey2() -> ResdataSMSPECNode.get_key2()
- ResdataSMSPECNode.varType() -> ResdataSMSPECNode.var_type()
- ResdataSMSPECNode.getNum() -> ResdataSMSPECNode.get_num()
- ResdataSMSPECNode.isRate() -> ResdataSMSPECNode.is_rate()
- ResdataSMSPECNode.isTotal() -> ResdataSMSPECNode.is_total()
- ResdataSMSPECNode.isHistorical() -> ResdataSMSPECNode.is_historical()
- Summary.varType() -> Summary.var_type()
- Summary.addVariable() -> Summary.add_variable()
- Summary.addTStep() -> Summary.add_t_step()
- Summary.assertKeyValid() -> Summary.assert_key_valid()
- Summary.timeRange() -> Summary.time_range()
- Summary.blockedProduction() -> Summary.blocked_production()
- Summary.getDataStartTime() -> Summary.get_data_start_time()
- Summary.getStartTime() -> Summary.get_start_time()
- Summary.getEndTime() -> Summary.get_end_time()
- Summary.solveDates() -> Summary.solve_dates()
- Summary.solveDays() -> Summary.solve_days()
- Summary.dumpCSVLine() -> Summary.dump_csv_line()
- Summary.exportCSV() -> Summary.export_csv()
- SummaryKeyWordVector.addKeyword() -> SummaryKeyWordVector.add_keyword()
- SummaryKeyWordVector.addKeywords() -> SummaryKeyWordVector.add_keywords()
- SummaryTStep.getSimDays() -> SummaryTStep.get_sim_days()
- SummaryTStep.getReport() -> SummaryTStep.get_report()
- SummaryTStep.getMiniStep() -> SummaryTStep.get_mini_step()
- SummaryTStep.getSimTime() -> SummaryTStep.get_sim_time()
- Grid.createRectangular() -> GridGenerator.create_rectangular()
- ResdataKW.getDataPtr() -> ResdataKW.numpy_view()
- ResdataKW.type (property) -> ResdataKW.data_type
- ResdataKW.get_rd_type() -> ResdataKW.data_type
- ResdataKW.getResdataType() -> ResdataKW.data_type
- ResdataKW.array -> ResdataKW.numpy_view()
- ResdataKW.get_data_ptr() -> ResdataKW.numpy_view()
- openResdataFile() -> open_rd_file()
- ResdataRegion.rd_region_instance() -> isinstance(x, ResdataRegion)
- ResdataSMSPECNode.cmp() -> use
==,>and<operators instead.
-
Removed, already broken or raising before (no replacement):
- FaultBlockLayer.addFaultLink() / add_fault_link() (deprecated, never worked)
- Summary.scaleVector() / scale_vector() (raised NotImplementedError; use numpy_vector(key) * scalar)
- Summary.shiftVector() / shift_vector() (raised NotImplementedError; use numpy_vector(key) + addend)
-
Removed all datatypes in resdata.util.util, this includes
DoubleVectorIntVectorTimeVectorStringHashDoubleHashIntegerHashStringListBoolVectorLookupTableThreadPoolPermutationVectorVectorTemplate
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 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)- resdata.Summary::time_range (now returns
list[CTime]instead ofTimeVector) - resdata.Summary::alloc_time_vector (now returns numpy.array[datetime64])
resdata.summary.Summary::resample(time_pointsis now any iterable of time-like values, such asdatetime,date,CTimeornumpy.datetime64, instead of aTimeVector)- resdata.Grid.load_column (now returns
list[float]) - resdata.Region::get_active_list, get_global_list and kw_index_list (now returns
list[int]instead of IntVector)
-
file-handles are no longer of the type CFile opened with cwrap.copen, built-in
openshould be used instead, this applies to:- ResdataKW.read_grdecl
- ResdataKW.fseek_grdecl
- ResdataKW.write_grdecl
- ResdataKW.fprintf_data
- Grid.save_grdecl
- Grid.write_grdecl
- Summary.dump_csv_line
-
Passing incorrect types will now raise
TypeError(would sometimes raiseValueErrorbefore). -
Passing integers that are too large for int32/int64, will raise
TypeErrorrather than wrap. -
Passing negative integers where positive integers are expected also raises
TypeError -
bool is no longer automatically converted. This applies to any method that eventually called cwrap.
-
__repr__results no longer contain address. -
Where before resdata would send an abort signal, it now raises exceptions.
Invalid:
grid = Grid(f"{case}.EGRID", apply_mapaxes="yes") # Any object would be converted to bool in version 6Valid:
grid = Grid(f"{case}.EGRID", apply_mapaxes=True) # Version 7 only accepts bool-
Enums that used to be cwrap.BaseCEnum are now plain python enums.
-
Removed several components which is easily replaced by numpy/standard library:
- RandomNumberGenerator, RngAlgTypeEnum, RngInitModeEnum -> numpy.random
- CWDContext, resdata.util.test -> pytest
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:
fort_io = FortIO(summary_path, mode=2)valid:
fort_io = FortIO(summary_path, mode=FortIO.WRITE_MODE)- All dropped
WellConnectionsnow write to stderr ResdataFile.iget_restart_sim_daysnow 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 betweenhas_sim_timeandfind_sim_timewhere
find_sim_timeworked correctly on non-unified files, buthas_sim_timedid not. - Grid.coarse_groups() now returns the count of distinct groups instead of the maximal group number.
ResdataFileView.block_view2(start_kw, stop_kw, start_index)(andResdataFile.block_view2) withstop_kw=Nonenow returns every keyword fromstart_kwto the end of the file, as documented. On 6.4 the view only contained the first keyword (#1248).
Bug fixes:
- The
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.- Fixed a bug where the ordering of summary keys and files could be ill-defined. This does not affect normal summary keys.
- Fixed a bug where guessing the case-name did not work for formatted files.
- Summary::first_day now computes the number of days correctly.
- WellState.*RateSI() now returns correct SI values.
- Well-head connections now get direction dirZ instead of dirX.
- Summary.dates is now correct for restarted cases.
- Fixed a bug where Lazy loading of formatted summary files would get the wrong offset
- Grid.save_GRID handles formattedness like save_EGRID (.FGRID writes formatted).
- Reading a GRID file with dual porosity and LGRs is fixed.
- ResdataFile.close() no longer nulls the handle, so later reads re-open the file lazily.
Summary.time_range:intervalmust now be a positive number of time units, Previously zero time units looped forever, and negative values such as"-1d"raisedTypeError.- With
interval="1Y"andextend_end=True, an end date that is exactly 1 January is no longer extended by an extra year. An end date later in the year is still extended to the next 1 January .
ResdataFileView.block_view2(start_kw, stop_kw, start_index)(andResdataFile.block_view2) withstop_kw=Nonenow returns every keyword fromstart_kwto the end of the file, as document, where before it only contained the first keyword.
ResdataFile.iget_named_kw(kw_name, index, copy=True)now returns a copy of the keyword, where before the copy argument was ignored.- Fixed object lifetime bugs where a Python object could outlive the object that owns its memory, giving dangling pointers:
Surface.getPointset()returned aGeoPointsetthat did not keep itsSurfacealive, andGeoRegiondid not keep the pointset it was built from alive.CPolylineCollection.addPolyline()andshallowCopy(): a polyline could be freed while still in a collection, for example when added from another collection that was then garbage collected. Polylines are now shared-owned.SummaryKeyWordVector(andSummaryKeyWordVector.copy()) did not keep itsSummaryalive.
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(), andcreateCReference()and do not declareTYPE_NAME. KeyErrorinWellState.__getitem__andTypeErrorinaddWellFilehave slightly changed messages.- Classes that used to inherit from
cwrap.BaseCClassnow inherit from a private_BaseCClass. The methodsisReference(),parent(),convertToCReference(),is_initialized(),storageType()andfrom_param()are gone,setParentno longer raises for non-reference objects, and__bool__is no longer defined, sobool(obj)is alwaysTrue. Code that checkedif obj:must checkis None.
New Contributors
- @MagnusSletten made their first contribution in #1214
- @kaamyashinde made their first contribution in #1210
Full Changelog: 6.3.1...7.0.0