Skip to content

Commit 6b8bcf6

Browse files
authored
Merge pull request #466 from MiraGeoscience/release/0.8.0
GEOPY-1285 set version to 0.8.0
2 parents 5b4db1c + 000594b commit 6b8bcf6

File tree

206 files changed

+10229
-6504
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

206 files changed

+10229
-6504
lines changed

.github/workflows/issue_to_jira.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
# Additional fields in JSON format
2929
fields: '{"components": [{"name": "geoh5py"}]}'
3030
- name: Post JIRA link
31-
uses: peter-evans/create-or-update-comment@v2
31+
uses: peter-evans/create-or-update-comment@v3
3232
with:
3333
# The number of the issue or pull request in which to create a comment.
3434
issue-number: ${{ github.event.issue.number }}

.github/workflows/pytest-windows.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ jobs:
6565
- name: Install dependencies
6666
run: poetry install -vvv
6767
- name: pytest
68-
run: poetry run pytest --cov-report=xml
68+
run: poetry run pytest --cov --cov-report=xml
6969
- name: Codecov
7070
if: ${{ success() && matrix.python_ver == '3.10' }}
7171
uses: codecov/codecov-action@v3

.lift.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
ignoreFiles = """
2+
tests/
3+
docs/
4+
examples/
5+
devtools/
6+
"""

.pre-commit-config.yaml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ ci:
1010

1111
repos:
1212
- repo: https://github.com/psf/black
13-
rev: 23.3.0
13+
rev: 23.7.0
1414
hooks:
1515
- id: black
1616
types: [text]
@@ -22,27 +22,28 @@ repos:
2222
additional_dependencies: [tomli] # to read config from pyproject.toml
2323
types: [text]
2424
types_or: [python, pyi]
25+
exclude: geoh5py/objects/__init__\.py
2526
- repo: https://github.com/humitos/mirrors-autoflake
2627
rev: v1.1
2728
hooks:
2829
- id: autoflake
2930
types: [text]
3031
types_or: [python, pyi]
3132
- repo: https://github.com/PyCQA/flake8
32-
rev: 6.0.0
33+
rev: 6.1.0
3334
hooks:
3435
- id: flake8
3536
types: [text]
3637
types_or: [python, pyi]
3738
- repo: https://github.com/asottile/pyupgrade
38-
rev: v3.4.0
39+
rev: v3.10.1
3940
hooks:
4041
- id: pyupgrade
4142
args: [--py37-plus]
4243
types: [text]
4344
types_or: [python, pyi]
4445
- repo: https://github.com/pre-commit/mirrors-mypy
45-
rev: v1.3.0
46+
rev: v1.5.1
4647
hooks:
4748
- id: mypy
4849
additional_dependencies: [
@@ -51,6 +52,12 @@ repos:
5152
# 'numpy>=1.23.5,<1.24.0'
5253
]
5354
exclude: (geoh5py/interfaces/__init__\.py|geoh5py/handlers/__init__\.py|geoh5py/interfaces|geoh5py/handlers|tests)
55+
- repo: https://github.com/codingjoe/relint
56+
rev: 3.1.0
57+
hooks:
58+
- id: relint
59+
args: [-W] # to fail on warnings
60+
exclude: ^setup.py$
5461
- repo: local
5562
hooks:
5663
- id: pylint
@@ -69,7 +76,7 @@ repos:
6976
types_or: [python, pyi]
7077
exclude: ^(devtools/|docs/|setup.py)
7178
- repo: https://github.com/codespell-project/codespell
72-
rev: v2.2.4
79+
rev: v2.2.5
7380
hooks:
7481
- id: codespell
7582
exclude: (\.ipynb$|^\.github/workflows/issue_to_jira.yml$)

.readthedocs.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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+
9+
# Build documentation in the docs/ directory with Sphinx
10+
sphinx:
11+
configuration: docs/conf.py
12+
13+
conda:
14+
environment: docs/environment.yml
15+
16+
python:
17+
install:
18+
- method: pip
19+
path: .

.relint.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
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

README.rst

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,4 +150,13 @@ Third Party Software notices and/or additional terms and conditions are located
150150

