3 Commits

Author SHA1 Message Date
msramalho
de4d4689b9 Bump version to v0.4.1 for release 2022-09-27 14:49:17 +01:00
msramalho
484d3cb02c adds: tests for csv 2022-09-27 14:49:04 +01:00
msramalho
65366816fa updates readme with release info 2022-09-27 14:43:05 +01:00
5 changed files with 14 additions and 1 deletions

View File

@@ -162,3 +162,9 @@ It is assumed that you are using **Python3.9+**. It is encouraged to [setup a vi
```
We use [Black](https://github.com/psf/black) as our code formatter. If you don't want to use the `pre-commit` hook, you can run the formatter manually or via an editor plugin.
## Release
1. Update [version.py](geoclustering/version.py)
2. Run `scripts/release.sh`
3. Confirm GH action completed successfully

View File

@@ -89,6 +89,7 @@ class CSVEncoder:
self.state,
fieldnames=["cluster_id"] + list(cluster[0].keys()),
quoting=csv.QUOTE_NONNUMERIC,
lineterminator="\n",
)
self.writer.writeheader()

View File

@@ -2,7 +2,7 @@ _MAJOR = "0"
_MINOR = "4"
# On main and in a nightly release the patch should be one ahead of the last
# released build.
_PATCH = "0"
_PATCH = "1"
# This is mainly for nightly builds which have the suffix ".dev$DATE". See
# https://semver.org/#is-v123-a-semantic-version for the semantics.
_SUFFIX = ""

View File

@@ -27,3 +27,4 @@ def test_encoders():
assert res["string"] == read_fixture_content("snapshots/result.txt")
assert res["json"] == read_fixture_content("snapshots/result.json")
assert res["geojson"] == read_fixture_content("snapshots/result.geojson")
assert res["csv"] == read_fixture_content("snapshots/result.csv")

5
tests/fixtures/snapshots/result.csv vendored Normal file
View File

@@ -0,0 +1,5 @@
"cluster_id","id","name","lat","lon"
0,1,"Alice",52.523955,13.442362
0,2,"Bob",52.526659,13.448097
1,3,"Carol",52.525626,13.419246
1,4,"Dan",52.52443559865125,13.41261723049818
1 cluster_id id name lat lon
2 0 1 Alice 52.523955 13.442362
3 0 2 Bob 52.526659 13.448097
4 1 3 Carol 52.525626 13.419246
5 1 4 Dan 52.52443559865125 13.41261723049818