Skip to content

Commit bd0ecdb

Browse files
committed
Merge branch 'dev' into gef-example
2 parents a4041f4 + 89fafb1 commit bd0ecdb

Some content is hidden

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

42 files changed

+35562
-12671
lines changed

.github/workflows/python-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
strategy:
1313
matrix:
1414
os: [ubuntu-latest, windows-latest]
15-
python-version: ['3.9']
15+
python-version: ['3.10', '3.12']
1616

1717
steps:
1818
- name: Checkout code

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ __marimo__/
66
**/log
77
**/tmp
88
**/temp
9+
examples/**/raw/
10+
examples/**/cleaned/
911

1012
# SQLite Databases
1113
*.sqlite

.python-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.10

RELEASE.md

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,19 @@ Update the version number in:
1414
- [`/src/bedrock/__init__.py`](/src/bedrock_ge/__init__.py)
1515
- Inline script dependencies of marimo notebooks in [`examples`](/examples/)
1616

17-
## 2. Update the Changelog
17+
## 2. Update `uv.lock`
1818

19-
Update `CHANGELOG.md` with details about the new release. Include any new features, bug fixes, or breaking changes.
19+
The version of `bedrock-ge` in the `uv.lock` file needs to be updated such that tests can run properly. Therefore run:
2020

21-
## 3. Run Tests
21+
```bash
22+
uv sync --all-groups --upgrade
23+
```
24+
25+
## 3. PR `dev``main`
2226

23-
Ensure that all tests pass by running your test suite.
27+
Open a pull request (PR) from `dev` to `main`.
2428

25-
To automate this, it's possible to set up a CI (Continuous Integration) pipeline to confirm everything works in multiple environments, e.g. with `GitHub Actions`.
29+
This also runs the automated tests.
2630

2731
## 4. Commit the Changes
2832

@@ -33,15 +37,11 @@ git add .
3337
git commit -m "Release version X.Y.Z"
3438
```
3539

36-
## 5. Prepare for Merge
37-
38-
Open a pull request (PR) from `dev` to `main`.
39-
40-
## 6. Merge `dev` into `main`
40+
## 5. Merge `dev` into `main`
4141

4242
Once everything is ready, and the PR is approved, merge `dev` into `main`. This officially brings all the changes in `dev` into the release-ready `main` branch.
4343

44-
## 7. Tag the Release
44+
## 6. Tag the Release
4545

4646
Create a Git tag for the new version:
4747

@@ -51,14 +51,20 @@ git tag X.Y.Z
5151
git push origin X.Y.Z
5252
```
5353

54-
## 8. Build the Distribution
54+
## 7. Build the Distribution
5555

5656
Create source and wheel distributions:
5757

5858
```bash
5959
uv build
6060
```
6161

62+
This creates a `bedrock_ge-X.Y.Z.tar.gz` file (source) and a `bedrock_ge-X.Y.Z-py3-none-any.whl` file (wheel) in the `/dist` folder.
63+
64+
## 8. Remove the old distribution
65+
66+
In order for the `uv publish` command to work properly, only one version of the distriution can be inside the `/dist` folder. Therefore delete the old source and wheel files.
67+
6268
## 9. Publish to PyPI
6369

