Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: equinor/pyscal
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.10.4
Choose a base ref
...
head repository: equinor/pyscal
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref

Commits on Aug 10, 2023

  1. Copy the full SHA
    7bb5e7f View commit details

Commits on Aug 14, 2023

  1. Copy the full SHA
    072bba6 View commit details

Commits on Aug 25, 2023

  1. Copy the full SHA
    013ef86 View commit details
  2. Pin numpy < 2

    numpy 2.0 is coming in December 2023 or January 2024 and its
    developers have recommended pinning it to test against release
    candidates. This pin will be enforced elsewhere within Komodo.
    mferrera committed Aug 25, 2023
    Copy the full SHA
    cb7bf43 View commit details

Commits on Sep 27, 2023

  1. Run CI without fail-fast (#413)

    * Run CI without fail-fast
    * Skip isort on pyscal/__init__.py
    alifbe authored Sep 27, 2023
    Copy the full SHA
    750020a View commit details

Commits on Oct 12, 2023

  1. Copy the full SHA
    df9a96c View commit details

Commits on Oct 19, 2023

  1. Add SECURITY.md (#418)

    alifbe authored Oct 19, 2023
    Copy the full SHA
    c8c385b View commit details

Commits on Nov 24, 2023

  1. Add contributing file to root (#423)

    Moved the contribution guidelines from the docs to the root folder.
    Included the root-level file in the docs, so no change there.
    Resolves #421.
    kwinkunks authored Nov 24, 2023
    Copy the full SHA
    ea748d4 View commit details

Commits on Nov 28, 2023

  1. Copy the full SHA
    22d82ef View commit details

Commits on Dec 20, 2023

  1. Add plotting module (#425)

    Add plotting module
    richypitman authored Dec 20, 2023
    Copy the full SHA
    ee05460 View commit details

Commits on Jan 17, 2024

  1. Copy the full SHA
    aa69e87 View commit details
  2. Copy the full SHA
    743d9c8 View commit details

Commits on Jan 25, 2024

  1. Add Python3.11 to tests

    larsevj committed Jan 25, 2024
    Copy the full SHA
    2a8cfa8 View commit details

Commits on Jan 31, 2024

  1. Switch to ruff (#430)

    - Use ruff for code linting and formatting close #429 
    - Update contributing documentation
    - Remove sphinx pin
    alifbe authored Jan 31, 2024
    Copy the full SHA
    c55ed28 View commit details

Commits on Feb 9, 2024

  1. move pyscal to src (#432)

    alifbe authored Feb 9, 2024
    Copy the full SHA
    94879ef View commit details

Commits on Feb 14, 2024

  1. Reinstate pylint (#433)

    alifbe authored Feb 14, 2024
    Copy the full SHA
    7090e6f View commit details

Commits on Mar 3, 2024

  1. Copy the full SHA
    f79c7e5 View commit details

Commits on Mar 15, 2024

  1. Unpin urllib3

    Prefer to have komodo restrict the necessary urllib3 version for specific rhel versions.
    larsevj committed Mar 15, 2024
    Copy the full SHA
    ff9b018 View commit details

Commits on Mar 19, 2024

  1. Copy the full SHA
    2cd0feb View commit details

Commits on May 3, 2024

  1. Copy the full SHA
    e807dad View commit details

Commits on Jun 6, 2024

  1. Use codecov CLI (#442)

    alifbe authored Jun 6, 2024
    Copy the full SHA
    dab68e7 View commit details

Commits on Jul 8, 2024

  1. Fix matplotlib argument typing

    matplotlib updated its type annotations and indicated that
    the method arguments changed in this commit should not
    receive lists, but tuples.
    mferrera committed Jul 8, 2024
    Copy the full SHA
    407480f View commit details

Commits on Jul 16, 2024

  1. Copy the full SHA
    30df7e5 View commit details

Commits on Aug 16, 2024

  1. Formatted using ruff 0.6.0

    alifbe committed Aug 16, 2024
    Copy the full SHA
    173f05f View commit details
  2. Unpin sphinx argparse

    alifbe committed Aug 16, 2024
    Copy the full SHA
    b79ebc4 View commit details

Commits on Aug 19, 2024

  1. Relax requirement for interpolation in tests

    @reproduce_failure('6.111.1', b'AXicY2BgOGDAgAUc8L/eJVux8DqIKYAQFUBXx0gMk2gTAGS/CLQ=')
    triggers a failure (ip_dist_std =~ 1.03) which the accompanying plot
    reveals is perfectly fine.
    berland committed Aug 19, 2024
    Copy the full SHA
    4c66136 View commit details

Commits on Aug 23, 2024

  1. Unpin numpy

    Numpy 2 works fine as long as pandas >2.2
    berland committed Aug 23, 2024
    Copy the full SHA
    24ea68b View commit details
  2. Extend ruff to pylint checks

    Add exceptions for high-hanging fruits and solve the low-hanging fruits.
    berland committed Aug 23, 2024
    Copy the full SHA
    0b036ec View commit details

Commits on Sep 2, 2024

  1. Refactor PyscalFactory (#448)

    * Refactor create_water_oil
    
    * Code refactoring
    
    * Merge update
    
    * Fix ruff issue
    
    * test deprecated api work and warnings are emitted
    
    ---------
    
    Co-authored-by: Bartek Florczyk Vik (CCI RPT RES1) <barv@st-linrgs624.st.statoil.no>
    Co-authored-by: Bartek Florczyk Vik (CCI RPT RES1) <barv@st-linrgs569.st.statoil.no>
    3 people authored Sep 2, 2024
    Copy the full SHA
    a7c078d View commit details

Commits on Sep 10, 2024

  1. Pin sphinx-autodoc-typehints

    alifbe committed Sep 10, 2024
    Copy the full SHA
    4162b12 View commit details

Commits on Oct 2, 2024

  1. Match SWINTEGERS and saturation print format

    The documentation for SWINTEGERS did not match the accuracy of printed
    floating numbers, and this lead to a rare possibility for test failures,
    exemplified by test_slgof.py::test_slgof_hypo where it was possible to
    end up with two saturation points being printed identically.
    
    The usage of SWINTEGERS in test code has been tuned accordingly.
    
    Co-authored by: Alif Be <11570927+alifbe@users.noreply.github.com>
    berland committed Oct 2, 2024
    Copy the full SHA
    469bb84 View commit details
  2. Copy the full SHA
    85fbde0 View commit details
  3. Copy the full SHA
    49e8115 View commit details
  4. Fix indendation bug in CI

    Previous commit was garbled.
    berland committed Oct 2, 2024
    Copy the full SHA
    d6f0bf7 View commit details

Commits on Oct 4, 2024

  1. Fix h_min after unintended change

    SWINTEGERS was changed in 469bb84, and other critical usage of that
    constant has to be adjusted accordingly.
    
    There are still other places where SWINTEGERS are used, but as
    long as tests pass they should be fine.
    
    Also adjust the lower limit for h in test_slgof_hypo. If h can
    become much lower than h_min, hypothesis shrinking in case of
    errors becomes very slow.
    berland committed Oct 4, 2024
    Copy the full SHA
    7272760 View commit details

Commits on Oct 14, 2024

  1. Relax requirement for interpolation in tests

    This is tuning of commit 4c66136
    
    @reproduce_failure('6.114.1', b'AXicY2BgOGDAgAUc8L/eJVux8DqIKYAQFUBXx0gME9kEBXwmAABmjwjE')
    triggers a failure (ip_dist_std =  ~1.13) which the accompanying plot
    reveals is perfectly fine.
    berland committed Oct 14, 2024
    Copy the full SHA
    474e161 View commit details

Commits on Oct 23, 2024

  1. Avoid misuse of pytest.mark.xfail

    One should test that the code always fails in an expected manner, not letting
    it fail if the code so pleases.
    berland committed Oct 23, 2024
    Copy the full SHA
    60d8b64 View commit details

Commits on Nov 25, 2024

  1. Fix issues in ruff

    alifbe committed Nov 25, 2024
    Copy the full SHA
    ae09ae8 View commit details

Commits on Jan 10, 2025

  1. Upgrade to ruff 0.9

    alifbe committed Jan 10, 2025
    Copy the full SHA
    39ef33b View commit details

Commits on Feb 20, 2025

  1. Copy the full SHA
    fc804a8 View commit details
Showing with 3,666 additions and 2,584 deletions.
  1. +0 −3 .codacy.yml
  2. +1 −1 .gitattributes
  3. +13 −6 .github/workflows/codecov.yml
  4. +37 −0 .github/workflows/publish.yml
  5. +34 −25 .github/workflows/pyscal.yml
  6. +1 −1 .gitignore
  7. +0 −34 .pre-commit-config.yaml
  8. +2 −3 .pylintrc
  9. +0 −30 .travis.yml
  10. +96 −0 CONTRIBUTING.rst
  11. +2 −2 README.md
  12. +17 −0 SECURITY.md
  13. +0 −1 bandit.yml
  14. +1 −1 ci/testkomodo.sh
  15. +2 −3 docs/conf.py
  16. +1 −47 docs/contributing.rst
  17. +73 −72 docs/make_plots.py
  18. +6 −6 docs/usage.rst
  19. +0 −23 mypy.ini
  20. +131 −0 pyproject.toml
  21. +0 −20 pyscal/constants.py
  22. +0 −1,287 pyscal/factory.py
  23. +0 −29 setup.cfg
  24. +0 −65 setup.py
  25. +4 −3 { → src}/pyscal/__init__.py
  26. +25 −0 src/pyscal/constants.py
  27. +1,397 −0 src/pyscal/factory.py
  28. +53 −45 { → src}/pyscal/gasoil.py
  29. +4 −5 { → src}/pyscal/gaswater.py
  30. +533 −0 src/pyscal/plotting.py
  31. +56 −18 { → src}/pyscal/pyscalcli.py
  32. +11 −17 { → src}/pyscal/pyscallist.py
  33. +8 −13 { → src}/pyscal/scalrecommendation.py
  34. 0 { → src}/pyscal/utils/__init__.py
  35. +5 −10 { → src}/pyscal/utils/capillarypressure.py
  36. 0 { → src}/pyscal/utils/interpolation.py
  37. +45 −50 { → src}/pyscal/utils/monotonicity.py
  38. +4 −4 { → src}/pyscal/utils/relperm.py
  39. +1 −4 { → src}/pyscal/utils/string.py
  40. +8 −15 { → src}/pyscal/utils/testing.py
  41. +93 −85 { → src}/pyscal/wateroil.py
  42. +4 −5 { → src}/pyscal/wateroilgas.py
  43. +0 −15 test_requirements.txt
  44. +1 −0 tests/benchme.py
  45. +463 −353 tests/test_factory.py
  46. +1 −1 tests/test_fromtable.py
  47. +27 −22 tests/test_gasoil.py
  48. +1 −2 tests/test_gaswater.py
  49. +5 −12 tests/test_interactive_plots.py
  50. +239 −0 tests/test_plotting.py
  51. +48 −12 tests/test_pyscalcli.py
  52. +81 −111 tests/test_pyscallist.py
  53. +31 −22 tests/test_scalrecommendation.py
  54. +14 −15 tests/test_slgof.py
  55. +1 −8 tests/test_utils_capillarypressure.py
  56. +2 −7 tests/test_utils_interpolation.py
  57. +1 −2 tests/test_utils_monotonicity.py
  58. +72 −57 tests/test_utils_testing.py
  59. +4 −4 tests/test_wateroil.py
  60. +3 −3 tests/test_wateroil_pc.py
  61. +4 −4 tests/test_wateroil_saturation.py
  62. +0 −1 tests/test_wateroilgas.py
3 changes: 0 additions & 3 deletions .codacy.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1 @@
pyscal/_version.py export-subst
src/pyscal/_version.py export-subst
19 changes: 13 additions & 6 deletions .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
@@ -13,15 +13,15 @@ jobs:
os: [ubuntu-latest]
env:
OS: ${{ matrix.os }}
PYTHON: '3.8'
PYTHON: '3.11'

steps:
- uses: actions/checkout@main

- name: Setup Python
uses: actions/setup-python@main
uses: actions/setup-python@v5
with:
python-version: 3.8
python-version: 3.11

- name: Install pyscal and test dependencies
run: |
@@ -31,8 +31,15 @@ jobs:
- name: Generate coverage report
run: |
pytest --hypothesis-profile ci tests --disable-warnings --cov=pyscal --cov-report=xml
pytest --hypothesis-profile ci tests --disable-warnings --cov=pyscal --cov-report=xml --junitxml=junit.xml -o junit_family=legacy
- name: Upload coverage to Codecov
run: |
bash <(curl -s https://codecov.io/bash)
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}

- name: Upload test report to Codecov
if: ${{ !cancelled() }}
uses: codecov/test-results-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
37 changes: 37 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Publish to PyPI

on:
release:
types: [published]

jobs:
pypi-publish:
name: Upload release to PyPI
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/pyscal
permissions:
id-token: write

steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Python 3.8
uses: actions/setup-python@v5
with:
python-version: 3.8

- name: Install build dependencies
run: |
pip install -U pip
pip install build
- name: Build distributions
run: python -m build

- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
59 changes: 34 additions & 25 deletions .github/workflows/pyscal.yml
Original file line number Diff line number Diff line change
@@ -14,6 +14,10 @@ on:
# Run CI every night and check that tests are working with latest dependencies
- cron: "0 0 * * *"

env:
# Default python version to be use to create docs
DEFAULT_PYTHON_VERSION: "3.11"

jobs:
pyscal:
runs-on: ${{ matrix.os }}
@@ -24,71 +28,76 @@ jobs:
python-version: "3.8"
- os: "ubuntu-latest"
python-version: "3.9"
- os: "ubuntu-latest"
python-version: "3.10"
- os: "ubuntu-latest"
python-version: "3.11"
- os: "macos-latest"
python-version: "3.9"
python-version: "3.11"
- os: "windows-latest"
python-version: "3.9"
python-version: "3.11"

steps:
- name: Checkout commit locally
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install pyscal with dependencies
if: ${{ always() }}
run: |
pip install --upgrade pip
pip install .[tests]
pip install .[tests,docs]
- name: List all installed packages
if: ${{ always() }}
run: pip freeze

- name: Check code style and typing
- name: Ruff check
if: ${{ always() }}
run: |
ruff check .
- name: Ruff format
if: ${{ always() }}
run: |
black --check --force-exclude="pyscal/version.py" pyscal/*py tests/test_*py setup.py docs/conf.py
flake8 pyscal tests
isort --check-only --profile black pyscal tests
mypy pyscal
ruff format . --check
- name: Check typing with mypy
if: ${{ always() }}
run: |
mypy src/pyscal
- name: Run tests
if: ${{ always() }}
run: |
python -c "import pyscal"
pytest --strict-markers --hypothesis-profile ci tests/
pytest -n auto --strict-markers --hypothesis-profile ci tests/
- name: Syntax check documentation
if: ${{ always() }}
run: |
rstcheck -r docs
- name: Install font (xkcd) for documentation
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.8'
if: ${{ matrix.os == 'ubuntu-latest' && matrix.python-version == env.DEFAULT_PYTHON_VERSION }}
run: |
sudo apt-get install -y fonts-humor-sans
- name: Build documentation
if: matrix.os == 'ubuntu-latest'
if: ${{ matrix.os == 'ubuntu-latest' && matrix.python-version == env.DEFAULT_PYTHON_VERSION }}
run: |
export SETUPTOOLS_SCM_PRETEND_VERSION=${GITHUB_REF//refs\/tags\//}
python docs/make_plots.py
sphinx-build -b html docs ./build/sphinx/html
- name: Build python package and publish to pypi
if: github.event_name == 'release' && matrix.python-version == '3.8' && matrix.os == 'ubuntu-latest'
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.pyscal_pypi_token }}
run: |
export SETUPTOOLS_SCM_PRETEND_VERSION=${GITHUB_REF//refs\/tags\//}
python -m pip install --upgrade setuptools wheel twine
python setup.py sdist bdist_wheel
twine upload dist/*
- name: Update GitHub pages
if: github.event_name == 'release' && matrix.python-version == '3.8' && matrix.os == 'ubuntu-latest'
if: ${{ github.event_name == 'release' && matrix.os == 'ubuntu-latest' && matrix.python-version == env.DEFAULT_PYTHON_VERSION }}
run: |
cp -R ./build/sphinx/html ../html
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -110,4 +110,4 @@ env*/

# mypy
.mypy_cache/
pyscal/version.py
src/pyscal/version.py
34 changes: 0 additions & 34 deletions .pre-commit-config.yaml

This file was deleted.

5 changes: 2 additions & 3 deletions .pylintrc
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
[GENERAL]
disable=R0205, F0010, C0330, E1136, E0401
output-format=colorized

[MASTER]
ignore=setup.py,version.py

# We allow a lot of "bad" variable names, because it is important to keep the link to the original formulas
[BASIC]
good-names=df,logger,h,l,e,t,SGFN,SWOF,SGOF,SLGOF,SOF3,SWFN,WOTABLE,GOTABLE,nw,ng,Ls,Es,Ts,Lf,Ef,Tf,Pcmax,Pcmin,Pct,add_LET_pc_pd,Lp,Ep,Tp,Lt,Et,Tt,add_LET_pc_pd,Lp,Ep,Tp,Lt,Et,Tt,cw,co,aw,ao,a,b,g,add_LET_water,add_LET_oil,add_LET_gas,add_LET_pc_imb,add_simple_J,add_normalized_J,add_simple_J_petro
good-names=df,logger,h,l,e,t,SGFN,SWOF,SGOF,SLGOF,SOF3,SWFN,WOTABLE,GOTABLE,nw,ng,Ls,Es,Ts,Lf,Ef,Tf,Pcmax,Pcmin,Pct,add_LET_pc_pd,Lp,Ep,Tp,Lt,Et,Tt,add_LET_pc_pd,Lp,Ep,Tp,Lt,Et,Tt,cw,co,aw,ao,a,b,g,add_LET_water,add_LET_oil,add_LET_gas,add_LET_pc_imb,add_simple_J,add_normalized_J,add_simple_J_petro,simple_J,J,_sw_to_simpleJ,_simpleJ_to_sw,_simpleJ_to_height,_height_to_simpleJ,H,swl_from_height_simpleJ

[FORMAT]
max-line-length=88
@@ -20,4 +19,4 @@ max-args=10
min-similarity-lines=6
ignore-comments=yes
ignore-docstrings=yes
ignore-imports=yes
ignore-imports=yes
30 changes: 0 additions & 30 deletions .travis.yml

This file was deleted.

96 changes: 96 additions & 0 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
Contributing to pyscal
=========================

* The code is hosted on https://github.com/equinor/pyscal
* Submit bugs on github
* Pull requests are welcome!


Create pull request
-------------------

1. Fork the pyscal repository from the Equinor repository to your GitHub
user account.

2. Clone your fork locally:

.. code-block:: bash
git clone git@github.com:your_name_here/pyscal
cd pyscal
git remote add upstream git@github.com:equinor/pyscal
git remote -v
# origin git@github.com:your_name_here/pyscal (fetch)
# origin git@github.com:your_name_here/pyscal (push)
# upstream git@github.com:equinor/pyscal (fetch)
# upstream git@github.com:equinor/pyscal (push)
4. Install your forked copy into a local venv:

.. code-block:: bash
python -m venv ~/venv/pyscal
source ~/venv/pyscal/bin/activate
pip install -U pip
pip install -e ".[tests,docs]"
5. Run the tests to ensure everything works:

.. code-block:: bash
pytest -n auto
6. Create a branch for local development:

.. code-block:: bash
git checkout -b name-of-your-bugfix-or-feature
Now you can make your changes locally.

7. When you're done making changes, check that your changes pass ruff, mypy and the
tests:

.. code-block:: bash
ruff check .
ruff format .
mypy src/pyscal
pytest -n auto
In addition, it is recommended to use pylint to improve code quality

.. code-block:: bash
pylint src
Deviations from default (strict) pylint are stored in ``.pylintrc`` at root level,
or as comments in the file e.g. ``# pylint: disable=broad-except``.

Only use deviations when e.g. ruff and pylint are in conflict, or if conformity with
pylint would clearly make the code worse or not work at all. Do not use it to
increase pylint score.

8. Commit your changes and push your branch to GitHub:

.. code-block:: bash
git add file1.py file2.py
git commit -m "Add some feature"
git push origin name-of-your-bugfix-or-feature
9. Submit a pull request through GitHub.


Building documentation
----------------------

To build the documentation for pyscal run the following command:

.. code-block:: bash
python docs/make_plots.py
sphinx-build -b html docs ./build/sphinx/html
And now you can find the start page of the documentation in the
build folder: ``build/sphinx/html/index.html``.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[![Build Status](https://github.com/equinor/pyscal/actions/workflows/pyscal.yml/badge.svg)](https://github.com/equinor/pyscal/actions?query=workflow%3Apyscal)
[![codecov](https://codecov.io/gh/equinor/pyscal/branch/master/graph/badge.svg)](https://codecov.io/gh/equinor/pyscal)
[![Python 3.8-3.9](https://img.shields.io/badge/python-3.8%20|%203.9-blue.svg)](https://www.python.org)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://black.readthedocs.io/)
[![Python 3.8-3.11](https://img.shields.io/badge/python-3.8%20|%203.9%20|%203.10|%203.11-blue.svg)](https://www.python.org)
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
[![PyPI version](https://badge.fury.io/py/pyscal.svg)](https://badge.fury.io/py/pyscal)
[![Downloads](https://pepy.tech/badge/pyscal)](https://pepy.tech/project/pyscal)
[![License: GPL v3](https://img.shields.io/badge/License-LGPLv3-blue.svg)](https://www.gnu.org/licenses/lgpl-3.0)
Loading