Skip to content

Commit 687bed2

Browse files
authored
Merge pull request #30 from bedrock-engineer/test-kaitak-hk-notebook-bed-26
Test kaitak hk notebook and set up automated testing with GitHub actions
2 parents 5469e5b + 85ed1eb commit 687bed2

File tree

20 files changed

+2410
-2285
lines changed

20 files changed

+2410
-2285
lines changed

.github/workflows/python-tests.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Run Python tests
2+
3+
on:
4+
push:
5+
branches: [ main, dev ]
6+
pull_request:
7+
branches: [ main, dev ]
8+
9+
jobs:
10+
test:
11+
runs-on: ${{ matrix.os }}
12+
strategy:
13+
matrix:
14+
os: [ubuntu-latest, windows-latest]
15+
python-version: ['3.9']
16+
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@v4
20+
21+
- name: Install uv
22+
uses: astral-sh/setup-uv@v5
23+
24+
- name: Set up Python
25+
uses: actions/setup-python@v5
26+
with:
27+
python-version: ${{ matrix.python-version }}
28+
29+
- name: Install bedrock-ge with testing dependencies
30+
run: uv sync --locked --group tests
31+
32+
- name: Run tests
33+
run: uv run pytest tests

.python-version

Lines changed: 0 additions & 1 deletion
This file was deleted.

.vscode/settings.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"python.testing.pytestArgs": [
3+
"tests"
4+
],
5+
"python.testing.unittestEnabled": false,
6+
"python.testing.pytestEnabled": true
7+
}

RELEASE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ Update the version number in:
1212

1313
- [`pyproject.toml`](pyproject.toml)
1414
- [`/src/bedrock/__init__.py`](/src/bedrock/__init__.py)
15+
- Inline script dependencies of marimo notebooks in [`examples`](/examples/)
1516

1617
## 2. Update the Changelog
1718

examples/hk_kaitak_ags3/hk_kaitak_ags3_to_brgi_geodb.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# /// script
22
# requires-python = ">=3.12"
33
# dependencies = [
4-
# "bedrock-ge==0.2.2",
4+
# "bedrock-ge==0.2.3",
55
# "chardet==5.2.0",
66
# "folium==0.19.5",
77
# "geopandas==1.0.1",
@@ -167,7 +167,7 @@ def _(mo):
167167
168168
### From GI dataframe to `geopandas.GeoDataFrame`
169169
170-
In order to construct the 3D simple feature GIS geometry of the `Location`s, `Sample`s and `InSitu_TEST`s, a few more columns have to be calcualated for each of these tables: `elevation_at_top` and `elevation_at_base` if the in-situ test or sample was taken over a depth interval.
170+
In order to construct the 3D simple feature GIS geometry of the `Location`s, `Sample`s and `InSitu_TEST`s, a few more columns have to be calculated for each of these tables: `elevation_at_top` and `elevation_at_base` if the in-situ test or sample was taken over a depth interval.
171171
172172
The 3D simple feature GIS geometry as [WKT](https://en.wikipedia.org/wiki/Well-known_text_representation_of_geometry) for point tests and samples:
173173
`POINT (easting northing elevation_at_top)`
@@ -341,7 +341,7 @@ def _(mo):
341341
342342
<iframe title="Speckle" src="https://app.speckle.systems/projects/013aaf06e7/models/1cbe68ed69,44c8d1ecae,9535541c2b,a739490298,ff81bfa02b#embed=%7B%22isEnabled%22%3Atrue%7D" width="100%" height="400" frameborder="0"></iframe>
343343
344-
Additionally, you can load the GI data in other software that Speckle has a connector for, such as Rhino / Grasshopper to enable parameteric geotechnical engineering workflows.
344+
Additionally, you can load the GI data in other software that Speckle has a connector for, such as Rhino / Grasshopper to enable parametric geotechnical engineering workflows.
345345
"""
346346
)
347347
return
@@ -410,7 +410,7 @@ def zip_of_ags3s_to_bedrock_gi_database(zip, crs):
410410
)
411411
check_no_gis_brgi_database(brgi_db_from_1_ags3_file)
412412
print(
413-
f"\nSuccesfully converted {file_name} to Bedrock GI database and validated!\n"
413+
f"\nSuccessfully converted {file_name} to Bedrock GI database and validated!\n"
414414
)
415415
print(
416416
f"🧵 Concatenating Bedrock GI database for {file_name} to existing Bedrock GI database...\n"
-2.24 MB
Binary file not shown.

pyproject.toml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,9 @@ Source = "https://github.com/bedrock-engineer/bedrock-ge"
6969
Documentation = "https://bedrock.engineer/docs/"
7070
Tracker = "https://github.com/bedrock-engineer/bedrock-ge/issues"
7171

72-
[build-system]
73-
requires = ["hatchling"]
74-
build-backend = "hatchling.build"
7572

76-
[tool.uv]
77-
dev-dependencies = [
73+
[project.optional-dependencies]
74+
dev = [
7875
"duckdb>=1.2.2",
7976
"folium>=0.17.0",
8077
"frictionless[excel]>=4.40.8",
@@ -85,11 +82,18 @@ dev-dependencies = [
8582
"mypy>=1.11.2",
8683
"nbconvert>=7.16.6",
8784
"pandas-stubs>=2.2.2.240807",
88-
"pytest>=8.3.3",
8985
"ruff>=0.6.7",
9086
"sqlglot>=26.12.1",
9187
]
9288

89+
tests = [
90+
"pytest>=8.3.3",
91+
]
92+
93+
[build-system]
94+
requires = ["hatchling"]
95+
build-backend = "hatchling.build"
96+
9397
[tool.ruff]
9498
line-length = 88
9599

src/bedrock_ge/plot.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
def hello_plt() -> None:
2-
print("Hello from src/bedrock/plot.py!")
2+
print(
3+
"Hi Bedrock engineer! bedrock_ge.plot is a placeholder module for Geotechnical Engineering plots."
4+
)

tests/__init__.py

Whitespace-only changes.

tests/test_bedrock_ge/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)