diff --git a/.ci_support/environment.yml b/.ci_support/environment.yml index afdfc218a..9e5e26772 100644 --- a/.ci_support/environment.yml +++ b/.ci_support/environment.yml @@ -5,6 +5,7 @@ dependencies: - coveralls - coverage - codacy-coverage +- ipython - matplotlib =3.7.1 - numpy =1.24.3 - pyiron_base =0.5.36 diff --git a/notebooks/workflow_example.ipynb b/notebooks/workflow_example.ipynb index 37539bda3..8d6a8af7f 100644 --- a/notebooks/workflow_example.ipynb +++ b/notebooks/workflow_example.ipynb @@ -29,7 +29,7 @@ { "data": { "application/vnd.jupyter.widget-view+json": { - "model_id": "baec001264424daf8fbb8ca2bb4a7aad", + "model_id": "322f7f0435944dd2a35b2e6821f6d2db", "version_major": 2, "version_minor": 0 }, @@ -492,7 +492,7 @@ "output_type": "stream", "text": [ "n1 n1 n1 (GreaterThanHalf) output single-value: False\n", - "n2 n2 \n", + "n2 n2 \n", "n3 n3 n3 (GreaterThanHalf) output single-value: False\n", "n4 n4 n4 (GreaterThanHalf) output single-value: False\n", "n5 n5 n5 (GreaterThanHalf) output single-value: False\n" @@ -681,7 +681,7 @@ { "cell_type": "code", "execution_count": null, - "id": "80a9eac6-9953-4105-8c70-c1e14a698564", + "id": "cab89cc8-2409-4bdb-8b50-ccdf48e9ec5d", "metadata": {}, "outputs": [], "source": [] diff --git a/pyiron_contrib/workflow/channels.py b/pyiron_contrib/workflow/channels.py index 29f1cb129..8be0c5e86 100644 --- a/pyiron_contrib/workflow/channels.py +++ b/pyiron_contrib/workflow/channels.py @@ -2,6 +2,7 @@ import typing from abc import ABC, abstractmethod +from json import dumps from warnings import warn from pyiron_contrib.workflow.has_channel import HasChannel @@ -198,8 +199,9 @@ def __str__(self): def to_dict(self): d = super().to_dict() - d["value"] = self.value + d["value"] = repr(self.value) d["ready"] = self.ready + return d class InputData(DataChannel): diff --git a/pyiron_contrib/workflow/has_to_dict.py b/pyiron_contrib/workflow/has_to_dict.py index 814f0bac8..d08aa8699 100644 --- a/pyiron_contrib/workflow/has_to_dict.py +++ b/pyiron_contrib/workflow/has_to_dict.py @@ -1,6 +1,8 @@ from abc import ABC, abstractmethod from json import dumps +from IPython.display import JSON + class HasToDict(ABC): @abstractmethod @@ -10,6 +12,8 @@ def to_dict(self): def _repr_json_(self): return self.to_dict() - @property def info(self): print(dumps(self.to_dict(), indent=2)) + + def repr_json(self): + return JSON(self.to_dict()) diff --git a/setup.py b/setup.py index ca057ef36..5874503f5 100644 --- a/setup.py +++ b/setup.py @@ -55,6 +55,7 @@ ], 'workflow': [ 'python>=3.10', + 'ipython', 'typeguard==3.0.2' ] },