OPM / opm-common

Common components for OPM, in particular build system (cmake).
http://www.opm-project.org
GNU General Public License v3.0
30 stars 112 forks source link

Numpy-views of Deck data #1295

Open berland opened 4 years ago

berland commented 4 years ago

Request for some possibility to obtain numpy views (or similar) of numerical data within DeckKeyword's. For now I have not found any other option than looping over each record and picking each number individually.

This is needed for being able to produce Pandas DataFrames of tabular data in the deck. This can be done for a selection of keywords currently in https://github.com/equinor/ecl2df, but perhaps it is an API that at some point belongs inside opm-common. I suspect there is enough information in the json-files describing each keyword to enable a single piece of code that can generate dataframes for a majority of tabular data.

joakim-hove commented 4 years ago

This is interesting and a good idea - unfortunately right now the capacity to look into this is totally lacking 😕

berland commented 4 years ago

ecl2df now has a general parser of keyword data, based on json files, into DataFrames in https://github.com/equinor/ecl2df/blob/master/ecl2df/common.py

"general" in this context imply general enough for ecl2df's current needs..