Skip to content

Commit

Permalink
Renaming for new package (#17)
Browse files Browse the repository at this point in the history
resmda->dageo; ES-MDA->ESMDA; m->z
  • Loading branch information
prisae authored Dec 6, 2024
1 parent b2ae43b commit 5eda23d
Show file tree
Hide file tree
Showing 28 changed files with 176 additions and 177 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,13 @@ jobs:
- name: Flake8
shell: bash -l {0}
run: flake8 docs/conf.py resmda/ tests/
run: flake8 docs/conf.py dageo/ tests/

- name: Test with pytest
shell: bash -l {0}
run: |
python -m pip install .
pytest --cov=resmda
pytest --cov=dageo
deploy:
needs: test
Expand Down
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ __pycache__/

# Sphinx
docs/_build/
docs/api/resmda*
docs/api/dageo*
docs/savefig/
docs/gallery/*
docs/sg_execution_times.rst
Expand All @@ -15,10 +15,10 @@ htmlcov
.pytest_cache/

# setuptools_scm
resmda/version.py
dageo/version.py

# Build related
.eggs/
build/
dist/
resmda.egg-info/
dageo.egg-info/
12 changes: 6 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ dev-install:
.ONESHELL:
pytest:
rm -rf .coverage htmlcov/ .pytest_cache/
pytest --cov=resmda
pytest --cov=dageo
coverage html

flake8:
flake8 docs/conf.py resmda/ tests/ examples/
flake8 docs/conf.py dageo/ tests/ examples/

html:
cd docs && make html
Expand All @@ -35,7 +35,7 @@ html-noplot:
cd docs && make html-noplot

html-clean:
cd docs && rm -rf api/resmda* gallery/* _build/ && make html
cd docs && rm -rf api/dageo* gallery/* _build/ && make html

preview:
xdg-open docs/_build/html/index.html
Expand All @@ -44,9 +44,9 @@ linkcheck:
cd docs && make linkcheck

clean:
python -m pip uninstall resmda -y
rm -rf build/ dist/ .eggs/ resmda.egg-info/ resmda/version.py # build
python -m pip uninstall dageo -y
rm -rf build/ dist/ .eggs/ dageo.egg-info/ dageo/version.py # build
rm -rf */__pycache__/ */*/__pycache__/ # python cache
rm -rf .coverage htmlcov/ .pytest_cache/ # tests and coverage
rm -rf docs/gallery/* docs/gallery/*.zip docs/_build/ docs/api/resmda* # docs
rm -rf docs/gallery/* docs/gallery/*.zip docs/_build/ docs/api/dageo* # docs
rm -rf docs/savefig
20 changes: 11 additions & 9 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
``resmda`` - ES-MDA with a simple 2D reservoir modeller
=======================================================
``dageo`` - Data Assimilation in Geosciences
============================================

A simple 2D reservoir simulator and a straight-forward implementation of the
basic *Ensemble smoother with multiple data assimilation* (ES-MDA) algorithm as
presented by Emerick and Reynolds, 2013.
Data Assimilation in Geosciences is, for now, a simple 2D reservoir simulator
and a straight-forward implementation of the basic *Ensemble smoother with
multiple data assimilation* (ESMDA) algorithm as presented by Emerick and
Reynolds, 2013. However, more DA methods and examples might be added in the
future.

- **Documentation:** https://tuda-geo.github.io/resmda
- **Source Code:** https://github.com/tuda-geo/resmda
- **Bug reports:** https://github.com/tuda-geo/resmda/issues
- **Documentation:** https://tuda-geo.github.io/dageo
- **Source Code:** https://github.com/tuda-geo/dageo
- **Bug reports:** https://github.com/tuda-geo/dageo/issues


Available through pip and conda:
``pip install resmda`` / ``conda install -c conda-forge resmda``.
``pip install dageo`` / ``conda install -c conda-forge dageo``.

13 changes: 5 additions & 8 deletions resmda/__init__.py → dageo/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Copyright 2024 D. Werthmüller, G. Serrao Seabra, F.C. Vossepoel
#
# This file is part of resmda.
# This file is part of dageo.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy
Expand All @@ -14,13 +14,10 @@
# License for the specific language governing permissions and limitations under
# the License.

from resmda import utils
from resmda.utils import localization_matrix, Report
from resmda.data_assimilation import esmda
from resmda.reservoir_simulator import Simulator, RandomPermeability

print("Warning: `resmda` will change its name to `dageo`.")
print(" Install `dageo` to get the newest version.")
from dageo import utils
from dageo.utils import localization_matrix, Report
from dageo.data_assimilation import esmda
from dageo.reservoir_simulator import Simulator, RandomPermeability

# Initialize a random number generator.
rng = utils.rng()
Expand Down
18 changes: 9 additions & 9 deletions resmda/data_assimilation.py → dageo/data_assimilation.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Copyright 2024 D. Werthmüller, G. Serrao Seabra, F.C. Vossepoel
#
# This file is part of resmda.
# This file is part of dageo.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy
Expand All @@ -16,7 +16,7 @@

import numpy as np

from resmda import utils
from dageo import utils

__all__ = ['esmda']

Expand All @@ -28,10 +28,10 @@ def __dir__():
def esmda(model_prior, forward, data_obs, sigma, alphas=4, data_prior=None,
localization_matrix=None, callback_post=None, return_post_data=True,
return_steps=False, random=None):
"""ES-MDA algorithm ([EmRe13]_) with optional localization.
"""ESMDA algorithm ([EmRe13]_) with optional localization.
Consult the section :ref:`esmda` in the manual for the theory and more
information about ES-MDA.
information about ESMDA.
Parameters
----------
Expand All @@ -48,20 +48,20 @@ def esmda(model_prior, forward, data_obs, sigma, alphas=4, data_prior=None,
sigma : {float, ndarray}
Standard deviation(s) of the observation noise.
alphas : {int, array-like}, default: 4
Inflation factors for ES-MDA.
Inflation factors for ESMDA.
data_prior : ndarray, default: None
Prior data ensemble, of shape ``(ne, nd)``.
callback_post : function, default: None
Function to be executed after each ES-MDA iteration to the posterior
Function to be executed after each ESMDA iteration to the posterior
model, ``callback_post(model_post)``.
return_post_data : bool, default: True
If true, returns also ``forward(model_post)``.
return_steps : bool, default: False
If true, returns model and data of all ES-MDA steps. Setting
If true, returns model and data of all ESMDA steps. Setting
``return_steps`` to True enforces ``return_post_data=True``.
random : {None, int, np.random.Generator}, default: None
Seed or random generator for reproducibility; see
:func:`resmda.utils.rng`.
:func:`dageo.utils.rng`.
localization_matrix : {ndarray, None}, default: None
If provided, apply localization to the Kalman gain matrix, of shape
``(model-shape, nd)``.
Expand Down Expand Up @@ -97,7 +97,7 @@ def esmda(model_prior, forward, data_obs, sigma, alphas=4, data_prior=None,

# Loop over alphas
for i, alpha in enumerate(alphas):
print(f"ES-MDA step {i+1: 3d}; α={alpha}")
print(f"ESMDA step {i+1: 3d}; α={alpha}")

# == Step (a) of Emerick & Reynolds, 2013 ==
# Run the ensemble from time zero.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Copyright 2024 D. Werthmüller, G. Serrao Seabra, F.C. Vossepoel
#
# This file is part of resmda.
# This file is part of dageo.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy
Expand All @@ -17,7 +17,7 @@
import numpy as np
import scipy as sp

from resmda import utils
from dageo import utils

__all__ = ['Simulator', 'RandomPermeability']

Expand Down
6 changes: 3 additions & 3 deletions resmda/utils.py → dageo/utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Copyright 2024 D. Werthmüller, G. Serrao Seabra, F.C. Vossepoel
#
# This file is part of resmda.
# This file is part of dageo.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy
Expand All @@ -21,7 +21,7 @@
from scooby import Report as ScoobyReport

try:
from resmda.version import version as __version__
from dageo.version import version as __version__
except ImportError:
__version__ = 'unknown-'+datetime.today().strftime('%Y%m%d')

Expand Down Expand Up @@ -189,6 +189,6 @@ class Report(ScoobyReport):
def __init__(self, **kwargs):
"""Initiate a scooby.Report instance."""
kwargs = {'ncol': 3, **kwargs}
kwargs['core'] = ['resmda', 'numpy', 'scipy']
kwargs['core'] = ['dageo', 'numpy', 'scipy']
kwargs['optional'] = ['matplotlib', 'IPython']
super().__init__(**kwargs)
2 changes: 1 addition & 1 deletion docs/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Command line options.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
SPHINXPROJ = resmda
SPHINXPROJ = dageo
SOURCEDIR = .
BUILDDIR = _build

Expand Down
2 changes: 1 addition & 1 deletion docs/api/data_assimilation.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Data Assimilation
-----------------

.. automodapi:: resmda.data_assimilation
.. automodapi:: dageo.data_assimilation
:no-inheritance-diagram:
:no-heading:
2 changes: 1 addition & 1 deletion docs/api/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ API reference

----

.. module:: resmda
.. module:: dageo


.. toctree::
Expand Down
2 changes: 1 addition & 1 deletion docs/api/reservoir_simulator.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Reservoir Simulator
-------------------

.. automodapi:: resmda.reservoir_simulator
.. automodapi:: dageo.reservoir_simulator
:no-inheritance-diagram:
:no-heading:
2 changes: 1 addition & 1 deletion docs/api/utils.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Utilities
---------

.. automodapi:: resmda.utils
.. automodapi:: dageo.utils
:no-inheritance-diagram:
:no-heading:
14 changes: 7 additions & 7 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import time
import warnings
from resmda import __version__
from dageo import __version__

# ==== 1. Extensions ====

Expand Down Expand Up @@ -64,7 +64,7 @@
}

# ==== 2. General Settings ====
description = "ES-MDA with a simple 2D reservoir modeller"
description = "Data Assimilation in Geosciences"

# The templates path.
# templates_path = ["_templates"]
Expand All @@ -76,7 +76,7 @@
master_doc = "index"

# General information about the project.
project = "resmda"
project = "dageo"
author = "D. Werthmüller, G. Serrao Seabra, F.C. Vossepoel"
copyright = f"2024-{time.strftime('%Y')}, {author}"

Expand All @@ -99,23 +99,23 @@

html_theme_options = {
"logo": {
"text": "resmda",
"text": "dageo",
},
"navigation_with_keys": True,
"github_url": "https://github.com/tuda-geo/resmda",
"github_url": "https://github.com/tuda-geo/dageo",
# "use_edit_page_button": True,
}

html_context = {
"github_user": "tuda-geo",
"github_repo": "resmda",
"github_repo": "dageo",
"github_version": "main",
"doc_path": "docs",
}

html_use_modindex = True
html_file_suffix = ".html"
htmlhelp_basename = "resmda"
htmlhelp_basename = "dageo"
html_css_files = [
"style.css",
"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/" +
Expand Down
16 changes: 8 additions & 8 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
.. _resmda-manual:
.. _dageo-manual:

####################
resmda Documentation
####################
###################
dageo Documentation
###################

:Release: |version|
:Date: |today|
:Source: `github.com/tuda-geo/resmda <https://github.com/tuda-geo/resmda>`_
:Source: `github.com/tuda-geo/dageo <https://github.com/tuda-geo/dageo>`_

----

Expand Down Expand Up @@ -47,13 +47,13 @@ resmda Documentation
Gallery
^^^^^^^

The gallery contains examples on the usage of resmda, and is generally
The gallery contains examples on the usage of dageo, and is generally
the best way to get started. Download them and modify them to your
needs!

+++

.. button-ref:: resmda_gallery
.. button-ref:: dageo_gallery
:expand:
:color: info
:click-parent:
Expand All @@ -67,7 +67,7 @@ resmda Documentation
API reference
^^^^^^^^^^^^^

The API reference of resmda includes almost every function and class.
The API reference of dageo includes almost every function and class.
Some of the underlying theory is also described in the docstrings.

+++
Expand Down
Loading

0 comments on commit 5eda23d

Please sign in to comment.