Commit Graph

334 Commits

Author SHA1 Message Date
Arne Morten Kvarving
302e7e7d41 add python 3.10 to pypi builds 2022-03-07 13:58:12 +01:00
Joakim Hove
42e36100a8 Export RawString as std::string to Python 2022-02-23 11:01:00 +01:00
Torbjørn Skille
5bf2087d0a DeckItem - API change 2022-02-14 15:48:52 +01:00
Markus Blatt
06618244e7 Use C++ everywhere and skip using a custom build_ext subclass.
Somehow using a custom build_ext subclass always triggered a failing
rebuild when testing:

/usr/lib/ccache/g++-10 -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fwrapv -O2 -Wl,-z,relro -g -fwrapv -O2 -g -ffile-prefix-map=/build/python3.9-RNBry6/python3.9-3.9.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 build/temp.linux-x86_64-3.9/cxx/builtin_pybind11.o build/temp.linux-x86_64-3.9/cxx/connection.o build/temp.linux-x86_64-3.9/cxx/converters.o build/temp.linux-x86_64-3.9/cxx/deck.o build/temp.linux-x86_64-3.9/cxx/deck_keyword.o build/temp.linux-x86_64-3.9/cxx/eclipse_config.o build/temp.linux-x86_64-3.9/cxx/eclipse_grid.o build/temp.linux-x86_64-3.9/cxx/eclipse_io.o build/temp.linux-x86_64-3.9/cxx/eclipse_state.o build/temp.linux-x86_64-3.9/cxx/emodel_util.o build/temp.linux-x86_64-3.9/cxx/export.o build/temp.linux-x86_64-3.9/cxx/field_props.o build/temp.linux-x86_64-3.9/cxx/group.o build/temp.linux-x86_64-3.9/cxx/log.o build/temp.linux-x86_64-3.9/cxx/parsecontext.o build/temp.linux-x86_64-3.9/cxx/parser.o build/temp.linux-x86_64-3.9/cxx/schedule.o build/temp.linux-x86_64-3.9/cxx/summary_state.o build/temp.linux-x86_64-3.9/cxx/table_manager.o build/temp.linux-x86_64-3.9/cxx/unit_system.o build/temp.linux-x86_64-3.9/cxx/well.o -lopmcommon -lboost_system -lstdc++fs -o build/lib.linux-x86_64-3.9/opm/libopmcommon_python.cpython-39-x86_64-linux-gnu.so -fopenmp /usr/lib/x86_64-linux-gnu/libfmt.so.7.1.3
error: can't copy 'build/lib.linux-x86_64-3.9/opm/libopmcommon_python.cpython-39-x86_64-linux-gnu.so': doesn't exist or not a regular file

Therefore we resort to only setting the CC and CXX variables to the
C++ compiler. Note that one cannot use "ccache c++" for CXX.

With the default build_ext the problem vanishes.
2022-02-04 10:07:05 +01:00
Markus Blatt
b67091183b [python] Use correct C++ compiler for linking.
CC is the C compiler. CXX is the C++ compiler. Setuptools will
use the C++ compiler for C++ code. Hence it is vital to set that
correctly. If not set the default C++ compiler will be used.

Unfortunately it will use the first string as the CXX compiler and
hence we need to strip ccache. Fortunately it used CC for the
compilation and that works with gcc as well.
2022-02-03 17:02:09 +01:00
Markus Blatt
c5691477e5 Merge pull request #2948 from blattms/fix-setup.py-mult-lib
[bugfix] Make opm-common_PYTHON_LINKAGE a comma separated list.
2022-02-02 09:44:34 +01:00
Joakim Hove
c37c2b2d49 Make SummaryState::set() available as __setitem__ in Python 2022-01-28 12:05:17 +01:00
Markus Blatt
1daa7d1df4 [bugfix] Make library list used for setup.py a comma separated list.
It is used verbatim in setup.py in the list that specifies the linker
flage. Hence it needs to comma separted instead of using a semicolon
as separator.

We also rename it to SETUP_PY_LINKAGE to indicate where it is used.

