Skip to content

Commit

Permalink
Merge pull request #11 from MiraGeoscience/GEOPY-1130
Browse files Browse the repository at this point in the history
GEOPY-1130: Prepare release las-geoh5 v0.1.0
  • Loading branch information
sebhmg authored Nov 7, 2023
2 parents 0971e2a + da56e3c commit 2091e98
Show file tree
Hide file tree
Showing 25 changed files with 170 additions and 47 deletions.
21 changes: 21 additions & 0 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2023 Mira Geoscience

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
58 changes: 58 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
las-geoh5
=========

Import/Export LAS files to/from geoh5 format.

This package contains three modules for import/export of LAS files in
and out of a geoh5 file. the import/export directories modules allow
export and subsequent re-import of LAS files from a drillhole group
saved in a geoh5 file to a structured set of directories on disk. The
import files module is intended for the more general case of LAS file
import to an existing drillhole group.

Basic Usage
-----------
.. _Geoscience ANALYST Pro: https://mirageoscience.com/mining-industry-software/geoscience-analyst-pro/

The most convenient way to use this package is through `Geoscience ANALYST Pro`_
where the import files driver may be run from the **file -> import**
menu.

All drivers may also be run from a ui.json file in `Geoscience ANALYST Pro`_
by either adding to the Python Scripts directory or drag and drop into
the viewport. Defaulted ui.json files can be found in the uijson folder
of the las-geoh5 project.

Finally, the drivers can be run from CLI using the following

.. code:: bash
python -m las_geoh5.module.driver some_file.ui.json
Where module is one of ``import_files``, ``export_files``, or ``import_las``.

License
-------

MIT License

Copyright (c) 2023 Mira Geoscience

Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the
“Software”), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
14 changes: 11 additions & 3 deletions devtools/check-copyright.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@
#!/usr/bin/env python3

# Copyright (c) 2023 Mira Geoscience Ltd.
# Copyright (c) 2022-2023 Mira Geoscience Ltd.
#
# This file is part of Orano RnD project.
#
# All rights reserved.

from __future__ import annotations

import re
import sys
from datetime import date

if __name__ == "__main__":
current_year = date.today().year
copyright_re = re.compile(rf"\bcopyright \(c\) \b{current_year}\b", re.IGNORECASE)
copyright_re = re.compile(
rf"\bcopyright \(c\) (:?\d{{4}}-|)\b{current_year}\b", re.IGNORECASE
)
files = sys.argv[1:]
max_lines = 10
report_files = []
Expand All @@ -20,7 +26,9 @@
has_dated_copyright = False
for line in file:
count += 1
if count >= max_lines:
if count >= max_lines and not (
f.endswith("README.rst") or f.endswith("README-dev.rst")
):
break
if re.search(copyright_re, line):
has_dated_copyright = True
Expand Down
6 changes: 4 additions & 2 deletions las_geoh5/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@
#
# This file is part of las_geoh5 project.
#
# All rights reserved.
# las-geoh5 is distributed under the terms and conditions of the MIT License
# (see LICENSE file at the root of this source code package).
#

# flake8: noqa

__version__ = "0.0.1"
__version__ = "0.1.0"
5 changes: 3 additions & 2 deletions las_geoh5/export_directories/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Copyright (c) 2023 Mira Geoscience Ltd.
#
# This file is part of my_app project.
# This file is part of las-geoh5 project.
#
# All rights reserved.
# las-geoh5 is distributed under the terms and conditions of the MIT License
# (see LICENSE file at the root of this source code package).
#
5 changes: 3 additions & 2 deletions las_geoh5/export_directories/driver.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# Copyright (c) 2023 Mira Geoscience Ltd.
#
# This file is part of my_app project.
# This file is part of las-geoh5 project.
#
# All rights reserved.
# las-geoh5 is distributed under the terms and conditions of the MIT License
# (see LICENSE file at the root of this source code package).
#

from __future__ import annotations
Expand Down
5 changes: 3 additions & 2 deletions las_geoh5/export_directories/uijson.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# Copyright (c) 2023 Mira Geoscience Ltd.
#
# This file is part of my_app project.
# This file is part of las-geoh5 project.
#
# All rights reserved.
# las-geoh5 is distributed under the terms and conditions of the MIT License
# (see LICENSE file at the root of this source code package).
#


Expand Down
3 changes: 2 additions & 1 deletion las_geoh5/export_las.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
#
# This file is part of las-geoh5 project.
#
# All rights reserved.
# las-geoh5 is distributed under the terms and conditions of the MIT License
# (see LICENSE file at the root of this source code package).
#

from __future__ import annotations
Expand Down
5 changes: 3 additions & 2 deletions las_geoh5/import_directories/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Copyright (c) 2023 Mira Geoscience Ltd.
#
# This file is part of my_app project.
# This file is part of las-geoh5 project.
#
# All rights reserved.
# las-geoh5 is distributed under the terms and conditions of the MIT License
# (see LICENSE file at the root of this source code package).
#
5 changes: 3 additions & 2 deletions las_geoh5/import_directories/driver.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# Copyright (c) 2023 Mira Geoscience Ltd.
#
# This file is part of my_app project.
# This file is part of las-geoh5 project.
#
# All rights reserved.
# las-geoh5 is distributed under the terms and conditions of the MIT License
# (see LICENSE file at the root of this source code package).
#