6470
1. Set the `UV_PUBLISH_TOKEN` environment variable. Copy from `.env`.
@@ -69,10 +75,6 @@ set UV_PUBLISH_TOKEN=pypi-blablabla
6975
uv publish
7076
```
7177

72-
> ⚠️ **Attention:**
73-
>
74-
> You might have to delete previous distributions of the Python package in `dist/*`
75-
7678
## 10. Verify the Release
7779

7880
Check that the new version is available on PyPI:

examples/hk_kaitak_ags3/hk_kaitak_ags3_to_brgi_geodb.ipynb

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

examples/hk_kaitak_ags3/hk_kaitak_ags3_to_brgi_geodb.py

Lines changed: 666 additions & 296 deletions
Large diffs are not rendered by default.
-2 Bytes
Binary file not shown.
19.7 MB
Binary file not shown.

examples/uk_silvertown_tunnel_ags4/20110770-2021-02-16_1308-Final-6.ags

Lines changed: 17797 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
# /// script
2+
# requires-python = ">=3.12"
3+
# dependencies = [
4+
# "geopandas==1.1.0",
5+
# "mapclassify==2.9.0",
6+
# "marimo",
7+
# "matplotlib==3.10.3",
8+
# "pyarrow==20.0.0",
9+
# "python-ags4==1.1.0",
10+
# "requests==2.32.4",
11+
# ]
12+
# ///
13+
14+
import marimo
15+
16+
__generated_with = "0.14.7"
17+
app = marimo.App(width="medium")
18+
19+
20+
@app.cell(hide_code=True)
21+
def _():
22+
import io
23+
import platform
24+
import sys
25+
26+
import geopandas as gpd
27+
import marimo as mo
28+
from python_ags4 import AGS4
29+
30+
platform_system = platform.system()
31+
print(platform_system)
32+
print(sys.version)
33+
# print(sys.executable)
34+
return AGS4, gpd, io, mo, platform_system
35+
36+
37+
@app.cell(hide_code=True)
38+
def _(mo):
39+
mo.md(
40+
r"""
41+
# AGS 4 data for the Silvertown Tunnel, London, UK
42+
43+
The Silvertown Tunnel is a road tunnel, opened on 7 April 2025, beneath the River Thames in east London, England. The 1.4 km (0.87-mile) twin-bore tunnel runs between west Silvertown, east of the River Lea estuary, on the north side of the Thames and a portal adjacent to the existing Blackwall Tunnel on the Greenwich Peninsula south of the river. ([Source](https://en.wikipedia.org/wiki/Silvertown_Tunnel))
44+
45+
The Ground Investigation (GI) data and derived ground model that were used for the design of the Siltertown bored tunnels have been published online.
46+
47+
The GI data for the Silvertown tunnel can be found on the British Geological Survey's ([BGS](https://www.bgs.ac.uk/)) [Deposited data search page](https://webapps.bgs.ac.uk/services/ngdc/accessions/index.html):
48+
[**Title**: Preliminary GI for Silvertown Tunnel
49+
**Description**: 77 exploratory holes carried out for the design of the Silvertown Tunnel, London](https://webapps.bgs.ac.uk/services/ngdc/accessions/index.html?simpleText=silvertown#item162465)
50+
For convenience, the AGS 4 file has also been uploaded to GitHub such that you can have a quick look what this AGS 4 data [looks like 🔎](https://raw.githubusercontent.com/bedrock-engineer/bedrock-ge/refs/heads/main/examples/uk_silvertown_tunnel_ags4/20110770-2021-02-16_1308-Final-6.ags).
51+
52+
The ground model has been published as an [AGSi Ground Model](https://www.ags.org.uk/data-format/agsi-ground-model/) by the Association of Geotechnical & Geoenvironmental Specialists ([AGS](https://www.ags.org.uk/)):
53+
[AGSi Guidance / Example files](https://ags-data-format-wg.gitlab.io/agsi/AGSi_Documentation/Example_Silvertown)
54+
"""
55+
)
56+
return
57+
58+
59+
@app.cell
60+
async def _(io, platform_system):
61+
bgs_url = "https://webservices.bgs.ac.uk/accessions/download/162465?fileName=20110770%20-%202021-02-16%201308%20-%20Final%20-%206.ags"
62+
# When running this marimo notebook in WebAssembly (WASM, a.k.a. Emscripten), use pyodide to request the data
63+
if platform_system == "Emscripten":
64+
from pyodide.http import pyfetch
65+
response = await pyfetch(bgs_url)
66+
ags = io.BytesIO(await response.bytes())
67+
else:
68+
import requests
69+
ags = io.BytesIO(requests.get(bgs_url).content)
70+
return (ags,)
71+
72+
73+
@app.cell
74+
def _(AGS4, ags):
75+
ags_tables, headings = AGS4.AGS4_to_dataframe(ags)
76+
for group, data in ags_tables.items():
77+
ags_tables[group] = (
78+
AGS4.convert_to_numeric(data).drop(columns=["HEADING"])
79+
# .convert_to_numeric already removes the UNIT and TYPE rows.
80+
# .loc[2:]
81+
# .reset_index(drop=True)
82+
)
83+
84+
ags_tables
85+
return (ags_tables,)
86+
87+
88+
@app.cell
89+
def _(ags_tables, gpd):
90+
ags_tables["LOCA"] = gpd.GeoDataFrame(
91+
ags_tables["LOCA"],
92+
geometry=gpd.points_from_xy(
93+
ags_tables["LOCA"]["LOCA_NATE"], ags_tables["LOCA"]["LOCA_NATN"]
94+
),
95+
crs="EPSG:27700",
96+
)
97+
return
98+
99+
100+
@app.cell
101+
def _(ags_tables):
102+
ags_tables["LOCA"].explore()
103+
return
104+
105+
106+
if __name__ == "__main__":
107+
app.run()

0 commit comments

Comments
 (0)