151151
Copyright
152152
^^^^^^^^^
153-
Copyright (c) 2023 Mira Geoscience Ltd.
153+
Copyright (c) 2024 Mira Geoscience Ltd.
154+
155+
156+
Citing geoh5py
157+
^^^^^^^^^^^^^^
158+
159+
If you use **geoh5py** in your research, please cite it as follows:
160+
161+
.. image:: https://zenodo.org/badge/207860560.svg
162+
:target: https://zenodo.org/badge/latestdoi/207860560

devtools/publish.py

Lines changed: 0 additions & 29 deletions
This file was deleted.

docs/_ext/Add2Build.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
import os
22
import shutil
3+
from pathlib import Path
34

45

56
def copyImages():
67
# get relevant directories
7-
cwd = os.getcwd()
8-
contentdir = cwd + "/content"
9-
buildimagesdir = cwd + "/_build/html/_images"
8+
cwd = Path()
9+
contentdir = cwd / "content"
10+
buildimagesdir = cwd / "_build" / "html" / "_images"
1011

1112
# check if images directory exists
12-
if not os.path.isdir(buildimagesdir):
13-
os.mkdir(buildimagesdir)
13+
buildimagesdir.mkdir(exist_ok=True)
1414

1515
# images that have been copied
1616
imnames = os.listdir(buildimagesdir)
1717

1818
# search for images that have been missed
19-
for root, dirList, fileList in os.walk(contentdir):
19+
for root, dirList, fileList in os.walk(str(contentdir)):
2020
if root.endswith("images"):
2121
for filename in fileList:
2222
if filename not in imnames:
23-
shutil.copy(os.path.join(root, filename), buildimagesdir)
23+
shutil.copy(Path(root) / filename, buildimagesdir)
2424
return
2525

2626

docs/_ext/autodoc.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
import datetime
44
import json
5-
import os
5+
from pathlib import Path
66

7-
fName = os.path.realpath(__file__)
7+
fName = Path(__file__).resolve()
88
# info_list = ['title', 'date', 'author', 'url', 'pdf', 'jupyter']
99
pdf_root = "https://storage.googleapis.com/simpeg/eosc350lectures/"
1010
jupyter_root = "http://mybinder.org/repo/ubcgif/gpgLabs/notebooks/"
@@ -31,8 +31,8 @@ def make_lectures_page(fpath=None, fout=None):
3131
if fout is None:
3232
fout = lecture_path + "lectures.rst"
3333

34-
fpath = os.path.sep.join(fName.split(os.path.sep)[:-2] + [fpath])
35-
fout = os.path.sep.join(fName.split(os.path.sep)[:-2] + [fout])
34+
fpath = Path(fName).parents(2) / fpath
35+
fout = Path(fName).parents(2) / fout
3636

3737
fpath = open(fpath) # file to write to
3838
lectures = json.load(fpath) # lecture json
@@ -61,7 +61,7 @@ def make_lectures_page(fpath=None, fout=None):
6161
date = datetime.date(year=date[0], month=date[1], day=date[2])
6262

6363
if "pdf" in lecture.keys():
64-
pdf_name = lecture["pdf"].split(".")[0].split(os.path.sep)[-1]
64+
pdf_name = Path(lecture["pdf"]).stem
6565
if "_" in pdf_name:
6666
pdf_name = " ".join(pdf_name.split("_")[1:])
6767
lecture_slides = """

docs/_ext/edit_on_github.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
Loosely based on https://github.com/astropy/astropy/pull/347
66
"""
77

8-
import os
8+
from pathlib import Path
99
import warnings
1010

1111
__licence__ = "BSD (3 clause)"
@@ -37,9 +37,9 @@ def html_page_context(app, pagename, templatename, context, doctree):
3737
warnings.warn("edit_on_github_project not specified")
3838
return
3939

40-
path = os.path.relpath(doctree.get("source"), app.builder.srcdir)
41-
show_url = get_github_url(app, "blob", path)
42-
edit_url = get_github_url(app, "edit", path)
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))
4343

4444
# context['show_on_github_url'] = show_url
4545
context["edit_on_github_url"] = edit_url

