diff --git a/.idea/copyright/GMG.xml b/.idea/copyright/GMG.xml new file mode 100644 index 00000000..f32445b3 --- /dev/null +++ b/.idea/copyright/GMG.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/.idea/copyright/MiraGeoscience.xml b/.idea/copyright/MiraGeoscience.xml new file mode 100644 index 00000000..2d6a4985 --- /dev/null +++ b/.idea/copyright/MiraGeoscience.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/.idea/copyright/profiles_settings.xml b/.idea/copyright/profiles_settings.xml new file mode 100644 index 00000000..0313fd03 --- /dev/null +++ b/.idea/copyright/profiles_settings.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/scopes/sources.xml b/.idea/scopes/sources.xml index ac2cbbb6..f4755295 100644 --- a/.idea/scopes/sources.xml +++ b/.idea/scopes/sources.xml @@ -1,3 +1,3 @@ - - + + \ No newline at end of file diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 18510fba..4dc9ef07 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -52,9 +52,29 @@ repos: - repo: https://github.com/MiraGeoscience/pre-commit-hooks rev: v1.0.2 hooks: -# - id: check-copyright # no copyright nor license notice: differ to upstream repo -# files: ^(omf/fileio/geoh5\.py$|omf/scripts/|tests/) + - id: check-copyright + files: (^package\.rst|^LICENSE|^README(|-dev)\.rst|\.py|\.pyi)$ + # do not check sources from the original omf package + exclude: | + (?x)( + ^\..*| + ^docs/.*| + omf/( + fileio/__init__| + fileio/fileio| + fileio/utils| + base| + data| + lineset| + pointset| + serializers| + surface| + texture| + volume)\.py| + tests/doc_example_test\.py + )$ - id: prepare-commit-msg + - id: check-commit-msg - repo: local hooks: - id: pylint diff --git a/LICENSE b/LICENSE index 79729d2b..3833ab50 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,7 @@ MIT License Copyright (c) 2017 Global Mining Standards and Guidelines Group +Copyright (c) 2022-2025 Mira Geoscience Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.rst b/README.rst index 95c7b8c0..7d7187c8 100644 --- a/README.rst +++ b/README.rst @@ -89,7 +89,8 @@ License ^^^^^^^ MIT License -Copyright (c) 2025 Mira Geoscience +Copyright (c) 2017 Global Mining Standards and Guidelines Group +Copyright (c) 2022-2025 Mira Geoscience Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/omf/__init__.py b/omf/__init__.py index cc5c7b13..b17ec295 100644 --- a/omf/__init__.py +++ b/omf/__init__.py @@ -1,5 +1,19 @@ """omf: API library for Open Mining Format file interchange format""" +# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' +# Copyright (c) 2022-2025 Mira Geoscience Ltd. ' +# ' +# This file is part of mira-omf package. ' +# ' +# mira-omf is distributed under the terms and conditions of the MIT License ' +# (see LICENSE file at the root of this source code package). ' +# ' +# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' + +# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' +# Copyright (c) 2017 Global Mining Standards and Guidelines Group ' +# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' + import logging import sys @@ -31,9 +45,12 @@ __version__ = "3.3.0-rc.1" -__author__ = "Global Mining Standards and Guidelines Group" +__author__ = "Global Mining Standards and Guidelines Group, Mira Geoscience Ltd." __license__ = "MIT License" -__copyright__ = "Copyright 2017 Global Mining Standards and Guidelines Group" +__copyright__ = ( + "Copyright 2017 Global Mining Standards and Guidelines Group, " + "Copyright 2022-2025 Mira Geoscience Ltd." +) def _create_logger(): diff --git a/omf/base.py b/omf/base.py index 983da60c..b1a76611 100644 --- a/omf/base.py +++ b/omf/base.py @@ -1,5 +1,15 @@ """base.py: OMF Project and base classes for its components""" +# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' +# Copyright (c) 2017 Global Mining Standards and Guidelines Group ' +# ' +# This file is part of mira-omf package. ' +# ' +# mira-omf is distributed under the terms and conditions of the MIT License ' +# (see LICENSE file at the root of this source code package). ' +# ' +# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' + from __future__ import annotations import datetime diff --git a/omf/data.py b/omf/data.py index 5d41a45f..3cd34a28 100644 --- a/omf/data.py +++ b/omf/data.py @@ -1,5 +1,15 @@ """data.py: different ProjectElementData classes""" +# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' +# Copyright (c) 2017 Global Mining Standards and Guidelines Group ' +# ' +# This file is part of mira-omf package. ' +# ' +# mira-omf is distributed under the terms and conditions of the MIT License ' +# (see LICENSE file at the root of this source code package). ' +# ' +# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' + import numpy as np import properties diff --git a/omf/fileio/__init__.py b/omf/fileio/__init__.py index ac53c272..0e87312f 100644 --- a/omf/fileio/__init__.py +++ b/omf/fileio/__init__.py @@ -1,3 +1,13 @@ +# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' +# Copyright (c) 2017 Global Mining Standards and Guidelines Group ' +# ' +# This file is part of mira-omf package. ' +# ' +# mira-omf is distributed under the terms and conditions of the MIT License ' +# (see LICENSE file at the root of this source code package). ' +# ' +# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' + from .fileio import OMFReader, OMFWriter from .geoh5 import GeoH5Writer from .utils import compare_elements diff --git a/omf/fileio/fileio.py b/omf/fileio/fileio.py index 0ad7dd13..bd214e95 100644 --- a/omf/fileio/fileio.py +++ b/omf/fileio/fileio.py @@ -1,5 +1,15 @@ """fileio.py: OMF Writer and Reader for serializing to and from .omf files""" +# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' +# Copyright (c) 2017 Global Mining Standards and Guidelines Group ' +# ' +# This file is part of mira-omf package. ' +# ' +# mira-omf is distributed under the terms and conditions of the MIT License ' +# (see LICENSE file at the root of this source code package). ' +# ' +# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' + from __future__ import annotations import json diff --git a/omf/fileio/geoh5.py b/omf/fileio/geoh5.py index 54d3bcc1..143525fa 100644 --- a/omf/fileio/geoh5.py +++ b/omf/fileio/geoh5.py @@ -1,3 +1,13 @@ +# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' +# Copyright (c) 2022-2025 Mira Geoscience Ltd. ' +# ' +# This file is part of mira-omf package. ' +# ' +# mira-omf is distributed under the terms and conditions of the MIT License ' +# (see LICENSE file at the root of this source code package). ' +# ' +# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' + # pylint: disable=too-many-lines from __future__ import annotations diff --git a/omf/fileio/utils.py b/omf/fileio/utils.py index 54f76d1e..c1128530 100644 --- a/omf/fileio/utils.py +++ b/omf/fileio/utils.py @@ -1,3 +1,13 @@ +# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' +# Copyright (c) 2017 Global Mining Standards and Guidelines Group ' +# ' +# This file is part of mira-omf package. ' +# ' +# mira-omf is distributed under the terms and conditions of the MIT License ' +# (see LICENSE file at the root of this source code package). ' +# ' +# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' + from numpy import testing diff --git a/omf/lineset.py b/omf/lineset.py index d40c81d9..eb90d340 100644 --- a/omf/lineset.py +++ b/omf/lineset.py @@ -1,5 +1,15 @@ """lineset.py: LineSet element and geometry""" +# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' +# Copyright (c) 2017 Global Mining Standards and Guidelines Group ' +# ' +# This file is part of mira-omf package. ' +# ' +# mira-omf is distributed under the terms and conditions of the MIT License ' +# (see LICENSE file at the root of this source code package). ' +# ' +# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' + import numpy as np import properties diff --git a/omf/pointset.py b/omf/pointset.py index 64f4c140..e957a5ee 100644 --- a/omf/pointset.py +++ b/omf/pointset.py @@ -1,5 +1,15 @@ """pointset.py: PointSet element and geometry""" +# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' +# Copyright (c) 2017 Global Mining Standards and Guidelines Group ' +# ' +# This file is part of mira-omf package. ' +# ' +# mira-omf is distributed under the terms and conditions of the MIT License ' +# (see LICENSE file at the root of this source code package). ' +# ' +# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' + import properties from .base import ProjectElement, ProjectElementGeometry diff --git a/omf/scripts/__init__.py b/omf/scripts/__init__.py index e69de29b..d8b6fd73 100644 --- a/omf/scripts/__init__.py +++ b/omf/scripts/__init__.py @@ -0,0 +1,9 @@ +# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' +# Copyright (c) 2025 Mira Geoscience Ltd. ' +# ' +# This file is part of mira-omf package. ' +# ' +# mira-omf is distributed under the terms and conditions of the MIT License ' +# (see LICENSE file at the root of this source code package). ' +# ' +# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' diff --git a/omf/scripts/geoh5_to_omf.py b/omf/scripts/geoh5_to_omf.py index c58bcb67..a9412926 100644 --- a/omf/scripts/geoh5_to_omf.py +++ b/omf/scripts/geoh5_to_omf.py @@ -1,3 +1,13 @@ +# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' +# Copyright (c) 2025 Mira Geoscience Ltd. ' +# ' +# This file is part of mira-omf package. ' +# ' +# mira-omf is distributed under the terms and conditions of the MIT License ' +# (see LICENSE file at the root of this source code package). ' +# ' +# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' + import argparse import logging import sys diff --git a/omf/scripts/omf_to_geoh5.py b/omf/scripts/omf_to_geoh5.py index f710ed5b..a0e285df 100644 --- a/omf/scripts/omf_to_geoh5.py +++ b/omf/scripts/omf_to_geoh5.py @@ -1,3 +1,13 @@ +# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' +# Copyright (c) 2025 Mira Geoscience Ltd. ' +# ' +# This file is part of mira-omf package. ' +# ' +# mira-omf is distributed under the terms and conditions of the MIT License ' +# (see LICENSE file at the root of this source code package). ' +# ' +# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' + import argparse import logging import sys diff --git a/omf/serializers.py b/omf/serializers.py index 99c9998d..3715d52d 100644 --- a/omf/serializers.py +++ b/omf/serializers.py @@ -1,5 +1,15 @@ """serializers.py: array and image serializers/deserializers for OMF file IO""" +# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' +# Copyright (c) 2017 Global Mining Standards and Guidelines Group ' +# ' +# This file is part of mira-omf package. ' +# ' +# mira-omf is distributed under the terms and conditions of the MIT License ' +# (see LICENSE file at the root of this source code package). ' +# ' +# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' + import zlib from io import BytesIO diff --git a/omf/surface.py b/omf/surface.py index 7f3e0aac..cea30fac 100644 --- a/omf/surface.py +++ b/omf/surface.py @@ -1,5 +1,15 @@ """surface.py: Surface element and geometry""" +# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' +# Copyright (c) 2017 Global Mining Standards and Guidelines Group ' +# ' +# This file is part of mira-omf package. ' +# ' +# mira-omf is distributed under the terms and conditions of the MIT License ' +# (see LICENSE file at the root of this source code package). ' +# ' +# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' + import numpy as np import properties diff --git a/omf/texture.py b/omf/texture.py index 631406c7..8f00c902 100644 --- a/omf/texture.py +++ b/omf/texture.py @@ -1,5 +1,15 @@ """texture.py: contains ImageTexture definition""" +# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' +# Copyright (c) 2017 Global Mining Standards and Guidelines Group ' +# ' +# This file is part of mira-omf package. ' +# ' +# mira-omf is distributed under the terms and conditions of the MIT License ' +# (see LICENSE file at the root of this source code package). ' +# ' +# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' + import properties from .base import ContentModel diff --git a/omf/volume.py b/omf/volume.py index d399e47e..8982fb14 100644 --- a/omf/volume.py +++ b/omf/volume.py @@ -1,5 +1,15 @@ """volume.py: Volume element and geometry""" +# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' +# Copyright (c) 2017 Global Mining Standards and Guidelines Group ' +# ' +# This file is part of mira-omf package. ' +# ' +# mira-omf is distributed under the terms and conditions of the MIT License ' +# (see LICENSE file at the root of this source code package). ' +# ' +# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' + import numpy as np import properties diff --git a/tests/__init__.py b/tests/__init__.py index e69de29b..d8b6fd73 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -0,0 +1,9 @@ +# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' +# Copyright (c) 2025 Mira Geoscience Ltd. ' +# ' +# This file is part of mira-omf package. ' +# ' +# mira-omf is distributed under the terms and conditions of the MIT License ' +# (see LICENSE file at the root of this source code package). ' +# ' +# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' diff --git a/tests/conftest.py b/tests/conftest.py index 088d863b..4d71bdda 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,3 +1,13 @@ +# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' +# Copyright (c) 2025 Mira Geoscience Ltd. ' +# ' +# This file is part of mira-omf package. ' +# ' +# mira-omf is distributed under the terms and conditions of the MIT License ' +# (see LICENSE file at the root of this source code package). ' +# ' +# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' + from pathlib import Path import numpy as np diff --git a/tests/convert_curve_test.py b/tests/convert_curve_test.py index bba8f5a3..4094a1c3 100644 --- a/tests/convert_curve_test.py +++ b/tests/convert_curve_test.py @@ -1,5 +1,15 @@ """Tests for PointSet validation""" +# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' +# Copyright (c) 2025 Mira Geoscience Ltd. ' +# ' +# This file is part of mira-omf package. ' +# ' +# mira-omf is distributed under the terms and conditions of the MIT License ' +# (see LICENSE file at the root of this source code package). ' +# ' +# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' + from pathlib import Path import numpy as np diff --git a/tests/convert_grid2d_test.py b/tests/convert_grid2d_test.py index 0975ba14..219eff30 100644 --- a/tests/convert_grid2d_test.py +++ b/tests/convert_grid2d_test.py @@ -1,5 +1,15 @@ """Tests for PointSet validation""" +# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' +# Copyright (c) 2025 Mira Geoscience Ltd. ' +# ' +# This file is part of mira-omf package. ' +# ' +# mira-omf is distributed under the terms and conditions of the MIT License ' +# (see LICENSE file at the root of this source code package). ' +# ' +# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' + import logging from pathlib import Path diff --git a/tests/convert_pointset_test.py b/tests/convert_pointset_test.py index bbc259bc..3ca2cb98 100644 --- a/tests/convert_pointset_test.py +++ b/tests/convert_pointset_test.py @@ -1,5 +1,15 @@ """Tests for PointSet validation""" +# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' +# Copyright (c) 2025 Mira Geoscience Ltd. ' +# ' +# This file is part of mira-omf package. ' +# ' +# mira-omf is distributed under the terms and conditions of the MIT License ' +# (see LICENSE file at the root of this source code package). ' +# ' +# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' + from pathlib import Path import numpy as np diff --git a/tests/convert_project_test.py b/tests/convert_project_test.py index 586d12f7..2feca2fc 100644 --- a/tests/convert_project_test.py +++ b/tests/convert_project_test.py @@ -1,5 +1,15 @@ """Tests for PointSet validation""" +# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' +# Copyright (c) 2025 Mira Geoscience Ltd. ' +# ' +# This file is part of mira-omf package. ' +# ' +# mira-omf is distributed under the terms and conditions of the MIT License ' +# (see LICENSE file at the root of this source code package). ' +# ' +# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' + import logging import os from pathlib import Path diff --git a/tests/convert_surface_test.py b/tests/convert_surface_test.py index 0b33e6eb..407df7c9 100644 --- a/tests/convert_surface_test.py +++ b/tests/convert_surface_test.py @@ -1,5 +1,15 @@ """Tests for PointSet validation""" +# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' +# Copyright (c) 2025 Mira Geoscience Ltd. ' +# ' +# This file is part of mira-omf package. ' +# ' +# mira-omf is distributed under the terms and conditions of the MIT License ' +# (see LICENSE file at the root of this source code package). ' +# ' +# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' + from pathlib import Path import numpy as np diff --git a/tests/convert_volume_test.py b/tests/convert_volume_test.py index 913e9323..b0a887d4 100644 --- a/tests/convert_volume_test.py +++ b/tests/convert_volume_test.py @@ -1,5 +1,15 @@ """Tests for PointSet validation""" +# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' +# Copyright (c) 2025 Mira Geoscience Ltd. ' +# ' +# This file is part of mira-omf package. ' +# ' +# mira-omf is distributed under the terms and conditions of the MIT License ' +# (see LICENSE file at the root of this source code package). ' +# ' +# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' + from pathlib import Path import numpy as np diff --git a/tests/doc_example_test.py b/tests/doc_example_test.py index 4374b72f..6131451f 100644 --- a/tests/doc_example_test.py +++ b/tests/doc_example_test.py @@ -1,3 +1,13 @@ +# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' +# Copyright (c) 2017 Global Mining Standards and Guidelines Group ' +# ' +# This file is part of mira-omf package. ' +# ' +# mira-omf is distributed under the terms and conditions of the MIT License ' +# (see LICENSE file at the root of this source code package). ' +# ' +# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' + from pathlib import Path import omf diff --git a/tests/script_geoh5_to_omf_test.py b/tests/script_geoh5_to_omf_test.py index e21705fb..8c6c200f 100644 --- a/tests/script_geoh5_to_omf_test.py +++ b/tests/script_geoh5_to_omf_test.py @@ -1,3 +1,13 @@ +# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' +# Copyright (c) 2025 Mira Geoscience Ltd. ' +# ' +# This file is part of mira-omf package. ' +# ' +# mira-omf is distributed under the terms and conditions of the MIT License ' +# (see LICENSE file at the root of this source code package). ' +# ' +# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' + from pathlib import Path from unittest.mock import patch diff --git a/tests/script_omf_to_geoh5_test.py b/tests/script_omf_to_geoh5_test.py index 65d4bb79..159607cf 100644 --- a/tests/script_omf_to_geoh5_test.py +++ b/tests/script_omf_to_geoh5_test.py @@ -1,3 +1,13 @@ +# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' +# Copyright (c) 2025 Mira Geoscience Ltd. ' +# ' +# This file is part of mira-omf package. ' +# ' +# mira-omf is distributed under the terms and conditions of the MIT License ' +# (see LICENSE file at the root of this source code package). ' +# ' +# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' + import re from pathlib import Path from unittest.mock import patch diff --git a/tests/version_test.py b/tests/version_test.py index 6f7c3725..571408d8 100644 --- a/tests/version_test.py +++ b/tests/version_test.py @@ -1,5 +1,15 @@ """Test the version follows SemVer and is consistent across files.""" +# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' +# Copyright (c) 2025 Mira Geoscience Ltd. ' +# ' +# This file is part of mira-omf package. ' +# ' +# mira-omf is distributed under the terms and conditions of the MIT License ' +# (see LICENSE file at the root of this source code package). ' +# ' +# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' + from __future__ import annotations import re