Skip to content

Commit

Permalink
Rename to res2df
Browse files Browse the repository at this point in the history
Rename to res2df
  • Loading branch information
yngve-sk committed Nov 22, 2023
1 parent 798ee62 commit 75b2413
Show file tree
Hide file tree
Showing 143 changed files with 2,497 additions and 2,384 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,16 @@ jobs:
with:
python-version: 3.8

- name: Install ecl2df
- name: Install res2df
run: |
pip install pip -U
pip install .[tests,ert]
- name: Generate coverage report and upload
run: |
pytest tests --disable-warnings --cov=ecl2df --cov-report=xml
# Uninstall packages that ecl2df supports not being installed:
pytest tests --disable-warnings --cov=res2df --cov-report=xml
# Uninstall packages that res2df supports not being installed:
pip uninstall --yes ert networkx opm
# Run tests again in cov-append-mode:
pytest tests --disable-warnings --cov=ecl2df --cov-report=xml --cov-append
pytest tests --disable-warnings --cov=res2df --cov-report=xml --cov-append
bash <(curl -s https://codecov.io/bash)
24 changes: 12 additions & 12 deletions .github/workflows/ecl2df.yml → .github/workflows/res2df.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: ecl2df
name: res2df

on:
push:
Expand All @@ -15,7 +15,7 @@ env:
ERT_SHOW_BACKTRACE: 1

jobs:
ecl2df:
res2df:
runs-on: ubuntu-latest
strategy:
matrix:
Expand All @@ -40,11 +40,11 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Install ecl2df with dependencies
- name: Install res2df with dependencies
run: |
pip install --upgrade pip
pip install .
python -c "import ecl2df"
python -c "import res2df"
- name: Install ert
if: matrix.install-ert
Expand All @@ -55,17 +55,17 @@ jobs:

- name: Check code style and typing
run: |
black --check ecl2df tests setup.py docs/conf.py
flake8 ecl2df tests
isort --check-only --profile black ecl2df tests
mypy ecl2df
black --check res2df tests setup.py docs/conf.py
flake8 res2df tests
isort --check-only --profile black res2df tests
mypy res2df
- name: List all installed packages
run: pip freeze

- name: Run tests
run: |
python -c "import ecl2df"
python -c "import res2df"
pytest tests/
- name: Syntax check documentation
Expand All @@ -81,8 +81,8 @@ jobs:
run: |
cp -R ./build/sphinx/html ../html
git config --local user.email "ecl2df-github-action"
git config --local user.name "ecl2df-github-action"
git config --local user.email "res2df-github-action"
git config --local user.name "res2df-github-action"
git fetch origin gh-pages
git checkout --track origin/gh-pages
git clean -f -f -d -x
Expand All @@ -103,7 +103,7 @@ jobs:
if: github.event_name == 'release' && matrix.python-version == '3.8'
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.ecl2df_pypi_token }}
TWINE_PASSWORD: ${{ secrets.res2df_pypi_token }}
run: |
python -m pip install --upgrade setuptools wheel twine
python setup.py sdist bdist_wheel
Expand Down
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
.eggs
.cache
.coverage
ecl2df.egg-info
res2df.egg-info
.tox
*.swp
*.pyc
*~
docs/modules.rst
docs/ecl2df.rst
ecl2df/version.py
docs/res2df.rst
res2df/version.py
\#*
.\#*
2 changes: 1 addition & 1 deletion .pylintrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# PYLINT: General settings for ecl2df
# PYLINT: General settings for res2df

