Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/python_analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,26 +26,26 @@
jobs:
call-workflow-static-analysis:
name: Static analysis
uses: MiraGeoscience/CI-tools/.github/workflows/reusable-python-static_analysis.yml@v2

Check failure on line 29 in .github/workflows/python_analysis.yml

View workflow job for this annotation

GitHub Actions / Zizmor analysis (annotate) / Security Scan

unpinned-uses

python_analysis.yml:29: unpinned action reference: action is not pinned to a hash (required by blanket policy)
permissions:
contents: read
pull-requests: read
with:
package-manager: 'poetry'
app-name: 'omf'
python-version: '3.10'
python-version: '3.12'
call-workflow-pytest:
name: Pytest
uses: MiraGeoscience/CI-tools/.github/workflows/reusable-python-pytest.yml@v2

Check failure on line 39 in .github/workflows/python_analysis.yml

View workflow job for this annotation

GitHub Actions / Zizmor analysis (annotate) / Security Scan

unpinned-uses

python_analysis.yml:39: unpinned action reference: action is not pinned to a hash (required by blanket policy)
permissions:
contents: read
pull-requests: read
with:
package-manager: 'poetry'
python-versions: '["3.10", "3.11", "3.12"]'
python-versions: '["3.12", "3.13", "3.14"]'
os: '["ubuntu-latest", "windows-latest"]'
cache-number: 1
codecov-reference-python-version: '3.10'
codecov-reference-python-version: '3.12'
codecov-reference-os: '["windows-latest"]'
secrets:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
4 changes: 2 additions & 2 deletions .github/workflows/python_deploy_dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@
jobs:
call-workflow-conda-publish:
name: Publish development conda package on JFrog Artifactory
uses: MiraGeoscience/CI-tools/.github/workflows/reusable-python-publish_rattler_package.yml@v2

Check failure on line 17 in .github/workflows/python_deploy_dev.yml

View workflow job for this annotation

GitHub Actions / Zizmor analysis (annotate) / Security Scan

unpinned-uses

python_deploy_dev.yml:17: unpinned action reference: action is not pinned to a hash (required by blanket policy)
permissions:
contents: write
with:
package-name: 'mira-omf'
python-version: '3.10'
python-version: '3.12'
source-repo-names: '["public-noremote-conda-dev"]'
conda-channels: '["conda-forge"]'
publish-repo-names: '["public-noremote-conda-dev"]'
Expand All @@ -28,14 +28,14 @@
JFROG_ARTIFACTORY_TOKEN: ${{ secrets.JFROG_ARTIFACTORY_TOKEN }}
call-workflow-pypi-publish:
name: Publish development pypi package (JFrog Artifactory, TestPyPI)
uses: MiraGeoscience/CI-tools/.github/workflows/reusable-python-publish_pypi_package.yml@v2

Check failure on line 31 in .github/workflows/python_deploy_dev.yml

View workflow job for this annotation

GitHub Actions / Zizmor analysis (annotate) / Security Scan

unpinned-uses

