├── .codeclimate.yml ├── .codespellignore ├── .flake8 ├── .gitattributes ├── .github ├── dependabot.yml └── workflows │ ├── issue_to_jira.yml │ ├── pr_add_jira_summary.yml │ ├── python_analysis.yml │ ├── python_deploy_dev.yml │ └── python_deploy_prod.yml ├── .gitignore ├── .idea ├── copyright │ ├── MiraGeoscience.xml │ └── profiles_settings.xml └── scopes │ └── sources.xml ├── .lift.toml ├── .pre-commit-config.yaml ├── .readthedocs.yml ├── .relint.yml ├── .rstcheck.cfg ├── COPYING ├── COPYING.LESSER ├── README-dev.rst ├── README.rst ├── docs ├── THIRD_PARTY_SOFTWARE.rst ├── _config.yml ├── _ext │ ├── Add2Build.py │ ├── __init__.py │ ├── autodoc.py │ ├── edit_on_github.py │ ├── environmentSetup.py │ └── fetch_gae_sdk.py ├── _toc.yml ├── app.yaml ├── conf.py ├── content │ ├── api │ │ ├── geoh5py.data.rst │ │ ├── geoh5py.groups.rst │ │ ├── geoh5py.io.rst │ │ ├── geoh5py.objects.rst │ │ ├── geoh5py.objects.surveys.electromagnetics.rst │ │ ├── geoh5py.objects.surveys.rst │ │ ├── geoh5py.shared.concatenation.rst │ │ ├── geoh5py.shared.conversion.rst │ │ ├── geoh5py.shared.merging.rst │ │ ├── geoh5py.shared.rst │ │ ├── geoh5py.ui_json.rst │ │ ├── geoh5py.ui_json.validations.rst │ │ ├── geoh5py.workspace.rst │ │ └── modules.rst │ ├── geoh5_format │ │ ├── data.rst │ │ ├── giftools.rst │ │ ├── groups.rst │ │ ├── images │ │ │ ├── data.png │ │ │ ├── entity_links.png │ │ │ ├── groups.png │ │ │ ├── hierarchy.png │ │ │ ├── logo.png │ │ │ ├── objects.png │ │ │ ├── root.png │ │ │ └── types.png │ │ ├── index.rst │ │ ├── integrator │ │ │ ├── data.rst │ │ │ ├── groups.rst │ │ │ ├── index.rst │ │ │ ├── objects.rst │ │ │ └── themes.rst │ │ ├── objects.rst │ │ ├── types.rst │ │ └── workspace.rst │ ├── installation.rst │ ├── release_notes.rst │ ├── uijson_format │ │ ├── forms.rst │ │ ├── images │ │ │ ├── block_model_output.png │ │ │ ├── block_model_uijson.png │ │ │ ├── bool_param.png │ │ │ ├── choice_list_param.png │ │ │ ├── data_param.png │ │ │ ├── data_value_param.png │ │ │ ├── data_value_param2.png │ │ │ ├── dependency_ex1.png │ │ │ ├── dependency_ex2.png │ │ │ ├── dependency_ex3.png │ │ │ ├── drag_drop.gif │ │ │ ├── drillhole_group_data_param.png │ │ │ ├── dropdown.gif │ │ │ ├── file_choice.png │ │ │ ├── file_param.png │ │ │ ├── float_param.png │ │ │ ├── group_param.png │ │ │ ├── int_param.png │ │ │ ├── object_param.png │ │ │ ├── range_slider_param.png │ │ │ ├── range_slider_param_complement.png │ │ │ └── str_param.png │ │ ├── index.rst │ │ ├── members.rst │ │ └── usage.rst │ └── user_guide │ │ ├── airborne_tem.ipynb │ │ ├── data.ipynb │ │ ├── direct_current.ipynb │ │ ├── docs.txt │ │ ├── groups.ipynb │ │ ├── images │ │ ├── DHinterval.png │ │ ├── DHlog.png │ │ ├── ab_cell_id.png │ │ ├── adddata.png │ │ ├── atem_metadata_custom.png │ │ ├── atem_metadata_uid.png │ │ ├── atem_metadata_yaw_property.png │ │ ├── atem_metadata_yaw_value.png │ │ ├── atem_survey.png │ │ ├── blankworkspace.png │ │ ├── blockmodel.png │ │ ├── current_electrodes.png │ │ ├── custom_colormap.png │ │ ├── data.png │ │ ├── dcip_pseudo_section.png │ │ ├── dcip_survey.png │ │ ├── default_colormap.png │ │ ├── drapemodel.png │ │ ├── drillhole.png │ │ ├── entities.png │ │ ├── filename_data.png │ │ ├── flin_flin_geology.jpg │ │ ├── grid2d.png │ │ ├── groups.png │ │ ├── line.png │ │ ├── mt_survey.png │ │ ├── objects.png │ │ ├── octree.png │ │ ├── points.png │ │ ├── potential_electrodes.png │ │ ├── propgroups.png │ │ ├── root.png │ │ ├── surface.png │ │ ├── tipper_survey.png │ │ ├── workspace.png │ │ └── workspace_tree.png │ │ ├── index.rst │ │ ├── magnetotelluric.ipynb │ │ ├── objects.ipynb │ │ ├── surveys.rst │ │ ├── tipper.ipynb │ │ └── workspace.ipynb ├── environment.yml ├── images │ ├── GA_demo.png │ ├── geoh5py_logo.png │ ├── gh5py.png │ ├── installation │ │ └── MinicondaInstaller.png │ └── readme │ │ ├── pycharm-add_Python_interpreter.png │ │ ├── pycharm-dialog_edit_test_run_config.png │ │ ├── pycharm-list_all_conda_packages.png │ │ ├── pycharm-mark_directory_as_tests.png │ │ ├── pycharm-menu_modify_test_run_config.png │ │ ├── pycharm-set_Poetry_Python_as_interpreter.png │ │ ├── pycharm-set_conda_env_as_interpreter.png │ │ └── pycharm-test_results.png ├── index.rst └── templates │ ├── module.rst_t │ ├── package.rst_t │ └── toc.rst_t ├── examples └── EMAG_global_plot.ipynb ├── geoh5py ├── __init__.py ├── data │ ├── __init__.py │ ├── blob_data.py │ ├── boolean_data.py │ ├── color_map.py │ ├── colour.py │ ├── data.py │ ├── data_association_enum.py │ ├── data_type.py │ ├── data_unit.py │ ├── datetime_data.py │ ├── filename_data.py │ ├── float_data.py │ ├── geometric_data.py │ ├── integer_data.py │ ├── numeric_data.py │ ├── primitive_type_enum.py │ ├── reference_value_map.py │ ├── referenced_data.py │ ├── text_data.py │ ├── unknown_data.py │ └── visual_parameters.py ├── groups │ ├── __init__.py │ ├── base.py │ ├── container.py │ ├── custom.py │ ├── drillhole.py │ ├── giftools.py │ ├── group_type.py │ ├── integrator.py │ ├── interpretation_section.py │ ├── maps.py │ ├── notype.py │ ├── property_group.py │ ├── property_group_table.py │ ├── property_group_type.py │ ├── root.py │ ├── simpeg.py │ ├── survey.py │ └── uijson.py ├── handlers │ ├── __init__.py │ ├── data_handler.py │ ├── groups_handler.py │ ├── objects_handler.py │ └── workspace_handler.py ├── interfaces │ ├── __init__.py │ ├── __init__.pyi │ ├── api.pyi │ ├── data.pyi │ ├── groups.pyi │ ├── objects.pyi │ ├── shared.pyi │ └── workspace.pyi ├── io │ ├── __init__.py │ ├── h5_reader.py │ ├── h5_writer.py │ └── utils.py ├── objects │ ├── __init__.py │ ├── block_model.py │ ├── cell_object.py │ ├── curve.py │ ├── drape_model.py │ ├── drillhole.py │ ├── geo_image.py │ ├── grid2d.py │ ├── grid_object.py │ ├── integrator.py │ ├── label.py │ ├── notype_object.py │ ├── object_base.py │ ├── object_type.py │ ├── octree.py │ ├── points.py │ ├── slicer.py │ ├── surface.py │ ├── surveys │ │ ├── __init__.py │ │ ├── base.py │ │ ├── direct_current.py │ │ ├── electromagnetics │ │ │ ├── __init__.py │ │ │ ├── airborne_fem.py │ │ │ ├── airborne_tem.py │ │ │ ├── base.py │ │ │ ├── ground_fem.py │ │ │ ├── ground_tem.py │ │ │ ├── magnetotellurics.py │ │ │ └── tipper.py │ │ └── magnetics.py │ └── text.py ├── py.typed ├── shared │ ├── __init__.py │ ├── concatenation │ │ ├── __init__.py │ │ ├── concatenated.py │ │ ├── concatenator.py │ │ ├── data.py │ │ ├── drillhole.py │ │ ├── drillholes_group_table.py │ │ ├── object.py │ │ └── property_group.py │ ├── conversion │ │ ├── __init__.py │ │ ├── base.py │ │ ├── geo_image.py │ │ └── grid2d.py │ ├── entity.py │ ├── entity_container.py │ ├── entity_type.py │ ├── exceptions.py │ ├── merging │ │ ├── __init__.py │ │ ├── base.py │ │ ├── cell.py │ │ ├── drape_model.py │ │ └── points.py │ ├── utils.py │ ├── validators.py │ └── weakref_utils.py ├── ui_json │ ├── __init__.py │ ├── annotations.py │ ├── constants.py │ ├── enforcers.py │ ├── forms.py │ ├── input_file.py │ ├── parameters.py │ ├── templates.py │ ├── ui_json.py │ ├── utils.py │ ├── validation.py │ └── validations │ │ ├── __init__.py │ │ └── uijson.py └── workspace │ ├── __init__.py │ └── workspace.py ├── package.rst ├── poetry.lock ├── pylintrc ├── pyproject.toml ├── recipe.yaml └── tests ├── __init__.py ├── add_filename_data_test.py ├── block_model_test.py ├── boolean_test.py ├── color_map_test.py ├── conversion_base_test.py ├── coordinate_system_test.py ├── copy_entity_test.py ├── copy_extent_cell_data_test.py ├── copy_extent_vertex_data_test.py ├── coulour_test.py ├── curve_data_test.py ├── data_instantiation_test.py ├── delete_entity_test.py ├── drape_model_test.py ├── drillhole_data_test.py ├── drillhole_v4_0_test.py ├── entity_attributes_test.py ├── entity_parent_test.py ├── geo_image_test.py ├── geometric_datatype_test.py ├── grid_2d_test.py ├── grid_object_test.py ├── group_test.py ├── groups_instantiation_test.py ├── h5_non_ascii_filename_test.py ├── insert_drillhole_data_test.py ├── interpretation_section_test.py ├── io_utils_test.py ├── io_write_test.py ├── label_test.py ├── merger_curve_test.py ├── merger_drape_model_test.py ├── merger_surface_test.py ├── merger_test.py ├── metadata_test.py ├── modify_property_group_test.py ├── monitored_update_test.py ├── no_data_value_test.py ├── notype_test.py ├── numeric_data_test.py ├── objects_instantiation_test.py ├── octree_test.py ├── point_data_test.py ├── property_group_test.py ├── reference_data_test.py ├── remove_root_test.py ├── save_modified_properties_test.py ├── set_parent_test.py ├── shared_utils_test.py ├── surveys ├── __init__.py ├── surface_data_test.py ├── survey_airborne_tem_test.py ├── survey_dcip_test.py ├── survey_fem_test.py ├── survey_ground_tem_test.py ├── survey_mt_test.py └── survey_tipper_test.py ├── text_data_test.py ├── text_object_test.py ├── type_uid_test.py ├── ui_json ├── __init__.py ├── enforcers_test.py ├── exceptions_test.py ├── forms_test.py ├── parameter_test.py ├── set_dict_test.py └── uijson_test.py ├── ui_json_test.py ├── ui_json_utils_test.py ├── user_comments_test.py ├── utils_test.py ├── validators_test.py ├── version_test.py ├── visual_parameters_test.py ├── weakref_test.py ├── weakref_utils_test.py ├── workspace_context_test.py └── workspace_test.py /.codeclimate.yml: -------------------------------------------------------------------------------- 1 | version: "2" # required to adjust maintainability checks 2 | 3 | checks: 4 | argument-count: 5 | enabled: true 6 | config: 7 | threshold: 10 # as long as not hitting too-many-positional-arguments 8 | # (note: for CodeClimate, '*' and '/' are counted as arguments) 9 | complex-logic: 10 | enabled: true 11 | config: 12 | threshold: 4 13 | file-lines: 14 | enabled: true 15 | config: 16 | threshold: 850 17 | method-complexity: 18 | enabled: true 19 | config: 20 | threshold: 6 21 | method-count: 22 | enabled: true 23 | config: 24 | threshold: 25 25 | method-lines: 26 | enabled: true 27 | config: 28 | threshold: 25 29 | nested-control-flow: 30 | enabled: true 31 | config: 32 | threshold: 4 33 | return-statements: 34 | enabled: true 35 | config: 36 | threshold: 4 37 | similar-code: 38 | enabled: true 39 | config: 40 | threshold: #language-specific defaults. overrides affect all languages. 41 | identical-code: 42 | enabled: true 43 | config: 44 | threshold: #language-specific defaults. overrides affect all languages. 45 | 46 | # plugins: 47 | # eslint: 48 | # enabled: true 49 | # channel: "eslint-6" 50 | # rubocop: 51 | # enabled: true 52 | # channel: "rubocop-0-79" 53 | 54 | exclude_patterns: 55 | - "config/" 56 | - "db/" 57 | - "dist/" 58 | - "devtools/" 59 | - "docs/" 60 | - "examples/" 61 | - "features/" 62 | - "**/node_modules/" 63 | - "script/" 64 | - "**/spec/" 65 | - "**/test/" 66 | - "**/tests/" 67 | - "tests/" 68 | - "**/vendor/" 69 | - "**/*_test.go" 70 | - "**/*.d.ts" 71 | -------------------------------------------------------------------------------- /.codespellignore: -------------------------------------------------------------------------------- 1 | ba 2 | nd 3 | -------------------------------------------------------------------------------- /.flake8: -------------------------------------------------------------------------------- 1 | [flake8] 2 | ignore = E203, E266, E501, W503 3 | max-line-length = 80 4 | max-complexity = 16 5 | select = B,C,E,F,W,T4,B9 6 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Shell scripts 2 | *.sh eol=lf 3 | *.gif filter=lfs diff=lfs merge=lfs -text 4 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | # To get started with Dependabot version updates, you'll need to specify which 2 | # package ecosystems to update and where the package manifests are located. 3 | # Please see the documentation for all configuration options: 4 | # https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates 5 | 6 | version: 2 7 | updates: 8 | - package-ecosystem: "github-actions" 9 | directory: "/" 10 | schedule: 11 | interval: "monthly" 12 | target-branch: "develop" 13 | -------------------------------------------------------------------------------- /.github/workflows/issue_to_jira.yml: -------------------------------------------------------------------------------- 1 | name: Create JIRA issue 2 | 3 | on: 4 | issues: 5 | types: [opened] 6 | 7 | jobs: 8 | call-workflow-create-jira-issue: 9 | uses: MiraGeoscience/CI-tools/.github/workflows/reusable-jira-issue_to_jira.yml@main 10 | secrets: inherit 11 | with: 12 | project-key: 'GEOPY' 13 | components: '[{"name": "geoh5py"}]' 14 | -------------------------------------------------------------------------------- /.github/workflows/pr_add_jira_summary.yml: -------------------------------------------------------------------------------- 1 | name: Add JIRA issue summary 2 | 3 | on: 4 | pull_request_target: 5 | types: [opened] 6 | 7 | jobs: 8 | call-workflow-add-jira-issue-summary: 9 | uses: MiraGeoscience/CI-tools/.github/workflows/reusable-jira-pr_add_jira_summary.yml@main 10 | secrets: inherit 11 | -------------------------------------------------------------------------------- /.github/workflows/python_analysis.yml: -------------------------------------------------------------------------------- 1 | name: Python analysis 2 | 3 | on: 4 | pull_request: 5 | types: [opened, synchronize, reopened, ready_for_review] 6 | branches: 7 | - develop 8 | - main 9 | - release/** 10 | - feature/** 11 | - hotfix/** 12 | push: 13 | branches: 14 | - develop 15 | - main 16 | - release/** 17 | - feature/** 18 | - hotfix/** 19 | 20 | concurrency: 21 | group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} 22 | cancel-in-progress: true 23 | 24 | jobs: 25 | call-workflow-static-analysis: 26 | name: Static analysis 27 | uses: MiraGeoscience/CI-tools/.github/workflows/reusable-python-static_analysis.yml@DEVOPS-690-poetry2 28 | with: 29 | package-manager: 'poetry' 30 | app-name: 'geoh5py' 31 | python-version: '3.10' 32 | call-workflow-pytest: 33 | name: Pytest 34 | uses: MiraGeoscience/CI-tools/.github/workflows/reusable-python-pytest.yml@DEVOPS-690-poetry2 35 | with: 36 | package-manager: 'poetry' 37 | python-versions: '["3.10", "3.11", "3.12"]' 38 | os: '["ubuntu-latest", "windows-latest"]' 39 | cache-number: 1 40 | codecov-reference-python-version: '3.10' 41 | codecov-reference-os: '["windows-latest"]' 42 | secrets: 43 | CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} 44 | -------------------------------------------------------------------------------- /.github/workflows/python_deploy_dev.yml: -------------------------------------------------------------------------------- 1 | name: Deploy python package in development 2 | 3 | on: 4 | push: 5 | tags: 6 | - 'v*' # Push events to every version tag (eg. v1.0.0) 7 | 8 | concurrency: 9 | group: ${{ github.workflow }}-${{ github.ref || github.run_id }} 10 | cancel-in-progress: true 11 | 12 | jobs: 13 | call-workflow-conda-publish: 14 | name: Publish development conda package on JFrog Artifactory 15 | uses: MiraGeoscience/CI-tools/.github/workflows/reusable-python-publish_rattler_package.yml@main 16 | with: 17 | package-name: 'geoh5py' 18 | python-version: '3.10' 19 | source-repo-names: '["public-noremote-conda-dev"]' 20 | conda-channels: '["conda-forge"]' 21 | publish-repo-names: '["public-noremote-conda-dev"]' 22 | secrets: 23 | JFROG_ARTIFACTORY_URL: ${{ secrets.JFROG_ARTIFACTORY_URL }} 24 | JFROG_ARTIFACTORY_TOKEN: ${{ secrets.JFROG_ARTIFACTORY_TOKEN }} 25 | call-workflow-pypi-publish: 26 | name: Publish development pypi package (JFrog Artifactory, TestPyPI) 27 | uses: MiraGeoscience/CI-tools/.github/workflows/reusable-python-publish_pypi_package.yml@main 28 | with: 29 | package-manager: 'poetry' 30 | package-name: 'geoh5py' 31 | version-tag: ${{ github.ref_name }} 32 | python-version: '3.10' 33 | virtual-repo-names: '["public-pypi-dev", "test-pypi"]' 34 | secrets: 35 | JFROG_ARTIFACTORY_URL: ${{ secrets.JFROG_ARTIFACTORY_URL }} 36 | JFROG_ARTIFACTORY_TOKEN: ${{ secrets.JFROG_ARTIFACTORY_TOKEN }} 37 | PYPI_TOKEN: ${{ secrets.TEST_PYPI_TOKEN }} 38 | -------------------------------------------------------------------------------- /.github/workflows/python_deploy_prod.yml: -------------------------------------------------------------------------------- 1 | name: Deploy python package in production 2 | 3 | on: 4 | release: 5 | types: [published] 6 | workflow_dispatch: 7 | inputs: 8 | release-tag: 9 | description: 'Tag for the existing (draft) release to publish assets from' 10 | required: true 11 | publish-conda: 12 | description: 'Publish Conda package' 13 | required: false 14 | type: boolean 15 | default: true 16 | publish-pypi: 17 | description: 'Publish PyPI package' 18 | required: false 19 | type: boolean 20 | default: true 21 | 22 | concurrency: 23 | group: ${{ github.workflow }}-${{ github.event.release.tag_name || github.event.inputs.release-tag || github.run_id }} 24 | cancel-in-progress: true 25 | 26 | jobs: 27 | call-workflow-conda-release: 28 | name: Publish production Conda package on JFrog Artifactory 29 | if: ${{ github.event_name == 'release' || github.event.inputs.publish-conda == 'true' }} 30 | uses: MiraGeoscience/CI-tools/.github/workflows/reusable-python-release_conda_assets.yml@main 31 | with: 32 | virtual-repo-names: '["public-noremote-conda-prod"]' 33 | release-tag: ${{ github.event.release.tag_name || github.event.inputs.release-tag }} 34 | secrets: 35 | JFROG_ARTIFACTORY_URL: ${{ secrets.JFROG_ARTIFACTORY_URL }} 36 | JFROG_ARTIFACTORY_TOKEN: ${{ secrets.JFROG_ARTIFACTORY_TOKEN }} 37 | call-workflow-pypi-release: 38 | name: Publish production PyPI package (JFrog Artifactory, PyPI) 39 | if: ${{ github.event_name == 'release' || github.event.inputs.publish-pypi == 'true' }} 40 | uses: MiraGeoscience/CI-tools/.github/workflows/reusable-python-release_pypi_assets.yml@main 41 | with: 42 | package-name: 'geoh5py' 43 | virtual-repo-names: '["public-pypi-prod", "pypi"]' 44 | release-tag: ${{ github.event.release.tag_name || github.event.inputs.release-tag }} 45 | secrets: 46 | JFROG_ARTIFACTORY_URL: ${{ secrets.JFROG_ARTIFACTORY_URL }} 47 | JFROG_ARTIFACTORY_TOKEN: ${{ secrets.JFROG_ARTIFACTORY_TOKEN }} 48 | PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} 49 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | build/ 12 | doc/_build/ 13 | develop-eggs/ 14 | dist/ 15 | downloads/ 16 | eggs/ 17 | .eggs/ 18 | lib/ 19 | lib64/ 20 | parts/ 21 | sdist/ 22 | var/ 23 | wheels/ 24 | pip-wheel-metadata/ 25 | share/python-wheels/ 26 | *.egg-info/ 27 | .installed.cfg 28 | *.egg 29 | MANIFEST 30 | 31 | source/ 32 | 33 | # PyInstaller 34 | # Usually these files are written by a python script from a template 35 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 36 | *.manifest 37 | *.spec 38 | 39 | # Installer logs 40 | pip-log.txt 41 | pip-delete-this-directory.txt 42 | 43 | # Unit test / coverage reports 44 | htmlcov/ 45 | .tox/ 46 | .nox/ 47 | .coverage 48 | .coverage.* 49 | .cache 50 | nosetests.xml 51 | coverage.xml 52 | *.cover 53 | *.py,cover 54 | .hypothesis/ 55 | .pytest_cache/ 56 | 57 | # Translations 58 | *.mo 59 | *.pot 60 | 61 | # Django stuff: 62 | *.log 63 | local_settings.py 64 | db.sqlite3 65 | db.sqlite3-journal 66 | 67 | # Flask stuff: 68 | instance/ 69 | .webassets-cache 70 | 71 | # Scrapy stuff: 72 | .scrapy 73 | 74 | # Sphinx documentation 75 | docs/_build/ 76 | 77 | # PyBuilder 78 | target/ 79 | 80 | # Jupyter Notebook 81 | .ipynb_checkpoints 82 | 83 | # IPython 84 | profile_default/ 85 | ipython_config.py 86 | 87 | # pyenv 88 | .python-version 89 | 90 | # pipenv 91 | # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. 92 | # However, in case of collaboration, if having platform-specific dependencies or dependencies 93 | # having no cross-platform support, pipenv may install dependencies that don't work, or not 94 | # install all needed dependencies. 95 | #Pipfile.lock 96 | 97 | # PEP 582; used by e.g. github.com/David-OConnor/pyflow 98 | __pypackages__/ 99 | 100 | # Celery stuff 101 | celerybeat-schedule 102 | celerybeat.pid 103 | 104 | # SageMath parsed files 105 | *.sage.py 106 | 107 | # Environments 108 | .env 109 | .venv 110 | env/ 111 | venv/ 112 | ENV/ 113 | env.bak/ 114 | venv.bak/ 115 | 116 | # Spyder project settings 117 | .spyderproject 118 | .spyproject 119 | 120 | # Rope project settings 121 | .ropeproject 122 | 123 | # mkdocs documentation 124 | /site 125 | 126 | #pycharm 127 | /.idea/* 128 | !/.idea/scopes/ 129 | !/.idea/copyright/ 130 | 131 | # mypy 132 | .mypy_cache/ 133 | .dmypy.json 134 | dmypy.json 135 | 136 | # Pyre type checker 137 | .pyre/ 138 | 139 | # isort config is in pyproject.toml 140 | .isort.cfg 141 | 142 | # vscode 143 | .vscode 144 | 145 | # geoh5 locks 146 | *.geoh5.lock 147 | -------------------------------------------------------------------------------- /.idea/copyright/MiraGeoscience.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | -------------------------------------------------------------------------------- /.idea/copyright/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 14 | 15 | 20 | 21 | -------------------------------------------------------------------------------- /.idea/scopes/sources.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /.lift.toml: -------------------------------------------------------------------------------- 1 | ignoreFiles = """ 2 | tests/ 3 | docs/ 4 | examples/ 5 | devtools/ 6 | """ 7 | -------------------------------------------------------------------------------- /.readthedocs.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | 3 | # Set the version of Python and other tools you might need 4 | build: 5 | os: "ubuntu-22.04" 6 | tools: 7 | python: "mambaforge-22.9" 8 | jobs: 9 | post_checkout: 10 | # Download and uncompress the binary 11 | # https://git-lfs.github.com/ 12 | - wget https://github.com/git-lfs/git-lfs/releases/download/v3.1.4/git-lfs-linux-amd64-v3.1.4.tar.gz 13 | - tar xvfz git-lfs-linux-amd64-v3.1.4.tar.gz 14 | # Modify LFS config paths to point where git-lfs binary was downloaded 15 | - git config filter.lfs.process "`pwd`/git-lfs filter-process" 16 | - git config filter.lfs.smudge "`pwd`/git-lfs smudge -- %f" 17 | - git config filter.lfs.clean "`pwd`/git-lfs clean -- %f" 18 | # Make LFS available in current repository 19 | - ./git-lfs install 20 | # Download content from remote 21 | - ./git-lfs fetch 22 | # Make local files to have the real content on them 23 | - ./git-lfs checkout 24 | pre_build: 25 | # Generate on-the-fly Sphinx configuration from Jupyter Book's _config.yml 26 | - "jupyter-book config sphinx docs/" 27 | - "pip install . --no-deps" 28 | 29 | # Build documentation in the docs/ directory with Sphinx 30 | sphinx: 31 | builder: html 32 | configuration: docs/conf.py 33 | fail_on_warning: false 34 | 35 | conda: 36 | environment: docs/environment.yml 37 | -------------------------------------------------------------------------------- /.relint.yml: -------------------------------------------------------------------------------- 1 | - name: No import os.path 2 | pattern: 'from os import\b.*\bpath\b' 3 | hint: Use from pathlib import Path 4 | filePattern: .*\.pyi? 5 | error: false 6 | - name: No os.path 7 | pattern: '\bos\.path\b' 8 | hint: Use pathlib.Path 9 | filePattern: .*\.pyi? 10 | error: false 11 | -------------------------------------------------------------------------------- /.rstcheck.cfg: -------------------------------------------------------------------------------- 1 | [rstcheck] 2 | ignore_directives=automodule,include 3 | report_level=WARNING 4 | ignore_substitutions = copyright_notice 5 | -------------------------------------------------------------------------------- /docs/THIRD_PARTY_SOFTWARE.rst: -------------------------------------------------------------------------------- 1 | Third Party Software 2 | ==================== 3 | 4 | The geoh5py repository and source distributions bundle several libraries that are 5 | compatibly licensed. We list these here. 6 | 7 | .. list-table:: 8 | :widths: 30 30 60 9 | :header-rows: 1 10 | 11 | * - Name 12 | - License 13 | - Description 14 | * - `h5py `_ 15 | - BSD-3-Clause 16 | - Read and write HDF5 files from Python. 17 | * - `NumPy `_ 18 | - BSD-3-Clause 19 | - NumPy is the fundamental package for array computing with Python. 20 | * - `Pydantic `_ 21 | - MIT 22 | - Data validation using Python type hints. 23 | * - `Pillow `_ 24 | - HPND 25 | - Python Imaging Library (Fork) 26 | -------------------------------------------------------------------------------- /docs/_config.yml: -------------------------------------------------------------------------------- 1 | # Book settings 2 | # Learn more at https://jupyterbook.org/customize/config.html 3 | 4 | title: Geoh5py 5 | author: Mira Geoscience 6 | logo: images/geoh5py_logo.png 7 | 8 | # Force re-execution of notebooks on each build. 9 | # See https://jupyterbook.org/content/execute.html 10 | execute: 11 | execute_notebooks: force 12 | run_in_temp: true 13 | 14 | sphinx: 15 | extra_extensions: 16 | - 'sphinx.ext.autodoc' 17 | config: 18 | suppress_warnings : ["etoc.toctree"] 19 | 20 | 21 | # Define the name of the latex output file for PDF builds 22 | latex: 23 | latex_documents: 24 | targetname: book.tex 25 | 26 | # Information about where the book exists on the web 27 | repository: 28 | url: https://github.com/executablebooks/jupyter-book # Online location of your book 29 | path_to_book: docs # Optional path to your book, relative to the repository root 30 | branch: main # Which branch of the repository should be used when creating links (optional) 31 | 32 | # Add GitHub buttons to your book 33 | # See https://jupyterbook.org/customize/config.html#add-a-link-to-your-repository 34 | html: 35 | use_issues_button: true 36 | use_repository_button: true 37 | -------------------------------------------------------------------------------- /docs/_ext/Add2Build.py: -------------------------------------------------------------------------------- 1 | import os 2 | import shutil 3 | from pathlib import Path 4 | 5 | 6 | def copyImages(): 7 | # get relevant directories 8 | cwd = Path() 9 | contentdir = cwd / "content" 10 | buildimagesdir = cwd / "_build" / "html" / "_images" 11 | 12 | # check if images directory exists 13 | buildimagesdir.mkdir(exist_ok=True) 14 | 15 | # images that have been copied 16 | imnames = os.listdir(buildimagesdir) 17 | 18 | # search for images that have been missed 19 | for root, dirList, fileList in os.walk(str(contentdir)): 20 | if root.endswith("images"): 21 | for filename in fileList: 22 | if filename not in imnames: 23 | shutil.copy(Path(root) / filename, buildimagesdir) 24 | return 25 | 26 | 27 | if __name__ == "__main__": 28 | copyImages() 29 | -------------------------------------------------------------------------------- /docs/_ext/__init__.py: -------------------------------------------------------------------------------- 1 | from Add2Build import copyImages 2 | from autodoc import make_lectures_page 3 | from edit_on_github import * 4 | from environmentSetup import supress_nonlocal_image_warn 5 | -------------------------------------------------------------------------------- /docs/_ext/edit_on_github.py: -------------------------------------------------------------------------------- 1 | """ 2 | Sphinx extension to add ReadTheDocs-style "Edit on GitHub" links to the 3 | sidebar. 4 | 5 | Loosely based on https://github.com/astropy/astropy/pull/347 6 | """ 7 | 8 | from pathlib import Path 9 | import warnings 10 | 11 | __licence__ = "BSD (3 clause)" 12 | 13 | 14 | def get_github_url(app, view, path): 15 | if app.config.edit_on_github_directory is not None: 16 | return "https://github.com/{project}/{view}/{branch}/{dir}/{path}".format( 17 | project=app.config.edit_on_github_project, 18 | view=view, 19 | branch=app.config.edit_on_github_branch, 20 | dir=app.config.edit_on_github_directory, 21 | path=path, 22 | ) 23 | else: 24 | return "https://github.com/{project}/{view}/{branch}/{path}".format( 25 | project=app.config.edit_on_github_project, 26 | view=view, 27 | branch=app.config.edit_on_github_branch, 28 | path=path, 29 | ) 30 | 31 | 32 | def html_page_context(app, pagename, templatename, context, doctree): 33 | if templatename != "page.html": 34 | return 35 | 36 | if not app.config.edit_on_github_project: 37 | warnings.warn("edit_on_github_project not specified") 38 | return 39 | 40 | path = Path(doctree.get("source")).relative(Path(app.builder.srcdir)) 41 | show_url = get_github_url(app, "blob", str(path)) 42 | edit_url = get_github_url(app, "edit", str(path)) 43 | 44 | # context['show_on_github_url'] = show_url 45 | context["edit_on_github_url"] = edit_url 46 | 47 | 48 | def setup(app): 49 | app.add_config_value("edit_on_github_project", "", True) 50 | app.add_config_value("edit_on_github_branch", "master", True) 51 | app.add_config_value("edit_on_github_directory", None, True) 52 | app.connect("html-page-context", html_page_context) 53 | -------------------------------------------------------------------------------- /docs/_ext/environmentSetup.py: -------------------------------------------------------------------------------- 1 | def supress_nonlocal_image_warn(): 2 | import sphinx.environment 3 | 4 | sphinx.environment.BuildEnvironment.warn_node = _supress_nonlocal_image_warn 5 | 6 | 7 | def _supress_nonlocal_image_warn(self, msg, node, **kwargs): 8 | from docutils.utils import get_source_line 9 | 10 | if not msg.startswith("nonlocal image URI found:"): 11 | self._warnfunc(msg, "%s:%s" % get_source_line(node)) 12 | -------------------------------------------------------------------------------- /docs/_toc.yml: -------------------------------------------------------------------------------- 1 | # Table of contents 2 | # Learn more at https://jupyterbook.org/customize/toc.html 3 | 4 | format: jb-book 5 | root: index 6 | chapters: 7 | - file: content/installation 8 | - file: content/user_guide/index 9 | - file: content/geoh5_format/index 10 | sections: 11 | - file: content/geoh5_format/workspace 12 | - file: content/geoh5_format/groups 13 | - file: content/geoh5_format/objects 14 | - file: content/geoh5_format/data 15 | - file: content/geoh5_format/types 16 | - file: content/geoh5_format/giftools 17 | - file: content/geoh5_format/integrator/index 18 | sections: 19 | - file: content/geoh5_format/integrator/data 20 | - file: content/geoh5_format/integrator/groups 21 | - file: content/geoh5_format/integrator/objects 22 | - file: content/geoh5_format/integrator/themes 23 | - file: content/uijson_format/index 24 | sections: 25 | - file: content/uijson_format/usage 26 | - file: content/uijson_format/forms 27 | - file: content/uijson_format/members 28 | - file: content/api/modules 29 | - file: content/release_notes 30 | - file: THIRD_PARTY_SOFTWARE 31 | -------------------------------------------------------------------------------- /docs/content/api/geoh5py.io.rst: -------------------------------------------------------------------------------- 1 | geoh5py.io package 2 | ================== 3 | 4 | Submodules 5 | ---------- 6 | 7 | geoh5py.io.h5\_reader module 8 | ---------------------------- 9 | 10 | .. automodule:: geoh5py.io.h5_reader 11 | :members: 12 | :undoc-members: 13 | :show-inheritance: 14 | 15 | geoh5py.io.h5\_writer module 16 | ---------------------------- 17 | 18 | .. automodule:: geoh5py.io.h5_writer 19 | :members: 20 | :undoc-members: 21 | :show-inheritance: 22 | 23 | geoh5py.io.utils module 24 | ----------------------- 25 | 26 | .. automodule:: geoh5py.io.utils 27 | :members: 28 | :undoc-members: 29 | :show-inheritance: 30 | 31 | Module contents 32 | --------------- 33 | 34 | .. automodule:: geoh5py.io 35 | :members: 36 | :undoc-members: 37 | :show-inheritance: 38 | -------------------------------------------------------------------------------- /docs/content/api/geoh5py.objects.surveys.electromagnetics.rst: -------------------------------------------------------------------------------- 1 | geoh5py.objects.surveys.electromagnetics package 2 | ================================================ 3 | 4 | Submodules 5 | ---------- 6 | 7 | geoh5py.objects.surveys.electromagnetics.airborne\_fem module 8 | ------------------------------------------------------------- 9 | 10 | .. automodule:: geoh5py.objects.surveys.electromagnetics.airborne_fem 11 | :members: 12 | :undoc-members: 13 | :show-inheritance: 14 | 15 | geoh5py.objects.surveys.electromagnetics.airborne\_tem module 16 | ------------------------------------------------------------- 17 | 18 | .. automodule:: geoh5py.objects.surveys.electromagnetics.airborne_tem 19 | :members: 20 | :undoc-members: 21 | :show-inheritance: 22 | 23 | geoh5py.objects.surveys.electromagnetics.base module 24 | ---------------------------------------------------- 25 | 26 | .. automodule:: geoh5py.objects.surveys.electromagnetics.base 27 | :members: 28 | :undoc-members: 29 | :show-inheritance: 30 | 31 | geoh5py.objects.surveys.electromagnetics.ground\_fem module 32 | ----------------------------------------------------------- 33 | 34 | .. automodule:: geoh5py.objects.surveys.electromagnetics.ground_fem 35 | :members: 36 | :undoc-members: 37 | :show-inheritance: 38 | 39 | geoh5py.objects.surveys.electromagnetics.ground\_tem module 40 | ----------------------------------------------------------- 41 | 42 | .. automodule:: geoh5py.objects.surveys.electromagnetics.ground_tem 43 | :members: 44 | :undoc-members: 45 | :show-inheritance: 46 | 47 | geoh5py.objects.surveys.electromagnetics.magnetotellurics module 48 | ---------------------------------------------------------------- 49 | 50 | .. automodule:: geoh5py.objects.surveys.electromagnetics.magnetotellurics 51 | :members: 52 | :undoc-members: 53 | :show-inheritance: 54 | 55 | geoh5py.objects.surveys.electromagnetics.tipper module 56 | ------------------------------------------------------ 57 | 58 | .. automodule:: geoh5py.objects.surveys.electromagnetics.tipper 59 | :members: 60 | :undoc-members: 61 | :show-inheritance: 62 | 63 | Module contents 64 | --------------- 65 | 66 | .. automodule:: geoh5py.objects.surveys.electromagnetics 67 | :members: 68 | :undoc-members: 69 | :show-inheritance: 70 | -------------------------------------------------------------------------------- /docs/content/api/geoh5py.objects.surveys.rst: -------------------------------------------------------------------------------- 1 | geoh5py.objects.surveys package 2 | =============================== 3 | 4 | Subpackages 5 | ----------- 6 | 7 | .. toctree:: 8 | :maxdepth: 4 9 | 10 | geoh5py.objects.surveys.electromagnetics 11 | 12 | Submodules 13 | ---------- 14 | 15 | geoh5py.objects.surveys.direct\_current module 16 | ---------------------------------------------- 17 | 18 | .. automodule:: geoh5py.objects.surveys.direct_current 19 | :members: 20 | :undoc-members: 21 | :show-inheritance: 22 | 23 | geoh5py.objects.surveys.magnetics module 24 | ---------------------------------------- 25 | 26 | .. automodule:: geoh5py.objects.surveys.magnetics 27 | :members: 28 | :undoc-members: 29 | :show-inheritance: 30 | 31 | Module contents 32 | --------------- 33 | 34 | .. automodule:: geoh5py.objects.surveys 35 | :members: 36 | :undoc-members: 37 | :show-inheritance: 38 | -------------------------------------------------------------------------------- /docs/content/api/geoh5py.shared.concatenation.rst: -------------------------------------------------------------------------------- 1 | geoh5py.shared.concatenation package 2 | ==================================== 3 | 4 | Submodules 5 | ---------- 6 | 7 | geoh5py.shared.concatenation.concatenated module 8 | ------------------------------------------------ 9 | 10 | .. automodule:: geoh5py.shared.concatenation.concatenated 11 | :members: 12 | :undoc-members: 13 | :show-inheritance: 14 | 15 | geoh5py.shared.concatenation.concatenator module 16 | ------------------------------------------------ 17 | 18 | .. automodule:: geoh5py.shared.concatenation.concatenator 19 | :members: 20 | :undoc-members: 21 | :show-inheritance: 22 | 23 | geoh5py.shared.concatenation.data module 24 | ---------------------------------------- 25 | 26 | .. automodule:: geoh5py.shared.concatenation.data 27 | :members: 28 | :undoc-members: 29 | :show-inheritance: 30 | 31 | geoh5py.shared.concatenation.drillhole module 32 | --------------------------------------------- 33 | 34 | .. automodule:: geoh5py.shared.concatenation.drillhole 35 | :members: 36 | :undoc-members: 37 | :show-inheritance: 38 | 39 | geoh5py.shared.concatenation.drillholes\_group\_table module 40 | ------------------------------------------------------------ 41 | 42 | .. automodule:: geoh5py.shared.concatenation.drillholes_group_table 43 | :members: 44 | :undoc-members: 45 | :show-inheritance: 46 | 47 | geoh5py.shared.concatenation.object module 48 | ------------------------------------------ 49 | 50 | .. automodule:: geoh5py.shared.concatenation.object 51 | :members: 52 | :undoc-members: 53 | :show-inheritance: 54 | 55 | geoh5py.shared.concatenation.property\_group module 56 | --------------------------------------------------- 57 | 58 | .. automodule:: geoh5py.shared.concatenation.property_group 59 | :members: 60 | :undoc-members: 61 | :show-inheritance: 62 | 63 | Module contents 64 | --------------- 65 | 66 | .. automodule:: geoh5py.shared.concatenation 67 | :members: 68 | :undoc-members: 69 | :show-inheritance: 70 | -------------------------------------------------------------------------------- /docs/content/api/geoh5py.shared.conversion.rst: -------------------------------------------------------------------------------- 1 | geoh5py.shared.conversion package 2 | ================================= 3 | 4 | Submodules 5 | ---------- 6 | 7 | geoh5py.shared.conversion.base module 8 | ------------------------------------- 9 | 10 | .. automodule:: geoh5py.shared.conversion.base 11 | :members: 12 | :undoc-members: 13 | :show-inheritance: 14 | 15 | geoh5py.shared.conversion.geo\_image module 16 | ------------------------------------------- 17 | 18 | .. automodule:: geoh5py.shared.conversion.geo_image 19 | :members: 20 | :undoc-members: 21 | :show-inheritance: 22 | 23 | geoh5py.shared.conversion.grid2d module 24 | --------------------------------------- 25 | 26 | .. automodule:: geoh5py.shared.conversion.grid2d 27 | :members: 28 | :undoc-members: 29 | :show-inheritance: 30 | 31 | Module contents 32 | --------------- 33 | 34 | .. automodule:: geoh5py.shared.conversion 35 | :members: 36 | :undoc-members: 37 | :show-inheritance: 38 | -------------------------------------------------------------------------------- /docs/content/api/geoh5py.shared.merging.rst: -------------------------------------------------------------------------------- 1 | geoh5py.shared.merging package 2 | ============================== 3 | 4 | Submodules 5 | ---------- 6 | 7 | geoh5py.shared.merging.base module 8 | ---------------------------------- 9 | 10 | .. automodule:: geoh5py.shared.merging.base 11 | :members: 12 | :undoc-members: 13 | :show-inheritance: 14 | 15 | geoh5py.shared.merging.cell module 16 | ---------------------------------- 17 | 18 | .. automodule:: geoh5py.shared.merging.cell 19 | :members: 20 | :undoc-members: 21 | :show-inheritance: 22 | 23 | geoh5py.shared.merging.drape\_model module 24 | ------------------------------------------ 25 | 26 | .. automodule:: geoh5py.shared.merging.drape_model 27 | :members: 28 | :undoc-members: 29 | :show-inheritance: 30 | 31 | geoh5py.shared.merging.points module 32 | ------------------------------------ 33 | 34 | .. automodule:: geoh5py.shared.merging.points 35 | :members: 36 | :undoc-members: 37 | :show-inheritance: 38 | 39 | Module contents 40 | --------------- 41 | 42 | .. automodule:: geoh5py.shared.merging 43 | :members: 44 | :undoc-members: 45 | :show-inheritance: 46 | -------------------------------------------------------------------------------- /docs/content/api/geoh5py.shared.rst: -------------------------------------------------------------------------------- 1 | geoh5py.shared package 2 | ====================== 3 | 4 | Subpackages 5 | ----------- 6 | 7 | .. toctree:: 8 | :maxdepth: 4 9 | 10 | geoh5py.shared.concatenation 11 | geoh5py.shared.conversion 12 | geoh5py.shared.merging 13 | 14 | Submodules 15 | ---------- 16 | 17 | geoh5py.shared.entity module 18 | ---------------------------- 19 | 20 | .. automodule:: geoh5py.shared.entity 21 | :members: 22 | :undoc-members: 23 | :show-inheritance: 24 | 25 | geoh5py.shared.entity\_container module 26 | --------------------------------------- 27 | 28 | .. automodule:: geoh5py.shared.entity_container 29 | :members: 30 | :undoc-members: 31 | :show-inheritance: 32 | 33 | geoh5py.shared.entity\_type module 34 | ---------------------------------- 35 | 36 | .. automodule:: geoh5py.shared.entity_type 37 | :members: 38 | :undoc-members: 39 | :show-inheritance: 40 | 41 | geoh5py.shared.exceptions module 42 | -------------------------------- 43 | 44 | .. automodule:: geoh5py.shared.exceptions 45 | :members: 46 | :undoc-members: 47 | :show-inheritance: 48 | 49 | geoh5py.shared.utils module 50 | --------------------------- 51 | 52 | .. automodule:: geoh5py.shared.utils 53 | :members: 54 | :undoc-members: 55 | :show-inheritance: 56 | 57 | geoh5py.shared.validators module 58 | -------------------------------- 59 | 60 | .. automodule:: geoh5py.shared.validators 61 | :members: 62 | :undoc-members: 63 | :show-inheritance: 64 | 65 | geoh5py.shared.weakref\_utils module 66 | ------------------------------------ 67 | 68 | .. automodule:: geoh5py.shared.weakref_utils 69 | :members: 70 | :undoc-members: 71 | :show-inheritance: 72 | 73 | Module contents 74 | --------------- 75 | 76 | .. automodule:: geoh5py.shared 77 | :members: 78 | :undoc-members: 79 | :show-inheritance: 80 | -------------------------------------------------------------------------------- /docs/content/api/geoh5py.ui_json.rst: -------------------------------------------------------------------------------- 1 | geoh5py.ui\_json package 2 | ======================== 3 | 4 | Subpackages 5 | ----------- 6 | 7 | .. toctree:: 8 | :maxdepth: 4 9 | 10 | geoh5py.ui_json.validations 11 | 12 | Submodules 13 | ---------- 14 | 15 | geoh5py.ui\_json.constants module 16 | --------------------------------- 17 | 18 | .. automodule:: geoh5py.ui_json.constants 19 | :members: 20 | :undoc-members: 21 | :show-inheritance: 22 | 23 | geoh5py.ui\_json.enforcers module 24 | --------------------------------- 25 | 26 | .. automodule:: geoh5py.ui_json.enforcers 27 | :members: 28 | :undoc-members: 29 | :show-inheritance: 30 | 31 | geoh5py.ui\_json.forms module 32 | ----------------------------- 33 | 34 | .. automodule:: geoh5py.ui_json.forms 35 | :members: 36 | :undoc-members: 37 | :show-inheritance: 38 | 39 | geoh5py.ui\_json.input\_file module 40 | ----------------------------------- 41 | 42 | .. automodule:: geoh5py.ui_json.input_file 43 | :members: 44 | :undoc-members: 45 | :show-inheritance: 46 | 47 | geoh5py.ui\_json.parameters module 48 | ---------------------------------- 49 | 50 | .. automodule:: geoh5py.ui_json.parameters 51 | :members: 52 | :undoc-members: 53 | :show-inheritance: 54 | 55 | geoh5py.ui\_json.templates module 56 | --------------------------------- 57 | 58 | .. automodule:: geoh5py.ui_json.templates 59 | :members: 60 | :undoc-members: 61 | :show-inheritance: 62 | 63 | geoh5py.ui\_json.ui\_json module 64 | -------------------------------- 65 | 66 | .. automodule:: geoh5py.ui_json.ui_json 67 | :members: 68 | :undoc-members: 69 | :show-inheritance: 70 | 71 | geoh5py.ui\_json.utils module 72 | ----------------------------- 73 | 74 | .. automodule:: geoh5py.ui_json.utils 75 | :members: 76 | :undoc-members: 77 | :show-inheritance: 78 | 79 | geoh5py.ui\_json.validation module 80 | ---------------------------------- 81 | 82 | .. automodule:: geoh5py.ui_json.validation 83 | :members: 84 | :undoc-members: 85 | :show-inheritance: 86 | 87 | Module contents 88 | --------------- 89 | 90 | .. automodule:: geoh5py.ui_json 91 | :members: 92 | :undoc-members: 93 | :show-inheritance: 94 | -------------------------------------------------------------------------------- /docs/content/api/geoh5py.ui_json.validations.rst: -------------------------------------------------------------------------------- 1 | geoh5py.ui\_json.validations package 2 | ==================================== 3 | 4 | Submodules 5 | ---------- 6 | 7 | geoh5py.ui\_json.validations.uijson module 8 | ------------------------------------------ 9 | 10 | .. automodule:: geoh5py.ui_json.validations.uijson 11 | :members: 12 | :undoc-members: 13 | :show-inheritance: 14 | 15 | Module contents 16 | --------------- 17 | 18 | .. automodule:: geoh5py.ui_json.validations 19 | :members: 20 | :undoc-members: 21 | :show-inheritance: 22 | -------------------------------------------------------------------------------- /docs/content/api/geoh5py.workspace.rst: -------------------------------------------------------------------------------- 1 | geoh5py.workspace package 2 | ========================= 3 | 4 | Submodules 5 | ---------- 6 | 7 | geoh5py.workspace.workspace module 8 | ---------------------------------- 9 | 10 | .. automodule:: geoh5py.workspace.workspace 11 | :members: 12 | :undoc-members: 13 | :show-inheritance: 14 | 15 | Module contents 16 | --------------- 17 | 18 | .. automodule:: geoh5py.workspace 19 | :members: 20 | :undoc-members: 21 | :show-inheritance: 22 | -------------------------------------------------------------------------------- /docs/content/api/modules.rst: -------------------------------------------------------------------------------- 1 | API Reference 2 | ============= 3 | 4 | .. toctree:: 5 | :maxdepth: 4 6 | 7 | geoh5py.data 8 | geoh5py.groups 9 | geoh5py.io 10 | geoh5py.objects 11 | geoh5py.shared 12 | geoh5py.ui_json 13 | geoh5py.workspace 14 | -------------------------------------------------------------------------------- /docs/content/geoh5_format/images/data.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiraGeoscience/geoh5py/585c89094e3eff35df10d3076964bf154b24d575/docs/content/geoh5_format/images/data.png -------------------------------------------------------------------------------- /docs/content/geoh5_format/images/entity_links.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiraGeoscience/geoh5py/585c89094e3eff35df10d3076964bf154b24d575/docs/content/geoh5_format/images/entity_links.png -------------------------------------------------------------------------------- /docs/content/geoh5_format/images/groups.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiraGeoscience/geoh5py/585c89094e3eff35df10d3076964bf154b24d575/docs/content/geoh5_format/images/groups.png -------------------------------------------------------------------------------- /docs/content/geoh5_format/images/hierarchy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiraGeoscience/geoh5py/585c89094e3eff35df10d3076964bf154b24d575/docs/content/geoh5_format/images/hierarchy.png -------------------------------------------------------------------------------- /docs/content/geoh5_format/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiraGeoscience/geoh5py/585c89094e3eff35df10d3076964bf154b24d575/docs/content/geoh5_format/images/logo.png -------------------------------------------------------------------------------- /docs/content/geoh5_format/images/objects.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiraGeoscience/geoh5py/585c89094e3eff35df10d3076964bf154b24d575/docs/content/geoh5_format/images/objects.png -------------------------------------------------------------------------------- /docs/content/geoh5_format/images/root.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiraGeoscience/geoh5py/585c89094e3eff35df10d3076964bf154b24d575/docs/content/geoh5_format/images/root.png -------------------------------------------------------------------------------- /docs/content/geoh5_format/images/types.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiraGeoscience/geoh5py/585c89094e3eff35df10d3076964bf154b24d575/docs/content/geoh5_format/images/types.png -------------------------------------------------------------------------------- /docs/content/geoh5_format/index.rst: -------------------------------------------------------------------------------- 1 | GEOH5 Format 2 | ============ 3 | 4 | .. figure:: ./images/logo.png 5 | :align: left 6 | :width: 100% 7 | 8 | About 9 | ^^^^^ 10 | 11 | The GEOH5 format aims to provide a robust means of handling large quantities 12 | of diverse data required in geoscience. The file structure builds on the 13 | generic qualities of the `Geoscience ANALYST 14 | `_ 15 | data model, and attempts to maintain a certain level of simplicity and 16 | consistency throughout. It is based entirely on free and open `HDF5 technology 17 | `__. 18 | Given that this specification is public, the 19 | file format could, with further investment and involvement, become a useful 20 | exchange format for the broader geoscientific community. 21 | 22 | 23 | Why GEOH5? 24 | ---------- 25 | 26 | - Leverages properties of HDF5. 27 | Fast I/O, compression, cross-platform 28 | 29 | - Content readable and writeable by third party software. 30 | We recommend using `HDFView `__, along with Geoscience ANALYST, when 31 | learning the format. 32 | 33 | - Easily extensible to new data types. 34 | It is intended for Geoscience ANALYST to preserve data it does not 35 | understand (and generally be very tolerant with regards to missing 36 | information) when loading and saving geoh5 files. This will allow third 37 | parties to write to this format fairly easily, as well as include 38 | additional information not included in this spec for their own purposes. In the current implementation, 39 | Geoscience ANALYST automatically removes unnecessary information on save. 40 | 41 | 42 | Standards 43 | ^^^^^^^^^ 44 | 45 | General notes on formatting. 46 | 47 | - All text data and attributes are variable-length and use UTF-8 encoding 48 | - All numeric data uses INTEL PC native types 49 | - Boolean values are stored using char (0:false, 1:true) 50 | - Anything found in a geoh5 v1.0 file which is not mentioned in this document is optional information 51 | 52 | 53 | External Links 54 | ^^^^^^^^^^^^^^ 55 | 56 | - `HDFView `_. 57 | - `Precompiled binaries for multiple platforms `_ 58 | - Libraries for accessing HDF5 data 59 | - `C, C, .NET `_ 60 | - `Python `_ 61 | - `Matlab `_ 62 | -------------------------------------------------------------------------------- /docs/content/geoh5_format/integrator/groups.rst: -------------------------------------------------------------------------------- 1 | Groups 2 | ====== 3 | 4 | Geoscience INTEGRATOR 5 | ^^^^^^^^^^^^^^^^^^^^^ 6 | **UUID : {61449477-3833-11e4-a7fb-fcddabfddab1}** 7 | 8 | *Not yet geoh5py implemented* 9 | 10 | *To be documented* 11 | 12 | Project 13 | ^^^^^^^ 14 | **UUID : {56f6f03e-3833-11e4-a7fb-fcddabfddab1}** 15 | 16 | *Not yet geoh5py implemented* 17 | 18 | *To be documented* 19 | 20 | Query Group 21 | ^^^^^^^^^^^ 22 | **UUID : {85756113-592a-4088-b374-f32c8fac37a2}** 23 | 24 | *Not yet geoh5py implemented* 25 | 26 | *To be documented* 27 | 28 | Neighbourhoods 29 | ^^^^^^^^^^^^^^ 30 | **UUID : {2a5b7faa-41d1-4437-afac-934933eae6eb}** 31 | 32 | *Not yet geoh5py implemented* 33 | 34 | *To be documented* 35 | 36 | Map File Group 37 | ^^^^^^^^^^^^^^ 38 | **UUID : {1f684938-2baf-4a01-ac71-e50c30cc0685}** 39 | 40 | *Not yet geoh5py implemented* 41 | 42 | *To be documented* 43 | 44 | Maps Group 45 | ^^^^^^^^^^ 46 | **UUID : {4d65f8c3-a015-4c01-b411-412c0f4f0884}** 47 | 48 | *Not yet geoh5py implemented* 49 | 50 | *To be documented* 51 | 52 | Airborne 53 | ^^^^^^^^ 54 | **UUID : {812f3b2a-fdae-4752-8391-3b657953a983}** 55 | 56 | *Not yet geoh5py implemented* 57 | 58 | *To be documented* 59 | 60 | Ground 61 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 62 | **UUID : {a9d05630-7a80-4bda-89a2-feca0dc7a83e}** 63 | 64 | *Not yet geoh5py implemented* 65 | 66 | *To be documented* 67 | 68 | Borehole 69 | ^^^^^^^^ 70 | **UUID : {f6f011a9-2e52-4f99-b842-a524ad9fdf03}** 71 | 72 | *Not yet geoh5py implemented* 73 | 74 | *To be documented* 75 | -------------------------------------------------------------------------------- /docs/content/geoh5_format/integrator/index.rst: -------------------------------------------------------------------------------- 1 | INTEGRATOR 2 | ========== 3 | 4 | This chapter provides information on the INTEGRATOR entities. 5 | -------------------------------------------------------------------------------- /docs/content/geoh5_format/workspace.rst: -------------------------------------------------------------------------------- 1 | Workspace 2 | ========= 3 | 4 | The workspace is the top-level container for all data in the file. 5 | 6 | **Attributes** 7 | 8 | :Version: ``double`` 9 | Version of specification used by this file 10 | :Distance unit: ``str`` *feet* or (default) *metres* 11 | Distance unit of all data enclosed 12 | :Contributors: 1D array of ``str`` 13 | (Optional) List of users who contributed to this workspace 14 | 15 | 16 | The bulk of the data is accessible both directly by ``UUID`` through the 17 | ``flat`` HDF5 groups or through a **hierarchy of hard links** structured as follow: 18 | 19 | :Data: Flat container for all data entities 20 | :Groups: Flat container for all group entities 21 | :Objects: Flat container for all object entities 22 | :Root: Optional hard link to ``workspace`` group, top of group hierarchy. 23 | :Types: 24 | - :ref:`Data Types `: Flat container for all data types 25 | - :ref:`Group Types `: Flat container for all group types 26 | - :ref:`Object Types `: Flat container for all object types 27 | 28 | .. figure:: ./images/hierarchy.png 29 | :align: center 30 | :height: 200 31 | 32 | As seen in `HDFView `_ 33 | 34 | 35 | While all groups, objects and data entities are written into their respective base 36 | folder, they also hold links to their children entities to allow for 37 | traversals. There is no data duplication, merely multiple references (pointers) to 38 | the data storage on file. Types are shared (and thus generally written to file first). All 39 | groups, objects and data must include a hard link to their type. 40 | 41 | 42 | .. figure:: ./images/entity_links.png 43 | :align: center 44 | :height: 400 45 | -------------------------------------------------------------------------------- /docs/content/installation.rst: -------------------------------------------------------------------------------- 1 | Installation 2 | ============ 3 | 4 | **geoh5py** is currently written for Python 3.10 or higher, and depends on `NumPy `_ and 5 | `h5py `_. 6 | 7 | 8 | 9 | .. note:: Users will likely want to take advantage of other packages available in the Python ecosystem. We therefore recommend using `Miniforge `_ `(Windows x86_64) `_ to manage the installation. 10 | 11 | .. figure:: ../images/installation/MinicondaInstaller.png 12 | :align: center 13 | :width: 200 14 | 15 | 16 | Install **geoh5py** from PyPI:: 17 | 18 | $ pip install geoh5py 19 | 20 | To install the latest development version of **geoh5py**, you can use ``pip`` with the 21 | latest GitHub ``development`` branch:: 22 | 23 | $ pip install git+https://github.com/MiraGeoscience/geoh5py.git 24 | 25 | To work with **geoh5py** source code in development, install from GitHub:: 26 | 27 | $ git clone --recursive https://github.com/MiraGeoscience/geoh5py.git 28 | $ cd geoh5py 29 | $ python setup.py install 30 | -------------------------------------------------------------------------------- /docs/content/uijson_format/images/block_model_output.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiraGeoscience/geoh5py/585c89094e3eff35df10d3076964bf154b24d575/docs/content/uijson_format/images/block_model_output.png -------------------------------------------------------------------------------- /docs/content/uijson_format/images/block_model_uijson.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiraGeoscience/geoh5py/585c89094e3eff35df10d3076964bf154b24d575/docs/content/uijson_format/images/block_model_uijson.png -------------------------------------------------------------------------------- /docs/content/uijson_format/images/bool_param.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiraGeoscience/geoh5py/585c89094e3eff35df10d3076964bf154b24d575/docs/content/uijson_format/images/bool_param.png -------------------------------------------------------------------------------- /docs/content/uijson_format/images/choice_list_param.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiraGeoscience/geoh5py/585c89094e3eff35df10d3076964bf154b24d575/docs/content/uijson_format/images/choice_list_param.png -------------------------------------------------------------------------------- /docs/content/uijson_format/images/data_param.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiraGeoscience/geoh5py/585c89094e3eff35df10d3076964bf154b24d575/docs/content/uijson_format/images/data_param.png -------------------------------------------------------------------------------- /docs/content/uijson_format/images/data_value_param.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiraGeoscience/geoh5py/585c89094e3eff35df10d3076964bf154b24d575/docs/content/uijson_format/images/data_value_param.png -------------------------------------------------------------------------------- /docs/content/uijson_format/images/data_value_param2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiraGeoscience/geoh5py/585c89094e3eff35df10d3076964bf154b24d575/docs/content/uijson_format/images/data_value_param2.png -------------------------------------------------------------------------------- /docs/content/uijson_format/images/dependency_ex1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiraGeoscience/geoh5py/585c89094e3eff35df10d3076964bf154b24d575/docs/content/uijson_format/images/dependency_ex1.png -------------------------------------------------------------------------------- /docs/content/uijson_format/images/dependency_ex2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiraGeoscience/geoh5py/585c89094e3eff35df10d3076964bf154b24d575/docs/content/uijson_format/images/dependency_ex2.png -------------------------------------------------------------------------------- /docs/content/uijson_format/images/dependency_ex3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiraGeoscience/geoh5py/585c89094e3eff35df10d3076964bf154b24d575/docs/content/uijson_format/images/dependency_ex3.png -------------------------------------------------------------------------------- /docs/content/uijson_format/images/drag_drop.gif: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:f64e2c8038c5049d61bd90f5c945b4d8b24c4e5f067d8782f675aaa246fd1d7c 3 | size 1098446 4 | -------------------------------------------------------------------------------- /docs/content/uijson_format/images/drillhole_group_data_param.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiraGeoscience/geoh5py/585c89094e3eff35df10d3076964bf154b24d575/docs/content/uijson_format/images/drillhole_group_data_param.png -------------------------------------------------------------------------------- /docs/content/uijson_format/images/dropdown.gif: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:2293851d2665513e81541e449d37eb5ce3ef84ae408b9cd72a1454106adbd20a 3 | size 1368396 4 | -------------------------------------------------------------------------------- /docs/content/uijson_format/images/file_choice.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiraGeoscience/geoh5py/585c89094e3eff35df10d3076964bf154b24d575/docs/content/uijson_format/images/file_choice.png -------------------------------------------------------------------------------- /docs/content/uijson_format/images/file_param.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiraGeoscience/geoh5py/585c89094e3eff35df10d3076964bf154b24d575/docs/content/uijson_format/images/file_param.png -------------------------------------------------------------------------------- /docs/content/uijson_format/images/float_param.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiraGeoscience/geoh5py/585c89094e3eff35df10d3076964bf154b24d575/docs/content/uijson_format/images/float_param.png -------------------------------------------------------------------------------- /docs/content/uijson_format/images/group_param.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiraGeoscience/geoh5py/585c89094e3eff35df10d3076964bf154b24d575/docs/content/uijson_format/images/group_param.png -------------------------------------------------------------------------------- /docs/content/uijson_format/images/int_param.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiraGeoscience/geoh5py/585c89094e3eff35df10d3076964bf154b24d575/docs/content/uijson_format/images/int_param.png -------------------------------------------------------------------------------- /docs/content/uijson_format/images/object_param.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiraGeoscience/geoh5py/585c89094e3eff35df10d3076964bf154b24d575/docs/content/uijson_format/images/object_param.png -------------------------------------------------------------------------------- /docs/content/uijson_format/images/range_slider_param.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiraGeoscience/geoh5py/585c89094e3eff35df10d3076964bf154b24d575/docs/content/uijson_format/images/range_slider_param.png -------------------------------------------------------------------------------- /docs/content/uijson_format/images/range_slider_param_complement.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiraGeoscience/geoh5py/585c89094e3eff35df10d3076964bf154b24d575/docs/content/uijson_format/images/range_slider_param_complement.png -------------------------------------------------------------------------------- /docs/content/uijson_format/images/str_param.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiraGeoscience/geoh5py/585c89094e3eff35df10d3076964bf154b24d575/docs/content/uijson_format/images/str_param.png -------------------------------------------------------------------------------- /docs/content/uijson_format/index.rst: -------------------------------------------------------------------------------- 1 | UI.JSON Format 2 | ============== 3 | 4 | The **ui.json** format provides a schema to create a simple User Interface (UI) between geoh5py and `Geoscience ANALYST Pro 5 | `_. 6 | The format uses `JSON objects `_ to represent 7 | input parameters used in the UI, and pass those parameters to an accompanying python script. 8 | 9 | 10 | .. figure:: ./images/drag_drop.gif 11 | :align: center 12 | :width: 800 13 | 14 | 15 | External Links 16 | ^^^^^^^^^^^^^^ 17 | - `JSON Schema `_ 18 | - `Universally Unique IDentifier (UUID) `_ 19 | -------------------------------------------------------------------------------- /docs/content/user_guide/docs.txt: -------------------------------------------------------------------------------- 1 | Hello world 2 | -------------------------------------------------------------------------------- /docs/content/user_guide/groups.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": {}, 6 | "source": [ 7 | "# Groups\n", 8 | "\n", 9 | "`Groups` are effectively containers for other entities, such as ``Objects`` (Points, Curve, Surface, etc.) and other `Groups`. Groups are used to establish `parent-child` relationships and to store information about a collection of entities. \n", 10 | "\n", 11 | "## RootGroup\n", 12 | "By default, the parent of any new `Entity` is the workspace ``RootGroup``. It is the only entity in the ``Workspace`` without a parent. Users rarely have to interect with the ``Root`` group as it is mainly used to maintain the overall project hierarchy.\n", 13 | "\n", 14 | "![Root](./images/root.png)" 15 | ] 16 | }, 17 | { 18 | "cell_type": "markdown", 19 | "metadata": {}, 20 | "source": [ 21 | "## ContainerGroup\n", 22 | "\n", 23 | "\n", 24 | "A ``ContainerGroup`` can easily be added to the workspace and can be assigned a `name` and `description`." 25 | ] 26 | }, 27 | { 28 | "cell_type": "code", 29 | "execution_count": null, 30 | "metadata": {}, 31 | "outputs": [], 32 | "source": [ 33 | "from geoh5py import Workspace\n", 34 | "from geoh5py.groups import ContainerGroup\n", 35 | "\n", 36 | "\n", 37 | "# Create a blank project\n", 38 | "workspace = Workspace.create(\"my_project.geoh5\")\n", 39 | "\n", 40 | "# Add a group\n", 41 | "group = ContainerGroup.create(workspace, name=\"myGroup\")" 42 | ] 43 | }, 44 | { 45 | "cell_type": "markdown", 46 | "metadata": {}, 47 | "source": [ 48 | "At creation, `\"myGroup\"` is written to the project ``geoh5`` file and visible in the Analyst project tree.\n", 49 | "\n", 50 | "![Groups](./images/groups.png)\n", 51 | "\n", 52 | "Any entity can be accessed by its `name` or `uid` (unique identifier):" 53 | ] 54 | }, 55 | { 56 | "cell_type": "code", 57 | "execution_count": null, 58 | "metadata": {}, 59 | "outputs": [], 60 | "source": [ 61 | "print(group.uid)\n", 62 | "print(workspace.get_entity(\"myGroup\")[0] == workspace.get_entity(group.uid)[0])" 63 | ] 64 | } 65 | ], 66 | "metadata": { 67 | "kernelspec": { 68 | "display_name": "Python 3 (ipykernel)", 69 | "language": "python", 70 | "name": "python3" 71 | }, 72 | "language_info": { 73 | "codemirror_mode": { 74 | "name": "ipython", 75 | "version": 3 76 | }, 77 | "file_extension": ".py", 78 | "mimetype": "text/x-python", 79 | "name": "python", 80 | "nbconvert_exporter": "python", 81 | "pygments_lexer": "ipython3", 82 | "version": "3.10.16" 83 | } 84 | }, 85 | "nbformat": 4, 86 | "nbformat_minor": 4 87 | } 88 | -------------------------------------------------------------------------------- /docs/content/user_guide/images/DHinterval.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiraGeoscience/geoh5py/585c89094e3eff35df10d3076964bf154b24d575/docs/content/user_guide/images/DHinterval.png -------------------------------------------------------------------------------- /docs/content/user_guide/images/DHlog.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiraGeoscience/geoh5py/585c89094e3eff35df10d3076964bf154b24d575/docs/content/user_guide/images/DHlog.png -------------------------------------------------------------------------------- /docs/content/user_guide/images/ab_cell_id.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiraGeoscience/geoh5py/585c89094e3eff35df10d3076964bf154b24d575/docs/content/user_guide/images/ab_cell_id.png -------------------------------------------------------------------------------- /docs/content/user_guide/images/adddata.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiraGeoscience/geoh5py/585c89094e3eff35df10d3076964bf154b24d575/docs/content/user_guide/images/adddata.png -------------------------------------------------------------------------------- /docs/content/user_guide/images/atem_metadata_custom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiraGeoscience/geoh5py/585c89094e3eff35df10d3076964bf154b24d575/docs/content/user_guide/images/atem_metadata_custom.png -------------------------------------------------------------------------------- /docs/content/user_guide/images/atem_metadata_uid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiraGeoscience/geoh5py/585c89094e3eff35df10d3076964bf154b24d575/docs/content/user_guide/images/atem_metadata_uid.png -------------------------------------------------------------------------------- /docs/content/user_guide/images/atem_metadata_yaw_property.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiraGeoscience/geoh5py/585c89094e3eff35df10d3076964bf154b24d575/docs/content/user_guide/images/atem_metadata_yaw_property.png -------------------------------------------------------------------------------- /docs/content/user_guide/images/atem_metadata_yaw_value.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiraGeoscience/geoh5py/585c89094e3eff35df10d3076964bf154b24d575/docs/content/user_guide/images/atem_metadata_yaw_value.png -------------------------------------------------------------------------------- /docs/content/user_guide/images/atem_survey.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiraGeoscience/geoh5py/585c89094e3eff35df10d3076964bf154b24d575/docs/content/user_guide/images/atem_survey.png -------------------------------------------------------------------------------- /docs/content/user_guide/images/blankworkspace.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiraGeoscience/geoh5py/585c89094e3eff35df10d3076964bf154b24d575/docs/content/user_guide/images/blankworkspace.png -------------------------------------------------------------------------------- /docs/content/user_guide/images/blockmodel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiraGeoscience/geoh5py/585c89094e3eff35df10d3076964bf154b24d575/docs/content/user_guide/images/blockmodel.png -------------------------------------------------------------------------------- /docs/content/user_guide/images/current_electrodes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiraGeoscience/geoh5py/585c89094e3eff35df10d3076964bf154b24d575/docs/content/user_guide/images/current_electrodes.png -------------------------------------------------------------------------------- /docs/content/user_guide/images/custom_colormap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiraGeoscience/geoh5py/585c89094e3eff35df10d3076964bf154b24d575/docs/content/user_guide/images/custom_colormap.png -------------------------------------------------------------------------------- /docs/content/user_guide/images/data.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiraGeoscience/geoh5py/585c89094e3eff35df10d3076964bf154b24d575/docs/content/user_guide/images/data.png -------------------------------------------------------------------------------- /docs/content/user_guide/images/dcip_pseudo_section.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiraGeoscience/geoh5py/585c89094e3eff35df10d3076964bf154b24d575/docs/content/user_guide/images/dcip_pseudo_section.png -------------------------------------------------------------------------------- /docs/content/user_guide/images/dcip_survey.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiraGeoscience/geoh5py/585c89094e3eff35df10d3076964bf154b24d575/docs/content/user_guide/images/dcip_survey.png -------------------------------------------------------------------------------- /docs/content/user_guide/images/default_colormap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiraGeoscience/geoh5py/585c89094e3eff35df10d3076964bf154b24d575/docs/content/user_guide/images/default_colormap.png -------------------------------------------------------------------------------- /docs/content/user_guide/images/drapemodel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiraGeoscience/geoh5py/585c89094e3eff35df10d3076964bf154b24d575/docs/content/user_guide/images/drapemodel.png -------------------------------------------------------------------------------- /docs/content/user_guide/images/drillhole.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiraGeoscience/geoh5py/585c89094e3eff35df10d3076964bf154b24d575/docs/content/user_guide/images/drillhole.png -------------------------------------------------------------------------------- /docs/content/user_guide/images/entities.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiraGeoscience/geoh5py/585c89094e3eff35df10d3076964bf154b24d575/docs/content/user_guide/images/entities.png -------------------------------------------------------------------------------- /docs/content/user_guide/images/filename_data.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiraGeoscience/geoh5py/585c89094e3eff35df10d3076964bf154b24d575/docs/content/user_guide/images/filename_data.png -------------------------------------------------------------------------------- /docs/content/user_guide/images/flin_flin_geology.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiraGeoscience/geoh5py/585c89094e3eff35df10d3076964bf154b24d575/docs/content/user_guide/images/flin_flin_geology.jpg -------------------------------------------------------------------------------- /docs/content/user_guide/images/grid2d.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiraGeoscience/geoh5py/585c89094e3eff35df10d3076964bf154b24d575/docs/content/user_guide/images/grid2d.png -------------------------------------------------------------------------------- /docs/content/user_guide/images/groups.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiraGeoscience/geoh5py/585c89094e3eff35df10d3076964bf154b24d575/docs/content/user_guide/images/groups.png -------------------------------------------------------------------------------- /docs/content/user_guide/images/line.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiraGeoscience/geoh5py/585c89094e3eff35df10d3076964bf154b24d575/docs/content/user_guide/images/line.png -------------------------------------------------------------------------------- /docs/content/user_guide/images/mt_survey.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiraGeoscience/geoh5py/585c89094e3eff35df10d3076964bf154b24d575/docs/content/user_guide/images/mt_survey.png -------------------------------------------------------------------------------- /docs/content/user_guide/images/objects.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiraGeoscience/geoh5py/585c89094e3eff35df10d3076964bf154b24d575/docs/content/user_guide/images/objects.png -------------------------------------------------------------------------------- /docs/content/user_guide/images/octree.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiraGeoscience/geoh5py/585c89094e3eff35df10d3076964bf154b24d575/docs/content/user_guide/images/octree.png -------------------------------------------------------------------------------- /docs/content/user_guide/images/points.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiraGeoscience/geoh5py/585c89094e3eff35df10d3076964bf154b24d575/docs/content/user_guide/images/points.png -------------------------------------------------------------------------------- /docs/content/user_guide/images/potential_electrodes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiraGeoscience/geoh5py/585c89094e3eff35df10d3076964bf154b24d575/docs/content/user_guide/images/potential_electrodes.png -------------------------------------------------------------------------------- /docs/content/user_guide/images/propgroups.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiraGeoscience/geoh5py/585c89094e3eff35df10d3076964bf154b24d575/docs/content/user_guide/images/propgroups.png -------------------------------------------------------------------------------- /docs/content/user_guide/images/root.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiraGeoscience/geoh5py/585c89094e3eff35df10d3076964bf154b24d575/docs/content/user_guide/images/root.png -------------------------------------------------------------------------------- /docs/content/user_guide/images/surface.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiraGeoscience/geoh5py/585c89094e3eff35df10d3076964bf154b24d575/docs/content/user_guide/images/surface.png -------------------------------------------------------------------------------- /docs/content/user_guide/images/tipper_survey.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiraGeoscience/geoh5py/585c89094e3eff35df10d3076964bf154b24d575/docs/content/user_guide/images/tipper_survey.png -------------------------------------------------------------------------------- /docs/content/user_guide/images/workspace.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiraGeoscience/geoh5py/585c89094e3eff35df10d3076964bf154b24d575/docs/content/user_guide/images/workspace.png -------------------------------------------------------------------------------- /docs/content/user_guide/images/workspace_tree.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiraGeoscience/geoh5py/585c89094e3eff35df10d3076964bf154b24d575/docs/content/user_guide/images/workspace_tree.png -------------------------------------------------------------------------------- /docs/content/user_guide/index.rst: -------------------------------------------------------------------------------- 1 | User Guide 2 | ========== 3 | 4 | This section provides information on how to use the **geoh5py** package, from 5 | the creation of a Workspace_ to the creation and manipulation of objects and data. 6 | 7 | .. figure:: ./images/entities.png 8 | :align: center 9 | :width: 600 10 | 11 | .. toctree:: 12 | :maxdepth: 1 13 | 14 | workspace 15 | groups 16 | objects 17 | surveys 18 | data 19 | 20 | .. _Workspace: workspace.ipynb 21 | -------------------------------------------------------------------------------- /docs/content/user_guide/surveys.rst: -------------------------------------------------------------------------------- 1 | Surveys 2 | ======= 3 | 4 | This section provides information on how to create geophysical surveys programmatically. 5 | 6 | .. figure:: ./images/dcip_pseudo_section.png 7 | :align: center 8 | :width: 600 9 | 10 | 11 | .. toctree:: 12 | :maxdepth: 2 13 | 14 | airborne_tem 15 | direct_current 16 | magnetotelluric 17 | tipper 18 | -------------------------------------------------------------------------------- /docs/environment.yml: -------------------------------------------------------------------------------- 1 | name: geoh5py_docs 2 | 3 | channels: 4 | - conda-forge 5 | - defaults 6 | dependencies: 7 | - python=3.10 8 | - pydantic 9 | - matplotlib 10 | - scipy 11 | - numpy 12 | - h5py 13 | - pip 14 | - jupyter-book 15 | - jupytext 16 | - notebook 17 | - pip: 18 | - sphinx 19 | - sphinx_issues 20 | - sphinx_rtd_theme 21 | - sphinxcontrib-bibtex 22 | - sphinxcontrib-googleanalytics 23 | - nbsphinx 24 | - nbstripout 25 | - numpydoc 26 | - jupyter_client 27 | -------------------------------------------------------------------------------- /docs/images/GA_demo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiraGeoscience/geoh5py/585c89094e3eff35df10d3076964bf154b24d575/docs/images/GA_demo.png -------------------------------------------------------------------------------- /docs/images/geoh5py_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiraGeoscience/geoh5py/585c89094e3eff35df10d3076964bf154b24d575/docs/images/geoh5py_logo.png -------------------------------------------------------------------------------- /docs/images/gh5py.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiraGeoscience/geoh5py/585c89094e3eff35df10d3076964bf154b24d575/docs/images/gh5py.png -------------------------------------------------------------------------------- /docs/images/installation/MinicondaInstaller.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiraGeoscience/geoh5py/585c89094e3eff35df10d3076964bf154b24d575/docs/images/installation/MinicondaInstaller.png -------------------------------------------------------------------------------- /docs/images/readme/pycharm-add_Python_interpreter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiraGeoscience/geoh5py/585c89094e3eff35df10d3076964bf154b24d575/docs/images/readme/pycharm-add_Python_interpreter.png -------------------------------------------------------------------------------- /docs/images/readme/pycharm-dialog_edit_test_run_config.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiraGeoscience/geoh5py/585c89094e3eff35df10d3076964bf154b24d575/docs/images/readme/pycharm-dialog_edit_test_run_config.png -------------------------------------------------------------------------------- /docs/images/readme/pycharm-list_all_conda_packages.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiraGeoscience/geoh5py/585c89094e3eff35df10d3076964bf154b24d575/docs/images/readme/pycharm-list_all_conda_packages.png -------------------------------------------------------------------------------- /docs/images/readme/pycharm-mark_directory_as_tests.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiraGeoscience/geoh5py/585c89094e3eff35df10d3076964bf154b24d575/docs/images/readme/pycharm-mark_directory_as_tests.png -------------------------------------------------------------------------------- /docs/images/readme/pycharm-menu_modify_test_run_config.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiraGeoscience/geoh5py/585c89094e3eff35df10d3076964bf154b24d575/docs/images/readme/pycharm-menu_modify_test_run_config.png -------------------------------------------------------------------------------- /docs/images/readme/pycharm-set_Poetry_Python_as_interpreter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiraGeoscience/geoh5py/585c89094e3eff35df10d3076964bf154b24d575/docs/images/readme/pycharm-set_Poetry_Python_as_interpreter.png -------------------------------------------------------------------------------- /docs/images/readme/pycharm-set_conda_env_as_interpreter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiraGeoscience/geoh5py/585c89094e3eff35df10d3076964bf154b24d575/docs/images/readme/pycharm-set_conda_env_as_interpreter.png -------------------------------------------------------------------------------- /docs/images/readme/pycharm-test_results.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiraGeoscience/geoh5py/585c89094e3eff35df10d3076964bf154b24d575/docs/images/readme/pycharm-test_results.png -------------------------------------------------------------------------------- /docs/index.rst: -------------------------------------------------------------------------------- 1 | About 2 | ===== 3 | 4 | 5 | Welcome to the documentation page for **geoh5py**. 6 | 7 | This library has been created for the manipulation and storage of a wide range of 8 | geoscientific data (points, curve, surface, 2D and 3D grids) in 9 | `geoh5 file format `_. 10 | Users are able to directly leverage the powerful visualization 11 | capabilities of `Geoscience ANALYST `_ along with open-source code from the Python ecosystem. 12 | 13 | .. figure:: ./images/GA_demo.png 14 | :align: center 15 | :width: 600 16 | 17 | 18 | License 19 | ^^^^^^^ 20 | geoh5py is free software: you can redistribute it and/or modify 21 | it under the terms of the GNU Lesser General Public License as published by 22 | the Free Software Foundation, either version 3 of the License, or 23 | (at your option) any later version. 24 | 25 | geoh5py is distributed in the hope that it will be useful, 26 | but WITHOUT ANY WARRANTY; without even the implied warranty of 27 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 28 | GNU Lesser General Public License for more details. 29 | 30 | You should have received a copy of the GNU Lesser General Public License 31 | along with geoh5py. If not, see . 32 | 33 | 34 | Third Party Software 35 | ^^^^^^^^^^^^^^^^^^^^ 36 | The geoh5 Software may provide links to third party libraries or code (collectively "Third Party Software") 37 | to implement various functions. Third Party Software does not comprise part of the Software. 38 | The use of Third Party Software is governed by the terms of such software license(s). 39 | Third Party Software notices and/or additional terms and conditions are located in the 40 | `THIRD_PARTY_SOFTWARE.rst`_ file. 41 | 42 | .. _THIRD_PARTY_SOFTWARE.rst: THIRD_PARTY_SOFTWARE.rst 43 | 44 | Citing 45 | ^^^^^^ 46 | 47 | If you use **geoh5py** in your research, please cite it as follows: 48 | 49 | .. image:: https://zenodo.org/badge/207860560.svg 50 | :target: https://zenodo.org/badge/latestdoi/207860560 51 | 52 | 53 | Feedback 54 | ^^^^^^^^ 55 | 56 | Have comments or suggestions? Submit feedback. 57 | All the content can be found on our github_ repository. 58 | 59 | .. _github: https://github.com/MiraGeoscience/geoh5py 60 | -------------------------------------------------------------------------------- /docs/templates/module.rst_t: -------------------------------------------------------------------------------- 1 | {%- if show_headings %} 2 | {{- basename | e | heading }} 3 | 4 | {% endif -%} 5 | .. automodule:: {{ qualname }} 6 | {%- for option in automodule_options %} 7 | :{{ option }}: 8 | {%- endfor %} 9 | -------------------------------------------------------------------------------- /docs/templates/package.rst_t: -------------------------------------------------------------------------------- 1 | {%- macro automodule(modname, options) -%} 2 | .. automodule:: {{ modname }} 3 | {%- for option in options %} 4 | :{{ option }}: 5 | {%- endfor %} 6 | {%- endmacro %} 7 | 8 | {%- macro toctree(docnames) -%} 9 | .. toctree:: 10 | :maxdepth: {{ maxdepth }} 11 | {% for docname in docnames %} 12 | {{ docname }} 13 | {%- endfor %} 14 | {%- endmacro %} 15 | 16 | {%- if is_namespace %} 17 | {{- [pkgname, "namespace"] | join(" ") | e | heading }} 18 | {% else %} 19 | {{- pkgname | e | heading }} 20 | {% endif %} 21 | 22 | {%- if is_namespace %} 23 | .. py:module:: {{ pkgname }} 24 | {% endif %} 25 | 26 | {%- if modulefirst and not is_namespace %} 27 | {{ automodule(pkgname, automodule_options) }} 28 | {% endif %} 29 | 30 | {%- if subpackages %} 31 | {{ toctree(subpackages) }} 32 | {% endif %} 33 | 34 | {%- if submodules %} 35 | {% if separatemodules %} 36 | {{ toctree(submodules) }} 37 | {% else %} 38 | {%- for submodule in submodules %} 39 | {% if show_headings %} 40 | {{- submodule | e | heading(2) }} 41 | {% endif %} 42 | {{ automodule(submodule, automodule_options) }} 43 | {% endfor %} 44 | {%- endif %} 45 | {%- endif %} 46 | 47 | {%- if not modulefirst and not is_namespace %} 48 | 49 | {{ automodule(pkgname, automodule_options) }} 50 | {% endif %} 51 | -------------------------------------------------------------------------------- /docs/templates/toc.rst_t: -------------------------------------------------------------------------------- 1 | {{ header | heading }} 2 | 3 | .. toctree:: 4 | :maxdepth: {{ maxdepth }} 5 | 6 | {% for docname in docnames %} 7 | {{ docname }} 8 | {%- endfor %} 9 | -------------------------------------------------------------------------------- /geoh5py/__init__.py: -------------------------------------------------------------------------------- 1 | # '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 2 | # Copyright (c) 2025 Mira Geoscience Ltd. ' 3 | # ' 4 | # This file is part of geoh5py. ' 5 | # ' 6 | # geoh5py is free software: you can redistribute it and/or modify ' 7 | # it under the terms of the GNU Lesser General Public License as published by ' 8 | # the Free Software Foundation, either version 3 of the License, or ' 9 | # (at your option) any later version. ' 10 | # ' 11 | # geoh5py is distributed in the hope that it will be useful, ' 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of ' 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ' 14 | # GNU Lesser General Public License for more details. ' 15 | # ' 16 | # You should have received a copy of the GNU Lesser General Public License ' 17 | # along with geoh5py. If not, see . ' 18 | # '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 19 | 20 | 21 | # flake8: noqa 22 | 23 | __version__ = "0.12.0a1" 24 | 25 | import inspect 26 | 27 | from geoh5py.workspace import Workspace 28 | 29 | from . import groups, objects 30 | from .groups import CustomGroup 31 | 32 | 33 | def get_type_uid_classes(): 34 | members = [] 35 | for _, member in inspect.getmembers(groups) + inspect.getmembers(objects): 36 | if inspect.isclass(member) and hasattr(member, "default_type_uid"): 37 | members.append(member) 38 | 39 | return members 40 | 41 | 42 | TYPE_UID_TO_CLASS = {k.default_type_uid(): k for k in get_type_uid_classes()} 43 | -------------------------------------------------------------------------------- /geoh5py/data/__init__.py: -------------------------------------------------------------------------------- 1 | # '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 2 | # Copyright (c) 2025 Mira Geoscience Ltd. ' 3 | # ' 4 | # This file is part of geoh5py. ' 5 | # ' 6 | # geoh5py is free software: you can redistribute it and/or modify ' 7 | # it under the terms of the GNU Lesser General Public License as published by ' 8 | # the Free Software Foundation, either version 3 of the License, or ' 9 | # (at your option) any later version. ' 10 | # ' 11 | # geoh5py is distributed in the hope that it will be useful, ' 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of ' 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ' 14 | # GNU Lesser General Public License for more details. ' 15 | # ' 16 | # You should have received a copy of the GNU Lesser General Public License ' 17 | # along with geoh5py. If not, see . ' 18 | # '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 19 | 20 | 21 | # pylint: disable=unused-import 22 | # flake8: noqa 23 | 24 | from .blob_data import BlobData 25 | from .boolean_data import BooleanData 26 | from .data import Data 27 | from .data_association_enum import DataAssociationEnum 28 | from .data_type import ( 29 | DataType, 30 | GeometricDataValueMapType, 31 | GeometricDynamicDataType, 32 | ReferenceDataType, 33 | ) 34 | from .colour import Colour 35 | from .data_unit import DataUnit 36 | from .datetime_data import DatetimeData 37 | from .filename_data import FilenameData 38 | from .float_data import FloatData 39 | from .geometric_data import GeometricDataConstants 40 | from .integer_data import IntegerData 41 | from .numeric_data import NumericData 42 | from .primitive_type_enum import PrimitiveTypeEnum 43 | from .reference_value_map import ReferenceValueMap 44 | from .referenced_data import ReferencedData 45 | from .text_data import CommentsData, MultiTextData, TextData 46 | from .unknown_data import UnknownData 47 | from .visual_parameters import VisualParameters 48 | -------------------------------------------------------------------------------- /geoh5py/data/blob_data.py: -------------------------------------------------------------------------------- 1 | # '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 2 | # Copyright (c) 2025 Mira Geoscience Ltd. ' 3 | # ' 4 | # This file is part of geoh5py. ' 5 | # ' 6 | # geoh5py is free software: you can redistribute it and/or modify ' 7 | # it under the terms of the GNU Lesser General Public License as published by ' 8 | # the Free Software Foundation, either version 3 of the License, or ' 9 | # (at your option) any later version. ' 10 | # ' 11 | # geoh5py is distributed in the hope that it will be useful, ' 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of ' 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ' 14 | # GNU Lesser General Public License for more details. ' 15 | # ' 16 | # You should have received a copy of the GNU Lesser General Public License ' 17 | # along with geoh5py. If not, see . ' 18 | # '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 19 | 20 | 21 | from __future__ import annotations 22 | 23 | from typing import Any 24 | 25 | from .data import Data, PrimitiveTypeEnum 26 | 27 | 28 | class BlobData(Data): 29 | @classmethod 30 | def primitive_type(cls) -> PrimitiveTypeEnum: 31 | return PrimitiveTypeEnum.BLOB 32 | 33 | def validate_values(self, values: Any | None) -> Any: 34 | """ 35 | Validate values for BlobData. 36 | """ 37 | if values is not None: 38 | if not isinstance(values, bytes): 39 | raise TypeError(f"Values must be of type bytes. Got {type(values)}") 40 | return values 41 | 42 | # TODO: implement specialization to access values. 43 | # Stored as a 1D array of 8-bit char type (native) (value '0' or '1'). 44 | # For each index set to 1, an opaque data set named after the index (e.g. "1", "2", etc) 45 | # must be added under the Data instance, containing the binary data tied to that index. 46 | # No data value : 0 47 | -------------------------------------------------------------------------------- /geoh5py/data/data_association_enum.py: -------------------------------------------------------------------------------- 1 | # '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 2 | # Copyright (c) 2025 Mira Geoscience Ltd. ' 3 | # ' 4 | # This file is part of geoh5py. ' 5 | # ' 6 | # geoh5py is free software: you can redistribute it and/or modify ' 7 | # it under the terms of the GNU Lesser General Public License as published by ' 8 | # the Free Software Foundation, either version 3 of the License, or ' 9 | # (at your option) any later version. ' 10 | # ' 11 | # geoh5py is distributed in the hope that it will be useful, ' 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of ' 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ' 14 | # GNU Lesser General Public License for more details. ' 15 | # ' 16 | # You should have received a copy of the GNU Lesser General Public License ' 17 | # along with geoh5py. If not, see . ' 18 | # '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 19 | 20 | 21 | from __future__ import annotations 22 | 23 | from enum import Enum 24 | 25 | 26 | class DataAssociationEnum(Enum): 27 | """ 28 | Known data association between :obj:`~geoh5py.data.data.Data.values` and 29 | the :obj:`~geoh5py.shared.entity.Entity.parent` object. 30 | Available options: 31 | """ 32 | 33 | UNKNOWN = 0 34 | OBJECT = 1 35 | CELL = 2 36 | VERTEX = 3 37 | FACE = 4 38 | GROUP = 5 39 | DEPTH = 6 40 | -------------------------------------------------------------------------------- /geoh5py/data/data_unit.py: -------------------------------------------------------------------------------- 1 | # '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 2 | # Copyright (c) 2025 Mira Geoscience Ltd. ' 3 | # ' 4 | # This file is part of geoh5py. ' 5 | # ' 6 | # geoh5py is free software: you can redistribute it and/or modify ' 7 | # it under the terms of the GNU Lesser General Public License as published by ' 8 | # the Free Software Foundation, either version 3 of the License, or ' 9 | # (at your option) any later version. ' 10 | # ' 11 | # geoh5py is distributed in the hope that it will be useful, ' 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of ' 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ' 14 | # GNU Lesser General Public License for more details. ' 15 | # ' 16 | # You should have received a copy of the GNU Lesser General Public License ' 17 | # along with geoh5py. If not, see . ' 18 | # '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 19 | 20 | 21 | from __future__ import annotations 22 | 23 | 24 | class DataUnit: 25 | """ 26 | Data unit 27 | """ 28 | 29 | # TODO Use for data_type 30 | # Currently replaced by a string value 31 | 32 | def __init__(self, unit_name: str | None = None): 33 | self._rep = unit_name 34 | 35 | @property 36 | def name(self) -> str | None: 37 | return self._rep 38 | 39 | def __str__(self): 40 | return str(self._rep) 41 | -------------------------------------------------------------------------------- /geoh5py/data/datetime_data.py: -------------------------------------------------------------------------------- 1 | # '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 2 | # Copyright (c) 2025 Mira Geoscience Ltd. ' 3 | # ' 4 | # This file is part of geoh5py. ' 5 | # ' 6 | # geoh5py is free software: you can redistribute it and/or modify ' 7 | # it under the terms of the GNU Lesser General Public License as published by ' 8 | # the Free Software Foundation, either version 3 of the License, or ' 9 | # (at your option) any later version. ' 10 | # ' 11 | # geoh5py is distributed in the hope that it will be useful, ' 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of ' 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ' 14 | # GNU Lesser General Public License for more details. ' 15 | # ' 16 | # You should have received a copy of the GNU Lesser General Public License ' 17 | # along with geoh5py. If not, see . ' 18 | # '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 19 | 20 | 21 | from __future__ import annotations 22 | 23 | from .data import PrimitiveTypeEnum 24 | from .text_data import TextData 25 | 26 | 27 | class DatetimeData(TextData): 28 | @classmethod 29 | def primitive_type(cls) -> PrimitiveTypeEnum: 30 | return PrimitiveTypeEnum.DATETIME 31 | 32 | # TODO: implement specialization to access values. 33 | # Stored as a 1D array of variable-length strings formatted according to the ISO 8601 34 | # extended specification for representations of UTC dates and times (Qt implementation), 35 | # taking the form YYYY-MM-DDTHH:mm:ss[Z|[+|-]HH:mm] 36 | # No data value : empty string 37 | -------------------------------------------------------------------------------- /geoh5py/data/float_data.py: -------------------------------------------------------------------------------- 1 | # '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 2 | # Copyright (c) 2025 Mira Geoscience Ltd. ' 3 | # ' 4 | # This file is part of geoh5py. ' 5 | # ' 6 | # geoh5py is free software: you can redistribute it and/or modify ' 7 | # it under the terms of the GNU Lesser General Public License as published by ' 8 | # the Free Software Foundation, either version 3 of the License, or ' 9 | # (at your option) any later version. ' 10 | # ' 11 | # geoh5py is distributed in the hope that it will be useful, ' 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of ' 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ' 14 | # GNU Lesser General Public License for more details. ' 15 | # ' 16 | # You should have received a copy of the GNU Lesser General Public License ' 17 | # along with geoh5py. If not, see . ' 18 | # '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 19 | 20 | 21 | from __future__ import annotations 22 | 23 | import numpy as np 24 | 25 | from ..shared import FLOAT_NDV 26 | from .data import PrimitiveTypeEnum 27 | from .numeric_data import NumericData 28 | 29 | 30 | class FloatData(NumericData): 31 | """ 32 | Data container for floats values 33 | """ 34 | 35 | def format_type(self, values: np.ndarray) -> np.ndarray: 36 | """ 37 | Check if the type of values is valid and coerce to type float64. 38 | :param values: numpy array to modify. 39 | :return: the formatted values. 40 | """ 41 | if not np.issubdtype(values.dtype, np.number): 42 | raise TypeError("Values must be a numpy array of numeric values.") 43 | 44 | return values 45 | 46 | @property 47 | def formatted_values(self): 48 | values = self.ndv_values 49 | if values is None: 50 | return values 51 | 52 | return values 53 | 54 | @classmethod 55 | def primitive_type(cls) -> PrimitiveTypeEnum: 56 | return PrimitiveTypeEnum.FLOAT 57 | 58 | @property 59 | def nan_value(self): 60 | """ 61 | Nan-Data-Value 62 | """ 63 | return np.nan 64 | 65 | @property 66 | def ndv(self) -> float: 67 | """ 68 | No-Data-Value 69 | """ 70 | return FLOAT_NDV 71 | -------------------------------------------------------------------------------- /geoh5py/data/geometric_data.py: -------------------------------------------------------------------------------- 1 | # '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 2 | # Copyright (c) 2025 Mira Geoscience Ltd. ' 3 | # ' 4 | # This file is part of geoh5py. ' 5 | # ' 6 | # geoh5py is free software: you can redistribute it and/or modify ' 7 | # it under the terms of the GNU Lesser General Public License as published by ' 8 | # the Free Software Foundation, either version 3 of the License, or ' 9 | # (at your option) any later version. ' 10 | # ' 11 | # geoh5py is distributed in the hope that it will be useful, ' 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of ' 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ' 14 | # GNU Lesser General Public License for more details. ' 15 | # ' 16 | # You should have received a copy of the GNU Lesser General Public License ' 17 | # along with geoh5py. If not, see . ' 18 | # '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 19 | 20 | 21 | from __future__ import annotations 22 | 23 | from uuid import UUID 24 | 25 | from .data import Data 26 | from .primitive_type_enum import PrimitiveTypeEnum 27 | 28 | 29 | class GeometricDataConstants(Data): 30 | """ 31 | Base class for geometric data constants. 32 | 33 | :param allow_move: Defaults coordinate to remain on object. 34 | :param visible: Defaults to not visible. 35 | """ 36 | 37 | _TYPE_UID: UUID 38 | 39 | def __init__( 40 | self, 41 | allow_move=False, 42 | visible=False, 43 | allow_delete=False, 44 | allow_rename=False, 45 | **kwargs, 46 | ): 47 | super().__init__( 48 | allow_move=allow_move, 49 | allow_delete=allow_delete, 50 | allow_rename=allow_rename, 51 | visible=visible, 52 | **kwargs, 53 | ) 54 | 55 | @classmethod 56 | def primitive_type(cls) -> PrimitiveTypeEnum: 57 | return PrimitiveTypeEnum.GEOMETRIC 58 | 59 | def validate_values(self, values: None) -> None: 60 | """ 61 | Validate values for GeometricDataConstants. 62 | """ 63 | if values is not None: 64 | raise TypeError( 65 | f"GeometricDataConstants does not accept values. Got {values}." 66 | ) 67 | 68 | return values 69 | -------------------------------------------------------------------------------- /geoh5py/data/integer_data.py: -------------------------------------------------------------------------------- 1 | # '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 2 | # Copyright (c) 2025 Mira Geoscience Ltd. ' 3 | # ' 4 | # This file is part of geoh5py. ' 5 | # ' 6 | # geoh5py is free software: you can redistribute it and/or modify ' 7 | # it under the terms of the GNU Lesser General Public License as published by ' 8 | # the Free Software Foundation, either version 3 of the License, or ' 9 | # (at your option) any later version. ' 10 | # ' 11 | # geoh5py is distributed in the hope that it will be useful, ' 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of ' 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ' 14 | # GNU Lesser General Public License for more details. ' 15 | # ' 16 | # You should have received a copy of the GNU Lesser General Public License ' 17 | # along with geoh5py. If not, see . ' 18 | # '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 19 | 20 | 21 | from __future__ import annotations 22 | 23 | import numpy as np 24 | 25 | from ..shared import INTEGER_NDV 26 | from .data import PrimitiveTypeEnum 27 | from .numeric_data import NumericData 28 | 29 | 30 | class IntegerData(NumericData): 31 | def format_type(self, values: np.ndarray) -> np.ndarray: 32 | """ 33 | Check if the type of values is valid and coerce to type int32. 34 | :param values: numpy array to modify. 35 | :return: the formatted values. 36 | """ 37 | if np.any(np.modf(values)[0] != 0): 38 | raise TypeError("Values cannot have decimal points.") 39 | 40 | return values.astype(np.int32) 41 | 42 | @property 43 | def formatted_values(self): 44 | values = self.ndv_values 45 | if values is None: 46 | return values 47 | 48 | return np.round(values).astype(np.int32) 49 | 50 | @classmethod 51 | def primitive_type(cls) -> PrimitiveTypeEnum: 52 | return PrimitiveTypeEnum.INTEGER 53 | 54 | @property 55 | def nan_value(self): 56 | """ 57 | Nan-Data-Value 58 | """ 59 | return self.ndv 60 | 61 | @property 62 | def ndv(self) -> int: 63 | """ 64 | No-Data-Value 65 | """ 66 | return INTEGER_NDV 67 | -------------------------------------------------------------------------------- /geoh5py/data/primitive_type_enum.py: -------------------------------------------------------------------------------- 1 | # '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 2 | # Copyright (c) 2025 Mira Geoscience Ltd. ' 3 | # ' 4 | # This file is part of geoh5py. ' 5 | # ' 6 | # geoh5py is free software: you can redistribute it and/or modify ' 7 | # it under the terms of the GNU Lesser General Public License as published by ' 8 | # the Free Software Foundation, either version 3 of the License, or ' 9 | # (at your option) any later version. ' 10 | # ' 11 | # geoh5py is distributed in the hope that it will be useful, ' 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of ' 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ' 14 | # GNU Lesser General Public License for more details. ' 15 | # ' 16 | # You should have received a copy of the GNU Lesser General Public License ' 17 | # along with geoh5py. If not, see . ' 18 | # '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 19 | 20 | 21 | from __future__ import annotations 22 | 23 | from enum import Enum 24 | from pathlib import Path 25 | 26 | import numpy as np 27 | 28 | 29 | class PrimitiveTypeEnum(Enum): 30 | """ 31 | Known data type. 32 | 33 | Available options: 34 | """ 35 | 36 | INVALID = 0 37 | INTEGER = 1 38 | FLOAT = 2 39 | TEXT = 3 40 | REFERENCED = 4 41 | FILENAME = 5 42 | BLOB = 6 43 | VECTOR = 7 44 | DATETIME = 8 45 | GEOMETRIC = 9 46 | MULTI_TEXT = 10 47 | BOOLEAN = 11 48 | COLOUR = 12 49 | 50 | 51 | class DataTypeEnum(Enum): 52 | INVALID = type(None) 53 | INTEGER = np.int32 54 | FLOAT = np.float32 55 | TEXT = str 56 | REFERENCED = np.uint32 # Could represent a reference type 57 | FILENAME = Path 58 | BLOB = bytes 59 | VECTOR = type(None) # Assuming a vector is a list 60 | DATETIME = str # Could use datetime 61 | GEOMETRIC = type(None) # For custom geometric type 62 | MULTI_TEXT = str 63 | BOOLEAN = bool 64 | 65 | @classmethod 66 | def from_primitive_type(cls, primitive_type: PrimitiveTypeEnum) -> type: 67 | """ 68 | Get the data type from the primitive type. 69 | 70 | :param primitive_type: The primitive type. 71 | :return: The data type. 72 | """ 73 | return DataTypeEnum[primitive_type.name].value 74 | -------------------------------------------------------------------------------- /geoh5py/data/unknown_data.py: -------------------------------------------------------------------------------- 1 | # '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 2 | # Copyright (c) 2025 Mira Geoscience Ltd. ' 3 | # ' 4 | # This file is part of geoh5py. ' 5 | # ' 6 | # geoh5py is free software: you can redistribute it and/or modify ' 7 | # it under the terms of the GNU Lesser General Public License as published by ' 8 | # the Free Software Foundation, either version 3 of the License, or ' 9 | # (at your option) any later version. ' 10 | # ' 11 | # geoh5py is distributed in the hope that it will be useful, ' 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of ' 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ' 14 | # GNU Lesser General Public License for more details. ' 15 | # ' 16 | # You should have received a copy of the GNU Lesser General Public License ' 17 | # along with geoh5py. If not, see . ' 18 | # '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 19 | 20 | 21 | from __future__ import annotations 22 | 23 | from typing import Any 24 | 25 | from .data import Data 26 | from .primitive_type_enum import PrimitiveTypeEnum 27 | 28 | 29 | class UnknownData(Data): 30 | @classmethod 31 | def primitive_type(cls) -> PrimitiveTypeEnum: 32 | return PrimitiveTypeEnum.INVALID 33 | 34 | def validate_values(self, values: Any | None) -> Any: 35 | """ 36 | Validate values for UnknownData. 37 | """ 38 | return values 39 | -------------------------------------------------------------------------------- /geoh5py/groups/__init__.py: -------------------------------------------------------------------------------- 1 | # '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 2 | # Copyright (c) 2025 Mira Geoscience Ltd. ' 3 | # ' 4 | # This file is part of geoh5py. ' 5 | # ' 6 | # geoh5py is free software: you can redistribute it and/or modify ' 7 | # it under the terms of the GNU Lesser General Public License as published by ' 8 | # the Free Software Foundation, either version 3 of the License, or ' 9 | # (at your option) any later version. ' 10 | # ' 11 | # geoh5py is distributed in the hope that it will be useful, ' 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of ' 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ' 14 | # GNU Lesser General Public License for more details. ' 15 | # ' 16 | # You should have received a copy of the GNU Lesser General Public License ' 17 | # along with geoh5py. If not, see . ' 18 | # '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 19 | 20 | 21 | # pylint: disable=unused-import 22 | # flake8: noqa 23 | 24 | from .base import Group 25 | from .container import ContainerGroup 26 | from .custom import CustomGroup 27 | from .drillhole import DrillholeGroup, IntegratorDrillholeGroup 28 | from .giftools import GiftoolsGroup 29 | from .group_type import GroupType 30 | from .integrator import ( 31 | AirborneTheme, 32 | BlastingDataSet, 33 | BlastingTheme, 34 | EarthModelsTheme, 35 | GeochemistryMineralogyDataSet, 36 | GeochemistryMineralogyTheme, 37 | GeophysicsTheme, 38 | GroundTheme, 39 | IncidentDataSet, 40 | IncidentsTheme, 41 | IntegratorGroup, 42 | IntegratorNeighbourhoods, 43 | IntegratorMaps, 44 | IntegratorMapFile, 45 | IntegratorProject, 46 | MineProductionTheme, 47 | ObservationPointsTheme, 48 | QueryGroup, 49 | RockPropertiesTheme, 50 | SamplesTheme, 51 | ) 52 | from .interpretation_section import InterpretationSection 53 | from .notype import NoTypeGroup 54 | from .property_group import PropertyGroup 55 | from .root import RootGroup 56 | from .simpeg import SimPEGGroup 57 | from .survey import AirborneGeophysics 58 | from .uijson import UIJsonGroup 59 | -------------------------------------------------------------------------------- /geoh5py/groups/container.py: -------------------------------------------------------------------------------- 1 | # '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 2 | # Copyright (c) 2025 Mira Geoscience Ltd. ' 3 | # ' 4 | # This file is part of geoh5py. ' 5 | # ' 6 | # geoh5py is free software: you can redistribute it and/or modify ' 7 | # it under the terms of the GNU Lesser General Public License as published by ' 8 | # the Free Software Foundation, either version 3 of the License, or ' 9 | # (at your option) any later version. ' 10 | # ' 11 | # geoh5py is distributed in the hope that it will be useful, ' 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of ' 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ' 14 | # GNU Lesser General Public License for more details. ' 15 | # ' 16 | # You should have received a copy of the GNU Lesser General Public License ' 17 | # along with geoh5py. If not, see . ' 18 | # '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 19 | 20 | 21 | from __future__ import annotations 22 | 23 | import uuid 24 | 25 | from .base import Group 26 | 27 | 28 | class ContainerGroup(Group): 29 | """The type for the basic Container group.""" 30 | 31 | _TYPE_UID = uuid.UUID( 32 | fields=(0x61FBB4E8, 0xA480, 0x11E3, 0x8D, 0x5A, 0x2776BDF4F982) 33 | ) 34 | _default_name = "Container Group" 35 | -------------------------------------------------------------------------------- /geoh5py/groups/custom.py: -------------------------------------------------------------------------------- 1 | # '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 2 | # Copyright (c) 2025 Mira Geoscience Ltd. ' 3 | # ' 4 | # This file is part of geoh5py. ' 5 | # ' 6 | # geoh5py is free software: you can redistribute it and/or modify ' 7 | # it under the terms of the GNU Lesser General Public License as published by ' 8 | # the Free Software Foundation, either version 3 of the License, or ' 9 | # (at your option) any later version. ' 10 | # ' 11 | # geoh5py is distributed in the hope that it will be useful, ' 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of ' 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ' 14 | # GNU Lesser General Public License for more details. ' 15 | # ' 16 | # You should have received a copy of the GNU Lesser General Public License ' 17 | # along with geoh5py. If not, see . ' 18 | # '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 19 | 20 | 21 | from __future__ import annotations 22 | 23 | import uuid 24 | 25 | from .base import Group 26 | 27 | 28 | class CustomGroup(Group): 29 | """A custom group, for an unlisted Group type.""" 30 | 31 | _default_name = "Custom Group" 32 | 33 | @classmethod 34 | def default_type_uid(cls) -> uuid.UUID | None: 35 | """ 36 | Mock the default type uid for the custom group. 37 | It returns a new UUID every time this class is called. 38 | """ 39 | return uuid.uuid4() 40 | -------------------------------------------------------------------------------- /geoh5py/groups/drillhole.py: -------------------------------------------------------------------------------- 1 | # '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 2 | # Copyright (c) 2025 Mira Geoscience Ltd. ' 3 | # ' 4 | # This file is part of geoh5py. ' 5 | # ' 6 | # geoh5py is free software: you can redistribute it and/or modify ' 7 | # it under the terms of the GNU Lesser General Public License as published by ' 8 | # the Free Software Foundation, either version 3 of the License, or ' 9 | # (at your option) any later version. ' 10 | # ' 11 | # geoh5py is distributed in the hope that it will be useful, ' 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of ' 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ' 14 | # GNU Lesser General Public License for more details. ' 15 | # ' 16 | # You should have received a copy of the GNU Lesser General Public License ' 17 | # along with geoh5py. If not, see . ' 18 | # '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 19 | 20 | 21 | from __future__ import annotations 22 | 23 | import uuid 24 | 25 | from .base import Group 26 | 27 | 28 | class DrillholeGroup(Group): 29 | """The type for the group containing drillholes.""" 30 | 31 | _TYPE_UID = uuid.UUID( 32 | fields=(0x825424FB, 0xC2C6, 0x4FEA, 0x9F, 0x2B, 0x6CD00023D393) 33 | ) 34 | _default_name = "Drillhole Group" 35 | 36 | 37 | class IntegratorDrillholeGroup(DrillholeGroup): 38 | """The type for the group containing drillholes.""" 39 | 40 | _TYPE_UID = uuid.UUID("{952829b6-76a2-4d0b-b908-7f8d2482dc0d}") 41 | _default_name = "Integrator Drillhole Group" 42 | -------------------------------------------------------------------------------- /geoh5py/groups/giftools.py: -------------------------------------------------------------------------------- 1 | # '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 2 | # Copyright (c) 2025 Mira Geoscience Ltd. ' 3 | # ' 4 | # This file is part of geoh5py. ' 5 | # ' 6 | # geoh5py is free software: you can redistribute it and/or modify ' 7 | # it under the terms of the GNU Lesser General Public License as published by ' 8 | # the Free Software Foundation, either version 3 of the License, or ' 9 | # (at your option) any later version. ' 10 | # ' 11 | # geoh5py is distributed in the hope that it will be useful, ' 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of ' 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ' 14 | # GNU Lesser General Public License for more details. ' 15 | # ' 16 | # You should have received a copy of the GNU Lesser General Public License ' 17 | # along with geoh5py. If not, see . ' 18 | # '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 19 | 20 | 21 | from __future__ import annotations 22 | 23 | import uuid 24 | 25 | from .base import Group 26 | 27 | 28 | class GiftoolsGroup(Group): 29 | """The type for a GIFtools group.""" 30 | 31 | _TYPE_UID = uuid.UUID( 32 | fields=(0x585B3218, 0xC24B, 0x41FE, 0xAD, 0x1F, 0x24D5E6E8348A) 33 | ) 34 | _default_name = "GIFtools Project" 35 | -------------------------------------------------------------------------------- /geoh5py/groups/maps.py: -------------------------------------------------------------------------------- 1 | # '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 2 | # Copyright (c) 2025 Mira Geoscience Ltd. ' 3 | # ' 4 | # This file is part of geoh5py. ' 5 | # ' 6 | # geoh5py is free software: you can redistribute it and/or modify ' 7 | # it under the terms of the GNU Lesser General Public License as published by ' 8 | # the Free Software Foundation, either version 3 of the License, or ' 9 | # (at your option) any later version. ' 10 | # ' 11 | # geoh5py is distributed in the hope that it will be useful, ' 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of ' 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ' 14 | # GNU Lesser General Public License for more details. ' 15 | # ' 16 | # You should have received a copy of the GNU Lesser General Public License ' 17 | # along with geoh5py. If not, see . ' 18 | # '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 19 | 20 | 21 | from __future__ import annotations 22 | 23 | import uuid 24 | 25 | from .base import Group 26 | 27 | 28 | class MapsGroup(Group): 29 | """The type for the basic Container group.""" 30 | 31 | _TYPE_UID = uuid.UUID("{4d65f8c3-a015-4c01-b411-412c0f4f0884}") 32 | _default_name = "Maps Group" 33 | -------------------------------------------------------------------------------- /geoh5py/groups/notype.py: -------------------------------------------------------------------------------- 1 | # '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 2 | # Copyright (c) 2025 Mira Geoscience Ltd. ' 3 | # ' 4 | # This file is part of geoh5py. ' 5 | # ' 6 | # geoh5py is free software: you can redistribute it and/or modify ' 7 | # it under the terms of the GNU Lesser General Public License as published by ' 8 | # the Free Software Foundation, either version 3 of the License, or ' 9 | # (at your option) any later version. ' 10 | # ' 11 | # geoh5py is distributed in the hope that it will be useful, ' 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of ' 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ' 14 | # GNU Lesser General Public License for more details. ' 15 | # ' 16 | # You should have received a copy of the GNU Lesser General Public License ' 17 | # along with geoh5py. If not, see . ' 18 | # '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 19 | 20 | 21 | from __future__ import annotations 22 | 23 | import uuid 24 | 25 | from .base import Group 26 | 27 | 28 | class NoTypeGroup(Group): 29 | """A group with no type.""" 30 | 31 | _TYPE_UID = uuid.UUID( 32 | fields=(0xDD99B610, 0xBE92, 0x48C0, 0x87, 0x3C, 0x5B5946EA2840) 33 | ) 34 | _default_name = "NoType" 35 | -------------------------------------------------------------------------------- /geoh5py/groups/root.py: -------------------------------------------------------------------------------- 1 | # '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 2 | # Copyright (c) 2025 Mira Geoscience Ltd. ' 3 | # ' 4 | # This file is part of geoh5py. ' 5 | # ' 6 | # geoh5py is free software: you can redistribute it and/or modify ' 7 | # it under the terms of the GNU Lesser General Public License as published by ' 8 | # the Free Software Foundation, either version 3 of the License, or ' 9 | # (at your option) any later version. ' 10 | # ' 11 | # geoh5py is distributed in the hope that it will be useful, ' 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of ' 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ' 14 | # GNU Lesser General Public License for more details. ' 15 | # ' 16 | # You should have received a copy of the GNU Lesser General Public License ' 17 | # along with geoh5py. If not, see . ' 18 | # '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 19 | 20 | 21 | from __future__ import annotations 22 | 23 | from .notype import NoTypeGroup 24 | 25 | 26 | class RootGroup(NoTypeGroup): 27 | """The Root group of a workspace.""" 28 | 29 | _default_name = "Workspace" 30 | 31 | def __init__( 32 | self, 33 | allow_move=False, 34 | allow_delete=False, 35 | allow_rename=False, 36 | **kwargs, 37 | ): 38 | super().__init__( 39 | allow_move=allow_move, 40 | allow_delete=allow_delete, 41 | allow_rename=allow_rename, 42 | parent=self, 43 | **kwargs, 44 | ) 45 | 46 | @property 47 | def parent(self): 48 | """ 49 | Parental entity of root is always None 50 | """ 51 | return None 52 | 53 | @parent.setter 54 | def parent(self, _): 55 | pass 56 | -------------------------------------------------------------------------------- /geoh5py/groups/simpeg.py: -------------------------------------------------------------------------------- 1 | # '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 2 | # Copyright (c) 2025 Mira Geoscience Ltd. ' 3 | # ' 4 | # This file is part of geoh5py. ' 5 | # ' 6 | # geoh5py is free software: you can redistribute it and/or modify ' 7 | # it under the terms of the GNU Lesser General Public License as published by ' 8 | # the Free Software Foundation, either version 3 of the License, or ' 9 | # (at your option) any later version. ' 10 | # ' 11 | # geoh5py is distributed in the hope that it will be useful, ' 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of ' 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ' 14 | # GNU Lesser General Public License for more details. ' 15 | # ' 16 | # You should have received a copy of the GNU Lesser General Public License ' 17 | # along with geoh5py. If not, see . ' 18 | # '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 19 | 20 | from __future__ import annotations 21 | 22 | import uuid 23 | 24 | from .uijson import UIJsonGroup 25 | 26 | 27 | class SimPEGGroup(UIJsonGroup): 28 | """Group for SimPEG inversions.""" 29 | 30 | _TYPE_UID = uuid.UUID("{55ed3daf-c192-4d4b-a439-60fa987fe2b8}") 31 | _default_name = "SimPEG" 32 | -------------------------------------------------------------------------------- /geoh5py/groups/survey.py: -------------------------------------------------------------------------------- 1 | # '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 2 | # Copyright (c) 2025 Mira Geoscience Ltd. ' 3 | # ' 4 | # This file is part of geoh5py. ' 5 | # ' 6 | # geoh5py is free software: you can redistribute it and/or modify ' 7 | # it under the terms of the GNU Lesser General Public License as published by ' 8 | # the Free Software Foundation, either version 3 of the License, or ' 9 | # (at your option) any later version. ' 10 | # ' 11 | # geoh5py is distributed in the hope that it will be useful, ' 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of ' 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ' 14 | # GNU Lesser General Public License for more details. ' 15 | # ' 16 | # You should have received a copy of the GNU Lesser General Public License ' 17 | # along with geoh5py. If not, see . ' 18 | # '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 19 | 20 | 21 | from __future__ import annotations 22 | 23 | import uuid 24 | 25 | from .base import Group 26 | 27 | 28 | class AirborneGeophysics(Group): 29 | """The type for the basic Container group.""" 30 | 31 | _TYPE_UID = uuid.UUID("{812f3b2a-fdae-4752-8391-3b657953a983}") 32 | _default_name = "Airborne Geophysics" 33 | -------------------------------------------------------------------------------- /geoh5py/handlers/__init__.py: -------------------------------------------------------------------------------- 1 | # '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 2 | # Copyright (c) 2025 Mira Geoscience Ltd. ' 3 | # ' 4 | # This file is part of geoh5py. ' 5 | # ' 6 | # geoh5py is free software: you can redistribute it and/or modify ' 7 | # it under the terms of the GNU Lesser General Public License as published by ' 8 | # the Free Software Foundation, either version 3 of the License, or ' 9 | # (at your option) any later version. ' 10 | # ' 11 | # geoh5py is distributed in the hope that it will be useful, ' 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of ' 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ' 14 | # GNU Lesser General Public License for more details. ' 15 | # ' 16 | # You should have received a copy of the GNU Lesser General Public License ' 17 | # along with geoh5py. If not, see . ' 18 | # '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 19 | 20 | 21 | # pylint: disable=unused-import 22 | # flake8: noqa 23 | 24 | from .data_handler import DataHandler 25 | from .groups_handler import GroupsHandler 26 | from .objects_handler import ObjectsHandler 27 | from .workspace_handler import WorkspaceHandler 28 | -------------------------------------------------------------------------------- /geoh5py/interfaces/__init__.py: -------------------------------------------------------------------------------- 1 | # '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 2 | # Copyright (c) 2025 Mira Geoscience Ltd. ' 3 | # ' 4 | # This file is part of geoh5py. ' 5 | # ' 6 | # geoh5py is free software: you can redistribute it and/or modify ' 7 | # it under the terms of the GNU Lesser General Public License as published by ' 8 | # the Free Software Foundation, either version 3 of the License, or ' 9 | # (at your option) any later version. ' 10 | # ' 11 | # geoh5py is distributed in the hope that it will be useful, ' 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of ' 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ' 14 | # GNU Lesser General Public License for more details. ' 15 | # ' 16 | # You should have received a copy of the GNU Lesser General Public License ' 17 | # along with geoh5py. If not, see . ' 18 | # '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 19 | 20 | 21 | from __future__ import annotations 22 | 23 | 24 | try: 25 | import thriftpy2 26 | except (ModuleNotFoundError, ImportError): 27 | pass 28 | else: 29 | from pathlib import Path 30 | from types import ModuleType 31 | 32 | _INTERFACES_PATH = Path("interfaces") 33 | _INTERFACES: dict[str, ModuleType] = {} 34 | 35 | def __getattr__(name): 36 | try: 37 | return _INTERFACES[name] 38 | except KeyError: 39 | interface = thriftpy2.load(str(_INTERFACES_PATH.joinpath(f"{name}.thrift"))) 40 | _INTERFACES[name] = interface 41 | return interface 42 | -------------------------------------------------------------------------------- /geoh5py/interfaces/__init__.pyi: -------------------------------------------------------------------------------- 1 | # '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 2 | # Copyright (c) 2025 Mira Geoscience Ltd. ' 3 | # ' 4 | # This file is part of geoh5py. ' 5 | # ' 6 | # geoh5py is free software: you can redistribute it and/or modify ' 7 | # it under the terms of the GNU Lesser General Public License as published by ' 8 | # the Free Software Foundation, either version 3 of the License, or ' 9 | # (at your option) any later version. ' 10 | # ' 11 | # geoh5py is distributed in the hope that it will be useful, ' 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of ' 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ' 14 | # GNU Lesser General Public License for more details. ' 15 | # ' 16 | # You should have received a copy of the GNU Lesser General Public License ' 17 | # along with geoh5py. If not, see . ' 18 | # '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 19 | 20 | # pylint: skip-file 21 | # flake8: noqa 22 | 23 | from . import api, data, groups, objects, shared, workspace 24 | -------------------------------------------------------------------------------- /geoh5py/interfaces/api.pyi: -------------------------------------------------------------------------------- 1 | # '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 2 | # Copyright (c) 2025 Mira Geoscience Ltd. ' 3 | # ' 4 | # This file is part of geoh5py. ' 5 | # ' 6 | # geoh5py is free software: you can redistribute it and/or modify ' 7 | # it under the terms of the GNU Lesser General Public License as published by ' 8 | # the Free Software Foundation, either version 3 of the License, or ' 9 | # (at your option) any later version. ' 10 | # ' 11 | # geoh5py is distributed in the hope that it will be useful, ' 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of ' 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ' 14 | # GNU Lesser General Public License for more details. ' 15 | # ' 16 | # You should have received a copy of the GNU Lesser General Public License ' 17 | # along with geoh5py. If not, see . ' 18 | # '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 19 | 20 | # pylint: skip-file 21 | # pylint: disable=unused-import,no-name-in-module 22 | # flake8: noqa 23 | 24 | from . import data, groups, objects, shared, workspace 25 | -------------------------------------------------------------------------------- /geoh5py/interfaces/workspace.pyi: -------------------------------------------------------------------------------- 1 | # '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 2 | # Copyright (c) 2025 Mira Geoscience Ltd. ' 3 | # ' 4 | # This file is part of geoh5py. ' 5 | # ' 6 | # geoh5py is free software: you can redistribute it and/or modify ' 7 | # it under the terms of the GNU Lesser General Public License as published by ' 8 | # the Free Software Foundation, either version 3 of the License, or ' 9 | # (at your option) any later version. ' 10 | # ' 11 | # geoh5py is distributed in the hope that it will be useful, ' 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of ' 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ' 14 | # GNU Lesser General Public License for more details. ' 15 | # ' 16 | # You should have received a copy of the GNU Lesser General Public License ' 17 | # along with geoh5py. If not, see . ' 18 | # '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 19 | 20 | # pylint: skip-file 21 | # pylint: disable=unused-argument,no-self-use,no-name-in-module 22 | # flake8: noqa 23 | 24 | from __future__ import annotations 25 | 26 | from dataclasses import dataclass 27 | 28 | from . import shared 29 | 30 | class FileIOException(Exception): 31 | message: str | None = "" 32 | 33 | class FileFormatException(Exception): 34 | message: str | None = "" 35 | 36 | @dataclass 37 | class Workspace: 38 | file_path: str | None = "" 39 | version: shared.VersionNumber | None = None 40 | distance_unit: shared.DistanceUnit | None = None 41 | date_created: shared.DateTime | None = None 42 | date_modified: shared.DateTime | None = None 43 | 44 | class WorkspaceService: 45 | def get_api_version( 46 | self, 47 | ) -> shared.VersionString: ... 48 | def create_geoh5( 49 | self, 50 | file_path: str, 51 | ) -> Workspace: ... 52 | def open_geoh5( 53 | self, 54 | file_path: str, 55 | ) -> Workspace: ... 56 | def save( 57 | self, 58 | file_path: str, 59 | overwrite_file: bool, 60 | ) -> Workspace: ... 61 | def export_objects( 62 | self, 63 | objects_or_groups: list[shared.Uuid], 64 | file_path: str, 65 | overwrite_file: bool, 66 | ) -> Workspace: ... 67 | def export_all( 68 | self, 69 | file_path: str, 70 | overwrite_file: bool, 71 | ) -> Workspace: ... 72 | def close( 73 | self, 74 | ) -> None: ... 75 | def get_contributors( 76 | self, 77 | ) -> list[str]: ... 78 | -------------------------------------------------------------------------------- /geoh5py/io/__init__.py: -------------------------------------------------------------------------------- 1 | # '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 2 | # Copyright (c) 2025 Mira Geoscience Ltd. ' 3 | # ' 4 | # This file is part of geoh5py. ' 5 | # ' 6 | # geoh5py is free software: you can redistribute it and/or modify ' 7 | # it under the terms of the GNU Lesser General Public License as published by ' 8 | # the Free Software Foundation, either version 3 of the License, or ' 9 | # (at your option) any later version. ' 10 | # ' 11 | # geoh5py is distributed in the hope that it will be useful, ' 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of ' 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ' 14 | # GNU Lesser General Public License for more details. ' 15 | # ' 16 | # You should have received a copy of the GNU Lesser General Public License ' 17 | # along with geoh5py. If not, see . ' 18 | # '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 19 | 20 | 21 | # pylint: disable=unused-import 22 | # flake8: noqa 23 | 24 | from .h5_reader import H5Reader 25 | from .h5_writer import H5Writer 26 | -------------------------------------------------------------------------------- /geoh5py/objects/integrator.py: -------------------------------------------------------------------------------- 1 | # '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 2 | # Copyright (c) 2025 Mira Geoscience Ltd. ' 3 | # ' 4 | # This file is part of geoh5py. ' 5 | # ' 6 | # geoh5py is free software: you can redistribute it and/or modify ' 7 | # it under the terms of the GNU Lesser General Public License as published by ' 8 | # the Free Software Foundation, either version 3 of the License, or ' 9 | # (at your option) any later version. ' 10 | # ' 11 | # geoh5py is distributed in the hope that it will be useful, ' 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of ' 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ' 14 | # GNU Lesser General Public License for more details. ' 15 | # ' 16 | # You should have received a copy of the GNU Lesser General Public License ' 17 | # along with geoh5py. If not, see . ' 18 | # '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 19 | 20 | 21 | from __future__ import annotations 22 | 23 | import uuid 24 | 25 | from .points import Points 26 | from .surface import Surface 27 | 28 | 29 | class IntegratorPoints(Points): 30 | """ 31 | INTEGRATOR Points object. 32 | Sub-class of :obj:`geoh5py.objects.points.Points`. 33 | """ 34 | 35 | _TYPE_UID = uuid.UUID("{6832ACF3-78AA-44D3-8506-9574A3510C44}") 36 | _default_name = "Geoscience INTEGRATOR Points" 37 | 38 | 39 | class NeighbourhoodSurface(Surface): 40 | """ 41 | Points object made up of vertices. 42 | """ 43 | 44 | _TYPE_UID = uuid.UUID("{88087FB8-76AE-445B-9CDF-68DBCE530404}") 45 | _default_name = "Neighbourhood Surface" 46 | -------------------------------------------------------------------------------- /geoh5py/objects/label.py: -------------------------------------------------------------------------------- 1 | # '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 2 | # Copyright (c) 2025 Mira Geoscience Ltd. ' 3 | # ' 4 | # This file is part of geoh5py. ' 5 | # ' 6 | # geoh5py is free software: you can redistribute it and/or modify ' 7 | # it under the terms of the GNU Lesser General Public License as published by ' 8 | # the Free Software Foundation, either version 3 of the License, or ' 9 | # (at your option) any later version. ' 10 | # ' 11 | # geoh5py is distributed in the hope that it will be useful, ' 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of ' 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ' 14 | # GNU Lesser General Public License for more details. ' 15 | # ' 16 | # You should have received a copy of the GNU Lesser General Public License ' 17 | # along with geoh5py. If not, see . ' 18 | # '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 19 | 20 | 21 | from __future__ import annotations 22 | 23 | import uuid 24 | from typing import TYPE_CHECKING 25 | 26 | from .object_base import ObjectBase 27 | 28 | 29 | if TYPE_CHECKING: 30 | from numpy import ndarray 31 | 32 | 33 | class Label(ObjectBase): 34 | """ 35 | Label object for annotation in viewport. 36 | 37 | .. warning:: Not yet implemented. 38 | 39 | """ 40 | 41 | _TYPE_UID = uuid.UUID( 42 | fields=(0xE79F449D, 0x74E3, 0x4598, 0x9C, 0x9C, 0x351A28B8B69E) 43 | ) 44 | 45 | def __init__(self, **kwargs): 46 | # TODO 47 | self.target_position = None 48 | self.label_position = None 49 | 50 | super().__init__(**kwargs) 51 | 52 | @property 53 | def extent(self): 54 | """ 55 | Geography bounding box of the object. 56 | """ 57 | return None 58 | 59 | def mask_by_extent(self, extent: ndarray, inverse: bool = False) -> None: 60 | """ 61 | Sub-class extension of :func:`~geoh5py.shared.entity.Entity.mask_by_extent`. 62 | """ 63 | return None 64 | -------------------------------------------------------------------------------- /geoh5py/objects/notype_object.py: -------------------------------------------------------------------------------- 1 | # '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 2 | # Copyright (c) 2025 Mira Geoscience Ltd. ' 3 | # ' 4 | # This file is part of geoh5py. ' 5 | # ' 6 | # geoh5py is free software: you can redistribute it and/or modify ' 7 | # it under the terms of the GNU Lesser General Public License as published by ' 8 | # the Free Software Foundation, either version 3 of the License, or ' 9 | # (at your option) any later version. ' 10 | # ' 11 | # geoh5py is distributed in the hope that it will be useful, ' 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of ' 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ' 14 | # GNU Lesser General Public License for more details. ' 15 | # ' 16 | # You should have received a copy of the GNU Lesser General Public License ' 17 | # along with geoh5py. If not, see . ' 18 | # '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 19 | 20 | 21 | from __future__ import annotations 22 | 23 | import uuid 24 | from typing import TYPE_CHECKING 25 | 26 | from .object_base import ObjectBase 27 | 28 | 29 | if TYPE_CHECKING: 30 | from numpy import ndarray 31 | 32 | 33 | class NoTypeObject(ObjectBase): 34 | """ 35 | Generic Data object without a registered type 36 | """ 37 | 38 | _TYPE_UID = uuid.UUID( 39 | fields=(0x849D2F3E, 0xA46E, 0x11E3, 0xB4, 0x01, 0x2776BDF4F982) 40 | ) 41 | -------------------------------------------------------------------------------- /geoh5py/objects/object_type.py: -------------------------------------------------------------------------------- 1 | # '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 2 | # Copyright (c) 2025 Mira Geoscience Ltd. ' 3 | # ' 4 | # This file is part of geoh5py. ' 5 | # ' 6 | # geoh5py is free software: you can redistribute it and/or modify ' 7 | # it under the terms of the GNU Lesser General Public License as published by ' 8 | # the Free Software Foundation, either version 3 of the License, or ' 9 | # (at your option) any later version. ' 10 | # ' 11 | # geoh5py is distributed in the hope that it will be useful, ' 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of ' 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ' 14 | # GNU Lesser General Public License for more details. ' 15 | # ' 16 | # You should have received a copy of the GNU Lesser General Public License ' 17 | # along with geoh5py. If not, see . ' 18 | # '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 19 | 20 | 21 | from __future__ import annotations 22 | 23 | from typing import TYPE_CHECKING 24 | 25 | from ..shared import EntityType 26 | 27 | 28 | if TYPE_CHECKING: 29 | from ..workspace import Workspace 30 | 31 | 32 | class ObjectType(EntityType): 33 | """ 34 | Object type class 35 | """ 36 | 37 | def __init__(self, workspace: Workspace, **kwargs): 38 | super().__init__(workspace, **kwargs) 39 | -------------------------------------------------------------------------------- /geoh5py/objects/slicer.py: -------------------------------------------------------------------------------- 1 | # '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 2 | # Copyright (c) 2025 Mira Geoscience Ltd. ' 3 | # ' 4 | # This file is part of geoh5py. ' 5 | # ' 6 | # geoh5py is free software: you can redistribute it and/or modify ' 7 | # it under the terms of the GNU Lesser General Public License as published by ' 8 | # the Free Software Foundation, either version 3 of the License, or ' 9 | # (at your option) any later version. ' 10 | # ' 11 | # geoh5py is distributed in the hope that it will be useful, ' 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of ' 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ' 14 | # GNU Lesser General Public License for more details. ' 15 | # ' 16 | # You should have received a copy of the GNU Lesser General Public License ' 17 | # along with geoh5py. If not, see . ' 18 | # '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 19 | 20 | 21 | from __future__ import annotations 22 | 23 | import uuid 24 | 25 | from .object_base import ObjectBase 26 | 27 | 28 | class Slicer(ObjectBase): 29 | """ 30 | Slicer object. 31 | 32 | It's an empty object used by 33 | :class:`geoh5py.groups.interpretation_section.InterpretationSection` 34 | to store the slicing VisualParameter information. 35 | """ 36 | 37 | _attribute_map: dict = ObjectBase._attribute_map.copy() 38 | _attribute_map.pop("Clipping IDs") 39 | _attribute_map.pop("PropertyGroups") 40 | _default_name = "Slicer" 41 | _TYPE_UID = uuid.UUID("{238F961D-AE63-43DE-AB64-E1A079271CF5}") 42 | -------------------------------------------------------------------------------- /geoh5py/objects/surveys/__init__.py: -------------------------------------------------------------------------------- 1 | # '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 2 | # Copyright (c) 2025 Mira Geoscience Ltd. ' 3 | # ' 4 | # This file is part of geoh5py. ' 5 | # ' 6 | # geoh5py is free software: you can redistribute it and/or modify ' 7 | # it under the terms of the GNU Lesser General Public License as published by ' 8 | # the Free Software Foundation, either version 3 of the License, or ' 9 | # (at your option) any later version. ' 10 | # ' 11 | # geoh5py is distributed in the hope that it will be useful, ' 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of ' 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ' 14 | # GNU Lesser General Public License for more details. ' 15 | # ' 16 | # You should have received a copy of the GNU Lesser General Public License ' 17 | # along with geoh5py. If not, see . ' 18 | # '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 19 | -------------------------------------------------------------------------------- /geoh5py/objects/surveys/electromagnetics/__init__.py: -------------------------------------------------------------------------------- 1 | # '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 2 | # Copyright (c) 2025 Mira Geoscience Ltd. ' 3 | # ' 4 | # This file is part of geoh5py. ' 5 | # ' 6 | # geoh5py is free software: you can redistribute it and/or modify ' 7 | # it under the terms of the GNU Lesser General Public License as published by ' 8 | # the Free Software Foundation, either version 3 of the License, or ' 9 | # (at your option) any later version. ' 10 | # ' 11 | # geoh5py is distributed in the hope that it will be useful, ' 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of ' 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ' 14 | # GNU Lesser General Public License for more details. ' 15 | # ' 16 | # You should have received a copy of the GNU Lesser General Public License ' 17 | # along with geoh5py. If not, see . ' 18 | # '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 19 | -------------------------------------------------------------------------------- /geoh5py/objects/surveys/magnetics.py: -------------------------------------------------------------------------------- 1 | # '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 2 | # Copyright (c) 2025 Mira Geoscience Ltd. ' 3 | # ' 4 | # This file is part of geoh5py. ' 5 | # ' 6 | # geoh5py is free software: you can redistribute it and/or modify ' 7 | # it under the terms of the GNU Lesser General Public License as published by ' 8 | # the Free Software Foundation, either version 3 of the License, or ' 9 | # (at your option) any later version. ' 10 | # ' 11 | # geoh5py is distributed in the hope that it will be useful, ' 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of ' 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ' 14 | # GNU Lesser General Public License for more details. ' 15 | # ' 16 | # You should have received a copy of the GNU Lesser General Public License ' 17 | # along with geoh5py. If not, see . ' 18 | # '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 19 | 20 | 21 | from __future__ import annotations 22 | 23 | import uuid 24 | 25 | from ..curve import Curve 26 | 27 | 28 | class AirborneMagnetics(Curve): 29 | """ 30 | An airborne magnetic survey object. 31 | 32 | .. warning:: Partially implemented. 33 | 34 | """ 35 | 36 | _TYPE_UID = uuid.UUID( 37 | fields=(0x4B99204C, 0xD133, 0x4579, 0xA9, 0x16, 0xA9C8B98CFCCB) 38 | ) 39 | -------------------------------------------------------------------------------- /geoh5py/py.typed: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MiraGeoscience/geoh5py/585c89094e3eff35df10d3076964bf154b24d575/geoh5py/py.typed -------------------------------------------------------------------------------- /geoh5py/shared/__init__.py: -------------------------------------------------------------------------------- 1 | # '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 2 | # Copyright (c) 2025 Mira Geoscience Ltd. ' 3 | # ' 4 | # This file is part of geoh5py. ' 5 | # ' 6 | # geoh5py is free software: you can redistribute it and/or modify ' 7 | # it under the terms of the GNU Lesser General Public License as published by ' 8 | # the Free Software Foundation, either version 3 of the License, or ' 9 | # (at your option) any later version. ' 10 | # ' 11 | # geoh5py is distributed in the hope that it will be useful, ' 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of ' 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ' 14 | # GNU Lesser General Public License for more details. ' 15 | # ' 16 | # You should have received a copy of the GNU Lesser General Public License ' 17 | # along with geoh5py. If not, see . ' 18 | # '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 19 | 20 | 21 | # pylint: disable=unused-import 22 | # flake8: noqa 23 | from . import weakref_utils 24 | from .entity import Entity 25 | from .entity_type import EntityType 26 | from .utils import fetch_h5_handle, match_values, merge_arrays 27 | 28 | INTEGER_NDV = -2147483648 29 | FLOAT_NDV = 1.17549435e-38 30 | -------------------------------------------------------------------------------- /geoh5py/shared/concatenation/__init__.py: -------------------------------------------------------------------------------- 1 | # '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 2 | # Copyright (c) 2025 Mira Geoscience Ltd. ' 3 | # ' 4 | # This file is part of geoh5py. ' 5 | # ' 6 | # geoh5py is free software: you can redistribute it and/or modify ' 7 | # it under the terms of the GNU Lesser General Public License as published by ' 8 | # the Free Software Foundation, either version 3 of the License, or ' 9 | # (at your option) any later version. ' 10 | # ' 11 | # geoh5py is distributed in the hope that it will be useful, ' 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of ' 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ' 14 | # GNU Lesser General Public License for more details. ' 15 | # ' 16 | # You should have received a copy of the GNU Lesser General Public License ' 17 | # along with geoh5py. If not, see . ' 18 | # '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 19 | 20 | 21 | # pylint: disable=unused-import 22 | # flake8: noqa 23 | 24 | from .concatenated import Concatenated 25 | from .concatenator import Concatenator 26 | from .data import ConcatenatedData 27 | from .drillhole import ConcatenatedDrillhole 28 | from .object import ConcatenatedObject 29 | from .property_group import ConcatenatedPropertyGroup 30 | -------------------------------------------------------------------------------- /geoh5py/shared/concatenation/concatenated.py: -------------------------------------------------------------------------------- 1 | # '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 2 | # Copyright (c) 2025 Mira Geoscience Ltd. ' 3 | # ' 4 | # This file is part of geoh5py. ' 5 | # ' 6 | # geoh5py is free software: you can redistribute it and/or modify ' 7 | # it under the terms of the GNU Lesser General Public License as published by ' 8 | # the Free Software Foundation, either version 3 of the License, or ' 9 | # (at your option) any later version. ' 10 | # ' 11 | # geoh5py is distributed in the hope that it will be useful, ' 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of ' 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ' 14 | # GNU Lesser General Public License for more details. ' 15 | # ' 16 | # You should have received a copy of the GNU Lesser General Public License ' 17 | # along with geoh5py. If not, see . ' 18 | # '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 19 | 20 | 21 | from __future__ import annotations 22 | 23 | from typing import TYPE_CHECKING 24 | 25 | 26 | if TYPE_CHECKING: 27 | from .concatenator import Concatenator 28 | 29 | 30 | class Concatenated: 31 | """ 32 | Base class modifier for concatenated objects and data. 33 | """ 34 | 35 | _concat_attr_str: str = "Attributes" 36 | 37 | def __init__(self, *args, **kwargs): 38 | attribute_map = getattr(self, "_attribute_map", {}) 39 | attr = {"name": "Entity", "parent": None} 40 | 41 | for key, value in kwargs.items(): 42 | attr[attribute_map.get(key, key)] = value 43 | 44 | super().__init__(*args, **attr) 45 | 46 | @property 47 | def concat_attr_str(self) -> str: 48 | """String identifier for the concatenated attributes.""" 49 | return self._concat_attr_str 50 | 51 | @property 52 | def concatenator(self) -> Concatenator: 53 | """ 54 | Parental Concatenator entity. 55 | 56 | Warning: Parent is not an attribute of Concatenated, but of the derived class. 57 | """ 58 | parent: Concatenated | Concatenator = getattr(self, "parent", None) # type: ignore 59 | if parent is None: 60 | raise UserWarning("Parent of concatenated object is not defined.") 61 | 62 | if isinstance(parent, Concatenated): 63 | return parent.concatenator 64 | 65 | return parent 66 | -------------------------------------------------------------------------------- /geoh5py/shared/conversion/__init__.py: -------------------------------------------------------------------------------- 1 | # '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 2 | # Copyright (c) 2025 Mira Geoscience Ltd. ' 3 | # ' 4 | # This file is part of geoh5py. ' 5 | # ' 6 | # geoh5py is free software: you can redistribute it and/or modify ' 7 | # it under the terms of the GNU Lesser General Public License as published by ' 8 | # the Free Software Foundation, either version 3 of the License, or ' 9 | # (at your option) any later version. ' 10 | # ' 11 | # geoh5py is distributed in the hope that it will be useful, ' 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of ' 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ' 14 | # GNU Lesser General Public License for more details. ' 15 | # ' 16 | # You should have received a copy of the GNU Lesser General Public License ' 17 | # along with geoh5py. If not, see . ' 18 | # '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 19 | 20 | 21 | # pylint: disable=unused-import 22 | # flake8: noqa 23 | 24 | from .base import BaseConversion, CellObjectConversion 25 | from .geo_image import GeoImageConversion 26 | from .grid2d import Grid2DConversion 27 | -------------------------------------------------------------------------------- /geoh5py/shared/merging/__init__.py: -------------------------------------------------------------------------------- 1 | # '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 2 | # Copyright (c) 2025 Mira Geoscience Ltd. ' 3 | # ' 4 | # This file is part of geoh5py. ' 5 | # ' 6 | # geoh5py is free software: you can redistribute it and/or modify ' 7 | # it under the terms of the GNU Lesser General Public License as published by ' 8 | # the Free Software Foundation, either version 3 of the License, or ' 9 | # (at your option) any later version. ' 10 | # ' 11 | # geoh5py is distributed in the hope that it will be useful, ' 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of ' 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ' 14 | # GNU Lesser General Public License for more details. ' 15 | # ' 16 | # You should have received a copy of the GNU Lesser General Public License ' 17 | # along with geoh5py. If not, see . ' 18 | # '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 19 | 20 | 21 | # pylint: disable=unused-import 22 | # flake8: noqa 23 | 24 | from .cell import CurveMerger, SurfaceMerger 25 | from .drape_model import DrapeModelMerger 26 | from .points import PointsMerger 27 | -------------------------------------------------------------------------------- /geoh5py/shared/merging/points.py: -------------------------------------------------------------------------------- 1 | # '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 2 | # Copyright (c) 2025 Mira Geoscience Ltd. ' 3 | # ' 4 | # This file is part of geoh5py. ' 5 | # ' 6 | # geoh5py is free software: you can redistribute it and/or modify ' 7 | # it under the terms of the GNU Lesser General Public License as published by ' 8 | # the Free Software Foundation, either version 3 of the License, or ' 9 | # (at your option) any later version. ' 10 | # ' 11 | # geoh5py is distributed in the hope that it will be useful, ' 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of ' 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ' 14 | # GNU Lesser General Public License for more details. ' 15 | # ' 16 | # You should have received a copy of the GNU Lesser General Public License ' 17 | # along with geoh5py. If not, see . ' 18 | # '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 19 | 20 | from __future__ import annotations 21 | 22 | import numpy as np 23 | 24 | from ...objects import Points 25 | from ...workspace import Workspace 26 | from .base import BaseMerger 27 | 28 | 29 | class PointsMerger(BaseMerger): 30 | _type: type = Points 31 | 32 | @classmethod 33 | def create_object( 34 | cls, workspace: Workspace, input_entities: list, **kwargs 35 | ) -> Points: 36 | # create the vertices 37 | vertices = np.vstack([input_entity.vertices for input_entity in input_entities]) 38 | 39 | # create an object of type 40 | output = cls._type.create( # type: ignore 41 | workspace, vertices=vertices, **kwargs 42 | ) 43 | 44 | return output 45 | 46 | @classmethod 47 | def validate_structure(cls, input_entity: Points): 48 | """ 49 | Validate the input entity structure and raises error if incompatible. 50 | :param input_entity: the input entity to validate. 51 | """ 52 | # verify if the input entity have vertices 53 | if not isinstance(input_entity.vertices, np.ndarray): 54 | raise AttributeError("All entities must have vertices.") 55 | -------------------------------------------------------------------------------- /geoh5py/ui_json/__init__.py: -------------------------------------------------------------------------------- 1 | # '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 2 | # Copyright (c) 2025 Mira Geoscience Ltd. ' 3 | # ' 4 | # This file is part of geoh5py. ' 5 | # ' 6 | # geoh5py is free software: you can redistribute it and/or modify ' 7 | # it under the terms of the GNU Lesser General Public License as published by ' 8 | # the Free Software Foundation, either version 3 of the License, or ' 9 | # (at your option) any later version. ' 10 | # ' 11 | # geoh5py is distributed in the hope that it will be useful, ' 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of ' 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ' 14 | # GNU Lesser General Public License for more details. ' 15 | # ' 16 | # You should have received a copy of the GNU Lesser General Public License ' 17 | # along with geoh5py. If not, see . ' 18 | # '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 19 | 20 | 21 | # pylint: disable=unused-import 22 | # flake8: noqa 23 | 24 | from __future__ import annotations 25 | 26 | from .input_file import InputFile 27 | from .utils import monitored_directory_copy 28 | from .validation import InputValidation 29 | -------------------------------------------------------------------------------- /geoh5py/ui_json/annotations.py: -------------------------------------------------------------------------------- 1 | # '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 2 | # Copyright (c) 2025 Mira Geoscience Ltd. ' 3 | # ' 4 | # This file is part of geoh5py. ' 5 | # ' 6 | # geoh5py is free software: you can redistribute it and/or modify ' 7 | # it under the terms of the GNU Lesser General Public License as published by ' 8 | # the Free Software Foundation, either version 3 of the License, or ' 9 | # (at your option) any later version. ' 10 | # ' 11 | # geoh5py is distributed in the hope that it will be useful, ' 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of ' 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ' 14 | # GNU Lesser General Public License for more details. ' 15 | # ' 16 | # You should have received a copy of the GNU Lesser General Public License ' 17 | # along with geoh5py. If not, see . ' 18 | # '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 19 | 20 | import logging 21 | from typing import Annotated, Any 22 | 23 | from pydantic import BeforeValidator, Field 24 | 25 | 26 | logger = logging.getLogger(__name__) 27 | 28 | 29 | def deprecate(value, info): 30 | """Issue deprecation warning.""" 31 | logger.warning("Skipping deprecated field: %s.", info.field_name) 32 | return value 33 | 34 | 35 | Deprecated = Annotated[ 36 | Any, 37 | Field(exclude=True), 38 | BeforeValidator(deprecate), 39 | ] 40 | -------------------------------------------------------------------------------- /geoh5py/ui_json/validations/__init__.py: -------------------------------------------------------------------------------- 1 | # '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 2 | # Copyright (c) 2025 Mira Geoscience Ltd. ' 3 | # ' 4 | # This file is part of geoh5py. ' 5 | # ' 6 | # geoh5py is free software: you can redistribute it and/or modify ' 7 | # it under the terms of the GNU Lesser General Public License as published by ' 8 | # the Free Software Foundation, either version 3 of the License, or ' 9 | # (at your option) any later version. ' 10 | # ' 11 | # geoh5py is distributed in the hope that it will be useful, ' 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of ' 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ' 14 | # GNU Lesser General Public License for more details. ' 15 | # ' 16 | # You should have received a copy of the GNU Lesser General Public License ' 17 | # along with geoh5py. If not, see . ' 18 | # '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 19 | 20 | from collections.abc import Callable 21 | 22 | from .uijson import ( 23 | ErrorPool, 24 | UIJsonError, 25 | dependency_type_validation, 26 | mesh_type_validation, 27 | parent_validation, 28 | ) 29 | 30 | 31 | VALIDATIONS_MAP = { 32 | "dependency": dependency_type_validation, 33 | "mesh_type": mesh_type_validation, 34 | "parent": parent_validation, 35 | } 36 | 37 | 38 | def get_validations(form_keys: list[str]) -> list[Callable]: 39 | """Returns a list of callable validations based on identifying form keys.""" 40 | return [VALIDATIONS_MAP[k] for k in form_keys if k in VALIDATIONS_MAP] 41 | -------------------------------------------------------------------------------- /geoh5py/workspace/__init__.py: -------------------------------------------------------------------------------- 1 | # '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 2 | # Copyright (c) 2025 Mira Geoscience Ltd. ' 3 | # ' 4 | # This file is part of geoh5py. ' 5 | # ' 6 | # geoh5py is free software: you can redistribute it and/or modify ' 7 | # it under the terms of the GNU Lesser General Public License as published by ' 8 | # the Free Software Foundation, either version 3 of the License, or ' 9 | # (at your option) any later version. ' 10 | # ' 11 | # geoh5py is distributed in the hope that it will be useful, ' 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of ' 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ' 14 | # GNU Lesser General Public License for more details. ' 15 | # ' 16 | # You should have received a copy of the GNU Lesser General Public License ' 17 | # along with geoh5py. If not, see . ' 18 | # '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 19 | 20 | 21 | # pylint: disable=unused-import 22 | # flake8: noqa 23 | 24 | from .workspace import Workspace, active_workspace 25 | -------------------------------------------------------------------------------- /package.rst: -------------------------------------------------------------------------------- 1 | geoh5py: Python API for geoh5. An open file format for geoscientific data 2 | ========================================================================== 3 | 4 | The **geoh5py** library has been created for the manipulation and storage of a wide range of 5 | geoscientific data (points, curve, surface, 2D and 3D grids) in 6 | `geoh5 file format `_. 7 | Users will be able to directly leverage the powerful visualization 8 | capabilities of `Geoscience ANALYST `_ along with open-source code from the Python ecosystem. 9 | 10 | Installation 11 | ^^^^^^^^^^^^ 12 | **geoh5py** depends on `NumPy `_ and `h5py `_. 13 | 14 | .. note:: Users will likely want to take advantage of other packages available in the Python ecosystem. 15 | We therefore recommend using `Miniforge `_ `(Windows x86_64) `_ 16 | 17 | 18 | Install **geoh5py** from PyPI:: 19 | 20 | $ pip install geoh5py 21 | 22 | 23 | Feedback 24 | ^^^^^^^^ 25 | Have comments or suggestions? Submit feedback. 26 | All the content can be found on the github_ repository. 27 | 28 | .. _github: https://github.com/MiraGeoscience/geoh5py 29 | 30 | 31 | Visit `Mira Geoscience website `_ to learn more about our products 32 | and services. 33 | 34 | 35 | License 36 | ^^^^^^^ 37 | geoh5py is free software: you can redistribute it and/or modify 38 | it under the terms of the GNU Lesser General Public License as published by 39 | the Free Software Foundation, either version 3 of the License, or 40 | (at your option) any later version. 41 | 42 | geoh5py is distributed in the hope that it will be useful, 43 | but WITHOUT ANY WARRANTY; without even the implied warranty of 44 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 45 | GNU Lesser General Public License for more details. 46 | 47 | You should have received a copy of the GNU Lesser General Public License 48 | along with geoh5py. If not, see . 49 | 50 | 51 | Copyright 52 | ^^^^^^^^^ 53 | Copyright (c) 2025 Mira Geoscience Ltd. 54 | -------------------------------------------------------------------------------- /recipe.yaml: -------------------------------------------------------------------------------- 1 | schema_version: 1 2 | 3 | context: 4 | name: "geoh5py" 5 | version: "0.12.0a1" 6 | python_min: "3.10" 7 | 8 | package: 9 | name: ${{ name|lower }} 10 | version: ${{ version }} 11 | 12 | source: 13 | path: ../${{ name}} 14 | 15 | build: 16 | number: 0 17 | noarch: python 18 | script: ${{ PYTHON }} -m pip install . -vv --no-deps --no-build-isolation 19 | 20 | requirements: 21 | host: 22 | - python 3.10.* 23 | - poetry-core >=1.0.0 24 | - setuptools 25 | - pip 26 | run: 27 | - python >=${{ python_min }} 28 | - h5py >=3.2.1, <4.0.dev 29 | - numpy >=1.26.0, <1.27.dev 30 | - pillow >=10.3.0, <10.4.dev 31 | - pydantic >=2.5.2, <3.0.dev 32 | 33 | tests: 34 | - python: 35 | imports: 36 | - geoh5py 37 | - script: 38 | - pytest --ignore=tests/version_test.py 39 | requirements: 40 | run: 41 | - pytest 42 | - scipy >= 1.14.0, <1.15.dev 43 | files: 44 | source: 45 | - tests/ 46 | 47 | about: 48 | summary: Python API for geoh5, an open file format for geoscientific data. 49 | description: | 50 | The geoh5py library has been created for the manipulation and storage of a wide range of 51 | geoscientific data (points, curve, surface, 2D and 3D grids) in GEOH5 file format. Users will 52 | be able to directly leverage the powerful visualization capabilities of 53 | (Geoscience ANALYST) 54 | along with open-source code from the Python ecosystem. 55 | license: LGPL-3.0-only 56 | license_file: 57 | - COPYING 58 | - COPYING.LESSER 59 | homepage: https://www.mirageoscience.com/mining-industry-software/python-integration/ 60 | repository: https://github.com/MiraGeoscience/geoh5py 61 | documentation: https://mirageoscience-geoh5py.readthedocs-hosted.com/ 62 | 63 | extra: 64 | recipe-maintainers: 65 | - andrewg-mira 66 | - sebhmg 67 | -------------------------------------------------------------------------------- /tests/__init__.py: -------------------------------------------------------------------------------- 1 | # '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 2 | # Copyright (c) 2025 Mira Geoscience Ltd. ' 3 | # ' 4 | # This file is part of geoh5py. ' 5 | # ' 6 | # geoh5py is free software: you can redistribute it and/or modify ' 7 | # it under the terms of the GNU Lesser General Public License as published by ' 8 | # the Free Software Foundation, either version 3 of the License, or ' 9 | # (at your option) any later version. ' 10 | # ' 11 | # geoh5py is distributed in the hope that it will be useful, ' 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of ' 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ' 14 | # GNU Lesser General Public License for more details. ' 15 | # ' 16 | # You should have received a copy of the GNU Lesser General Public License ' 17 | # along with geoh5py. If not, see . ' 18 | # '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 19 | -------------------------------------------------------------------------------- /tests/conversion_base_test.py: -------------------------------------------------------------------------------- 1 | # '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 2 | # Copyright (c) 2025 Mira Geoscience Ltd. ' 3 | # ' 4 | # This file is part of geoh5py. ' 5 | # ' 6 | # geoh5py is free software: you can redistribute it and/or modify ' 7 | # it under the terms of the GNU Lesser General Public License as published by ' 8 | # the Free Software Foundation, either version 3 of the License, or ' 9 | # (at your option) any later version. ' 10 | # ' 11 | # geoh5py is distributed in the hope that it will be useful, ' 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of ' 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ' 14 | # GNU Lesser General Public License for more details. ' 15 | # ' 16 | # You should have received a copy of the GNU Lesser General Public License ' 17 | # along with geoh5py. If not, see . ' 18 | # '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 19 | 20 | 21 | # pylint: disable=duplicate-code 22 | 23 | from __future__ import annotations 24 | 25 | import numpy as np 26 | import pytest 27 | 28 | from geoh5py.objects import Grid2D 29 | from geoh5py.shared.conversion.base import CellObjectConversion 30 | from geoh5py.workspace import Workspace 31 | 32 | 33 | def test_create_grid_2d_data(tmp_path): 34 | # Create a workspace 35 | h5file_path = tmp_path / r"test2Grid.geoh5" 36 | 37 | with Workspace.create(h5file_path) as workspace_context: 38 | # test base converter 39 | n_x, n_y, name = 10, 15, "test" 40 | grid = Grid2D.create( 41 | workspace_context, 42 | origin=[0, 0, 0], 43 | u_cell_size=20.0, 44 | v_cell_size=30.0, 45 | u_count=n_x, 46 | v_count=n_y, 47 | name=name, 48 | allow_move=False, 49 | ) 50 | 51 | converter = CellObjectConversion 52 | 53 | values, _ = np.meshgrid(np.linspace(0, np.pi, n_x), np.linspace(0, np.pi, n_y)) 54 | grid.add_data( 55 | data={"DataValues": {"values": values.flatten(), "association": "CELL"}} 56 | ) 57 | 58 | points = converter.to_points(grid) 59 | 60 | with pytest.raises(TypeError, match="Input entity for `GridObject` conversion"): 61 | converter.to_points(points) 62 | -------------------------------------------------------------------------------- /tests/entity_attributes_test.py: -------------------------------------------------------------------------------- 1 | # '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 2 | # Copyright (c) 2025 Mira Geoscience Ltd. ' 3 | # ' 4 | # This file is part of geoh5py. ' 5 | # ' 6 | # geoh5py is free software: you can redistribute it and/or modify ' 7 | # it under the terms of the GNU Lesser General Public License as published by ' 8 | # the Free Software Foundation, either version 3 of the License, or ' 9 | # (at your option) any later version. ' 10 | # ' 11 | # geoh5py is distributed in the hope that it will be useful, ' 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of ' 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ' 14 | # GNU Lesser General Public License for more details. ' 15 | # ' 16 | # You should have received a copy of the GNU Lesser General Public License ' 17 | # along with geoh5py. If not, see . ' 18 | # '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 19 | 20 | 21 | from __future__ import annotations 22 | 23 | import uuid 24 | 25 | import numpy as np 26 | import pytest 27 | 28 | from geoh5py.objects import Curve 29 | from geoh5py.workspace import Workspace 30 | 31 | 32 | def test_attribute_validations(): 33 | workspace = Workspace() 34 | xyz = np.random.randn(10, 3) 35 | 36 | with pytest.raises(TypeError, match="Input uid must be a string or uuid"): 37 | Curve.create(workspace, vertices=xyz, uid="abc") 38 | 39 | with pytest.raises(TypeError, match="Attribute 'on_file' must be of type bool"): 40 | Curve.create(workspace, vertices=xyz, on_file="abc") 41 | 42 | with pytest.raises( 43 | TypeError, match="Input clipping_ids must be a list of uuid.UUID or None" 44 | ): 45 | Curve.create(workspace, vertices=xyz, clipping_ids=["abc", uuid.uuid4()]) 46 | 47 | with pytest.raises( 48 | TypeError, match="Input clipping_ids must be a list of uuid.UUID or None" 49 | ): 50 | Curve.create(workspace, vertices=xyz, clipping_ids="abc") 51 | 52 | 53 | @pytest.mark.parametrize("parameter", ["partially_hidden", "public", "visible"]) 54 | def test_attribute_change(parameter): 55 | workspace = Workspace() 56 | xyz = np.random.randn(10, 3) 57 | curve = Curve.create(workspace, vertices=xyz) 58 | 59 | default = getattr(curve, parameter) 60 | setattr(curve, parameter, not default) 61 | 62 | assert getattr(curve, parameter) != default 63 | -------------------------------------------------------------------------------- /tests/geometric_datatype_test.py: -------------------------------------------------------------------------------- 1 | # '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 2 | # Copyright (c) 2025 Mira Geoscience Ltd. ' 3 | # ' 4 | # This file is part of geoh5py. ' 5 | # ' 6 | # geoh5py is free software: you can redistribute it and/or modify ' 7 | # it under the terms of the GNU Lesser General Public License as published by ' 8 | # the Free Software Foundation, either version 3 of the License, or ' 9 | # (at your option) any later version. ' 10 | # ' 11 | # geoh5py is distributed in the hope that it will be useful, ' 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of ' 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ' 14 | # GNU Lesser General Public License for more details. ' 15 | # ' 16 | # You should have received a copy of the GNU Lesser General Public License ' 17 | # along with geoh5py. If not, see . ' 18 | # '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 19 | 20 | 21 | from __future__ import annotations 22 | 23 | from pathlib import Path 24 | 25 | import numpy as np 26 | 27 | from geoh5py.data import data_type, geometric_data 28 | from geoh5py.objects import Points 29 | from geoh5py.workspace import Workspace 30 | 31 | 32 | def test_xyz_dataype(tmp_path: Path): 33 | h5file_path = tmp_path / f"{__name__}.geoh5" 34 | 35 | with Workspace.create(h5file_path) as workspace: 36 | points = Points.create(workspace, vertices=np.random.randn(10, 3)) 37 | 38 | for name in ["X", "Y", "Z"]: 39 | class_name = f"GeometricData{name}Type" 40 | dtype = getattr(data_type, class_name) 41 | dynamic_id = { 42 | value: key for key, value in data_type.DYNAMIC_CLASS_IDS.items() 43 | } 44 | data = points.add_data( 45 | { 46 | name: { 47 | "association": "VERTEX", 48 | "name": name, 49 | "primitive_type": "GEOMETRIC", 50 | "dynamic_implementation_id": dynamic_id[dtype], 51 | } 52 | } 53 | ) 54 | 55 | assert isinstance(data, geometric_data.GeometricDataConstants) 56 | assert ( 57 | data.entity_type.uid 58 | == getattr(data_type, class_name).default_type_uid() 59 | ) 60 | 61 | ws = Workspace(h5file_path) 62 | assert all( 63 | isinstance(data, geometric_data.GeometricDataConstants) for data in ws.data 64 | ) 65 | -------------------------------------------------------------------------------- /tests/grid_object_test.py: -------------------------------------------------------------------------------- 1 | # '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 2 | # Copyright (c) 2025 Mira Geoscience Ltd. ' 3 | # ' 4 | # This file is part of geoh5py. ' 5 | # ' 6 | # geoh5py is free software: you can redistribute it and/or modify ' 7 | # it under the terms of the GNU Lesser General Public License as published by ' 8 | # the Free Software Foundation, either version 3 of the License, or ' 9 | # (at your option) any later version. ' 10 | # ' 11 | # geoh5py is distributed in the hope that it will be useful, ' 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of ' 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ' 14 | # GNU Lesser General Public License for more details. ' 15 | # ' 16 | # You should have received a copy of the GNU Lesser General Public License ' 17 | # along with geoh5py. If not, see . ' 18 | # '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 19 | 20 | 21 | from __future__ import annotations 22 | 23 | import numpy as np 24 | import pytest 25 | 26 | from geoh5py.objects import Grid2D 27 | from geoh5py.workspace import Workspace 28 | 29 | 30 | def test_attribute_setters(): 31 | with Workspace() as workspace: 32 | grid = Grid2D.create(workspace) 33 | 34 | with pytest.raises(TypeError, match="Rotation angle must be a float."): 35 | grid.rotation = np.r_[0, 1] 36 | 37 | with pytest.raises(TypeError, match="Attribute 'origin' must be a list"): 38 | grid.origin = "abc" 39 | 40 | with pytest.raises( 41 | ValueError, match="Attribute 'origin' must be a list or array" 42 | ): 43 | grid.origin = np.r_[0, 1] 44 | 45 | with pytest.raises(ValueError, match="Array of 'origin' must be of dtype"): 46 | grid.origin = np.asarray( 47 | [0, 0, 0], dtype=np.dtype([("x", int), ("y", int), ("z", int)]) 48 | ) 49 | -------------------------------------------------------------------------------- /tests/io_write_test.py: -------------------------------------------------------------------------------- 1 | # '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 2 | # Copyright (c) 2025 Mira Geoscience Ltd. ' 3 | # ' 4 | # This file is part of geoh5py. ' 5 | # ' 6 | # geoh5py is free software: you can redistribute it and/or modify ' 7 | # it under the terms of the GNU Lesser General Public License as published by ' 8 | # the Free Software Foundation, either version 3 of the License, or ' 9 | # (at your option) any later version. ' 10 | # ' 11 | # geoh5py is distributed in the hope that it will be useful, ' 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of ' 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ' 14 | # GNU Lesser General Public License for more details. ' 15 | # ' 16 | # You should have received a copy of the GNU Lesser General Public License ' 17 | # along with geoh5py. If not, see . ' 18 | # '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 19 | 20 | 21 | from __future__ import annotations 22 | 23 | from h5py import File 24 | 25 | from geoh5py.objects import Points 26 | from geoh5py.workspace import Workspace 27 | 28 | 29 | def test_fetch_handle(tmp_path): 30 | h5file_path = tmp_path / r"test2.geoh5" 31 | w_s = Workspace.create(h5file_path) 32 | with File(h5file_path, "r+") as project: 33 | base = list(project.keys())[0] 34 | del project[base]["Objects"] 35 | del project[base]["Types"] 36 | 37 | Points.create(w_s) 38 | -------------------------------------------------------------------------------- /tests/label_test.py: -------------------------------------------------------------------------------- 1 | # '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 2 | # Copyright (c) 2025 Mira Geoscience Ltd. ' 3 | # ' 4 | # This file is part of geoh5py. ' 5 | # ' 6 | # geoh5py is free software: you can redistribute it and/or modify ' 7 | # it under the terms of the GNU Lesser General Public License as published by ' 8 | # the Free Software Foundation, either version 3 of the License, or ' 9 | # (at your option) any later version. ' 10 | # ' 11 | # geoh5py is distributed in the hope that it will be useful, ' 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of ' 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ' 14 | # GNU Lesser General Public License for more details. ' 15 | # ' 16 | # You should have received a copy of the GNU Lesser General Public License ' 17 | # along with geoh5py. If not, see . ' 18 | # '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 19 | 20 | 21 | from __future__ import annotations 22 | 23 | import logging 24 | from pathlib import Path 25 | 26 | import numpy as np 27 | 28 | from geoh5py.objects import Label 29 | from geoh5py.shared.utils import compare_entities 30 | from geoh5py.workspace import Workspace 31 | 32 | 33 | def test_create_label(tmp_path: Path, caplog): 34 | h5file_path = tmp_path / r"testGroup.geoh5" 35 | 36 | # Create a workspace 37 | with Workspace.create(h5file_path) as workspace: 38 | label = Label.create(workspace, name="MyTestLabel") 39 | 40 | assert label.copy_from_extent(np.vstack([[0, 0], [1, 1]])) is None 41 | 42 | with caplog.at_level(logging.WARNING): 43 | copy_label = label.copy(mask=[[0, 0], [1, 1]]) 44 | 45 | assert "Masking is not supported" in caplog.text 46 | 47 | compare_entities( 48 | label, copy_label, ignore=["target_position", "label_position", "_uid"] 49 | ) 50 | -------------------------------------------------------------------------------- /tests/notype_test.py: -------------------------------------------------------------------------------- 1 | # '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 2 | # Copyright (c) 2025 Mira Geoscience Ltd. ' 3 | # ' 4 | # This file is part of geoh5py. ' 5 | # ' 6 | # geoh5py is free software: you can redistribute it and/or modify ' 7 | # it under the terms of the GNU Lesser General Public License as published by ' 8 | # the Free Software Foundation, either version 3 of the License, or ' 9 | # (at your option) any later version. ' 10 | # ' 11 | # geoh5py is distributed in the hope that it will be useful, ' 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of ' 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ' 14 | # GNU Lesser General Public License for more details. ' 15 | # ' 16 | # You should have received a copy of the GNU Lesser General Public License ' 17 | # along with geoh5py. If not, see . ' 18 | # '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 19 | 20 | 21 | from __future__ import annotations 22 | 23 | import logging 24 | 25 | import numpy as np 26 | 27 | from geoh5py.objects import NoTypeObject 28 | from geoh5py.shared.utils import compare_entities 29 | from geoh5py.workspace import Workspace 30 | 31 | 32 | def test_create_notype(tmp_path, caplog): 33 | h5file_path = tmp_path / r"testNoType.geoh5" 34 | 35 | # Create a workspace 36 | with Workspace.create(h5file_path) as workspace: 37 | label = NoTypeObject.create(workspace, name="MyTestLabel") 38 | 39 | assert label.copy_from_extent(np.vstack([[0, 0], [1, 1]])) is None 40 | 41 | with caplog.at_level(logging.WARNING): 42 | copy_label = label.copy(mask=[[0, 0], [1, 1]]) 43 | 44 | assert "Masking is not supported" in caplog.text 45 | 46 | compare_entities(label, copy_label, ignore=["_uid"]) 47 | -------------------------------------------------------------------------------- /tests/numeric_data_test.py: -------------------------------------------------------------------------------- 1 | # '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 2 | # Copyright (c) 2025 Mira Geoscience Ltd. ' 3 | # ' 4 | # This file is part of geoh5py. ' 5 | # ' 6 | # geoh5py is free software: you can redistribute it and/or modify ' 7 | # it under the terms of the GNU Lesser General Public License as published by ' 8 | # the Free Software Foundation, either version 3 of the License, or ' 9 | # (at your option) any later version. ' 10 | # ' 11 | # geoh5py is distributed in the hope that it will be useful, ' 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of ' 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ' 14 | # GNU Lesser General Public License for more details. ' 15 | # ' 16 | # You should have received a copy of the GNU Lesser General Public License ' 17 | # along with geoh5py. If not, see . ' 18 | # '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 19 | 20 | from __future__ import annotations 21 | 22 | import logging 23 | 24 | import numpy as np 25 | 26 | from geoh5py.objects import Points 27 | from geoh5py.workspace import Workspace 28 | 29 | 30 | def test_create_point_data(tmp_path, caplog): 31 | h5file_path = tmp_path / r"testNumeric.geoh5" 32 | workspace = Workspace.create(h5file_path) 33 | 34 | values = np.random.randn(16) 35 | points = Points.create(workspace, vertices=np.random.randn(12, 3), allow_move=False) 36 | 37 | with caplog.at_level(logging.WARNING): 38 | data = points.add_data( 39 | { 40 | "DataValues1": {"association": "VERTEX", "values": values}, 41 | "DataValues2": {"association": "VERTEX", "values": values[:8]}, 42 | } 43 | ) 44 | 45 | assert np.array_equal(data[0].values, values[:12]) 46 | 47 | test = np.full((12,), np.nan) 48 | test[:8] = values[:8] 49 | 50 | assert np.array_equal(data[1].values, test, equal_nan=True) 51 | -------------------------------------------------------------------------------- /tests/save_modified_properties_test.py: -------------------------------------------------------------------------------- 1 | # '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 2 | # Copyright (c) 2025 Mira Geoscience Ltd. ' 3 | # ' 4 | # This file is part of geoh5py. ' 5 | # ' 6 | # geoh5py is free software: you can redistribute it and/or modify ' 7 | # it under the terms of the GNU Lesser General Public License as published by ' 8 | # the Free Software Foundation, either version 3 of the License, or ' 9 | # (at your option) any later version. ' 10 | # ' 11 | # geoh5py is distributed in the hope that it will be useful, ' 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of ' 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ' 14 | # GNU Lesser General Public License for more details. ' 15 | # ' 16 | # You should have received a copy of the GNU Lesser General Public License ' 17 | # along with geoh5py. If not, see . ' 18 | # '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 19 | 20 | 21 | from __future__ import annotations 22 | 23 | from unittest.mock import patch 24 | 25 | import numpy as np 26 | 27 | from geoh5py.objects import Points 28 | from geoh5py.workspace import Workspace 29 | 30 | 31 | @patch("geoh5py.io.h5_writer.H5Writer.write_data_values") 32 | @patch("geoh5py.io.h5_writer.H5Writer.write_array_attribute") 33 | @patch("geoh5py.io.h5_writer.H5Writer.write_attributes") 34 | def test_save_modified_properties( 35 | write_attributes, write_array_attribute, write_data_values, tmp_path 36 | ): 37 | n_data = 12 38 | xyz = np.random.randn(n_data, 3) 39 | 40 | h5file_path = tmp_path / r"testPoints.geoh5" 41 | 42 | # Create a workspace 43 | with Workspace.create(h5file_path) as workspace: 44 | points = Points.create(workspace, vertices=xyz) 45 | 46 | assert write_attributes.called, f"{write_attributes} was not called." 47 | assert write_array_attribute.called, f"{write_array_attribute} was not called." 48 | assert not write_data_values.called, ( 49 | f"{write_data_values} should not have been called." 50 | ) 51 | 52 | assert not write_data_values.called, ( 53 | f"{write_data_values} should not have been called." 54 | ) 55 | 56 | points.add_data({"rando": {"values": np.ones(n_data)}}) 57 | 58 | assert write_data_values.called, f"{write_data_values} should have been called." 59 | -------------------------------------------------------------------------------- /tests/set_parent_test.py: -------------------------------------------------------------------------------- 1 | # '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 2 | # Copyright (c) 2025 Mira Geoscience Ltd. ' 3 | # ' 4 | # This file is part of geoh5py. ' 5 | # ' 6 | # geoh5py is free software: you can redistribute it and/or modify ' 7 | # it under the terms of the GNU Lesser General Public License as published by ' 8 | # the Free Software Foundation, either version 3 of the License, or ' 9 | # (at your option) any later version. ' 10 | # ' 11 | # geoh5py is distributed in the hope that it will be useful, ' 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of ' 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ' 14 | # GNU Lesser General Public License for more details. ' 15 | # ' 16 | # You should have received a copy of the GNU Lesser General Public License ' 17 | # along with geoh5py. If not, see . ' 18 | # '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 19 | 20 | 21 | from __future__ import annotations 22 | 23 | import numpy as np 24 | 25 | from geoh5py.groups import ContainerGroup 26 | from geoh5py.objects import Points 27 | from geoh5py.workspace import Workspace 28 | 29 | 30 | def test_set_parent(tmp_path): 31 | # Generate a random cloud of points 32 | xyz = np.random.randn(2, 3) 33 | name = "test_points" 34 | h5file_path = tmp_path / r"testProject.geoh5" 35 | 36 | with Workspace.create(h5file_path) as workspace: 37 | group_a = ContainerGroup.create(workspace) 38 | entity = Points.create(workspace, vertices=xyz, name=name, parent=group_a) 39 | entity.add_data({"random": {"values": np.random.randn(xyz.shape[0])}}) 40 | group_b = ContainerGroup.create(workspace, name="group_b") 41 | entity.parent = group_b 42 | 43 | workspace = Workspace(h5file_path) 44 | group_reload = workspace.get_entity("group_b")[0] 45 | entity_reload = workspace.get_entity(name)[0] 46 | data_reload = workspace.get_entity("random")[0] 47 | 48 | assert entity_reload.parent == group_reload, "Parent different than expected." 49 | assert entity_reload in group_reload.children, ( 50 | "Entity not in the list of children." 51 | ) 52 | assert data_reload in entity_reload.children, ( 53 | "Data not in list of entity children." 54 | ) 55 | -------------------------------------------------------------------------------- /tests/surveys/__init__.py: -------------------------------------------------------------------------------- 1 | # '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 2 | # Copyright (c) 2025 Mira Geoscience Ltd. ' 3 | # ' 4 | # This file is part of geoh5py. ' 5 | # ' 6 | # geoh5py is free software: you can redistribute it and/or modify ' 7 | # it under the terms of the GNU Lesser General Public License as published by ' 8 | # the Free Software Foundation, either version 3 of the License, or ' 9 | # (at your option) any later version. ' 10 | # ' 11 | # geoh5py is distributed in the hope that it will be useful, ' 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of ' 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ' 14 | # GNU Lesser General Public License for more details. ' 15 | # ' 16 | # You should have received a copy of the GNU Lesser General Public License ' 17 | # along with geoh5py. If not, see . ' 18 | # '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 19 | -------------------------------------------------------------------------------- /tests/type_uid_test.py: -------------------------------------------------------------------------------- 1 | # '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 2 | # Copyright (c) 2025 Mira Geoscience Ltd. ' 3 | # ' 4 | # This file is part of geoh5py. ' 5 | # ' 6 | # geoh5py is free software: you can redistribute it and/or modify ' 7 | # it under the terms of the GNU Lesser General Public License as published by ' 8 | # the Free Software Foundation, either version 3 of the License, or ' 9 | # (at your option) any later version. ' 10 | # ' 11 | # geoh5py is distributed in the hope that it will be useful, ' 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of ' 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ' 14 | # GNU Lesser General Public License for more details. ' 15 | # ' 16 | # You should have received a copy of the GNU Lesser General Public License ' 17 | # along with geoh5py. If not, see . ' 18 | # '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 19 | 20 | 21 | from geoh5py import TYPE_UID_TO_CLASS, get_type_uid_classes 22 | from geoh5py.groups import ContainerGroup, SimPEGGroup, UIJsonGroup 23 | from geoh5py.objects import Curve, Points, Surface 24 | 25 | 26 | def test_get_objects_with_type_uid(): 27 | members = get_type_uid_classes() 28 | checks = [Points, Curve, Surface, UIJsonGroup, SimPEGGroup, ContainerGroup] 29 | assert all(k in members for k in checks) 30 | assert all(k in TYPE_UID_TO_CLASS.values() for k in checks) 31 | -------------------------------------------------------------------------------- /tests/ui_json/__init__.py: -------------------------------------------------------------------------------- 1 | # '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 2 | # Copyright (c) 2025 Mira Geoscience Ltd. ' 3 | # ' 4 | # This file is part of geoh5py. ' 5 | # ' 6 | # geoh5py is free software: you can redistribute it and/or modify ' 7 | # it under the terms of the GNU Lesser General Public License as published by ' 8 | # the Free Software Foundation, either version 3 of the License, or ' 9 | # (at your option) any later version. ' 10 | # ' 11 | # geoh5py is distributed in the hope that it will be useful, ' 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of ' 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ' 14 | # GNU Lesser General Public License for more details. ' 15 | # ' 16 | # You should have received a copy of the GNU Lesser General Public License ' 17 | # along with geoh5py. If not, see . ' 18 | # '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 19 | -------------------------------------------------------------------------------- /tests/ui_json/set_dict_test.py: -------------------------------------------------------------------------------- 1 | # '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 2 | # Copyright (c) 2025 Mira Geoscience Ltd. ' 3 | # ' 4 | # This file is part of geoh5py. ' 5 | # ' 6 | # geoh5py is free software: you can redistribute it and/or modify ' 7 | # it under the terms of the GNU Lesser General Public License as published by ' 8 | # the Free Software Foundation, either version 3 of the License, or ' 9 | # (at your option) any later version. ' 10 | # ' 11 | # geoh5py is distributed in the hope that it will be useful, ' 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of ' 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ' 14 | # GNU Lesser General Public License for more details. ' 15 | # ' 16 | # You should have received a copy of the GNU Lesser General Public License ' 17 | # along with geoh5py. If not, see . ' 18 | # '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 19 | 20 | 21 | from __future__ import annotations 22 | 23 | from geoh5py.shared.utils import SetDict 24 | 25 | 26 | def test_dict_set_class(): 27 | test = SetDict(a=1, b=[2, 3]) 28 | assert repr(test) == "{'a': {1}, 'b': {2, 3}}" 29 | assert test["a"] == {1} 30 | test["a"] = [1, 2] 31 | assert test["a"] == {1, 2} 32 | test["a"] = {1, 2} 33 | assert test["a"] == {1, 2} 34 | test.update({"b": 4}) 35 | assert test["b"] == {2, 3, 4} 36 | test.update({"c": "hello"}) 37 | assert test["c"] == {"hello"} 38 | for v in test.values(): # pylint: disable=invalid-name 39 | assert isinstance(v, set) 40 | assert len(test) == 3 41 | assert list(test) == ["a", "b", "c"] 42 | assert repr(test) == "{'a': {1, 2}, 'b': {2, 3, 4}, 'c': {'hello'}}" 43 | assert test 44 | test = SetDict() 45 | assert not test 46 | -------------------------------------------------------------------------------- /tests/utils_test.py: -------------------------------------------------------------------------------- 1 | # '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 2 | # Copyright (c) 2025 Mira Geoscience Ltd. ' 3 | # ' 4 | # This file is part of geoh5py. ' 5 | # ' 6 | # geoh5py is free software: you can redistribute it and/or modify ' 7 | # it under the terms of the GNU Lesser General Public License as published by ' 8 | # the Free Software Foundation, either version 3 of the License, or ' 9 | # (at your option) any later version. ' 10 | # ' 11 | # geoh5py is distributed in the hope that it will be useful, ' 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of ' 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ' 14 | # GNU Lesser General Public License for more details. ' 15 | # ' 16 | # You should have received a copy of the GNU Lesser General Public License ' 17 | # along with geoh5py. If not, see . ' 18 | # '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 19 | 20 | 21 | from __future__ import annotations 22 | 23 | import numpy as np 24 | 25 | from geoh5py.shared.utils import dip_azimuth_to_vector, find_unique_name 26 | 27 | 28 | def test_find_unique_name(): 29 | name = "test" 30 | names = ["test", "test(1)", "bidon"] 31 | 32 | assert find_unique_name(name, names) == "test(2)" 33 | 34 | 35 | def test_dip_azimuth_to_vector(): 36 | dip = -45 37 | azimuth = 90 38 | 39 | np.testing.assert_almost_equal( 40 | dip_azimuth_to_vector(dip, azimuth), np.c_[0.7071, 0.0, -0.7071], decimal=3 41 | ) 42 | 43 | dip = 45 44 | azimuth = 245 45 | 46 | np.testing.assert_almost_equal( 47 | dip_azimuth_to_vector(dip, azimuth), np.c_[-0.641, -0.299, 0.707], decimal=3 48 | ) 49 | -------------------------------------------------------------------------------- /tests/weakref_test.py: -------------------------------------------------------------------------------- 1 | # '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 2 | # Copyright (c) 2025 Mira Geoscience Ltd. ' 3 | # ' 4 | # This file is part of geoh5py. ' 5 | # ' 6 | # geoh5py is free software: you can redistribute it and/or modify ' 7 | # it under the terms of the GNU Lesser General Public License as published by ' 8 | # the Free Software Foundation, either version 3 of the License, or ' 9 | # (at your option) any later version. ' 10 | # ' 11 | # geoh5py is distributed in the hope that it will be useful, ' 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of ' 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ' 14 | # GNU Lesser General Public License for more details. ' 15 | # ' 16 | # You should have received a copy of the GNU Lesser General Public License ' 17 | # along with geoh5py. If not, see . ' 18 | # '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 19 | 20 | 21 | from __future__ import annotations 22 | 23 | import weakref 24 | 25 | 26 | class AnyObject: 27 | # pylint: disable=too-few-public-methods 28 | pass 29 | 30 | 31 | def test_weakref_identity(): 32 | any_object = AnyObject() 33 | ref = weakref.ref(any_object) 34 | assert ref() == any_object 35 | assert ref() is any_object 36 | assert ref is not any_object 37 | assert ref != any_object 38 | --------------------------------------------------------------------------------