Skip to content

Commit

Permalink
fix CI
Browse files Browse the repository at this point in the history
  • Loading branch information
district10 committed Nov 29, 2023
1 parent 0371d44 commit 64c1622
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
echo "MACOS_DEPLOYMENT_TARGET=10.14" >> $GITHUB_ENV
- name: Build and install
run: pip install --verbose .[test]
run: pip install --verbose .[test] && make data_pull

- name: Test
run: python -m pytest
6 changes: 6 additions & 0 deletions src/bindings/pybind11_network.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,13 @@

#include "nano_fmm/network.hpp"
#include "nano_fmm/indexer.hpp"

#include "spdlog/spdlog.h"
// fix exposed macro 'GetObject' from wingdi.h (included by spdlog.h) under
// windows, see https://github.com/Tencent/rapidjson/issues/1448
#ifdef GetObject
#undef GetObject
#endif

namespace nano_fmm
{
Expand Down
31 changes: 16 additions & 15 deletions tests/test_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -673,29 +673,30 @@ def test_network_query_enu():

hits = network.query([5, 0, 0], radius=5)
hits = [h.to_rapidjson()() for h in hits]
assert hits == [
hit1 = {
"position": [5.0, 5.0, 0.0],
"direction": [1.0, 0.0, 0.0],
"distance": 5.0,
"road_id": 0,
"offset": 5.0,
}
hit2 = {
"position": [10.0, 0.0, 0.0],
"direction": [0.0, 1.0, 0.0],
"distance": 5.0,
"road_id": 2,
"offset": 5.0,
}
assert hits[0] == [
{
"position": [5.0, 0.0, 0.0],
"direction": [1.0, 0.0, 0.0],
"distance": 0.0,
"road_id": 1,
"offset": 5.0,
},
{
"position": [5.0, 5.0, 0.0],
"direction": [1.0, 0.0, 0.0],
"distance": 5.0,
"road_id": 0,
"offset": 5.0,
},
{
"position": [10.0, 0.0, 0.0],
"direction": [0.0, 1.0, 0.0],
"distance": 5.0,
"road_id": 2,
"offset": 5.0,
},
]
assert hits[1:] == [hit1, hit2] or hits[1:] == [hit2, hit1]


def pytest_main(dir: str, *, test_file: str):
Expand Down

0 comments on commit 64c1622

Please sign in to comment.