python_deploy_dev.yml:31: unpinned action reference: action is not pinned to a hash (required by blanket policy)
permissions:
contents: write
with:
package-manager: 'poetry'
package-name: 'mira-omf'
version-tag: ${{ github.ref_name }}
python-version: '3.10'
python-version: '3.12'
virtual-repo-names: '["public-pypi-dev", "test-pypi"]'
secrets:
JFROG_ARTIFACTORY_URL: ${{ secrets.JFROG_ARTIFACTORY_URL }}
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ repos:
hooks:
- id: mypy
additional_dependencies: [
# numpy==1.26.*, # TODO: fix mypy errors related to numpy
numpy==2.4.*, # TODO: fix mypy errors related to numpy
tomli, # to read config from pyproject.toml
types-six,
types-toml,
Expand Down
396 changes: 190 additions & 206 deletions poetry.lock

Large diffs are not rendered by default.

13 changes: 6 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ build-backend = "poetry_dynamic_versioning.backend"

[project]
name = "mira-omf"
requires-python = ">=3.10,<4.0"
requires-python = ">=3.12,<3.15"
description = "API Library for Open Mining Format"
license = "MIT"
license-files = [
Expand Down Expand Up @@ -64,11 +64,12 @@ include = [
version = "0.0.0.dev0"

[tool.poetry.dependencies]
numpy = "~1.26.0" # also in geoh5py
numpy = "~2.4.0" # also in geoh5py
properties = "0.6.*"
pypng = "^0.20220715"
six = "^1.16"
vectormath = "0.2.*"
standard-imghdr = "3.13.*"

## dependencies from Git repositories
#------------------------------------
Expand All @@ -81,7 +82,7 @@ Pygments = "*"
pylint = "*"
pytest = "*"
pytest-cov = "*"
sphinx = "^5.3"
sphinx = "*"
pyyaml = '*'
packaging = '*'

Expand Down Expand Up @@ -114,7 +115,7 @@ initial-content = """
persistent-substitution = true

[tool.ruff]
target-version = "py310"
target-version = "py312"

exclude = [
"docs/*",
Expand Down Expand Up @@ -174,9 +175,7 @@ show_error_context = true
show_column_numbers = true
check_untyped_defs = true

plugins = [
# "numpy.typing.mypy_plugin"
]
plugins = []

[tool.pytest.ini_options]

Expand Down
9 changes: 5 additions & 4 deletions recipe.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ schema_version: 1
context:
name: "mira-omf"
version: "0.0.0.dev0" # This will be replaced by the actual version in the build process
python_min: "3.10"
python_min: "3.12"
module_name: omf

package:
Expand All @@ -25,20 +25,21 @@ build:
requirements:
host:
- pip
- python 3.10.*
- python ${{ python_min }}.*
- poetry-core >=1.8.0
- poetry-dynamic-versioning >=1.9, 1.*
- setuptools
run:
- python >=${{ python_min }}
# Mira packages
- geoh5py >=0.12.0b5, 0.12.*
- geoh5py >=0.13.0a2, 0.13.*
# direct dependencies
- numpy 1.26.*
- numpy 2.4.*
- properties 0.6.*
- pypng 0.20220715.*
- six >=1.16.0, 1.*
- vectormath 0.2.*
- standard-imghdr 3.13.0

tests:
- python:
Expand Down
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def random_project() -> omf.Project:
),
omf.ScalarData(
name="rand face data",
array=np.random.rand(10, 15).flatten(order="f"),
array=np.random.rand(10, 15).flatten(order="F"),
location="faces",
),
],
Expand Down
12 changes: 6 additions & 6 deletions tests/convert_grid2d_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@

def test_grid2d_to_geoh5(tmp_path: Path, caplog):
"""Test pointset geometry validation"""
dip = np.random.uniform(low=0.0, high=np.pi / 2, size=1)[0]
rotation = np.random.uniform(low=-np.pi, high=np.pi, size=1)[0]

dip = np.random.uniform(low=0.0, high=90, size=1)
rotation = np.random.uniform(low=-180, high=180, size=1)
rot_op = omf.fileio.geoh5.rotation_opt(np.deg2rad(rotation), np.deg2rad(dip))
rot_op = omf.fileio.geoh5.rotation_opt(rotation, dip)
grid = omf.SurfaceElement(
name="gridsurf",
geometry=omf.SurfaceGridGeometry(
Expand All @@ -43,7 +43,7 @@ def test_grid2d_to_geoh5(tmp_path: Path, caplog):
),
omf.ScalarData(
name="rand face data",
array=np.random.rand(10, 15).flatten(order="f"),
array=np.random.rand(10, 15).flatten(order="F"),
location="faces",
),
],
Expand All @@ -57,8 +57,8 @@ def test_grid2d_to_geoh5(tmp_path: Path, caplog):
with Workspace(file) as workspace:
grid2d = workspace.get_entity("gridsurf")[0]

np.testing.assert_array_almost_equal(grid2d.dip, dip)
np.testing.assert_array_almost_equal(grid2d.rotation, rotation)
np.testing.assert_array_almost_equal(np.deg2rad(grid2d.dip), dip)
np.testing.assert_array_almost_equal(np.deg2rad(grid2d.rotation), rotation)

data = grid2d.get_entity("rand vert data")[0]
np.testing.assert_array_almost_equal(np.r_[grid.data[0].array], data.values)
Expand Down
13 changes: 5 additions & 8 deletions tests/convert_volume_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
def test_volume_to_geoh5(tmp_path: Path):
"""Test pointset geometry validation"""
dims = [10, 15, 20]
size = int(np.prod(dims))
vol = omf.VolumeElement(
name="vol",
geometry=omf.VolumeGridGeometry(
Expand All @@ -39,19 +40,17 @@ def test_volume_to_geoh5(tmp_path: Path):
omf.ScalarData(
name="Random Int Data",
location="cells",
array=np.arange(np.prod(dims)).flatten().astype(np.int32),
array=np.arange(size).flatten().astype(np.int32),
),
omf.ScalarData(
name="Random Float Data",
location="cells",
array=np.random.randn(np.prod(dims)),
array=np.random.randn(size),
),
omf.MappedData(
name="Reference Data",
location="cells",
array=np.random.randint(-1, 3, np.prod(dims))
.flatten()
.astype(np.int32),
array=np.random.randint(-1, 3, size).flatten().astype(np.int32),
legends=[
omf.Legend(values=omf.StringArray(array=["abc", "123", "@#$%"])),
omf.Legend(
Expand All @@ -68,9 +67,7 @@ def test_volume_to_geoh5(tmp_path: Path):
omf.MappedData(
name="Reference Data 2",
location="cells",
array=np.random.randint(-1, 3, np.prod(dims))
.flatten()
.astype(np.int32),
array=np.random.randint(-1, 3, size).flatten().astype(np.int32),
legends=[
omf.Legend(
values=omf.ColorArray(
Expand Down
Loading