Skip to content

Commit

Permalink
Rename namespace ecl to resdata/rd
Browse files Browse the repository at this point in the history
  • Loading branch information
eivindjahren committed Oct 25, 2023
1 parent 2621d8d commit 7ffe357
Show file tree
Hide file tree
Showing 501 changed files with 18,984 additions and 19,207 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
export DYLD_LIBRARY_PATH=$PWD/lib
ctest --output-on-failure
env:
ECL_SKIP_SIGNAL: absolutely
RD_SKIP_SIGNAL: absolutely
ERT_SHOW_BACKTRACE: yes please!


Expand Down Expand Up @@ -88,7 +88,7 @@ jobs:
python -m pip install pytest
# pytest adds every directory up-to and including python/ into sys.path,
# meaning that "import ecl" will import python/ecl and not the installed
# meaning that "import resdata" will import python/ecl and not the installed
# one. This doesn't work because the resdata.so library only exists in
# site-packages, so we copy directories required by the tests out into its
# own temporary directory.
Expand All @@ -100,7 +100,7 @@ jobs:
cp -R {..,$PWD}/python/tests
# Env vars
export ECL_SKIP_SIGNAL=1
export RD_SKIP_SIGNAL=1
export ERT_SHOW_BACKTRACE=1
# Run tests
Expand Down
5 changes: 2 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ python/lib64
/temp-build
/libert_util/tests/data/latex_OK.pdf
/test-data/Equinor
/python/python/ert/ecl/ecl_local.py
/GPATH
/GRTAGS
/GTAGS
Expand All @@ -28,11 +27,11 @@ __resdata_info.py

/venv/
/_skbuild/
/python/ecl/version.py
/python/resdata/version.py
.*
*.egg-info/

/dist
/dist-*

CMakeSettings.json
CMakeSettings.json
46 changes: 23 additions & 23 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.16)
project(ecl C CXX)
project(restdata C CXX)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
Expand Down Expand Up @@ -79,25 +79,25 @@ conan_cmake_run(

# -----------------------------------------------------------------

set(ECL_VERSION_MAJOR 0)
set(ECL_VERSION_MINOR 0)
set(ECL_VERSION_MICRO "not-available")
set(RD_VERSION_MAJOR 0)
set(RD_VERSION_MINOR 0)
set(RD_VERSION_MICRO "not-available")

# If the micro version is not integer, that should be interpreted as a
# development version leading towards version MAJOR.MINOR.0

execute_process(COMMAND date "+%Y-%m-%d %H:%M:%S"
OUTPUT_VARIABLE ECL_BUILD_TIME)
string(STRIP "${ECL_BUILD_TIME}" ECL_BUILD_TIME)
OUTPUT_VARIABLE RD_BUILD_TIME)
string(STRIP "${RD_BUILD_TIME}" RD_BUILD_TIME)

if(ECL_VERSION)
if(RD_VERSION)
# Have we been provided with an explicitly-set version?
string(REGEX REPLACE "^([^.]+)\\.([^.]+)\\.(.+)$" "\\1" ECL_VERSION_MAJOR
"${ECL_VERSION}")
string(REGEX REPLACE "^([^.]+)\\.([^.]+)\\.(.+)$" "\\2" ECL_VERSION_MINOR
"${ECL_VERSION}")
string(REGEX REPLACE "^([^.]+)\\.([^.]+)\\.(.+)$" "\\3" ECL_VERSION_MICRO
"${ECL_VERSION}")
string(REGEX REPLACE "^([^.]+)\\.([^.]+)\\.(.+)$" "\\1" RD_VERSION_MAJOR
"${RD_VERSION}")
string(REGEX REPLACE "^([^.]+)\\.([^.]+)\\.(.+)$" "\\2" RD_VERSION_MINOR
"${RD_VERSION}")
string(REGEX REPLACE "^([^.]+)\\.([^.]+)\\.(.+)$" "\\3" RD_VERSION_MICRO
"${RD_VERSION}")
else()
# Otherwise try to discover it via git
find_package(Git)
Expand Down Expand Up @@ -132,11 +132,11 @@ else()
OUTPUT_VARIABLE GIT_TAG
OUTPUT_STRIP_TRAILING_WHITESPACE)

