resdata icon indicating copy to clipboard operation
resdata copied to clipboard

Deprecation warning of __getitem__ in EclSum

Open mortalisk opened this issue 5 years ago • 1 comments

When indexing objects of the EclSum class, in __getitem__ there is a deprecation warning. The fix is to call numpy_array instead of get_vector and remove the warning, but that results in changing the API, breaking user code that expects objects of the class EclSumVector (or something that quacks like it at least), and not numpy arrays (who quack in a noticeably different pitch, not acceptable for the experienced EclSumVector connoisseur).

This was discovered by running the snake_oil project of ert, which spews a lot of deprecation warnings in the diff job, to the point of slowing down the running time.

We should probably agree on a plan to either fix this or when to break the api.

mortalisk avatar Feb 19 '20 10:02 mortalisk

So, I realized that the alternative is for the user to call the numpy_array function in stead of the [] indexing, and also change the expectations for the returned object. Is that what we intend the user to do? If so, this issue can be closed I guess.

mortalisk avatar Feb 20 '20 12:02 mortalisk

Closing as there is no ongoing effort on removing deprecated stuff. If there turns out to be some, then we can spawn issues like this.

pinkwah avatar Dec 18 '23 11:12 pinkwah