Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow explicit remapping of segment 0 during MeshTask #155

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion igneous/task_creation/mesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,8 @@ def create_meshing_tasks(
mesh_dir=None, cdn_cache=False, dust_threshold=None,
object_ids=None, progress=False, fill_missing=False,
encoding='precomputed', spatial_index=True, sharded=False,
compress='gzip', closed_dataset_edges=True, dust_global=False
compress='gzip', closed_dataset_edges=True, dust_global=False,
remap_table=None,
):
shape = Vec(*shape)

Expand Down Expand Up @@ -208,6 +209,7 @@ def task(self, shape, offset):
sharded=sharded,
compress=compress,
closed_dataset_edges=closed_dataset_edges,
remap_table=remap_table,
)

def on_finish(self):
Expand All @@ -230,6 +232,7 @@ def on_finish(self):
'compress': compress,
'closed_dataset_edges': closed_dataset_edges,
'dust_global': bool(dust_global),
'remap_table': remap_table,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the remap table is big, this could cause the provenance file to become gigantic. Do we need to think about this? Maybe just record the size of the remap table above a certain size?

},
'by': operator_contact(),
'date': strftime('%Y-%m-%d %H:%M %Z'),
Expand Down
3 changes: 2 additions & 1 deletion igneous/tasks/mesh/mesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,8 @@ def _remap(self, data):
}

remap = self.options['remap_table']
remap[0] = 0
if 0 not in remap:
remap[0] = 0

data = fastremap.mask_except(data, list(remap.keys()), in_place=True)
return fastremap.remap(data, remap, in_place=True)
Expand Down