diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml
index e0d9e35..067e035 100644
--- a/.github/workflows/CI.yml
+++ b/.github/workflows/CI.yml
@@ -36,7 +36,7 @@ jobs:
sudo apt-get install mpi-default-bin
sudo apt-get install libopm-simulators-bin
- - name: Install test dependecies
+ - name: Install dependecies
run: |
pip install --upgrade pip setuptools wheel
pip install -r dev-requirements.txt
@@ -47,9 +47,9 @@ jobs:
- name: Check code style and linting
run: |
- black --check src/ tests/ setup.py
- pylint src/ tests/ setup.py
- mypy --ignore-missing-imports src/ tests/ setup.py
+ black --check src/ tests/
+ pylint src/ tests/
+ mypy --ignore-missing-imports src/ tests/
- name: Run the tests
run: |
diff --git a/README.md b/README.md
index ea30b29..62a0a2b 100644
--- a/README.md
+++ b/README.md
@@ -1,5 +1,5 @@
[![Build Status](https://github.com/cssr-tools/pycopm/actions/workflows/CI.yml/badge.svg)](https://github.com/cssr-tools/pycopm/actions/workflows/CI.yml)
-
+
[![Code style](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black)
[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)
[![DOI](https://zenodo.org/badge/815649176.svg)](https://zenodo.org/doi/10.5281/zenodo.12740838)
@@ -12,9 +12,9 @@ Creation of coarser models from given input decks.
## Installation
You will first need to install
-* Flow (https://opm-project.org, Release 2024.04 or current master branches)
+* OPM Flow (https://opm-project.org, Release 2024.04 or current master branches)
-To install the _pycopm_ executable in an existing Python environment:
+To install the _pycopm_ executable in an existing Python environment:
```bash
pip install git+https://github.com/cssr-tools/pycopm.git
@@ -34,15 +34,13 @@ python3 -m venv vpycopm
source vpycopm/bin/activate
# Upgrade pip, setuptools, and wheel
pip install --upgrade pip setuptools wheel
-# Install the pycopm package (in editable mode for contributions/modifications; otherwise, pip install .)
+# Install the pycopm package
pip install -e .
# For contributions/testing/linting, install the dev-requirements
pip install -r dev-requirements.txt
```
-See the [_CI.yml_](https://github.com/OPM/pycopm/blob/main/.github/workflows/CI.yml) script for installation of OPM Flow (binary packages) and the pycopm package. If you are a Linux user (including the Windows subsystem for Linux), then you could try to build Flow from the master branches with mpi support, by running the script `./build_opm-flow_mpi.bash`, which in turn should build flow in the folder ./build/opm-simulators/bin/flow (you first need to install the [_OPM-Flow-prerequisites_](https://opm-project.org/?page_id=239)).
-
-For macOS users, use at least a Python version of 3.10 (due to resdata), and run the `./build_opm-flow_macOS.bash` to build OPM Flow (the [_OPM-Flow-prerequisites_](https://opm-project.org/?page_id=239) can be installed via brew or macports).
+See the [_installation_](https://cssr-tools.github.io/pycopm/installation.html) for further details on building OPM Flow from the master branches in Linux, Windows, and macOS, as well as the opm Python package.
## Running pycopm
You can run _pycopm_ as a single command line:
@@ -52,4 +50,10 @@ pycopm -i some_input -o some_output_folder
Run `pycopm --help` to see all possible command line argument options.
## Getting started
-See the [_examples_](https://cssr-tools.github.io/pycopm/examples.html) in the [_documentation_](https://cssr-tools.github.io/pycopm/introduction.html).
\ No newline at end of file
+See the [_examples_](https://cssr-tools.github.io/pycopm/examples.html) in the [_documentation_](https://cssr-tools.github.io/pycopm/introduction.html).
+
+## About pycopm
+The _pycopm_ package is being funded by the [_Center for Sustainable Subsurface Resources (CSSR)_](https://cssr.no)
+[project no. 331841].
+This is work in progress.
+Contributions are more than welcome using the fork and pull request approach.
\ No newline at end of file
diff --git a/build_opm-flow_macOS.bash b/build_opm-flow_macOS.bash
deleted file mode 100755
index 14f282f..0000000
--- a/build_opm-flow_macOS.bash
+++ /dev/null
@@ -1,36 +0,0 @@
-# SPDX-FileCopyrightText: 2024 NORCE
-# SPDX-License-Identifier: GPL-3.0
-
-CURRENT_DIRECTORY="$PWD"
-
-# Dune modules
-for module in common geometry grid istl
-do git clone https://gitlab.dune-project.org/core/dune-$module.git
-done
-for module in common geometry grid istl
-do ./dune-common/bin/dunecontrol --only=dune-$module cmake -DCMAKE_DISABLE_FIND_PACKAGE_MPI=1
- ./dune-common/bin/dunecontrol --only=dune-$module make -j5
-done
-
-# OPM modules
-for repo in common grid models simulators
-do
- git clone https://github.com/OPM/opm-$repo.git
-done
-
-mkdir build
-
-for repo in common grid models
-do
- mkdir build/opm-$repo
- cd build/opm-$repo
- cmake -DUSE_MPI=0 -DNDEBUG=1 -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="$CURRENT_DIRECTORY/dune-common/build-cmake;$CURRENT_DIRECTORY/dune-grid/build-cmake;$CURRENT_DIRECTORY/dune-geometry/build-cmake;$CURRENT_DIRECTORY/dune-istl/build-cmake;$CURRENT_DIRECTORY/build/opm-common;$CURRENT_DIRECTORY/build/opm-grid" $CURRENT_DIRECTORY/opm-$repo
- make -j5
- cd ../..
-done
-
-mkdir build/opm-simulators
-cd build/opm-simulators
-cmake -DUSE_MPI=0 -DNDEBUG=1 -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="$CURRENT_DIRECTORY/dune-common/build-cmake;$CURRENT_DIRECTORY/dune-grid/build-cmake;$CURRENT_DIRECTORY/dune-geometry/build-cmake;$CURRENT_DIRECTORY/dune-istl/build-cmake;$CURRENT_DIRECTORY/build/opm-common;$CURRENT_DIRECTORY/build/opm-grid;$CURRENT_DIRECTORY/build/opm-models" $CURRENT_DIRECTORY/opm-simulators
-make -j5 flow
-cd ../..
\ No newline at end of file
diff --git a/build_opm-flow_mpi.bash b/build_opm-flow_mpi.bash
deleted file mode 100644
index 39c2c1c..0000000
--- a/build_opm-flow_mpi.bash
+++ /dev/null
@@ -1,27 +0,0 @@
-# SPDX-FileCopyrightText: 2024 NORCE
-# SPDX-License-Identifier: GPL-3.0
-
-CURRENT_DIRECTORY="$PWD"
-
-# OPM modules
-for repo in common grid models simulators
-do
- git clone https://github.com/OPM/opm-$repo.git
-done
-
-mkdir build
-
-for repo in common grid models
-do
- mkdir build/opm-$repo
- cd build/opm-$repo
- cmake -DUSE_MPI=1 -DNDEBUG=1 -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="$CURRENT_DIRECTORY/build/opm-common;$CURRENT_DIRECTORY/build/opm-grid" $CURRENT_DIRECTORY/opm-$repo
- make -j5
- cd ../..
-done
-
-mkdir build/opm-simulators
-cd build/opm-simulators
-cmake -DUSE_MPI=1 -DNDEBUG=1 -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="$CURRENT_DIRECTORY/build/opm-common;$CURRENT_DIRECTORY/build/opm-grid;$CURRENT_DIRECTORY/build/opm-models" $CURRENT_DIRECTORY/opm-simulators
-make -j5 flow
-cd ../..
\ No newline at end of file
diff --git a/dev-requirements.txt b/dev-requirements.txt
index de0a4ea..e6a74d0 100644
--- a/dev-requirements.txt
+++ b/dev-requirements.txt
@@ -1,7 +1,7 @@
black
-pylint
+numpydoc
mypy
+pylint
pytest-cov
sphinx
-sphinx-rtd-theme
-pytest
\ No newline at end of file
+sphinx-rtd-theme
\ No newline at end of file
diff --git a/docs/_sources/index.rst.txt b/docs/_sources/index.rst.txt
index ce96eaf..1dcc9d1 100644
--- a/docs/_sources/index.rst.txt
+++ b/docs/_sources/index.rst.txt
@@ -7,6 +7,7 @@ Welcome to pycopm's documentation!
:maxdepth: 4
introduction
+ installation
configuration_file
examples
api
diff --git a/docs/_sources/installation.rst.txt b/docs/_sources/installation.rst.txt
new file mode 100644
index 0000000..82165e2
--- /dev/null
+++ b/docs/_sources/installation.rst.txt
@@ -0,0 +1,120 @@
+============
+Installation
+============
+
+Python package
+--------------
+
+To install the **pycopm** executable in an existing Python environment:
+
+.. code-block:: bash
+
+ pip install git+https://github.com/cssr-tools/pycopm.git
+
+If you are interested in modifying the source code, then you can clone the repository and
+install the Python requirements in a virtual environment with the following commands:
+
+.. code-block:: console
+
+ # Clone the repo
+ git clone https://github.com/cssr-tools/pycopm.git
+ # Get inside the folder
+ cd pycopm
+ # Create virtual environment
+ python3 -m venv vpycopm
+ # Activate virtual environment
+ source vpycopm/bin/activate
+ # Upgrade pip, setuptools, and wheel
+ pip install --upgrade pip setuptools wheel
+ # Install the pycopm package
+ pip install -e .
+ # For contributions/testing/linting, install the dev-requirements
+ pip install -r dev-requirements.txt
+
+OPM Flow
+--------
+You also need to install:
+
+* OPM Flow (https://opm-project.org, Release 2024.04 or current master branches)
+
+.. tip::
+
+ See the `CI.yml `_ script
+ for installation of OPM Flow (binary packages) and the pycopm package in Linux.
+
+Source build in Linux/Windows
++++++++++++++++++++++++++++++
+If you are a Linux user (including the Windows subsystem for Linux), then you could try to build Flow (after installing the `prerequisites `_) from the master branches with mpi support by running
+in the terminal the following lines (which in turn should build flow in the folder ./build/opm-simulators/bin/flow.):
+
+.. code-block:: console
+
+ CURRENT_DIRECTORY="$PWD"
+
+ for repo in common grid models simulators
+ do
+ git clone https://github.com/OPM/opm-$repo.git
+ done
+
+ mkdir build
+
+ for repo in common grid models
+ do
+ mkdir build/opm-$repo
+ cd build/opm-$repo
+ cmake -DUSE_MPI=1 -DWITH_NDEBUG=1 -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="$CURRENT_DIRECTORY/build/opm-common;$CURRENT_DIRECTORY/build/opm-grid" $CURRENT_DIRECTORY/opm-$repo
+ make -j5 opm$repo
+ cd ../..
+ done
+
+ mkdir build/opm-simulators
+ cd build/opm-simulators
+ cmake -DUSE_MPI=1 -DWITH_NDEBUG=1 -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="$CURRENT_DIRECTORY/build/opm-common;$CURRENT_DIRECTORY/build/opm-grid;$CURRENT_DIRECTORY/build/opm-models" $CURRENT_DIRECTORY/opm-simulators
+ make -j5 flow
+ cd ../..
+
+
+.. tip::
+
+ You can create a .sh file (e.g., build_opm_mpi.sh), copy the previous lines, and run in the terminal **source build_opm_mpi.sh**
+
+Source build in macOS
++++++++++++++++++++++
+For macOS, there are no available binary packages, so OPM Flow needs to be built from source, in addition to the dune libraries
+(see the `prerequisites `_, which can be installed using macports or brew). This can be achieved by the following lines:
+
+.. code-block:: console
+
+ CURRENT_DIRECTORY="$PWD"
+
+ for module in common geometry grid istl
+ do git clone https://gitlab.dune-project.org/core/dune-$module.git --branch v2.9.1
+ done
+ for module in common geometry grid istl
+ do ./dune-common/bin/dunecontrol --only=dune-$module cmake -DCMAKE_DISABLE_FIND_PACKAGE_MPI=1
+ ./dune-common/bin/dunecontrol --only=dune-$module make -j5
+ done
+
+ for repo in common grid models simulators
+ do
+ git clone https://github.com/OPM/opm-$repo.git
+ done
+
+ mkdir build
+
+ for repo in common grid models
+ do
+ mkdir build/opm-$repo
+ cd build/opm-$repo
+ cmake -DUSE_MPI=0 -DWITH_NDEBUG=1 -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="$CURRENT_DIRECTORY/dune-common/build-cmake;$CURRENT_DIRECTORY/dune-grid/build-cmake;$CURRENT_DIRECTORY/dune-geometry/build-cmake;$CURRENT_DIRECTORY/dune-istl/build-cmake;$CURRENT_DIRECTORY/build/opm-common;$CURRENT_DIRECTORY/build/opm-grid" $CURRENT_DIRECTORY/opm-$repo
+ make -j5 opm$repo
+ cd ../..
+ done
+
+ mkdir build/opm-simulators
+ cd build/opm-simulators
+ cmake -DUSE_MPI=0 -DWITH_NDEBUG=1 -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="$CURRENT_DIRECTORY/dune-common/build-cmake;$CURRENT_DIRECTORY/dune-grid/build-cmake;$CURRENT_DIRECTORY/dune-geometry/build-cmake;$CURRENT_DIRECTORY/dune-istl/build-cmake;$CURRENT_DIRECTORY/build/opm-common;$CURRENT_DIRECTORY/build/opm-grid;$CURRENT_DIRECTORY/build/opm-models" $CURRENT_DIRECTORY/opm-simulators
+ make -j5 flow
+ cd ../..
+
+In addition, use at least a Python version of 3.10 (due to the resdata Python package).
\ No newline at end of file
diff --git a/docs/_sources/introduction.rst.txt b/docs/_sources/introduction.rst.txt
index c4b2857..47d838d 100644
--- a/docs/_sources/introduction.rst.txt
+++ b/docs/_sources/introduction.rst.txt
@@ -42,17 +42,3 @@ where
- \-y: Vector of y-coarsening (`` by default).
- \-z: Vector of z-coarsening (`` by default).
- \-e: Use `utf8` or `ISO-8859-1` encoding to read the deck (`ISO-8859-1` by default).
-
-Installation
-------------
-See the `Github page `_.
-
-.. tip::
- Check the `CI.yml `_ file.
-
-Getting started
----------------
-See the :doc:`examples <./examples>`.
-
-.. tip::
- Check the `tests `_.
diff --git a/docs/_static/searchtools.js b/docs/_static/searchtools.js
index 92da3f8..b08d58c 100644
--- a/docs/_static/searchtools.js
+++ b/docs/_static/searchtools.js
@@ -178,7 +178,7 @@ const Search = {
htmlToText: (htmlString, anchor) => {
const htmlElement = new DOMParser().parseFromString(htmlString, 'text/html');
- for (const removalQuery of [".headerlinks", "script", "style"]) {
+ for (const removalQuery of [".headerlink", "script", "style"]) {
htmlElement.querySelectorAll(removalQuery).forEach((el) => { el.remove() });
}
if (anchor) {
@@ -328,13 +328,14 @@ const Search = {
for (const [title, foundTitles] of Object.entries(allTitles)) {
if (title.toLowerCase().trim().includes(queryLower) && (queryLower.length >= title.length/2)) {
for (const [file, id] of foundTitles) {
- let score = Math.round(100 * queryLower.length / title.length)
+ const score = Math.round(Scorer.title * queryLower.length / title.length);
+ const boost = titles[file] === title ? 1 : 0; // add a boost for document titles
normalResults.push([
docNames[file],
titles[file] !== title ? `${titles[file]} > ${title}` : title,
id !== null ? "#" + id : "",
null,
- score,
+ score + boost,
filenames[file],
]);
}
diff --git a/docs/about.html b/docs/about.html
index 4712008..45659f1 100644
--- a/docs/about.html
+++ b/docs/about.html
@@ -47,6 +47,7 @@
diff --git a/docs/examples.html b/docs/examples.html
index 1f7c483..6c89c0d 100644
--- a/docs/examples.html
+++ b/docs/examples.html
@@ -48,6 +48,7 @@
diff --git a/docs/modules.html b/docs/modules.html
index e2d4b5f..73c752f 100644
--- a/docs/modules.html
+++ b/docs/modules.html
@@ -46,6 +46,7 @@