Closes #2947
2022-01-27 11:26:56 +01:00
Joakim Hove
07500d5f09 Set the CC environment variable also for non ccache situation 2022-01-26 12:20:43 +01:00
Joakim Hove
b3faf8abf2 Use C++ compiler from cmake in setup.py 2022-01-24 16:05:25 +01:00
Joakim Hove
0a59bd8f61 Filesystem rename EclipseState/Schedule/ Schedule/ 2022-01-02 14:32:14 +01:00
Joakim Hove
aede532b9a Filesystem rename parser/eclipse/ input/eclipse 2022-01-02 14:32:14 +01:00
Daniel
90ce7bc6cb Replaced call to Deck::getKeyword(kw, index) with deck[kw][index] 2021-11-23 14:00:38 +01:00
Daniel
b0f757eb50 Replace Deck::getKeyword(std::string) with operator[std::string] 2021-11-23 14:00:38 +01:00
Joakim Hove
bef5f5b9f4 Small fixup in python wrapper 2021-11-16 18:37:59 +01:00
Håkon Hægland
928a33d2ea Add comment about insert_keywords()
Add comment explaining that one of the insert_keywords()
overloads does not work yet.
2021-11-14 13:18:26 +01:00
Håkon Hægland
372b7e86a4 Support for adding keywords to schedule from Python.
Adds support for adding keywords to the SCHEDULE section of the deck
after the deck has been read from file from Python.
2021-11-14 13:18:26 +01:00
Joakim Hove
08e29defd2 Remove python2 adaption 2021-11-11 15:53:21 +01:00
Joakim Hove
e017195478 Whitespace fixup 2021-11-11 15:53:21 +01:00
Joakim Hove
b77ed8cc7c Add dimension to UDAValue when creating 2021-11-11 15:53:21 +01:00
Joakim Hove
0fc2448369 Expose UDAValue to Python 2021-11-11 15:53:21 +01:00
Joakim Hove
77985eaa08 Export UnitSystem and Dimension from opm.io 2021-11-11 15:53:21 +01:00
Joakim Hove
64e10a9c77 Export UnitSystem to opm._common 2021-11-11 15:53:21 +01:00
Joakim Hove
55eeabba42 Use only python3 syntax for import from test directory 2021-11-11 15:53:21 +01:00
Håkon Hægland
4e5f7ef48e Add some more UDA value tests.
Adds some more tests for UDA value items when constructing DeckKeyword
from Python.
2021-11-10 15:56:36 +01:00
Håkon Hægland
25ccb17917 Test UDA value DeckKeyword
Test that the DeckKeyword() Python constructor can handle UDA value
keywords.
2021-11-09 11:47:58 +01:00
Håkon Hægland
702c4d46af Add support for UDA values in DeckKeyword constructor.
Add support for UDA values items when constructing DeckKeywords from
DeckValues. This is needed when constructing DeckKeywords
from Python. For example WCONPROD has UDA value argument for the oil
rate.
2021-11-08 09:58:22 +01:00
Arne Morten Kvarving
6465cfe1ea changed: drop gcc7 compatibility
this means getting rid of the Opm::filesystem namespace
and directly using std::filesystem, as well as dropping
some of the compat code for the tr filesystem.

we still need the FileSystem.hpp/cpp files though as unique_path
is not part of std::filesystem.
2021-11-01 12:36:42 +01:00
Håkon Hægland
29c4ffcdc9 Use std::shared_ptr as holder type.
Use std::shared_ptr as holder type for some Pybind11 classes such that
they can be shared with opm.simulators.
2021-09-20 11:43:50 +02:00
Torbjørn Skille
c900462edb fixing bug in Opm::EclIO::ESmry constructor
- changed behaviour when opening summary file from restart run
 - will now work with loadBaseRunData=false and original base run folder
   not found.
2021-09-07 22:49:48 +02:00
Torbjørn Skille
514e3a4a35 Adding python bindings for c++ class ExtESmry
- Used for loading data from summary file ESMRY
 - python class ESmry supporting both SMSPEC/UNSMRY and ESMRY summary files.
2021-08-23 22:15:58 +02:00
Cintia Goncalves Machado
0427f45163 fix; 2021-08-04 13:35:21 +02:00
Cintia Goncalves Machado
830cb81620 addEnableWATVAP 2021-08-04 12:23:17 +02:00
Torbjørn Skille
eded5fdb0c add functionality to the parser for parsing selected sections of a data deck
- made available in python bindings
 - added unit tests both for c++ and python
2021-06-22 18:45:24 +02:00
Markus Blatt
50ec3bca05 Spelling fixes pointed out by lintian. 2021-06-15 21:11:36 +02:00
Vegard Kippe
e5987985be Removed pandas dep also from supporting files.. 2021-05-13 10:53:03 +02:00
Vegard Kippe
8a69023089 Removed the pandas dependency 2021-05-13 10:47:27 +02:00
Vegard Kippe
62e78e0018 Adding pandas to requirements.txt 2021-05-12 12:36:42 +02:00
Vegard Kippe
fe5004685c Adding support for time (HH:MM:SS.MICROSEC) in time_vector. Updating tests accordingly. 2021-05-12 12:16:34 +02:00
Arne Morten Kvarving
04ae012638 changed: python 3.5 is no longer support in pypi 2021-05-08 19:25:06 +02:00
Arne Morten Kvarving
c407618375 Schedule: forward types to avoid includes
move constructor definition to compile unit
to avoid symbol usage in header
2021-04-27 12:45:24 +02:00
Arne Morten Kvarving
97eaa972c2 EclipseState: forward types to avoid includes
also clean up some unnecessary forwards, old debugging code
2021-04-27 12:45:24 +02:00
Joakim Hove
a6bdda7b27 Merge pull request #2420 from tskille/fix_erst
fixing bug for python bindings ERst
2021-04-14 10:05:59 +02:00
Torbjørn Skille
94e541ad60 new python bindings class EModel 2021-04-13 10:42:43 +02:00
Torbjørn Skille
6003736221 fixing bug for python bindings ERst
> bug related to occurence parameter in function get_erst_vector(..)
 > additional python unittest related to this function
2021-04-11 08:48:23 +02:00
Arne Morten Kvarving
9402db2421 fix building python bindings (with lto)
need to set the define for header only library with internal libfmt,
and whatever flags are required by external libfmt
2021-04-09 11:56:25 +02:00
Arne Morten Kvarving
5d13b9ed59 fixed: built builtin_pybind11.cpp in python bindings
necessary with lto as symbols are not visible in main library
2021-04-09 11:56:25 +02:00
Markus Blatt
f8c6fabb2d Use system's pybind11 if available. 2021-03-19 20:18:58 +01:00
Markus Blatt
6cf4250f18 Removes inclusion of boost-python header 2021-03-17 16:02:41 +01:00
Markus Blatt
974f7da6a1 Use python3 for setup scripts, too 2021-03-11 11:50:27 +01:00