diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..5d563391a36816c739ef85a8af54689f0ece9608 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.ipynb_checkpoints/nowo1_base-checkpoint.py +__pycache__/nowo1_base.cpython-39.pyc diff --git a/.ipynb_checkpoints/Balance_Binary-checkpoint.ipynb b/.ipynb_checkpoints/Balance_Binary-checkpoint.ipynb index 4c87cd94f48c10dc9eb62a7b671caa5675a83b0c..39e88f671bc24d38ae981b169ee3e0c6aed91155 100644 --- a/.ipynb_checkpoints/Balance_Binary-checkpoint.ipynb +++ b/.ipynb_checkpoints/Balance_Binary-checkpoint.ipynb @@ -132,7 +132,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 1, "id": "ab70ee95-ce3c-4c4c-a7bc-2658a1a5d41a", "metadata": { "extensions": { @@ -152,15 +152,15 @@ }, "outputs": [], "source": [ - "import nowo_base_1 as no_ba\n", - "import nowo_sim_binary as no_bi\n", - "import nowo_gui_base as no_gui\n", - "import nowo_log_base as no_log" + "import nowo1_base as no_ba\n", + "import nowo1_sim_binary as no_bi\n", + "import nowo1_gui_base as no_gui\n", + "import nowo1_log_base as no_log" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 2, "id": "eec838fd-a5a9-49c8-a873-07c0e3653622", "metadata": { "extensions": { @@ -180,15 +180,15 @@ }, "outputs": [], "source": [ - "test_obj = no_bi.binaer_node('test_obj') # Umgebungs\n", - "step_1 = no_ba.step_single('step_1')\n", + "bilanz_1 = no_bi.binary_node('bilanz_1') # Umgebungs\n", + "step = no_ba.step_single('step')\n", "gui_data = no_gui.gui_ipysheet('gui_data')\n", - "log_1 = no_log.log_sheet('log_1')" + "log = no_log.log_sheet('log')" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 3, "id": "5e7dc37c-8fe1-4569-a233-e3e45f450ae2", "metadata": { "extensions": { @@ -208,13 +208,13 @@ }, "outputs": [], "source": [ - "step_1.Init(work_objs=[test_obj.Calc_A_B])\n", - "log_1.Init(Values=[test_obj.log_all], Gui_For_Data = gui_data)" + "step.Init(work_objs=[bilanz_1.Calc_A_B])\n", + "log.Init(Values=[bilanz_1.log_all], Gui_For_Data = gui_data)" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 4, "id": "9a853d13-b21f-475a-8262-b9616bad6a60", "metadata": { "extensions": { @@ -233,14 +233,29 @@ }, "tags": [] }, - "outputs": [], + "outputs": [ + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "7a92df3acd14402ea5ff7ebd1d353569", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "VBox(children=(Sheet(cells=(Cell(column_end=0, column_start=0, row_end=7, row_start=0, squeeze_row=False, type…" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], "source": [ "gui_data.Show_GUI()" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 5, "id": "155a052c-b1b6-4098-8614-19388211296a", "metadata": { "extensions": { @@ -258,14 +273,29 @@ } } }, - "outputs": [], + "outputs": [ + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "1461e095163a482a8bb86ba8a917be4c", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "VBox(children=(VBox(children=(Label(value='extensive Größe:'), HBox(children=(Dropdown(layout=Layout(width='10…" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], "source": [ - "test_obj.Show_GUI()" + "bilanz_1.Show_GUI()" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 6, "id": "aa1fe3ad-55bb-491d-a677-ea20354ba5c1", "metadata": { "extensions": { @@ -283,10 +313,62 @@ } } }, - "outputs": [], + "outputs": [ + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "0f7812802d0b4f4f80f7da3f313f7210", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "VBox(children=(Button(description='Calc', style=ButtonStyle()),))" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "5138f46b0a4e4ac6b63b61b8d36c668f", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "Output()" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], "source": [ - "step_1.Show_GUI()" + "step.Show_GUI()" ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "6de5555e-b239-41f5-82e6-8691f8eb946a", + "metadata": { + "extensions": { + "jupyter_dashboards": { + "activeView": "grid_default", + "views": { + "grid_default": { + "col": null, + "height": 2, + "hidden": true, + "row": null, + "width": 2 + } + } + } + } + }, + "outputs": [], + "source": [] } ], "metadata": { diff --git a/Balance_Binary.ipynb b/Balance_Binary.ipynb index 39e88f671bc24d38ae981b169ee3e0c6aed91155..8f0e77040e7d85979a87a5361ed1607e299aad3e 100644 --- a/Balance_Binary.ipynb +++ b/Balance_Binary.ipynb @@ -178,7 +178,50 @@ } } }, - "outputs": [], + "outputs": [ + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "c14793f1a8c34dcbb290b0466961a8c6", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "Output()" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "bb22dc2094444c5badef1bb437e5d993", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "Output()" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "ee0f4cb0a68a43e587a6337cddeec13e", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "Output()" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], "source": [ "bilanz_1 = no_bi.binary_node('bilanz_1') # Umgebungs\n", "step = no_ba.step_single('step')\n", @@ -237,7 +280,7 @@ { "data": { "application/vnd.jupyter.widget-view+json": { - "model_id": "7a92df3acd14402ea5ff7ebd1d353569", + "model_id": "1fb138e47cfb4fc295c6cbdb11ccafd8", "version_major": 2, "version_minor": 0 }, @@ -277,7 +320,7 @@ { "data": { "application/vnd.jupyter.widget-view+json": { - "model_id": "1461e095163a482a8bb86ba8a917be4c", + "model_id": "5909d959cded4e95bda0ab33a9bb8add", "version_major": 2, "version_minor": 0 }, @@ -317,7 +360,7 @@ { "data": { "application/vnd.jupyter.widget-view+json": { - "model_id": "0f7812802d0b4f4f80f7da3f313f7210", + "model_id": "870ccb5a6094410ca1beab78b97d484f", "version_major": 2, "version_minor": 0 }, @@ -331,7 +374,7 @@ { "data": { "application/vnd.jupyter.widget-view+json": { - "model_id": "5138f46b0a4e4ac6b63b61b8d36c668f", + "model_id": "7fae8a23e52440a49b155ecbe11c7542", "version_major": 2, "version_minor": 0 }, diff --git a/README.md b/README.md index e327024d5c57047fcb42ff7bb53ccae99354f6cd..e5947efe9ab3c91cb3476a625f1d7490945b9e2b 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,6 @@ [](https://mybinder.org/v2/gh/was-ist-immer/Binary_Balance/HEAD?urlpath=voila%2Frender%2FBalance_Binary.ipynb) -## Jupyterlab starten (Warum will die Datei nicht) +## Jupyterlab starten [](https://mybinder.org/v2/gh/was-ist-immer/Binary_Balance/HEAD?urlpath=lab%2Ftree%2FBalance_Binary.ipynb) diff --git a/__pycache__/nowo1_base.cpython-39.pyc b/__pycache__/nowo1_base.cpython-39.pyc index 4a2d8537bfdba8749adffb5c8d4fb534ecbee302..1bd10108762bb53080d1177eb354221287479a43 100644 Binary files a/__pycache__/nowo1_base.cpython-39.pyc and b/__pycache__/nowo1_base.cpython-39.pyc differ diff --git a/__pycache__/nowo1_gui_base.cpython-39.pyc b/__pycache__/nowo1_gui_base.cpython-39.pyc index eedef653f6714a41958a39925eccf904fb940d62..a0994e8ffebf914333ad6632dd787b4236ad041f 100644 Binary files a/__pycache__/nowo1_gui_base.cpython-39.pyc and b/__pycache__/nowo1_gui_base.cpython-39.pyc differ diff --git a/__pycache__/nowo1_log_base.cpython-39.pyc b/__pycache__/nowo1_log_base.cpython-39.pyc index 5a454f371b8823692aa4b1f24492237b7ff8d62d..c07db9d3b7d5b8b6b355ad790fc0eaefe475fdc1 100644 Binary files a/__pycache__/nowo1_log_base.cpython-39.pyc and b/__pycache__/nowo1_log_base.cpython-39.pyc differ diff --git a/nowo1_base.py b/nowo1_base.py index 6cce977be1da0f3dd98e67ecaf2ab05f1b53aebd..a871aa82298b3c6bb6d284da6c8d452c030476fc 100644 --- a/nowo1_base.py +++ b/nowo1_base.py @@ -384,7 +384,7 @@ class step_base(): parent = args.parent parent.reset() with self.info: - print('Hier') + print('on click') # for obj in parent.work_objs: # if obj._GUI_is_visible: @@ -444,6 +444,7 @@ class step_base(): logger.ready_for_start(self) if self._GUI_visible: pass + with self.info: print(logger.name, 'work 1') while self.step() == 1: self._node_success() @@ -451,6 +452,7 @@ class step_base(): obj.ready_for_end() for logger in self._loggerlist: + with self.info: print(logger.name, 'work 2') logger.ready_for_end() @@ -641,8 +643,8 @@ class work_base(): self._GUI_itemlist : dict = dict() self.GUI_Item = None self._GUI_is_visible = False - self.info = widgets.Output() + display(self.info) def Init(self): pass @@ -658,7 +660,6 @@ class work_base(): def Show_GUI(self): - #display(self.info) if not self.GUI_Item: self.GUI_Item = self._create_gui() self._GUI_is_visible = True diff --git a/nowo1_gui_base.py b/nowo1_gui_base.py index 5cb83109a02d7ca9560953e47ef9a2f7aa4f7a93..36ca1cfb59dea31c7d2087c9a3359e04732b1730 100644 --- a/nowo1_gui_base.py +++ b/nowo1_gui_base.py @@ -22,13 +22,19 @@ class gui_ipysheet(nowo.gui_base): def Init_by_dataframe(self, dataframe): + with self.info: print(self.name, 'Init_by') self.sheet_data = dataframe self.sheet_colnames = list(self.sheet_data.head()) self.sheet_rownames = list(self.sheet_data.index.tolist()) def ready_for_end(self): + with self.info: print(self.name, 'ready_1') buffer = self.sheet_data.values.T.tolist() + # self.sheet.cells = (ipysheet.Cell( + # column_end=0, column_start=1, row_end=1, row_start=1, type='text', value='Hello'), + # ipysheet.Cell(column_end=0, column_start=0, row_end=0, row_start=0, type='text', value='Hello')) + ipysheet.cell_range(buffer[0], column_start=1) # self.dataframe_out = ipysheet.to_dataframe(self.sheet) #self.sheet_data.to_clipboard() diff --git a/nowo1_log_base.py b/nowo1_log_base.py index c65b4f7f11bd681416f3ec2dda75d39aee645d5c..8da4e91b46e14f8d92203c3cf0736fd87d002ccb 100644 --- a/nowo1_log_base.py +++ b/nowo1_log_base.py @@ -3,6 +3,7 @@ import nowo1_base as nowo import datetime as dt import pandas as pd import numpy as np +import nowo1_gui_base class logger(nowo.port_base): def __init__(self, name: str, GUI : bool = False, **kwargs): @@ -35,7 +36,8 @@ class log_sheet(nowo.port_base): self.log_data = pd.DataFrame() - def Init(self, Values = [], Gui_For_Data = None, ): + def Init(self, Values = [], Gui_For_Data = None): + with self.info: print(self.name, 'init') super().Init(Values, Gui_For_Data) for name in self.buffer_data.keys(): split_name = name.split('.', 1) @@ -51,7 +53,7 @@ class log_sheet(nowo.port_base): def ready_for_end(self): super().ready_for_end() # self.log_data = pd.DataFrame(dict([ (k,pd.Series(v)) for k,v in self.buffer_data.items() ])) - + with self.info: print(self.name, 'ready') for col_name in self.sheet_colnames: for row_name in self.sheet_rownames: key_name = col_name + '.' + row_name @@ -59,6 +61,7 @@ class log_sheet(nowo.port_base): self.sheet_data.at[row_name, col_name] = value self.sheet_data.to_clipboard() if self.Gui_For_Data: + with self.info: print(self.Gui_For_Data.name, 'ready_2') self.Gui_For_Data.ready_for_end()