Skip to content

Commit

Permalink
Update the structure dtype check on the fly
Browse files Browse the repository at this point in the history
  • Loading branch information
liamhuber committed Apr 4, 2023
1 parent b49cde6 commit 161994c
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions ironflow/nodes/pyiron/atomistics_nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
from matplotlib.axes import Axes
from nglview import NGLWidget
from pandas import DataFrame
from ryvencore.InfoMsgs import InfoMsgs

import pyiron_base
import pyiron_ontology
Expand Down Expand Up @@ -51,7 +50,7 @@
PortList,
)
from ironflow.nodes.std.special_nodes import DualNodeBase

from ryvencore.InfoMsgs import InfoMsgs
if TYPE_CHECKING:
from pyiron_base import HasGroups

Expand Down Expand Up @@ -809,10 +808,13 @@ def _update_potential_choices(self):
else:
self.inputs.ports.potential.update(available_potentials[0])
self.inputs.ports.potential.dtype.items = available_potentials
self.inputs.ports.potential.set_dtype_ok()

def update_event(self, inp=-1):
if inp == 1 and self.inputs.ports.structure.ready:
self._update_potential_choices()
if inp == 1:
self.inputs.ports.structure.set_dtype_ok()
if self.inputs.ports.structure.ready:
self._update_potential_choices()
super().update_event(inp=inp)

def node_function(self, project, structure, potential, **kwargs) -> dict:
Expand Down

0 comments on commit 161994c

Please sign in to comment.