Comments (6)
Ok great. Can we close this?
from geowombat.
A a simple solution we could add a chunk id in the generator as follows:
class ParallelTask
def map(self, func, *args):
....
for cidx, wchunk in enumerate(range(0, self.n_windows, self.n_chunks)):
data_gen = ((self.data[slice_], cidx, widx, *args) for widx, slice_ in enumerate(window_slice))
although I am admittedly a bit confused about chunk vs window, especially as this relates to pt.n_chunks pt.n_windows
from geowombat.
Found a better option (see PR), the following will ensure that the window_id increments from 0 the n_windows without repeat.
class ParallelTask
def map(self, func, *args):
....
for cidx, wchunk in enumerate(range(0, self.n_windows, self.n_chunks)):
data_gen = ((self.data[slice_], cidx*self.n_chunks + widx, *args) for widx, slice_ in enumerate(window_slice))
from geowombat.
Nice catch. I should have used batches
instead of chunks
. You can think of them as mini batches of windows passed to the parallel executor. I added it a while back to limit memory overhead.
I think we just need the following, right?
for wchunk in range(0, self.n_windows, self.n_chunks):
data_gen = ((self.data[slice_], widx+wchunk, *args) for widx, slice_ in enumerate(window_slice))
from geowombat.
from geowombat.
@mmann1123 The window id was also incorrect in to_raster
. Both cidx*self.n_chunks + widx
and widx+wchunk
produced the same result. The fix was pushed in 911145ecc92bad22f06d0326cadf99d46ec893f2.
from geowombat.
Related Issues (20)
- ML DataArray HOT 13
- Predicted .tif file assigns a class to zero HOT 43
- Extra install examples fail; coreg extra builds unwanted GDAL version HOT 3
- config issue? HOT 11
- ml install HOT 2
- Ubuntu 22.4 & conda HOT 3
- AttributeError: type object 'threadpool_limits' has no attribute 'wrap' HOT 5
- Newer versions (> 1.2.0) do not work with Intel OpenMP installed HOT 15
- `python setup.py sdist` fails to find metadata HOT 4
- Resample leaves no data blocks into Sentinel2 image HOT 2
- geowombat save functionality not working HOT 15
- typo in mosaic min option HOT 3
- to_raster 'compress' functionality 'FileExistsError:' HOT 4
- Problem installing gewombat from git clone HOT 4
- conda-forge fail HOT 1
- Array clip failure HOT 2
- Masking with reproject HOT 1
- Google SEO HOT 8
- DOCS Index
- conda-forge issues HOT 13
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from geowombat.