Skip to content

Commit 8d52a80

Browse files
committed
Add instructions for running through docker
1 parent 647f0ba commit 8d52a80

File tree

3 files changed

+17
-9
lines changed

3 files changed

+17
-9
lines changed

README.md

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,18 @@ This breaks the reliance on the need for the graph database to support s2 indexi
1515

1616
### Docker
1717

18-
Docker should be used to generate the s2 coverings, which can be done with
18+
Docker should be used to generate the s2 coverings, which can be done by running the following from the root folder.
1919

2020
```bash
21-
docker compose up -d
22-
docker exec -it s2 bash
23-
python3 src/s2.py --level <s2_level>
21+
git clone https://github.com/KnowWhereGraph/s2-coverings.git
22+
cd s2-coverings
23+
docker run -v ./:/s2 ghcr.io/knowwheregraph/s2-coverings:main python3 src/s2.py --level <level>
2424
```
2525

2626
Cell integration can be disabled by adding the `--ni` flag to the command,
2727

2828
```bash
29-
python3 src/s2.py --level <s2_level> --ni
29+
docker run -v ./:/s2 ghcr.io/knowwheregraph/s2-coverings:main python3 src/s2.py --level <level> --ni
3030
```
3131

3232
A complete list of options can be found by running
@@ -48,6 +48,18 @@ Due to the steps involved with installing the s2 libray bindings and different a
4848

4949
## Development
5050

51+
### Running Locally With Docker
52+
53+
During development, you'll need a way to run the local codebase with your changes. To do this run the following,
54+
55+
```bash
56+
docker compose up -d
57+
docker exec -it s2 bash
58+
python3 src/s2.py --level <s2_level>
59+
```
60+
61+
The source code in the container will stay up to date with the local filesystem, so there's no need to rebuild the image after each code change.
62+
5163
### Linting
5264

5365
This repository adheres to the Black tool's default settings. It also makes use of isort for import sorting. Run these before each pull request.

src/lib/geometric_feature.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,6 @@ def filling(
270270

271271

272272
def yield_geometric_features(path: Path) -> Generator[GeometricFeature, None, None]:
273-
print("====")
274273
if os.path.isfile(path):
275274
graph = Graph()
276275
with open(path, "r") as read_stream:

src/s2.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ def write_to_rdf(cell_id_int: int, out_path: str, rdf_format: str) -> None:
3131
graph = graphify(cell_id)
3232
if graph:
3333
for pfx in namespace_prefix:
34-
print(pfx)
3534
graph.bind(pfx, namespace_prefix[pfx])
3635
file_extensions = {
3736
"ttl": ".ttl",
@@ -176,7 +175,6 @@ def get_vertex_polygon(cell: S2Cell) -> Polygon:
176175
id_as_integer = (
177176
current_id.id()
178177
) # note that current_id is an instance of S2CellId
179-
print(id_as_integer)
180178
cell_id_integers.append(id_as_integer)
181179
current_id = current_id.next()
182180
if current_id == ending_id:
@@ -195,5 +193,4 @@ def get_vertex_polygon(cell: S2Cell) -> Polygon:
195193

196194
# Handle integration
197195
if not args.ni:
198-
print("ni not present")
199196
Integrator(args.compressed)

0 commit comments

Comments
 (0)