string(REGEX REPLACE "^([^.]+)\\.([^.]+)\\.(.+)$" "\\1" ECL_VERSION_MAJOR
string(REGEX REPLACE "^([^.]+)\\.([^.]+)\\.(.+)$" "\\1" RD_VERSION_MAJOR
"${GIT_TAG}")
string(REGEX REPLACE "^([^.]+)\\.([^.]+)\\.(.+)$" "\\2" ECL_VERSION_MINOR
string(REGEX REPLACE "^([^.]+)\\.([^.]+)\\.(.+)$" "\\2" RD_VERSION_MINOR
"${GIT_TAG}")
string(REGEX REPLACE "^([^.]+)\\.([^.]+)\\.(.+)$" "\\3" ECL_VERSION_MICRO
string(REGEX REPLACE "^([^.]+)\\.([^.]+)\\.(.+)$" "\\3" RD_VERSION_MICRO
"${GIT_TAG}")
else()
set(GIT_COMMIT "unknown (git not found!)")
Expand All @@ -148,14 +148,14 @@ endif()

message(
STATUS
"resdata version: ${ECL_VERSION_MAJOR}.${ECL_VERSION_MINOR}.${ECL_VERSION_MICRO}"
"resdata version: ${RD_VERSION_MAJOR}.${RD_VERSION_MINOR}.${RD_VERSION_MICRO}"
)

# -----------------------------------------------------------------

option(BUILD_TESTS "Should the tests be built" OFF)
option(BUILD_APPLICATIONS "Should we build small utility applications" OFF)
option(BUILD_ECL_SUMMARY "Build the commandline application ecl_summary" OFF)
option(BUILD_RD_SUMMARY "Build the commandline application rd_summary" OFF)
option(ENABLE_PYTHON "Build and install the Python wrappers" OFF)
option(BUILD_SHARED_LIBS "Build shared libraries" ON)
option(ERT_USE_OPENMP "Use OpenMP" OFF)
Expand All @@ -176,11 +176,11 @@ if(EXISTS ${EQUINOR_TESTDATA_ROOT})
message(STATUS "Linking testdata: ${LINK} -> ${EQUINOR_TESTDATA_ROOT}")

set(_equinor_test_data ${CMAKE_SOURCE_DIR}/test-data/Equinor)
set(_eclpath ${_equinor_test_data}/ECLIPSE)
set(_resdatapath ${_equinor_test_data}/ECLIPSE)
set(_geopath ${_equinor_test_data}/Geometry)
endif()
set(_local_test_data "${CMAKE_CURRENT_SOURCE_DIR}/test-data/local")
set(_local_eclpath ${_local_test_data}/ECLIPSE)
set(_local_resdatapath ${_local_test_data}/ECLIPSE)

# output libs to some lib/ path for testing
set(LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR})
Expand Down Expand Up @@ -472,7 +472,7 @@ endif()

if(NOT SKBUILD)
# Avoid installing when calling from python setup.py
install(EXPORT ecl-config DESTINATION share/cmake/ecl)
export(TARGETS ecl FILE eclConfig.cmake)
export(PACKAGE ecl)
install(EXPORT resdata-config DESTINATION share/cmake/resdata)
export(TARGETS resdata FILE resdataConfig.cmake)
export(PACKAGE resdata)
endif()
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Contributing

The following is a set of guidelines for contributing to ecl.
The following is a set of guidelines for contributing to resdata.

## Ground Rules

Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ compiler such as GNU GCC, the CMake build system and, optionally, zlib.

```bash
$ git clone https://github.com/Equinor/ecl
$ mkdir ecl/build
$ cd ecl/build
$ mkdir resdata/build
$ cd resdata/build
$ cmake ..
$ make
$ make install
Expand All @@ -70,8 +70,8 @@ compiler, CMake and, optionally, zlib.

```bash
$ git clone https://github.com/Equinor/ecl
$ mkdir ecl/build
$ cd ecl/build
$ mkdir resdata/build
$ cd resdata/build
$ pip install -r ../requirements.txt
$ cmake .. -DENABLE_PYTHON=ON
$ make
Expand All @@ -92,10 +92,10 @@ $ export LD_LIBRARY_PATH=/path/to/install/lib64:$LD_LIBRARY_PATH

Then you can fire up your Python interpreter and try it out:
```python
>>> from ecl.summary import EclSum
>>> from resdata.summary import RdSum
>>> import sys

>>> summary = EclSum(sys.argv[1])
>>> summary = RdSum(sys.argv[1])
>>> fopt = summary.numpy_vector("FOPT")
```

Expand Down
2 changes: 1 addition & 1 deletion WINDOWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@
~~~~
6. For **_resdata_** to be accessible in Python the `%INSTALLPATH%\lib\pythonX.Y\site-package` and Python subdirectories must be added to the `PATH` and `PYTHONPATH` variables. Where `pythonx.y` is the current Python version _e.g._ (`python3.9`, `python3.10` _etc._) .

8. Open a Python interactive session and run `import ecl` to check that the install and paths are now set.
8. Open a Python interactive session and run `import resdata` to check that the install and paths are now set.
30 changes: 15 additions & 15 deletions applications/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
project(resdata-applications)

function(target_link_resdata target)
target_link_libraries(${target} ecl)
target_link_libraries(${target} resdata)
if(SKBUILD)
set_target_properties(${target} PROPERTIES INSTALL_RPATH "$ORIGIN/../.libs")
endif()
endfunction()

if(BUILD_APPLICATIONS)
add_executable(sum_write ecl/sum_write.cpp)
add_executable(make_grid ecl/make_grid.c)
add_executable(grdecl_grid ecl/grdecl_grid.c)
add_executable(summary ecl/view_summary.cpp)
add_executable(kw_extract ecl/kw_extract.cpp)
add_executable(sum_write resdata/sum_write.cpp)
add_executable(make_grid resdata/make_grid.c)
add_executable(grdecl_grid resdata/grdecl_grid.c)
add_executable(summary resdata/view_summary.cpp)
add_executable(kw_extract resdata/kw_extract.cpp)
target_link_resdata(sum_write)
target_link_resdata(make_grid)
target_link_resdata(grdecl_grid)
Expand All @@ -23,14 +23,14 @@ if(BUILD_APPLICATIONS)

foreach(
app
ecl_pack
ecl_unpack
rd_pack
rd_unpack
grid_info
grid_dump
grid_dump_ascii
select_test
load_test)
add_executable(${app} ecl/${app}.c)
add_executable(${app} resdata/${app}.c)
target_link_resdata(${app})
list(APPEND apps ${app})
if(ERT_LINUX)
Expand All @@ -41,7 +41,7 @@ if(BUILD_APPLICATIONS)

if(ERT_LINUX)
foreach(app convert grdecl_test kw_list)
add_executable(${app} ecl/${app}.c)
add_executable(${app} resdata/${app}.c)
target_link_resdata(${app})
# The .x extension creates problems on windows
set_target_properties(${app} PROPERTIES SUFFIX ".x")
Expand All @@ -62,12 +62,12 @@ if(BUILD_APPLICATIONS)
list(APPEND apps segment_info CF_dump ri_well_test)
endif()

if(BUILD_ECL_SUMMARY)
add_executable(ecl_summary ecl/view_summary.cpp)
target_link_resdata(ecl_summary)
list(APPEND apps ecl_summary)
if(BUILD_RD_SUMMARY)
add_executable(rd_summary resdata/view_summary.cpp)
target_link_resdata(rd_summary)
list(APPEND apps rd_summary)

install(FILES ${PROJECT_SOURCE_DIR}/man/man1/ecl_summary.1
install(FILES ${PROJECT_SOURCE_DIR}/man/man1/rd_summary.1
DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
endif()

Expand Down
Loading

0 comments on commit 7ffe357

Please sign in to comment.