Avoid recomputatation of `transformation` inside of `DisplacementField.warp`
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 45/100
- Issue type
- Refactor
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- numpy, python
- Domain
- performance
Research direction
Start at src/atldld/base.py around line 319 and inspect DisplacementField.warp and how transformation is computed with np.meshgrid or np.indices. Compare repeated warps using the same field; done means an immutable DisplacementField reuses one computed transformation for both operations without changing warp results.
Written by the indexing model from the issue text.
Description
Whenever one calls warp the transformation needs to be computed from the displacements.
This operation requires np.meshgrid or np.indices and can be costly for big shapes. Anyway, the DisplacementField should be immutable and it should be enough to compute the transformation once.
Some ideas
- LRU cache
- Explicit caching
e.g. (self._tx, self._ty) - Optionally pass it in the constructor (assuming it was computed already)
Why relevant?
The primary example is when we download both the section and the expression image. We use the same DisplacementField to warp them, however, transformation is computed twice.
- Dominant language
- Python
- Stars
- 17
- Forks
- 8
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from BlueBrain/Atlas-Download-Tools
-
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
-
Some RMA queries never return all resultsPossibly taken @Stannislav claimed this 1773 days ago. Open
BlueBrain/Atlas-Download-Tools#98 · 1 assignee ·
-
Add the "downloads faithful dataset" CLI commandPossibly taken @Stannislav claimed this 1809 days ago. Open
BlueBrain/Atlas-Download-Tools#95 · 1 assignee ·
-
Difficulty 3/5 1-2 days Newbie friendliness 48/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 48/100
BlueBrain/Atlas-Download-Tools#93 · 1 reaction ·
All issues in BlueBrain/Atlas-Download-Tools
Similar issues
-
debt
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
microsoft/vscode-flake8#601 ·
Maintainers usually reply within 1 day
-
nonews refactor
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Uninett/nav#4255 · 1 comment · 1 reaction ·
Maintainers usually reply within 3 days
-
namespace operations
Difficulty 1/5 Under an hour Newbie friendliness 70/100
EclipseFdn/open-vsx.org#14421 ·
Maintainers usually reply within 1 day
-
untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
ubuntu/ubuntu-project-docs#850 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
Maintainers usually reply within 1 day