from __future__ import annotations
Expand Down
5 changes: 3 additions & 2 deletions las_geoh5/import_directories/uijson.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# Copyright (c) 2023 Mira Geoscience Ltd.
#
# This file is part of my_app project.
# This file is part of las-geoh5 project.
#
# All rights reserved.
# las-geoh5 is distributed under the terms and conditions of the MIT License
# (see LICENSE file at the root of this source code package).
#

from copy import deepcopy
Expand Down
5 changes: 3 additions & 2 deletions las_geoh5/import_files/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Copyright (c) 2023 Mira Geoscience Ltd.
#
# This file is part of my_app project.
# This file is part of las-geoh5 project.
#
# All rights reserved.
# las-geoh5 is distributed under the terms and conditions of the MIT License
# (see LICENSE file at the root of this source code package).
#
5 changes: 3 additions & 2 deletions las_geoh5/import_files/driver.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# Copyright (c) 2023 Mira Geoscience Ltd.
#
# This file is part of my_app project.
# This file is part of las-geoh5 project.
#
# All rights reserved.
# las-geoh5 is distributed under the terms and conditions of the MIT License
# (see LICENSE file at the root of this source code package).
#

from __future__ import annotations
Expand Down
5 changes: 3 additions & 2 deletions las_geoh5/import_files/uijson.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# Copyright (c) 2023 Mira Geoscience Ltd.
#
# This file is part of my_app project.
# This file is part of las-geoh5 project.
#
# All rights reserved.
# las-geoh5 is distributed under the terms and conditions of the MIT License
# (see LICENSE file at the root of this source code package).
#

from copy import deepcopy
Expand Down
6 changes: 4 additions & 2 deletions las_geoh5/import_las.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@
#
# This file is part of las-geoh5 project.
#
# All rights reserved.
# las-geoh5 is distributed under the terms and conditions of the MIT License
# (see LICENSE file at the root of this source code package).
#

from __future__ import annotations

import warnings
Expand Down Expand Up @@ -362,7 +364,7 @@ def las_to_drillhole( # pylint: disable=too-many-arguments
if translator is None:
translator = LASTranslator()

for datum in tqdm(data):
for datum in data:
collar = get_collar(datum, translator)
if all(k == 0 for k in collar) and skip_empty_header:
continue
Expand Down
2 changes: 1 addition & 1 deletion las_geoh5/uijson/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Copyright (c) 2023 Mira Geoscience Ltd.
#
# This file is part of my_app project.
# This file is part of las-geoh5 project.
#
# All rights reserved.
#
2 changes: 1 addition & 1 deletion las_geoh5/uijson/write_uijson.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Copyright (c) 2023 Mira Geoscience Ltd.
#
# This file is part of my_app project.
# This file is part of las-geoh5 project.
#
# All rights reserved.
#
Expand Down
13 changes: 5 additions & 8 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 20 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,16 +1,32 @@
[tool.poetry]
name = "las-geoh5"
version = "0.0.1"
version = "0.1.0"
description = "Las/Geoh5 conversion"
license = "MIT"
readme = "README.rst"
homepage = "https://mirageoscience.com"
authors = ["Mira Geoscience <[email protected]>"]
keywords = ["geology", "geophysics", "earth sciences", "io", "data", "interoperability"]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Science/Research",
"Programming Language :: Python",
"Topic :: Scientific/Engineering",
"Topic :: Scientific/Engineering :: Mathematics",
"Topic :: Scientific/Engineering :: Physics",
"Operating System :: Microsoft :: Windows",
"Operating System :: POSIX",
"Operating System :: Unix",
"Operating System :: MacOS",
"Natural Language :: English",
]

[tool.poetry.dependencies]
python = "^3.9, <3.11"

## dependencies on github repos
geoh5py = { url = "https://github.com/MiraGeoscience/geoh5py/archive/refs/heads/release/0.8.0.zip#sha256=" }
#geoh5py = {version ="~0.8.0rc1", source = "pypi", allow-prereleases = true}

#geoh5py = { url = "https://github.com/MiraGeoscience/geoh5py/archive/refs/heads/release/0.8.0.zip#sha256=" }
geoh5py = {version ="~0.8.0rc3", allow-prereleases = true}

## pip dependencies
lasio = "~0.31"
Expand Down
4 changes: 3 additions & 1 deletion tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@
#
# This file is part of las_geoh5 project.
#
# All rights reserved.
# las-geoh5 is distributed under the terms and conditions of the MIT License
# (see LICENSE file at the root of this source code package).
#
4 changes: 3 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
#
# This file is part of las_geoh5 project.
#
# All rights reserved.
# las-geoh5 is distributed under the terms and conditions of the MIT License
# (see LICENSE file at the root of this source code package).
#

from __future__ import annotations

Expand Down
3 changes: 2 additions & 1 deletion tests/geoh5_to_las_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
#
# This file is part of las-geoh5 project.
#
# All rights reserved.
# las-geoh5 is distributed under the terms and conditions of the MIT License
# (see LICENSE file at the root of this source code package).
#

import random
Expand Down
5 changes: 3 additions & 2 deletions tests/import_las_test.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# Copyright (c) 2023 Mira Geoscience Ltd.
#
# This file is part of my_app project.
# This file is part of las-geoh5 project.
#
# All rights reserved.
# las-geoh5 is distributed under the terms and conditions of the MIT License
# (see LICENSE file at the root of this source code package).
#

from __future__ import annotations
Expand Down
Loading

0 comments on commit 2091e98

Please sign in to comment.