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

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/py-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
include:
- os: macos-latest
python-version: "3.11"
python-version: "3.12"
- os: windows-latest
python-version: "3.11"
python-version: "3.12"

env:
SDKROOT: /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
Expand Down
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -123,15 +123,15 @@ Tool names in the **whitebox** Python package can be called either using the sna
.. code:: python

import os
import pkg_resources
from importlib_resources import files
import whitebox

wbt = whitebox.WhiteboxTools()
print(wbt.version())
print(wbt.help())

# identify the sample data directory of the package
data_dir = os.path.dirname(pkg_resources.resource_filename("whitebox", 'testdata/'))
data_dir = str(files("whitebox").joinpath("testdata"))

wbt.set_working_dir(data_dir)
wbt.verbose = False
Expand Down
4 changes: 2 additions & 2 deletions docs/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ For example:
.. code:: python

import os
import pkg_resources
from importlib_resources import files
import whitebox

wbt = whitebox.WhiteboxTools()
print(wbt.version())
print(wbt.help())

# identify the sample data directory of the package
data_dir = os.path.dirname(pkg_resources.resource_filename("whitebox", 'testdata/'))
data_dir = str(files("whitebox").joinpath("testdata"))

wbt.set_working_dir(data_dir)
wbt.verbose = False
Expand Down
12 changes: 3 additions & 9 deletions examples/whitebox.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -249,13 +249,6 @@
"**Tool names in the whitebox Python package can be called either using the snake_case or CamelCase convention (e.g. lidar_info or LidarInfo). The example below uses snake_case.** "
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
Expand All @@ -264,10 +257,11 @@
},
"outputs": [],
"source": [
"import os, pkg_resources\n",
"import os\n",
"from importlib_resources import files\n",
"\n",
"# identify the sample data directory of the package\n",
"data_dir = os.path.dirname(pkg_resources.resource_filename(\"whitebox\", 'testdata/'))\n",
"data_dir = str(files(\"whitebox\").joinpath(\"testdata\"))\n",
"\n",
"# set whitebox working directory\n",
"wbt.set_working_dir(data_dir)\n",
Expand Down
5 changes: 3 additions & 2 deletions whitebox/download_wbt.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def download_wbt(linux_musl=False, reset=False, verbose=True):
import tarfile
import shutil
import urllib.request
import pkg_resources
import importlib.resources
import webbrowser

if os.environ.get("WBT_PATH", None) is not None:
Expand All @@ -25,8 +25,9 @@ def download_wbt(linux_musl=False, reset=False, verbose=True):
package_name = "whitebox"
# Get package directory
pkg_dir = os.path.dirname(
pkg_resources.resource_filename(package_name, "whitebox_tools.py")
importlib.resources.files(package_name) / "whitebox_tools.py"
)

exe_dir = os.path.join(
pkg_dir, "WBT"
) # Get directory of WhiteboxTools executable file
Expand Down
Loading