Skip to content
Merged
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
1 change: 1 addition & 0 deletions geoapps/base/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,7 @@ def get_param_dict(self):

except AttributeError:
continue

return param_dict


Expand Down
9 changes: 4 additions & 5 deletions geoapps/edge_detection/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ def window_size(self):

def trigger_click(self, _):
param_dict = self.get_param_dict()
temp_geoh5 = f"{string_name(self.params.export_as)}_{time():.0f}.geoh5"
temp_geoh5 = f"{string_name(param_dict.get('export_as'))}_{time():.0f}.geoh5"
ws, self.live_link.value = BaseApplication.get_output_workspace(
self.live_link.value, self.export_directory.selected_path, temp_geoh5
)
Expand Down Expand Up @@ -228,16 +228,15 @@ def update_name(self, _):

def compute_trigger(self, _):
param_dict = self.get_param_dict()
param_dict["geoh5"] = self.params.geoh5
param_dict["geoh5"] = self.workspace

with fetch_active_workspace(self.params.geoh5):
self.params.update(param_dict)

new_params = EdgeDetectionParams(**param_dict)
self.refresh.value = False
(
vertices,
_,
) = EdgeDetectionDriver.get_edges(*self.params.edge_args())
) = EdgeDetectionDriver.get_edges(*new_params.edge_args())
self.collections = [
collections.LineCollection(
np.reshape(vertices[:, :2], (-1, 2, 2)), colors="k", linewidths=2
Expand Down
9 changes: 6 additions & 3 deletions tests/run_tests/apps_run_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -418,13 +418,14 @@ def test_data_interpolation(tmp_path: Path):


def test_edge_detection(tmp_path: Path):
temp_workspace = tmp_path / "contour.geoh5"
temp_workspace = tmp_path / "edge_detection.geoh5"
with Workspace(temp_workspace) as workspace:
for uid in [
"{538a7eb1-2218-4bec-98cc-0a759aa0ef4f}",
]:
new_copy = GEOH5.get_entity(uuid.UUID(uid))[0].copy(parent=workspace)
new_data = new_copy.add_data(
grid = new_copy.copy(copy_children=False)
new_data = grid.add_data(
{
"copy_data": {
"values": new_copy.children[0].values,
Expand All @@ -436,11 +437,13 @@ def test_edge_detection(tmp_path: Path):
app = EdgeDetectionApp(plot_result=False)
app._file_browser.reset(
path=tmp_path,
filename="contour.geoh5",
filename="edge_detection.geoh5",
)
app._file_browser._apply_selection()
app.file_browser_change(None)
app.objects.value = grid.uid
app.data.value = new_data.uid
app.compute_trigger(None)
app.trigger_click(None)

with Workspace(get_output_workspace(tmp_path)) as workspace:
Expand Down