Skip to content

Conversation

@sujata-m
Copy link
Contributor

@sujata-m sujata-m commented Sep 8, 2025

Dev Board Ticket

https://dev.azure.com/TDEI-UW/TDEI/_workitems/edit/2304

Changes

  • Derive climb direction from numeric incline when climb is missing
  • Keep existing incline and climb tags untouched when both are present
  • Adjust unit and integration tests to cover incline preservation and climb inference
  • Updated ChangeLog

Testing

  • Added 10 unit test cases
  • Test Results
> python -m coverage run --source=src -m unittest discover tests/unit_tests 
.........................................Creating networks from region extracts...
Traceback (most recent call last):
  File "/Users/anuj/Work/Gaussian/TDEI-python-lib-osw-formatter/src/osm_osw_reformatter/osm2osw/osm2osw.py", line 22, in convert
    osm_graph_results = await asyncio.gather(*tasks)
  File "/Users/anuj/Work/Gaussian/TDEI-python-lib-osw-formatter/src/osm_osw_reformatter/helpers/osw/__init__.py", line 97, in get_osm_graph
    OG = await loop.run_in_executor(
  File "/opt/homebrew/Cellar/[email protected]/3.10.17_1/Frameworks/Python.framework/Versions/3.10/lib/python3.10/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/Users/anuj/Work/Gaussian/TDEI-python-lib-osw-formatter/src/osm_osw_reformatter/serializer/osm/osm_graph.py", line 342, in from_osm_file
    way_parser.apply_file(osm_file, locations=True)
RuntimeError: Open failed for 'test.pbf': No such file or directory
Open failed for 'test.pbf': No such file or directory
.Creating networks from region extracts...
Created OSW files!
....Creating networks from region extracts...
Created OSW files!
.Creating networks from region extracts...
Traceback (most recent call last):
  File "/Users/anuj/Work/Gaussian/TDEI-python-lib-osw-formatter/src/osm_osw_reformatter/osm2osw/osm2osw.py", line 22, in convert
    osm_graph_results = await asyncio.gather(*tasks)
  File "/Users/anuj/Work/Gaussian/TDEI-python-lib-osw-formatter/src/osm_osw_reformatter/helpers/osw/__init__.py", line 97, in get_osm_graph
    OG = await loop.run_in_executor(
  File "/opt/homebrew/Cellar/[email protected]/3.10.17_1/Frameworks/Python.framework/Versions/3.10/lib/python3.10/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/Users/anuj/Work/Gaussian/TDEI-python-lib-osw-formatter/src/osm_osw_reformatter/serializer/osm/osm_graph.py", line 342, in from_osm_file
    way_parser.apply_file(osm_file, locations=True)
RuntimeError: Open failed for 'test.pbf': No such file or directory
Open failed for 'test.pbf': No such file or directory
.Creating networks from region extracts...
Created OSW files!
.Creating networks from region extracts...
Created OSW files!
.Creating networks from region extracts...
Created OSW files!
.Creating networks from region extracts...
Created OSW files!
.Creating networks from region extracts...
Created OSW files!
.Creating networks from region extracts...
Created OSW files!
.Creating networks from region extracts...
Created OSW files!
.Creating networks from region extracts...
Created OSW files!
.Creating networks from region extracts...
Created OSW files!
.Error during conversion: [Errno 2] No such file or directory: 'test.zip'
.Warning 1: DeprecationWarning: 'Memory' driver is deprecated since GDAL 3.11. Use 'MEM' onwards. Further messages of this type will be suppressed.
......../Users/anuj/Work/Gaussian/TDEI-python-lib-osw-formatter/output/test_roundtrip.graph.osm.xml
Creating networks from region extracts...
Created OSW files!
Executing <Task pending name='Task-164' coro=<IsolatedAsyncioTestCase._asyncioLoopRunner() running at /opt/homebrew/Cellar/[email protected]/3.10.17_1/Frameworks/Python.framework/Versions/3.10/lib/python3.10/unittest/async_case.py:95> wait_for=<Future pending cb=[Task.task_wakeup()] created at /opt/homebrew/Cellar/[email protected]/3.10.17_1/Frameworks/Python.framework/Versions/3.10/lib/python3.10/asyncio/base_events.py:429> created at /opt/homebrew/Cellar/[email protected]/3.10.17_1/Frameworks/Python.framework/Versions/3.10/lib/python3.10/unittest/async_case.py:117> took 0.104 seconds
.Creating networks from region extracts...
Created OSW files!
................................................................
----------------------------------------------------------------------
Ran 131 tests in 25.426s

OK

sujata-m and others added 4 commits September 4, 2025 12:51
…rsion

## Dev Board Ticket
https://dev.azure.com/TDEI-UW/TDEI/_workitems/edit/2304

## Changes
- Derive climb direction from numeric incline when climb is missing
- Keep existing incline and climb tags untouched when both are present
- Adjust unit and integration tests to cover incline preservation and climb inference
- Updated ChangeLog

## Testing
- Added unit test cases
- Test Results
```bash
> python -m coverage run --source=src -m unittest discover tests/unit_tests
.........................................Creating networks from region extracts...
Traceback (most recent call last):
  File "/Users/anuj/Work/Gaussian/TDEI-python-lib-osw-formatter/src/osm_osw_reformatter/osm2osw/osm2osw.py", line 22, in convert
    osm_graph_results = await asyncio.gather(*tasks)
  File "/Users/anuj/Work/Gaussian/TDEI-python-lib-osw-formatter/src/osm_osw_reformatter/helpers/osw/__init__.py", line 97, in get_osm_graph
    OG = await loop.run_in_executor(
  File "/opt/homebrew/Cellar/[email protected]/3.10.17_1/Frameworks/Python.framework/Versions/3.10/lib/python3.10/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/Users/anuj/Work/Gaussian/TDEI-python-lib-osw-formatter/src/osm_osw_reformatter/serializer/osm/osm_graph.py", line 342, in from_osm_file
    way_parser.apply_file(osm_file, locations=True)
RuntimeError: Open failed for 'test.pbf': No such file or directory
Open failed for 'test.pbf': No such file or directory
.Creating networks from region extracts...
Created OSW files!
....Creating networks from region extracts...
Created OSW files!
.Creating networks from region extracts...
Traceback (most recent call last):
  File "/Users/anuj/Work/Gaussian/TDEI-python-lib-osw-formatter/src/osm_osw_reformatter/osm2osw/osm2osw.py", line 22, in convert
    osm_graph_results = await asyncio.gather(*tasks)
  File "/Users/anuj/Work/Gaussian/TDEI-python-lib-osw-formatter/src/osm_osw_reformatter/helpers/osw/__init__.py", line 97, in get_osm_graph
    OG = await loop.run_in_executor(
  File "/opt/homebrew/Cellar/[email protected]/3.10.17_1/Frameworks/Python.framework/Versions/3.10/lib/python3.10/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/Users/anuj/Work/Gaussian/TDEI-python-lib-osw-formatter/src/osm_osw_reformatter/serializer/osm/osm_graph.py", line 342, in from_osm_file
    way_parser.apply_file(osm_file, locations=True)
RuntimeError: Open failed for 'test.pbf': No such file or directory
Open failed for 'test.pbf': No such file or directory
.Creating networks from region extracts...
Created OSW files!
.Creating networks from region extracts...
Created OSW files!
.Creating networks from region extracts...
Created OSW files!
.Creating networks from region extracts...
Created OSW files!
.Creating networks from region extracts...
Created OSW files!
.Creating networks from region extracts...
Created OSW files!
.Creating networks from region extracts...
Created OSW files!
.Creating networks from region extracts...
Created OSW files!
.Creating networks from region extracts...
Created OSW files!
.Error during conversion: [Errno 2] No such file or directory: 'test.zip'
.Warning 1: DeprecationWarning: 'Memory' driver is deprecated since GDAL 3.11. Use 'MEM' onwards. Further messages of this type will be suppressed.
......../Users/anuj/Work/Gaussian/TDEI-python-lib-osw-formatter/output/test_roundtrip.graph.osm.xml
Creating networks from region extracts...
Created OSW files!
Executing <Task pending name='Task-164' coro=<IsolatedAsyncioTestCase._asyncioLoopRunner() running at /opt/homebrew/Cellar/[email protected]/3.10.17_1/Frameworks/Python.framework/Versions/3.10/lib/python3.10/unittest/async_case.py:95> wait_for=<Future pending cb=[Task.task_wakeup()] created at /opt/homebrew/Cellar/[email protected]/3.10.17_1/Frameworks/Python.framework/Versions/3.10/lib/python3.10/asyncio/base_events.py:429> created at /opt/homebrew/Cellar/[email protected]/3.10.17_1/Frameworks/Python.framework/Versions/3.10/lib/python3.10/unittest/async_case.py:117> took 0.104 seconds
.Creating networks from region extracts...
Created OSW files!
................................................................
----------------------------------------------------------------------
Ran 131 tests in 25.426s

OK
```
[Issue-2304] Preserve incline and infer climb during OSW to OSM conversion
@sujata-m sujata-m merged commit ad716fe into main Sep 8, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants