diff --git a/.gitattributes b/.gitattributes index df3d57a0..45307422 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1 +1 @@ -pyscal/_version.py export-subst +src/pyscal/_version.py export-subst diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index 0cb850a4..c64b90d4 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -19,7 +19,7 @@ jobs: - uses: actions/checkout@main - name: Setup Python - uses: actions/setup-python@main + uses: actions/setup-python@v5 with: python-version: 3.11 diff --git a/.github/workflows/pyscal.yml b/.github/workflows/pyscal.yml index a92a620c..4ed70d9b 100644 --- a/.github/workflows/pyscal.yml +++ b/.github/workflows/pyscal.yml @@ -44,7 +44,7 @@ jobs: 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 }} @@ -71,7 +71,7 @@ jobs: - name: Check typing with mypy if: ${{ always() }} run: | - mypy ./pyscal + mypy src/pyscal - name: Run tests if: ${{ always() }} diff --git a/.gitignore b/.gitignore index 748e435c..70af5986 100644 --- a/.gitignore +++ b/.gitignore @@ -110,4 +110,4 @@ env*/ # mypy .mypy_cache/ -pyscal/version.py +src/pyscal/version.py diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index e6e11731..d669ef9d 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -55,7 +55,7 @@ Now you can make your changes locally. ruff check . ruff format . - mypy ./pyscal + mypy src/pyscal pytest -n auto 8. Commit your changes and push your branch to GitHub: diff --git a/docs/make_plots.py b/docs/make_plots.py index 842536a1..d6084e45 100644 --- a/docs/make_plots.py +++ b/docs/make_plots.py @@ -2,7 +2,6 @@ from pathlib import Path import matplotlib.pyplot as plt - from pyscal import GasOil, GasWater, WaterOil IMG_DIR = Path(__file__).absolute().parent / "images" diff --git a/pyproject.toml b/pyproject.toml index 93248743..3c4a273a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,11 +7,8 @@ requires = [ build-backend = "setuptools.build_meta" -[tool.setuptools] -packages = ["pyscal"] - [tool.setuptools_scm] -write_to = "pyscal/version.py" +write_to = "src/pyscal/version.py" [project] name = "pyscal" @@ -79,7 +76,7 @@ pyscal = "pyscal.pyscalcli:main" [tool.ruff] -select=[ +lint.select=[ "E", "F", "I", @@ -96,7 +93,7 @@ select=[ line-length = 88 -ignore = ["E741"] +lint.ignore = ["E741"] [[tool.mypy.overrides]] module = ["numpy.*", "pyscal.version", "pandas.*", "matplotlib.*", "scipy.*", "xlrd.*", "openpyxl.*" diff --git a/pyscal/__init__.py b/src/pyscal/__init__.py similarity index 100% rename from pyscal/__init__.py rename to src/pyscal/__init__.py diff --git a/pyscal/constants.py b/src/pyscal/constants.py similarity index 100% rename from pyscal/constants.py rename to src/pyscal/constants.py diff --git a/pyscal/factory.py b/src/pyscal/factory.py similarity index 100% rename from pyscal/factory.py rename to src/pyscal/factory.py diff --git a/pyscal/gasoil.py b/src/pyscal/gasoil.py similarity index 100% rename from pyscal/gasoil.py rename to src/pyscal/gasoil.py diff --git a/pyscal/gaswater.py b/src/pyscal/gaswater.py similarity index 100% rename from pyscal/gaswater.py rename to src/pyscal/gaswater.py diff --git a/pyscal/plotting.py b/src/pyscal/plotting.py similarity index 100% rename from pyscal/plotting.py rename to src/pyscal/plotting.py diff --git a/pyscal/pyscalcli.py b/src/pyscal/pyscalcli.py similarity index 100% rename from pyscal/pyscalcli.py rename to src/pyscal/pyscalcli.py diff --git a/pyscal/pyscallist.py b/src/pyscal/pyscallist.py similarity index 100% rename from pyscal/pyscallist.py rename to src/pyscal/pyscallist.py diff --git a/pyscal/scalrecommendation.py b/src/pyscal/scalrecommendation.py similarity index 100% rename from pyscal/scalrecommendation.py rename to src/pyscal/scalrecommendation.py diff --git a/pyscal/utils/__init__.py b/src/pyscal/utils/__init__.py similarity index 100% rename from pyscal/utils/__init__.py rename to src/pyscal/utils/__init__.py diff --git a/pyscal/utils/capillarypressure.py b/src/pyscal/utils/capillarypressure.py similarity index 100% rename from pyscal/utils/capillarypressure.py rename to src/pyscal/utils/capillarypressure.py diff --git a/pyscal/utils/interpolation.py b/src/pyscal/utils/interpolation.py similarity index 100% rename from pyscal/utils/interpolation.py rename to src/pyscal/utils/interpolation.py diff --git a/pyscal/utils/monotonicity.py b/src/pyscal/utils/monotonicity.py similarity index 100% rename from pyscal/utils/monotonicity.py rename to src/pyscal/utils/monotonicity.py diff --git a/pyscal/utils/relperm.py b/src/pyscal/utils/relperm.py similarity index 100% rename from pyscal/utils/relperm.py rename to src/pyscal/utils/relperm.py diff --git a/pyscal/utils/string.py b/src/pyscal/utils/string.py similarity index 100% rename from pyscal/utils/string.py rename to src/pyscal/utils/string.py diff --git a/pyscal/utils/testing.py b/src/pyscal/utils/testing.py similarity index 100% rename from pyscal/utils/testing.py rename to src/pyscal/utils/testing.py diff --git a/pyscal/wateroil.py b/src/pyscal/wateroil.py similarity index 100% rename from pyscal/wateroil.py rename to src/pyscal/wateroil.py diff --git a/pyscal/wateroilgas.py b/src/pyscal/wateroilgas.py similarity index 100% rename from pyscal/wateroilgas.py rename to src/pyscal/wateroilgas.py diff --git a/tests/test_estimateendpoints.py b/tests/test_estimateendpoints.py index c833917c..5aaa003f 100644 --- a/tests/test_estimateendpoints.py +++ b/tests/test_estimateendpoints.py @@ -3,7 +3,6 @@ import hypothesis.strategies as st import numpy as np from hypothesis import given - from pyscal import GasOil, WaterOil from pyscal.constants import EPSILON as epsilon diff --git a/tests/test_factory.py b/tests/test_factory.py index b77eef8d..bdc5fed8 100644 --- a/tests/test_factory.py +++ b/tests/test_factory.py @@ -5,7 +5,6 @@ import numpy as np import pandas as pd import pytest - from pyscal import ( GasOil, GasWater, diff --git a/tests/test_fromtable.py b/tests/test_fromtable.py index b9b3f8b7..07b16fd6 100644 --- a/tests/test_fromtable.py +++ b/tests/test_fromtable.py @@ -5,7 +5,6 @@ import pandas as pd import pytest from hypothesis import given - from pyscal import GasOil, WaterOil, WaterOilGas from pyscal.utils.testing import check_table, float_df_checker diff --git a/tests/test_gasoil.py b/tests/test_gasoil.py index bbf9130b..89f432a8 100644 --- a/tests/test_gasoil.py +++ b/tests/test_gasoil.py @@ -9,7 +9,6 @@ import pandas as pd import pytest from hypothesis import given - from pyscal import GasOil from pyscal.constants import MAX_EXPONENT_KR, SWINTEGERS from pyscal.utils.relperm import truncate_zeroness diff --git a/tests/test_gaswater.py b/tests/test_gaswater.py index 902be7bb..f5bde8de 100644 --- a/tests/test_gaswater.py +++ b/tests/test_gaswater.py @@ -8,7 +8,6 @@ import numpy as np import pytest from hypothesis import given - from pyscal import GasWater from pyscal.constants import SWINTEGERS from pyscal.utils.testing import ( diff --git a/tests/test_interactive_plots.py b/tests/test_interactive_plots.py index e0785623..aee26e38 100644 --- a/tests/test_interactive_plots.py +++ b/tests/test_interactive_plots.py @@ -9,7 +9,6 @@ import numpy as np import pytest from matplotlib import pyplot - from pyscal import GasOil, GasWater, PyscalFactory, WaterOil, utils from .test_scalrecommendation import BASE_SAMPLE_LET, HIGH_SAMPLE_LET, LOW_SAMPLE_LET diff --git a/tests/test_logging.py b/tests/test_logging.py index f8465034..4784ef92 100644 --- a/tests/test_logging.py +++ b/tests/test_logging.py @@ -2,9 +2,8 @@ import sys from pathlib import Path -import pytest - import pyscal +import pytest from pyscal import pyscalcli diff --git a/tests/test_plotting.py b/tests/test_plotting.py index 2500b5da..947b73cc 100644 --- a/tests/test_plotting.py +++ b/tests/test_plotting.py @@ -4,7 +4,6 @@ import matplotlib.pyplot as plt import pytest - from pyscal import GasOil, GasWater, PyscalList, WaterOil, WaterOilGas, plotting diff --git a/tests/test_pyscalcli.py b/tests/test_pyscalcli.py index aeb2eea5..f9d833fb 100644 --- a/tests/test_pyscalcli.py +++ b/tests/test_pyscalcli.py @@ -8,7 +8,6 @@ import pandas as pd import pytest - from pyscal import pyscalcli from pyscal.utils.testing import sat_table_str_ok diff --git a/tests/test_pyscallist.py b/tests/test_pyscallist.py index b4f2fe0e..a6a93e64 100644 --- a/tests/test_pyscallist.py +++ b/tests/test_pyscallist.py @@ -5,7 +5,6 @@ import numpy as np import pandas as pd import pytest - from pyscal import ( GasOil, GasWater, diff --git a/tests/test_scalrecommendation.py b/tests/test_scalrecommendation.py index f3963f64..f98cf6c7 100644 --- a/tests/test_scalrecommendation.py +++ b/tests/test_scalrecommendation.py @@ -4,7 +4,6 @@ import pandas as pd import pytest from hypothesis import given - from pyscal import GasWater, PyscalFactory, SCALrecommendation, WaterOil, WaterOilGas from pyscal.factory import slicedict from pyscal.utils.testing import check_table, sat_table_str_ok, slow_hypothesis diff --git a/tests/test_slgof.py b/tests/test_slgof.py index 3b7e3b85..9cb84524 100644 --- a/tests/test_slgof.py +++ b/tests/test_slgof.py @@ -4,7 +4,6 @@ import numpy as np import pytest from hypothesis import given - from pyscal import GasOil, WaterOilGas from pyscal.constants import EPSILON, SWINTEGERS from pyscal.utils.testing import sat_table_str_ok diff --git a/tests/test_utils_capillarypressure.py b/tests/test_utils_capillarypressure.py index 17684d61..24abdbda 100644 --- a/tests/test_utils_capillarypressure.py +++ b/tests/test_utils_capillarypressure.py @@ -5,7 +5,6 @@ import numpy as np import pytest from hypothesis import given - from pyscal.constants import EPSILON from pyscal.utils import capillarypressure diff --git a/tests/test_utils_interpolation.py b/tests/test_utils_interpolation.py index 328b24a6..dbfbaf20 100644 --- a/tests/test_utils_interpolation.py +++ b/tests/test_utils_interpolation.py @@ -6,7 +6,6 @@ import pytest from hypothesis import given from matplotlib import pyplot as plt - from pyscal import GasOil, WaterOil from pyscal.constants import EPSILON as epsilon from pyscal.utils.interpolation import ( diff --git a/tests/test_utils_monotonicity.py b/tests/test_utils_monotonicity.py index 14137d67..5219e6c2 100644 --- a/tests/test_utils_monotonicity.py +++ b/tests/test_utils_monotonicity.py @@ -4,7 +4,6 @@ import numpy as np import pandas as pd import pytest - from pyscal.utils.monotonicity import ( check_almost_monotone, check_limits, diff --git a/tests/test_utils_relperm.py b/tests/test_utils_relperm.py index 19495fa3..c4bd047b 100644 --- a/tests/test_utils_relperm.py +++ b/tests/test_utils_relperm.py @@ -3,7 +3,6 @@ import numpy as np import pandas as pd import pytest - from pyscal.utils.relperm import crosspoint, estimate_diffjumppoint, truncate_zeroness # pyscal.utils.relperm.crosspoint() is also tested in test_wateroil and test_gasoil. diff --git a/tests/test_utils_string.py b/tests/test_utils_string.py index 277e1a4a..16b09d37 100644 --- a/tests/test_utils_string.py +++ b/tests/test_utils_string.py @@ -1,7 +1,6 @@ """Test module for pyscal.utils""" import pandas as pd - from pyscal.utils.string import comment_formatter, df2str diff --git a/tests/test_utils_testing.py b/tests/test_utils_testing.py index 0fedb1f4..616f2996 100644 --- a/tests/test_utils_testing.py +++ b/tests/test_utils_testing.py @@ -4,7 +4,6 @@ import pandas as pd import pytest - from pyscal.utils.testing import float_df_checker, sat_table_str_ok diff --git a/tests/test_wateroil.py b/tests/test_wateroil.py index 1a748d12..32fa4bfc 100644 --- a/tests/test_wateroil.py +++ b/tests/test_wateroil.py @@ -9,7 +9,6 @@ import pandas as pd import pytest from hypothesis import given - from pyscal import WaterOil from pyscal.constants import SWINTEGERS from pyscal.utils.testing import ( diff --git a/tests/test_wateroil_pc.py b/tests/test_wateroil_pc.py index 3c90086b..45b968a6 100644 --- a/tests/test_wateroil_pc.py +++ b/tests/test_wateroil_pc.py @@ -4,7 +4,6 @@ import numpy as np import pytest from hypothesis import given - from pyscal import WaterOil from pyscal.constants import MAX_EXPONENT_PC from pyscal.utils.testing import check_table, float_df_checker, sat_table_str_ok diff --git a/tests/test_wateroil_saturation.py b/tests/test_wateroil_saturation.py index a8bf2180..c5fa743c 100644 --- a/tests/test_wateroil_saturation.py +++ b/tests/test_wateroil_saturation.py @@ -4,7 +4,6 @@ import hypothesis.strategies as st from hypothesis import given - from pyscal import WaterOil from pyscal.constants import EPSILON, SWINTEGERS from pyscal.utils.testing import check_table, float_df_checker diff --git a/tests/test_wateroilgas.py b/tests/test_wateroilgas.py index 16c30d21..e912158a 100644 --- a/tests/test_wateroilgas.py +++ b/tests/test_wateroilgas.py @@ -4,7 +4,6 @@ from pathlib import Path import pytest - from pyscal import GasOil, WaterOil, WaterOilGas from pyscal.utils.testing import sat_table_str_ok