[GENERAL]
disable=R0205, F0010, C0330, E1136, E0401,C0114
Expand Down
28 changes: 14 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
[![Build Status](https://img.shields.io/github/workflow/status/equinor/ecl2df/ecl2df)](https://github.com/equinor/ecl2df/actions?query=workflow%3Aecl2df)
[![Language grade: Python](https://img.shields.io/lgtm/grade/python/g/equinor/ecl2df.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/equinor/ecl2df/context:python)
[![Total alerts](https://img.shields.io/lgtm/alerts/g/equinor/ecl2df.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/equinor/ecl2df/alerts/)
[![codecov](https://codecov.io/gh/equinor/ecl2df/branch/master/graph/badge.svg)](https://codecov.io/gh/equinor/ecl2df)
[![Build Status](https://img.shields.io/github/workflow/status/equinor/res2df/res2df)](https://github.com/equinor/res2df/actions?query=workflow%3Ares2df)
[![Language grade: Python](https://img.shields.io/lgtm/grade/python/g/equinor/res2df.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/equinor/res2df/context:python)
[![Total alerts](https://img.shields.io/lgtm/alerts/g/equinor/res2df.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/equinor/res2df/alerts/)
[![codecov](https://codecov.io/gh/equinor/res2df/branch/master/graph/badge.svg)](https://codecov.io/gh/equinor/res2df)
[![Python 3.8-3.10](https://img.shields.io/badge/python-3.8%20|%203.9%20|%203.10-blue.svg)](https://www.python.org)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://black.readthedocs.io/)
[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)

# ecl2df
# res2df

ecl2df is a Pandas DataFrame wrapper around libecl and opm.io, which
are used to access binary files outputted by the reservoir simulator
Eclipse, or its input files --- or any other tool outputting to the same
data format.
res2df is a Pandas DataFrame wrapper around resdata and opm.io, which
are used to access binary files outputted by reservoir simulators,
or its input files --- or any other tool outputting to the same data format.

The reverse operation, from a Pandas DataFrame to Eclipse include files,
is provided for some of the modules.
The reverse operation, from a Pandas DataFrame to reservoir simulator include files
(commonly given the extension ".inc", ".grdecl" etc.) is provided for some of the
modules.

The package consists of a module pr. datatype, e.g. one module for summary
files (.UNSMRY), one for completion data etc.

There is a command line frontend for almost all functionality, called
`ecl2csv`, which converts the Eclipse data to DataFrames, and then dumps
the dataframes to files in CSV format, and a similar `csv2ecl` for the
`res2csv`, which converts the reservoir data to DataFrames, and then dumps
the dataframes to files in CSV format, and a similar `csv2res` for the
reverse operation.

For documentation, see <https://equinor.github.io/ecl2df/>
For documentation, see <https://equinor.github.io/res2df/>

## License

Expand Down
20 changes: 10 additions & 10 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@

# -- Project information -----------------------------------------------------

project = "ecl2df"
project = "res2df"
author = "Håvard Berland"
copyright = f"Equinor 2019-{datetime.datetime.now().year}"

# The short X.Y version
import ecl2df # noqa
import res2df # noqa

release = metadata.version("ecl2df")
release = metadata.version("res2df")
version = release

# -- General configuration ---------------------------------------------------
Expand All @@ -50,7 +50,7 @@
"sphinxarg.ext",
]

autoapi_modules: dict = {"ecl2df": None}
autoapi_modules: dict = {"res2df": None}

autodoc_default_options = {"members": None}

Expand Down Expand Up @@ -118,7 +118,7 @@
# -- Options for HTMLHelp output ---------------------------------------------

# Output file base name for HTML help builder.
htmlhelp_basename = "ecl2dfdoc"
htmlhelp_basename = "res2dfdoc"


# -- Options for LaTeX output ------------------------------------------------
Expand All @@ -141,14 +141,14 @@
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [(master_doc, "ecl2df.tex", "ecl2df Documentation", author, "manual")]
latex_documents = [(master_doc, "res2df.tex", "res2df Documentation", author, "manual")]


# -- Options for manual page output ------------------------------------------

# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [(master_doc, "ecl2df", "ecl2df Documentation", [author], 1)]
man_pages = [(master_doc, "res2df", "res2df Documentation", [author], 1)]


# -- Options for Texinfo output ----------------------------------------------
Expand All @@ -159,10 +159,10 @@
texinfo_documents = [
(
master_doc,
"ecl2df",
"ecl2df Documentation",
"res2df",
"res2df Documentation",
author,
"ecl2df",
"res2df",
"One line description of project.",
"Miscellaneous",
)
Expand Down
36 changes: 18 additions & 18 deletions docs/contribution.rst
Original file line number Diff line number Diff line change
@@ -1,49 +1,49 @@
======================
Contributing to ecl2df
Contributing to res2df
======================

Contributing to ecl2df is easiest on Linux computers. Windows has not been
Contributing to res2df is easiest on Linux computers. Windows has not been
tested, and for Mac you will have to compile OPM yourself.

Getting started as a developer
------------------------------

The first thing to do, is to create a fork of ecl2df to your personal
github account. Go to https://github.com/equinor/ecl2df and click the Fork
The first thing to do, is to create a fork of res2df to your personal
github account. Go to https://github.com/equinor/res2df and click the Fork
button.

Clone your fork to your local computer:

.. code-block:: console
git clone git@github.com:<youraccount>/ecl2df
cd ecl2df
git clone git@github.com:<youraccount>/res2df
cd res2df
Then add the upstream repository:

.. code-block:: console
git remote add upstream git@github.com:equinor/ecl2df
git remote add upstream git@github.com:equinor/res2df
This requires a valid login setup with SSH keys for you github account, needed
for write access.

After cloning, you should make a Python virtual environment in which you install
ecl2df and its dependencies. If you want to create a new virtual environment for
ecl2df, you can do something like the following:
res2df and its dependencies. If you want to create a new virtual environment for
res2df, you can do something like the following:

.. code-block:: console
python3 -m venv venv-ecl2df
source venv-ecl2df/bin/activate
python3 -m venv venv-res2df
source venv-res2df/bin/activate
and then run ``pip`` :

.. code-block:: console
pip install -e .[tests,docs]
to install ecl2df in "edit"-mode together will all dependencies for ecl2df, its
to install res2df in "edit"-mode together will all dependencies for res2df, its
test suite and documentation.

A good start is to verify that all tests pass after having cloned the
Expand Down Expand Up @@ -73,13 +73,13 @@ Komodo in order to prepare for the command:
NB: For every monthly Komodo release, you might have to remake your komodo-venv.

Using ecl2df without OPM
Using res2df without OPM
------------------------

OPM is only pip-installable on Linux. To use the non-OPM dependent ecl2df
modules on something else than Linux (but with libecl installed), you should
OPM is only pip-installable on Linux. To use the non-OPM dependent res2df
modules on something else than Linux (but with resdata installed), you should
install all the dependencies (except OPM) using ``pip`` (see ``setup.py`` for
list of dependencies), and then install ecl2df with the ``--no-deps`` option
list of dependencies), and then install res2df with the ``--no-deps`` option
to ``pip``. After this, the non-OPM dependent modules should work, and others will
fail with import errors.

Expand All @@ -88,7 +88,7 @@ Development workflow

If you have a feature or bugfix, a typical procedure is to:

* Consider writing an issue on https://github.com/equinor/ecl2df/issues describing
* Consider writing an issue on https://github.com/equinor/res2df/issues describing
what is not working or what is not present.
* Make a new git branch for your contribution, from an updated master branch.
* Write a test for the feature or a test proving the bug. Verify that ``pytest``
Expand All @@ -100,7 +100,7 @@ If you have a feature or bugfix, a typical procedure is to:
* Check your code quality with pylint. New code should aim for maximal pylint
score. Pylint exceptions should only be used when warranted.
* Commit your changes, remember to add any new files.
* Push your branch to your fork on github, and go to github.com/equinor/ecl2df
* Push your branch to your fork on github, and go to github.com/equinor/res2df
and make a pull request from your branch. Link your pull request to any
relevant issue.
* Fix any errors that pop up from automated checks.
Expand Down
22 changes: 0 additions & 22 deletions docs/csv2ecl.rst

This file was deleted.

22 changes: 22 additions & 0 deletions docs/csv2res.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
csv2res
=======

Some of the modules inside res2df is able to write :term:`.DATA files<.DATA file>`
from dataframes (in the format dumped by res2df). This makes it possible
to produce :term:`.DATA files<.DATA file>` in any application that can write CSV files,
and use this tool to convert it into reservoir simulator files, or it can
facilitate operations/manipulations of an existing :term:`deck` using any tool
that can work on CSV files, by first running res2csv on an :term:`include file`,
transforming it, and writing back using csv2res.

Mandatory argument for csv2res is
always the submodule responsible, a CSV file, and
an ``--output`` option to specify which include file to write to.
If you want output to your terminal, use ``-`` as the output filename. Unless
you also specify the ``--keywords`` argument with a list of wanted keywords, all
supported keywords for a submodule which is also found in the CSV file provided,
will be dumped to an :term:`output file`.

.. argparse::
:ref: res2df.csv2res.get_parser
:prog: csv2res
13 changes: 0 additions & 13 deletions docs/ecl2csv.rst

This file was deleted.

0 comments on commit 75b2413

Please sign in to comment.