Skip to content

Commit

Permalink
feat: improve ways grouping (#19)
Browse files Browse the repository at this point in the history
* feat: improve ways grouping

* feat: add additional grouping step to avoid double join

* chore: modify rows_per_bucket with another memory tier

* chore: modify grouping operations

* feat: add speed column to rich progress

* chore: modify ways grouping operations

* chore: apply refurb suggestion

* fix: change speed display logic

* refactor: remove nodes_required_ids

* chore: change numeration of steps

* chore: disable refurb check for one line

* lint: change multiline strings

* chore: added changelog entry

* chore: remove overpass cache from github actions
  • Loading branch information
RaczeQ authored Jan 6, 2024
1 parent f990092 commit e9c2006
Show file tree
Hide file tree
Showing 6 changed files with 116 additions and 127 deletions.
5 changes: 0 additions & 5 deletions .github/workflows/_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,6 @@ jobs:
cache-dependency-path: "**/pdm.lock"
- name: Install dependencies
run: pdm install -d -G test --skip=post_install
- name: Cache Overpass data
uses: actions/cache@v3
with:
path: cache
key: overpass-cache-${{ matrix.os }}-${{ matrix.python-version }}
- name: Cache tox runner
uses: actions/cache@v3
with:
Expand Down
5 changes: 0 additions & 5 deletions .github/workflows/ci-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,6 @@ jobs:
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
- name: Cache Overpass data
uses: actions/cache@v3
with:
path: "**/cache"
key: mkdocs-overpass-dev-cache-${{ runner.os }}
- name: Execute jupyter notebooks
run: |
jupyter nbconvert --to notebook --inplace --execute $(find examples/ -type f -name "*.ipynb") --ExecutePreprocessor.kernel_name='python3'
Expand Down
5 changes: 0 additions & 5 deletions .github/workflows/ci-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,6 @@ jobs:
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
- name: Cache Overpass data
uses: actions/cache@v3
with:
path: "**/cache"
key: mkdocs-overpass-dev-cache-${{ runner.os }}
- name: Execute jupyter notebooks
run: |
jupyter nbconvert --to notebook --inplace --execute $(find examples/ -type f -name "*.ipynb") --ExecutePreprocessor.kernel_name='python3'
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Added

- Speed column for Rich progress bar

### Changed

- Simplified ways grouping logic by removing some steps

## [0.3.0] - 2024-01-02

### Added
Expand Down
19 changes: 17 additions & 2 deletions quackosm/_rich_progress.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@

__all__ = ["TaskProgressSpinner", "TaskProgressBar"]

TOTAL_STEPS = 36
TOTAL_STEPS = 33


class TaskProgressSpinner:
def __init__(self, step_name: str, step_number: str):
Expand Down Expand Up @@ -51,12 +52,24 @@ def __enter__(self):
BarColumn,
MofNCompleteColumn,
Progress,
ProgressColumn,
SpinnerColumn,
Task,
Text,
TextColumn,
TimeElapsedColumn,
TimeRemainingColumn,
)

class SpeedColumn(ProgressColumn):
def render(self, task: "Task") -> Text:
if task.speed is None:
return Text("")
elif task.speed >= 1:
return Text(f"{task.speed:.2f} it/s")
else:
return Text(f"{1/task.speed:.2f} s/it") # noqa: FURB126

self.progress = Progress(
SpinnerColumn(),
TextColumn(f"[{self.step_number: >4}/{TOTAL_STEPS}]"),
Expand All @@ -68,8 +81,10 @@ def __enter__(self):
MofNCompleteColumn(),
TextColumn("•"),
TimeElapsedColumn(),
TextColumn(""),
TextColumn("<"),
TimeRemainingColumn(),
TextColumn("•"),
SpeedColumn(),
transient=False,
speed_estimate_period=1800,
)
Expand Down
Loading

0 comments on commit e9c2006

Please sign in to comment.