docs/_ext/fetch_gae_sdk.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@
2222
"""
2323

2424
import json
25-
import os
2625
import sys
2726
import zipfile
27+
from pathlib import Path
2828

2929
import StringIO
3030
import urllib2
@@ -45,7 +45,7 @@ def get_gae_versions():
4545

4646

4747
def _version_tuple(v):
48-
version_string = os.path.splitext(v["name"])[0].rpartition("_")[2]
48+
version_string = Path(v["name"]).stem.rpartition("_")[2]
4949
return tuple(int(x) for x in version_string.split("."))
5050

5151

@@ -61,11 +61,10 @@ def main(argv):
6161
if len(argv) > 2:
6262
print("Usage: {} [<destination_dir>]".format(argv[0]))
6363
return 1
64-
dest_dir = argv[1] if len(argv) > 1 else "."
65-
if not os.path.exists(dest_dir):
66-
os.makedirs(dest_dir)
64+
dest_dir = Path(argv[1]) if len(argv) > 1 else Path()
65+
dest_dir.mkdir(exist_ok=True)
6766

68-
if os.path.exists(os.path.join(dest_dir, "google_appengine")):
67+
if (dest_dir / "google_appengine").exists():
6968
print(f"GAE SDK already installed at {dest_dir}, exiting.")
7069
return 0
7170

docs/conf.py

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@
1515
import os
1616
import sys
1717

18-
# import geoh5py
18+
from pathlib import Path
1919

20-
sys.path.append(os.path.abspath("./_ext"))
21-
sys.path.append(os.path.abspath(".."))
20+
sys.path.append(str(Path("_ext").resolve()))
21+
sys.path.append(str(Path().parent.resolve()))
2222

2323
# If extensions (or modules to document with autodoc) are in another directory,
2424
# add these directories to sys.path here. If the directory is relative to the
25-
# documentation root, use os.path.abspath to make it absolute, like shown here.
26-
# sys.path.insert(0, os.path.abspath('.'))
25+
# documentation root, use pathlib.Path.resolve to make it absolute, like shown here.
26+
# sys.path.insert(0, Path().resolve())
2727

2828
# -- General configuration ------------------------------------------------
2929

@@ -80,9 +80,9 @@
8080
project = "geoh5py"
8181

8282
# The short X.Y version.
83-
version = "0.7.1"
83+
version = "0.8.0"
8484
# The full version, including alpha/beta/rc tags.
85-
release = "0.7.1"
85+
release = "0.8.0"
8686

8787
# List of patterns, relative to source directory, that match files and
8888
# directories to ignore when looking for source files.
@@ -161,6 +161,11 @@
161161

162162
check_meta = False
163163

164+
html_theme_options = {
165+
"navigation_depth": 5,
166+
"collapse_navigation": False,
167+
}
168+
164169
# Add any paths that contain custom themes here, relative to this directory.
165170
# html_theme_path = []
166171

@@ -345,26 +350,28 @@ def clean_state():
345350
for root, dirList, fileList in os.walk(cwd):
346351
if "Workspace" not in root:
347352
for filename in fileList:
348-
if "ipynb" in filename:
349-
os.system("nbstripout " + os.path.join(root, filename))
350-
if ".geoh5" in filename:
351-
os.remove(os.path.join(root, filename))
353+
filepath = Path(root) / filename
354+
if filepath.suffix == ".ipynb":
355+
os.system("nbstripout " + str(filepath))
356+
if filepath.suffix == ".geoh5":
357+
filepath.unlink()
352358

353359

354360
clean_state()
355361
# # Build the API
356-
# dirname, filename = os.path.split(os.path.abspath(__file__))
362+
# dirpath = Path(__file__).parent.resolve()
357363
# subprocess.run(
358364
# [
359365
# "sphinx-autogen",
360366
# "-i",
361367
# "-t",
362-
# os.path.sep.join([dirname, "_templates"]),
368+
# str(dirpath / "_templates"),
363369
# "-o",
364-
# os.path.sep.join([dirname, "content/api/generated"]),
365-
# os.path.sep.join([dirname, "content/api/index.rst"]),
370+
# str(dirpath / "content" / "api" / "generated"),
371+
# str(dirpath / "content" / "api" / "index.rst"),
366372
# ]
367373
# )
368374

375+
369376
# TODO: build the source
370377
# sphinx-apidoc --templatedir templates/ -o content/api/ ../geoh5py

0 commit comments

Comments
 (0)