From 930f6954a18d3a97f02ef6fa6b8f80dbb3c8578c Mon Sep 17 00:00:00 2001 From: AlexandreSajus Date: Wed, 5 Jan 2022 18:54:11 +0100 Subject: [PATCH 01/18] :fire: deletes function_parsing --- opencodeblocks/graphics/function_parsing.py | 128 -------------------- 1 file changed, 128 deletions(-) delete mode 100644 opencodeblocks/graphics/function_parsing.py diff --git a/opencodeblocks/graphics/function_parsing.py b/opencodeblocks/graphics/function_parsing.py deleted file mode 100644 index 4af206a1..00000000 --- a/opencodeblocks/graphics/function_parsing.py +++ /dev/null @@ -1,128 +0,0 @@ -""" Module for code parsing and code execution """ - -from typing import List, Tuple -from opencodeblocks.graphics.kernel import Kernel - -kernel = Kernel() - - -def run_cell(cell: str) -> str: - """ - Executes a piece of Python code in an ipython kernel, returns its last output - - Args: - cell: String containing Python code - - Return: - output in the last message sent by the kernel - """ - return kernel.execute(cell) - - -def get_function_name(code: str) -> str: - """ - Parses a string of code and returns the first function name it finds - - Args: - code: String containing Python code - - Return: - Name of first defined function - """ - def_index = code.find("def") - if def_index == -1: - raise ValueError("'def' not found in source code") - start_of_name = def_index + 4 - parenthesis_index = code.find("(", start_of_name) - if parenthesis_index == -1: - raise ValueError("'(' not found in source code") - end_of_name = parenthesis_index - return code[start_of_name:end_of_name] - - -def get_signature(code: str) -> str: - """ - Returns the signature of a string of Python code defining a function - For example: the signature of def hello(a,b,c=3) is "(a,b,c=3)" - - Args: - code: String containing Python code - - Return: - Signature of first defined function - - """ - name = get_function_name(code) - run_cell(code) - run_cell("from inspect import signature") - return run_cell(f"print(signature({name}))") - - -def find_kwarg_index(signature_couple: List[str]) -> int: - """ - Returns the index delimiting the args and kwargs in a list of arguments - Examples: - find_kwwarg_index(['a','b','c=3']) -> 2 - find_kwwarg_index([]) -> None - - Args: - list of Strings representing the arguments of a function - - Return: - index delimiting the args and kwargs in a list of arguments - - """ - kwarg_index = len(signature_couple) - for i, item in enumerate(signature_couple): - if "=" in item: - kwarg_index = i - break - return kwarg_index - - -def extract_args(code: str) -> Tuple[List[str], List[str]]: - """ - Returns the args and kwargs of a string of Python code defining a function - Examples: - get_signature(def hello(a,b,c=3)...) -> "(a,b,c=3)" - - Args: - code: String containing Python code - - Return: - (args, kwargs) of first defined function - - """ - signature_string = get_signature(code) - # Remove parentheses - signature_string = signature_string[1:-2] - signature_string = signature_string.replace(" ", "") - if signature_string == "": - return ([], []) - signature_list = signature_string.split(",") - kwarg_index = find_kwarg_index(signature_list) - return signature_list[:kwarg_index], signature_list[kwarg_index:] - - -def execute_function(code: str, *args, **kwargs) -> str: - """ - Executes the function defined in code in an IPython shell and runs it fed by args and kwargs. - Other arguments than the first are passed to the function when executing it. - Keyword arguments are passed to the function when executing it. - - Args: - code: String representing the function code to execute. - - Return: - String representing the output given by the IPython shell when executing the function. - - """ - function_name = get_function_name(code) - execution_code = f"{function_name}(" - for arg in args: - execution_code += f"{arg}," - for name, value in kwargs.items(): - execution_code += f"{name}={value}," - - run_cell(code) - return run_cell(execution_code + ")") From 74305d0f84d4ff090ef015e2c8df1aa0108a7155 Mon Sep 17 00:00:00 2001 From: AlexandreSajus Date: Wed, 5 Jan 2022 18:55:30 +0100 Subject: [PATCH 02/18] :fire: Removes blocksDock --- opencodeblocks/graphics/window.py | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/opencodeblocks/graphics/window.py b/opencodeblocks/graphics/window.py index 1678fbb6..d7312cd1 100644 --- a/opencodeblocks/graphics/window.py +++ b/opencodeblocks/graphics/window.py @@ -63,9 +63,6 @@ def __init__(self): self.createMenus() self.createToolBars() - # BlocksDock - self.createBlocksDock() - # StatusBar self.statusbar = self.statusBar() @@ -78,24 +75,6 @@ def __init__(self): def createToolBars(self): pass - def createBlocksDock(self): - self.block_list = QListWidget() - self.block_list.addItem("Data loading") - self.block_list.addItem("Data normalization") - self.block_list.addItem("Data visualisation") - self.block_list.addItem("Data preprocessing") - self.block_list.addItem("Data reshape") - self.block_list.addItem("Model definition") - self.block_list.addItem("Model training") - self.block_list.addItem("Model prediction") - self.block_list.addItem("Model evaluation") - - self.items = QDockWidget("Blocks") - self.items.setWidget(self.block_list) - self.items.setFloating(False) - - self.addDockWidget(Qt.DockWidgetArea.RightDockWidgetArea, self.items) - def updateMenus(self): pass From 8cbeabb1f2b33d2dfb10f83cc353bbe9c1122744 Mon Sep 17 00:00:00 2001 From: AlexandreSajus Date: Wed, 5 Jan 2022 18:56:01 +0100 Subject: [PATCH 03/18] :fire: Remove useless dependencies --- opencodeblocks/graphics/window.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/opencodeblocks/graphics/window.py b/opencodeblocks/graphics/window.py index d7312cd1..78db449b 100644 --- a/opencodeblocks/graphics/window.py +++ b/opencodeblocks/graphics/window.py @@ -9,8 +9,6 @@ from PyQt5.QtGui import QCloseEvent, QKeySequence from PyQt5.QtWidgets import ( - QDockWidget, - QListWidget, QWidget, QAction, QFileDialog, From 63fea038bccb0a8004a4bb8a81c69dd4a518ec81 Mon Sep 17 00:00:00 2001 From: AlexandreSajus Date: Wed, 5 Jan 2022 19:01:26 +0100 Subject: [PATCH 04/18] :fire: Removes unnecessary blocks --- blocks/cnn_model.ocbb | 18 ------------------ blocks/container.ocbb | 16 ---------------- blocks/drawing.ocbb | 16 ---------------- blocks/empty.ocbb | 2 +- blocks/import_ml.ocbb | 18 ------------------ blocks/slider.ocbb | 16 ---------------- 6 files changed, 1 insertion(+), 85 deletions(-) delete mode 100644 blocks/cnn_model.ocbb delete mode 100644 blocks/container.ocbb delete mode 100644 blocks/drawing.ocbb delete mode 100644 blocks/import_ml.ocbb delete mode 100644 blocks/slider.ocbb diff --git a/blocks/cnn_model.ocbb b/blocks/cnn_model.ocbb deleted file mode 100644 index 2e123482..00000000 --- a/blocks/cnn_model.ocbb +++ /dev/null @@ -1,18 +0,0 @@ -{ - "title": "CNN", - "block_type": "OCBCodeBlock", - "source": "input_size = 28\r\nclasses = 5\r\nmodel = Sequential()\r\nmodel.add(layers.Conv2D(input_size, kernel_size=(3,3), input_shape=(input_size,input_size,1)))\r\nmodel.add(layers.MaxPooling2D(pool_size=(2, 2)))\r\nmodel.add(layers.Flatten())\r\nmodel.add(layers.Dense(128, activation=tf.nn.relu))\r\nmodel.add(layers.Dropout(0.2))\r\nmodel.add(layers.Dense(classes,activation=tf.nn.softmax))\r\n\r\nmodel.compile(optimizer='adam', \r\n loss='sparse_categorical_crossentropy')", - "stdout": "", - "image": "", - "splitter_pos": [80,50], - "width": 600, - "height": 400, - "metadata": { - "title_metadata": { - "color": "white", - "font": "Ubuntu", - "size": 10, - "padding": 4.0 - } - } -} \ No newline at end of file diff --git a/blocks/container.ocbb b/blocks/container.ocbb deleted file mode 100644 index e543d0b6..00000000 --- a/blocks/container.ocbb +++ /dev/null @@ -1,16 +0,0 @@ -{ - "title": "Container", - "block_type": "OCBContainerBlock", - "source": "", - "splitter_pos": [88,41], - "width": 618, - "height": 184, - "metadata": { - "title_metadata": { - "color": "white", - "font": "Ubuntu", - "size": 10, - "padding": 4.0 - } - } -} \ No newline at end of file diff --git a/blocks/drawing.ocbb b/blocks/drawing.ocbb deleted file mode 100644 index 25503ea0..00000000 --- a/blocks/drawing.ocbb +++ /dev/null @@ -1,16 +0,0 @@ -{ - "title": "Drawing", - "block_type": "OCBDrawingBlock", - "image": "", - "splitter_pos": [80,50], - "width": 600, - "height": 400, - "metadata": { - "title_metadata": { - "color": "white", - "font": "Ubuntu", - "size": 10, - "padding": 4.0 - } - } -} \ No newline at end of file diff --git a/blocks/empty.ocbb b/blocks/empty.ocbb index f5435526..8469d16b 100644 --- a/blocks/empty.ocbb +++ b/blocks/empty.ocbb @@ -1,5 +1,5 @@ { - "title": "Empty", + "title": "Code", "block_type": "OCBCodeBlock", "source": "", "stdout": "", diff --git a/blocks/import_ml.ocbb b/blocks/import_ml.ocbb deleted file mode 100644 index fdb57216..00000000 --- a/blocks/import_ml.ocbb +++ /dev/null @@ -1,18 +0,0 @@ -{ - "title": "Imports for ML", - "block_type": "OCBCodeBlock", - "source": "import tensorflow as tf\nimport matplotlib.pyplot as plt\nimport numpy as np\n\nfrom tensorflow import keras\nfrom tensorflow.keras import layers\nfrom tensorflow.keras.models import Sequential", - "stdout": "", - "image": "", - "splitter_pos": [80,50], - "width": 600, - "height": 400, - "metadata": { - "title_metadata": { - "color": "white", - "font": "Ubuntu", - "size": 10, - "padding": 4.0 - } - } -} \ No newline at end of file diff --git a/blocks/slider.ocbb b/blocks/slider.ocbb deleted file mode 100644 index c49a9362..00000000 --- a/blocks/slider.ocbb +++ /dev/null @@ -1,16 +0,0 @@ -{ - "title": "Slider", - "block_type": "OCBSliderBlock", - "source": "", - "splitter_pos": [88,41], - "width": 618, - "height": 184, - "metadata": { - "title_metadata": { - "color": "white", - "font": "Ubuntu", - "size": 10, - "padding": 4.0 - } - } -} \ No newline at end of file From 4cb904171c2213eac1be71c9bbf624320f91d81e Mon Sep 17 00:00:00 2001 From: AlexandreSajus Date: Wed, 5 Jan 2022 19:02:34 +0100 Subject: [PATCH 05/18] :fire: removes function parsing tests --- tests/unit/scene/test_function_parsing.py | 118 ---------------------- 1 file changed, 118 deletions(-) delete mode 100644 tests/unit/scene/test_function_parsing.py diff --git a/tests/unit/scene/test_function_parsing.py b/tests/unit/scene/test_function_parsing.py deleted file mode 100644 index ec862ce4..00000000 --- a/tests/unit/scene/test_function_parsing.py +++ /dev/null @@ -1,118 +0,0 @@ -""" Unit tests for the opencodeblocks function parsing module. """ - -import pytest -from pytest_mock import MockerFixture -import pytest_check as check - -from opencodeblocks.graphics.function_parsing import ( - find_kwarg_index, - run_cell, - get_function_name, - get_signature, - extract_args, - execute_function, - find_kwarg_index, -) - - -class TestFunctionParsing: - - """Testing function_parsing functions""" - - def test_run_cell(self, mocker: MockerFixture): - """Test run_cell""" - check.equal(run_cell("print(10)"), "10\n") - - def test_get_function_name(self, mocker: MockerFixture): - """Test get_function_name""" - check.equal(get_function_name("def function():\n return 'Hello'"), "function") - check.equal( - get_function_name("#Hello\ndef function():\n return 'Hello'\na = 10"), - "function", - ) - check.equal( - get_function_name( - "#Hello\ndef function(a,b=10):\n return 'Hello'\na = 10" - ), - "function", - ) - - def test_get_function_name_error(self, mocker: MockerFixture): - """Return ValueError if get_function_name has wrong input""" - with pytest.raises(ValueError): - get_function_name("") - get_function_name("#Hello") - get_function_name("def function") - - def test_get_signature(self, mocker: MockerFixture): - """Test get_signature""" - mocker.patch( - "opencodeblocks.graphics.function_parsing.run_cell", - return_value="(a, b, c=10)\n", - ) - check.equal( - get_signature("def function(a,b, c=10):\n return None"), "(a, b, c=10)\n" - ) - - def test_find_kwarg_index(self, mocker: MockerFixture): - """Test find_kwarg_index""" - check.equal(find_kwarg_index(["a", "b", "c=10"]), 2) - check.equal(find_kwarg_index([]), 0) - - def test_extract_args(self, mocker: MockerFixture): - """Test extract_args""" - mocker.patch( - "opencodeblocks.graphics.function_parsing.get_signature", - return_value="()\n", - ) - mocker.patch( - "opencodeblocks.graphics.function_parsing.find_kwarg_index", return_value=0 - ) - check.equal(extract_args("def function():\n return 'Hello'"), ([], [])) - mocker.patch( - "opencodeblocks.graphics.function_parsing.get_signature", - return_value="(a,b,c = 10)\n", - ) - mocker.patch( - "opencodeblocks.graphics.function_parsing.find_kwarg_index", return_value=2 - ) - check.equal( - extract_args("def function(a,b,c = 10):\n return 'Hello'"), - (["a", "b"], ["c=10"]), - ) - - def test_extract_args_empty(self, mocker: MockerFixture): - """Return a couple of empty lists if signature is empty""" - mocker.patch( - "opencodeblocks.graphics.function_parsing.get_signature", - return_value="()\n", - ) - mocker.patch( - "opencodeblocks.graphics.function_parsing.find_kwarg_index", - return_value=None, - ) - check.equal(extract_args("def function( ):\n return 'Hello'"), ([], [])) - mocker.patch( - "opencodeblocks.graphics.function_parsing.get_signature", - return_value="()\n", - ) - mocker.patch( - "opencodeblocks.graphics.function_parsing.find_kwarg_index", - return_value=None, - ) - check.equal(extract_args("def function():\n return 'Hello'"), ([], [])) - - def test_execute_function(self, mocker: MockerFixture): - """Test execute_function""" - mocker.patch( - "opencodeblocks.graphics.function_parsing.get_function_name", - return_value="function", - ) - mocker.patch( - "opencodeblocks.graphics.function_parsing.run_cell", - return_value="Out[1]: 25\n", - ) - check.equal( - execute_function("def function(a,b,c=10):\n return a+b+c", 10, 5), - "Out[1]: 25\n", - ) From 60cc35ef60d6c260dbf2e5642017cbc3019a5d21 Mon Sep 17 00:00:00 2001 From: AlexandreSajus Date: Wed, 5 Jan 2022 19:08:56 +0100 Subject: [PATCH 06/18] :wrench: adds window title --- opencodeblocks/__main__.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/opencodeblocks/__main__.py b/opencodeblocks/__main__.py index 957d8365..65a22ba3 100644 --- a/opencodeblocks/__main__.py +++ b/opencodeblocks/__main__.py @@ -5,6 +5,7 @@ import os import sys import asyncio +from PyQt5 import QtGui if os.name == "nt": # If on windows asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy()) @@ -21,5 +22,7 @@ wnd = OCBWindow() if len(sys.argv) > 1: wnd.createNewMdiChild(sys.argv[1]) + + wnd.setWindowTitle("Pyflow Beta v0.1") wnd.show() sys.exit(app.exec_()) From 6a1c408e97a5f0cf06f806072a428a7a2241c81f Mon Sep 17 00:00:00 2001 From: AlexandreSajus Date: Wed, 5 Jan 2022 19:09:09 +0100 Subject: [PATCH 07/18] :art: adds placeholder logo --- media/placeholder_logo.png | Bin 0 -> 29791 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 media/placeholder_logo.png diff --git a/media/placeholder_logo.png b/media/placeholder_logo.png new file mode 100644 index 0000000000000000000000000000000000000000..a63571a4696197ebb13e969aeca94feae4e60f86 GIT binary patch literal 29791 zcmd431ys~ww>OG`3J8jnh;&H~FoZP1fFRus5w(j^T;NjE6n-HqfBgS7Pb z$M?MFzU$tz&bRJ&-n-UyEk~HA_ukKr-`r~S{e5yD z_{NFZ%nJC2*g;&wK^bo1;A~(AMSEuqH-u71!3<2HN>Br1SKA(_05HPITt&k{Lso{* z2o7U4xa-5}0~4J}j@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k}z@qDhr*YThzfpd5as(;gJYu6SF%+hr_|KLIqcONl`tf4m7RvwN>JwT(c z)C+W^Vos^@lSk05Sq*;uLPEvaL$8e=gL>`|t(a=(>28P?n89&vH z=?k*m7o@EUJm@1mG12bjt(;SGm3v`hx!{XKP4ih6o2?Qt38qZD1q~NyFrrvI7>C;D z^+*I4{{xL)pHwZA@YC=V3GQeULDrx)c?T~18t6{~rW*Wj=4)6~Q$aQe`w0yRa$?GS z0MP}>D>ctbQ40Yx)M7^|p(yw3JxfBUg{=VwXXrtIkP`1;7QH-R7jh>kI0!GLF5UDA zX8mA~dkKD@?ZJNoVGD>RpDoUn;*Y+syaf>}D(VUF_PfgdvB_L|gyqKgmX?L3wm-~B zh)L+(zoEVv$$5a|;_3I3G2%`b#()6fkvBb_<;6GGDDL*cf&hveq8Py#b?R{dr5&GM zzwqg`D7$)xxHlE%7IE)2v8UTg?jGPlfQFZ z^y)wTH{JcS3UxmPN7MG{^ahncVNca7!8mxHGO79XG0&eY z*$t^;sg3?alF>mP1Cl*y;)`_k>SZVP#uIzTq3ccP)8#5=n-=dk(?*kemO2o<0I>9# z2?Y>PB8&|O6$Dn{?(K(x$V65=F!EasyVp(QvlX8ziK5kQRr!U*AtL$lX7AF0;8PvV z$6~>R@Y8slr*mQr)W~{ub%Xwp1{>A8%oxIOnv`pTF>zGR`ZMKTJeoGc$dWQ%p08A=%V(I?3q zvY7r+Zt=Ppl`YaW&?nIOeDM3T8Cb)!%l;aV+W?{J@CXRD)A-J}iW;4;B*b1ef>Ap2 z)rv{Z5*jlxb~im$2lMiFvQVV1`94WVnz-nZQ4bg0102EpYmp}QQSKr&J_=M;&Q}f& zT^+AK*p|ljtp9!61U@Im?*G5E_Tb9`?Ee2v3;6M`e*Z)J7yDyqp#Oi Date: Wed, 5 Jan 2022 19:14:09 +0100 Subject: [PATCH 08/18] :hammer: Replaced OCB with Pyflow --- .github/workflows/codacy-coverage.yml | 2 +- .github/workflows/python-coverage.yml | 10 +++--- .github/workflows/python-pylint.yml | 4 +-- .github/workflows/python-tests.yml | 2 +- CONTRIBUTING.md | 36 +++++++++---------- README.md | 16 ++++----- coverage_score.py | 2 +- opencodeblocks/__init__.py | 9 ----- opencodeblocks/blocks/__init__.py | 10 ------ opencodeblocks/blocks/widgets/__init__.py | 8 ----- opencodeblocks/core/__init__.py | 2 -- opencodeblocks/graphics/__init__.py | 2 -- pyflow/__init__.py | 9 +++++ {opencodeblocks => pyflow}/__main__.py | 4 +-- pyflow/blocks/__init__.py | 10 ++++++ {opencodeblocks => pyflow}/blocks/block.py | 14 ++++---- .../blocks/codeblock.py | 8 ++--- .../blocks/containerblock.py | 6 ++-- .../blocks/drawingblock.py | 2 +- .../blocks/executableblock.py | 4 +-- .../blocks/markdownblock.py | 4 +-- .../blocks/sliderblock.py | 4 +-- pyflow/blocks/widgets/__init__.py | 8 +++++ .../blocks/widgets/blocksizegrip.py | 0 .../blocks/widgets/blocksplitter.py | 0 .../blocks/widgets/blocktitle.py | 2 +- pyflow/core/__init__.py | 2 ++ .../core/serializable.py | 2 +- pyflow/graphics/__init__.py | 2 ++ {opencodeblocks => pyflow}/graphics/edge.py | 10 +++--- {opencodeblocks => pyflow}/graphics/kernel.py | 2 +- .../graphics/pyeditor.py | 12 +++---- {opencodeblocks => pyflow}/graphics/socket.py | 12 +++---- {opencodeblocks => pyflow}/graphics/theme.py | 0 .../graphics/theme_manager.py | 2 +- {opencodeblocks => pyflow}/graphics/view.py | 12 +++---- {opencodeblocks => pyflow}/graphics/widget.py | 8 ++--- {opencodeblocks => pyflow}/graphics/window.py | 14 ++++---- {opencodeblocks => pyflow}/graphics/worker.py | 2 +- {opencodeblocks => pyflow}/qss/__init__.py | 4 +-- .../qss/dark_resources.py | 0 {opencodeblocks => pyflow}/qss/ocb.qss | 0 {opencodeblocks => pyflow}/qss/ocb_dark.qss | 0 {opencodeblocks => pyflow}/scene/__init__.py | 4 +-- {opencodeblocks => pyflow}/scene/clipboard.py | 8 ++--- .../scene/from_ipynb_conversion.py | 6 ++-- {opencodeblocks => pyflow}/scene/history.py | 4 +-- .../scene/ipynb_conversion_constants.py | 0 {opencodeblocks => pyflow}/scene/scene.py | 20 +++++------ .../scene/to_ipynb_conversion.py | 2 +- pylint_score.py | 4 +-- tests/__init__.py | 4 +-- tests/integration/__init__.py | 2 +- tests/integration/blocks/__init__.py | 2 +- tests/integration/blocks/test_block.py | 4 +-- tests/integration/blocks/test_codeblock.py | 4 +-- tests/integration/blocks/test_flow.py | 4 +-- tests/integration/test_window.py | 4 +-- tests/integration/utils.py | 6 ++-- tests/unit/__init__.py | 4 +-- tests/unit/scene/__init__.py | 4 +-- tests/unit/scene/test_clipboard.py | 6 ++-- tests/unit/scene/test_history.py | 18 +++++----- tests/unit/scene/test_ipynb_conversion.py | 4 +-- utils.py | 2 +- 65 files changed, 189 insertions(+), 189 deletions(-) delete mode 100644 opencodeblocks/__init__.py delete mode 100644 opencodeblocks/blocks/__init__.py delete mode 100644 opencodeblocks/blocks/widgets/__init__.py delete mode 100644 opencodeblocks/core/__init__.py delete mode 100644 opencodeblocks/graphics/__init__.py create mode 100644 pyflow/__init__.py rename {opencodeblocks => pyflow}/__main__.py (83%) create mode 100644 pyflow/blocks/__init__.py rename {opencodeblocks => pyflow}/blocks/block.py (96%) rename {opencodeblocks => pyflow}/blocks/codeblock.py (97%) rename {opencodeblocks => pyflow}/blocks/containerblock.py (84%) rename {opencodeblocks => pyflow}/blocks/drawingblock.py (98%) rename {opencodeblocks => pyflow}/blocks/executableblock.py (99%) rename {opencodeblocks => pyflow}/blocks/markdownblock.py (96%) rename {opencodeblocks => pyflow}/blocks/sliderblock.py (95%) create mode 100644 pyflow/blocks/widgets/__init__.py rename {opencodeblocks => pyflow}/blocks/widgets/blocksizegrip.py (100%) rename {opencodeblocks => pyflow}/blocks/widgets/blocksplitter.py (100%) rename {opencodeblocks => pyflow}/blocks/widgets/blocktitle.py (98%) create mode 100644 pyflow/core/__init__.py rename {opencodeblocks => pyflow}/core/serializable.py (94%) create mode 100644 pyflow/graphics/__init__.py rename {opencodeblocks => pyflow}/graphics/edge.py (96%) rename {opencodeblocks => pyflow}/graphics/kernel.py (98%) rename {opencodeblocks => pyflow}/graphics/pyeditor.py (91%) rename {opencodeblocks => pyflow}/graphics/socket.py (93%) rename {opencodeblocks => pyflow}/graphics/theme.py (100%) rename {opencodeblocks => pyflow}/graphics/theme_manager.py (97%) rename {opencodeblocks => pyflow}/graphics/view.py (98%) rename {opencodeblocks => pyflow}/graphics/widget.py (90%) rename {opencodeblocks => pyflow}/graphics/window.py (97%) rename {opencodeblocks => pyflow}/graphics/worker.py (95%) rename {opencodeblocks => pyflow}/qss/__init__.py (81%) rename {opencodeblocks => pyflow}/qss/dark_resources.py (100%) rename {opencodeblocks => pyflow}/qss/ocb.qss (100%) rename {opencodeblocks => pyflow}/qss/ocb_dark.qss (100%) rename {opencodeblocks => pyflow}/scene/__init__.py (51%) rename {opencodeblocks => pyflow}/scene/clipboard.py (94%) rename {opencodeblocks => pyflow}/scene/from_ipynb_conversion.py (97%) rename {opencodeblocks => pyflow}/scene/history.py (95%) rename {opencodeblocks => pyflow}/scene/ipynb_conversion_constants.py (100%) rename {opencodeblocks => pyflow}/scene/scene.py (94%) rename {opencodeblocks => pyflow}/scene/to_ipynb_conversion.py (96%) diff --git a/.github/workflows/codacy-coverage.yml b/.github/workflows/codacy-coverage.yml index 0df87960..1a872fb6 100644 --- a/.github/workflows/codacy-coverage.yml +++ b/.github/workflows/codacy-coverage.yml @@ -25,7 +25,7 @@ jobs: - name: Build unit + integration coverage using pytest-cov run: | /sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -screen 0 1920x1080x24 -ac +extension GLX - pytest -s --cov=opencodeblocks --cov-report=xml:coverage.xml tests + pytest -s --cov=pyflow --cov-report=xml:coverage.xml tests env: DISPLAY: :99 - name: Run codacy-coverage-reporter diff --git a/.github/workflows/python-coverage.yml b/.github/workflows/python-coverage.yml index 70dca56b..984cf783 100644 --- a/.github/workflows/python-coverage.yml +++ b/.github/workflows/python-coverage.yml @@ -1,4 +1,4 @@ -# OpenCodeBlock an open-source tool for modular visual programing in python +# Pyflow an open-source tool for modular visual programing in python # Copyright (C) 2021 Mathïs FEDERICO name: Python coverage @@ -28,7 +28,7 @@ jobs: - name: Build unit coverage using pytest-cov run: | - pytest --cov=opencodeblocks --cov-report=xml tests/unit + pytest --cov=pyflow --cov-report=xml tests/unit score=$(python coverage_score.py --score) color=$(python coverage_score.py --color) echo "COVERAGE_UNIT_SCORE=$score" @@ -40,7 +40,7 @@ jobs: with: auth: ${{ secrets.GIST_SECRET }} gistID: 00ce73155619a4544884ca6d251954b3 - filename: opencodeblocks_unit_coverage_badge.json + filename: pyflow_unit_coverage_badge.json label: Unit coverage message: ${{ env.COVERAGE_UNIT_SCORE }} color: ${{ env.COVERAGE_UNIT_COLOR }} @@ -49,7 +49,7 @@ jobs: run: | /sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -screen 0 1920x1080x24 -ac +extension GLX - pytest -s --cov=opencodeblocks --cov-report=xml tests/integration + pytest -s --cov=pyflow --cov-report=xml tests/integration score=$(python coverage_score.py --score) color=$(python coverage_score.py --color) echo "COVERAGE_INTEGRATION_SCORE=$score" @@ -64,7 +64,7 @@ jobs: with: auth: ${{ secrets.GIST_SECRET }} gistID: 00ce73155619a4544884ca6d251954b3 - filename: opencodeblocks_integration_coverage_badge.json + filename: pyflow_integration_coverage_badge.json label: Integration coverage message: ${{ env.COVERAGE_INTEGRATION_SCORE }} color: ${{ env.COVERAGE_INTEGRATION_COLOR }} diff --git a/.github/workflows/python-pylint.yml b/.github/workflows/python-pylint.yml index 85f3b934..354e95a0 100644 --- a/.github/workflows/python-pylint.yml +++ b/.github/workflows/python-pylint.yml @@ -1,4 +1,4 @@ -# OpenCodeBlock an open-source tool for modular visual programing in python +# Pyflow an open-source tool for modular visual programing in python # Copyright (C) 2021 Mathïs FEDERICO name: Pylint @@ -32,7 +32,7 @@ jobs: with: auth: ${{ secrets.GIST_SECRET }} gistID: 00ce73155619a4544884ca6d251954b3 - filename: opencodeblocks_pylint_badge.json + filename: pyflow_pylint_badge.json label: Pylint message: ${{ env.PYLINT_SCORE }} color: ${{ env.PYLINT_COLOR }} diff --git a/.github/workflows/python-tests.yml b/.github/workflows/python-tests.yml index a4a7db6d..abaee1c5 100644 --- a/.github/workflows/python-tests.yml +++ b/.github/workflows/python-tests.yml @@ -1,4 +1,4 @@ -# OpenCodeBlock an open-source tool for modular visual programing in python +# Pyflow an open-source tool for modular visual programing in python # Copyright (C) 2021 Mathïs FEDERICO name: Pytest diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d8e8f557..cf86980f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,6 +1,6 @@ # PyFlow - Contributing guide -[![Pytest badge](https://github.com/Bycelium/OpenCodeBlocks/actions/workflows/python-tests.yml/badge.svg?branch=master)](https://github.com/MathisFederico/OpenCodeBlocks/actions/workflows/python-tests.yml) [![Pylint badge](https://img.shields.io/endpoint?url=https%3A%2F%2Fgist.githubusercontent.com%2FMathisFederico%2F00ce73155619a4544884ca6d251954b3%2Fraw%2Fopencodeblocks_pylint_badge.json)](https://github.com/MathisFederico/OpenCodeBlocks/actions/workflows/python-pylint.yml) [![Unit coverage badge](https://img.shields.io/endpoint?url=https%3A%2F%2Fgist.githubusercontent.com%2FMathisFederico%2F00ce73155619a4544884ca6d251954b3%2Fraw%2Fopencodeblocks_unit_coverage_badge.json)](https://github.com/MathisFederico/OpenCodeBlocks/actions/workflows/python-coverage.yml) [![Integration coverage badge](https://img.shields.io/endpoint?url=https%3A%2F%2Fgist.githubusercontent.com%2FMathisFederico%2F00ce73155619a4544884ca6d251954b3%2Fraw%2Fopencodeblocks_integration_coverage_badge.json)](https://github.com/MathisFederico/OpenCodeBlocks/actions/workflows/python-coverage.yml) +[![Pytest badge](https://github.com/Bycelium/Pyflow/actions/workflows/python-tests.yml/badge.svg?branch=master)](https://github.com/MathisFederico/Pyflow/actions/workflows/python-tests.yml) [![Pylint badge](https://img.shields.io/endpoint?url=https%3A%2F%2Fgist.githubusercontent.com%2FMathisFederico%2F00ce73155619a4544884ca6d251954b3%2Fraw%2Fpyflow_pylint_badge.json)](https://github.com/MathisFederico/Pyflow/actions/workflows/python-pylint.yml) [![Unit coverage badge](https://img.shields.io/endpoint?url=https%3A%2F%2Fgist.githubusercontent.com%2FMathisFederico%2F00ce73155619a4544884ca6d251954b3%2Fraw%2Fpyflow_unit_coverage_badge.json)](https://github.com/MathisFederico/Pyflow/actions/workflows/python-coverage.yml) [![Integration coverage badge](https://img.shields.io/endpoint?url=https%3A%2F%2Fgist.githubusercontent.com%2FMathisFederico%2F00ce73155619a4544884ca6d251954b3%2Fraw%2Fpyflow_integration_coverage_badge.json)](https://github.com/MathisFederico/Pyflow/actions/workflows/python-coverage.yml) Whenever you encounter a :beetle: **bug** or have :tada: **feature request**, report this via [GitHub issues](https://github.com/Bycelium/PyFlow/issues). @@ -21,7 +21,7 @@ You can run the program with `python main.py` Before doing your **pull request**, check using `pylint` and `pytest` that there were no code regressions. ```bash -pylint .\opencodeblocks\ +pylint .\pyflow\ ``` Some `pylint` issues can be fixed automatically using `black`, with the following command: @@ -31,7 +31,7 @@ black . ``` ```bash -pytest --cov=opencodeblocks --cov-report=html tests/unit +pytest --cov=pyflow --cov-report=html tests/unit ``` We want to keep the *Pylint* score above *9.0*. @@ -43,26 +43,26 @@ The comments and docstrings should preferably follow [these](https://google.gith Commits should start with a Capital letter and should be written in present tense (e.g. ``:tada: Add cool new feature`` instead of ``:tada: Added cool new feature``). You should also start your commit message with one or two applicable emoji. This does not only look great but also makes you rethink what to add to a commit. Make many but small commits! - Emoji | Description ------------------|------------- -:tada: `:tada:` | When you add a cool new feature -:beetle: `:beetle:` | When you fixed a bug -:fire: `:fire:` | When you removed something -:truck: `:truck:`| When you moved/renamed something -:wrench: `:wrench:` | When you improved/refactored a small piece of code -:hammer: `:hammer:` | When you improved/refactored a large piece of code -:sparkles: `:sparkles:` | When you improved code quality (pylint, PEP, ...) -:art: `:art:` | When you improved/added design assets -:rocket: `:rocket:` | When you improved performance. -:memo: `:memo:` | When you wrote documentation. -:umbrella: `:umbrella:` | When you improved coverage -:twisted_rightwards_arrows: `:twisted_rightwards_arrows:` | When you merge a branch + | Emoji | Description | + | --------------------------------------------------------- | -------------------------------------------------- | + | :tada: `:tada:` | When you add a cool new feature | + | :beetle: `:beetle:` | When you fixed a bug | + | :fire: `:fire:` | When you removed something | + | :truck: `:truck:` | When you moved/renamed something | + | :wrench: `:wrench:` | When you improved/refactored a small piece of code | + | :hammer: `:hammer:` | When you improved/refactored a large piece of code | + | :sparkles: `:sparkles:` | When you improved code quality (pylint, PEP, ...) | + | :art: `:art:` | When you improved/added design assets | + | :rocket: `:rocket:` | When you improved performance. | + | :memo: `:memo:` | When you wrote documentation. | + | :umbrella: `:umbrella:` | When you improved coverage | + | :twisted_rightwards_arrows: `:twisted_rightwards_arrows:` | When you merge a branch | This section was inspired by [This repository](https://github.com/schneegans/dynamic-badges-action). ## Creating a new block type -You can checkout [this commit](https://github.com/MathisFederico/OpenCodeBlocks/commits/2305e3c92d88d2fd32644e7eab4c4e40246675d3) which contains the minimal amount of code required to +You can checkout [this commit](https://github.com/MathisFederico/Pyflow/commits/2305e3c92d88d2fd32644e7eab4c4e40246675d3) which contains the minimal amount of code required to create a new block type. ## Version Numbers diff --git a/README.md b/README.md index 9b8ed643..cb4d4915 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,11 @@ # PyFlow -[![Pytest badge](https://github.com/MathisFederico/OpenCodeBlocks/actions/workflows/python-tests.yml/badge.svg?branch=master)](https://github.com/MathisFederico/OpenCodeBlocks/actions/workflows/python-tests.yml) -[![Codacy Badge](https://app.codacy.com/project/badge/Grade/ddd03302fd7c4849b452959753bc0939)](https://www.codacy.com/gh/MathisFederico/OpenCodeBlocks/dashboard?utm_source=github.com&utm_medium=referral&utm_content=MathisFederico/OpenCodeBlocks&utm_campaign=Badge_Grade) -[![Pylint badge](https://img.shields.io/endpoint?url=https%3A%2F%2Fgist.githubusercontent.com%2FMathisFederico%2F00ce73155619a4544884ca6d251954b3%2Fraw%2Fopencodeblocks_pylint_badge.json)](https://github.com/MathisFederico/OpenCodeBlocks/actions/workflows/python-pylint.yml) -[![Total coverage Codacy Badge](https://app.codacy.com/project/badge/Coverage/ddd03302fd7c4849b452959753bc0939)](https://www.codacy.com/gh/MathisFederico/OpenCodeBlocks/dashboard?utm_source=github.com&utm_medium=referral&utm_content=MathisFederico/OpenCodeBlocks&utm_campaign=Badge_Coverage) -[![Unit coverage badge](https://img.shields.io/endpoint?url=https%3A%2F%2Fgist.githubusercontent.com%2FMathisFederico%2F00ce73155619a4544884ca6d251954b3%2Fraw%2Fopencodeblocks_unit_coverage_badge.json)](https://github.com/MathisFederico/OpenCodeBlocks/actions/workflows/python-coverage.yml) -[![Integration coverage badge](https://img.shields.io/endpoint?url=https%3A%2F%2Fgist.githubusercontent.com%2FMathisFederico%2F00ce73155619a4544884ca6d251954b3%2Fraw%2Fopencodeblocks_integration_coverage_badge.json)](https://github.com/MathisFederico/OpenCodeBlocks/actions/workflows/python-coverage.yml) +[![Pytest badge](https://github.com/MathisFederico/Pyflow/actions/workflows/python-tests.yml/badge.svg?branch=master)](https://github.com/MathisFederico/Pyflow/actions/workflows/python-tests.yml) +[![Codacy Badge](https://app.codacy.com/project/badge/Grade/ddd03302fd7c4849b452959753bc0939)](https://www.codacy.com/gh/MathisFederico/Pyflow/dashboard?utm_source=github.com&utm_medium=referral&utm_content=MathisFederico/Pyflow&utm_campaign=Badge_Grade) +[![Pylint badge](https://img.shields.io/endpoint?url=https%3A%2F%2Fgist.githubusercontent.com%2FMathisFederico%2F00ce73155619a4544884ca6d251954b3%2Fraw%2Fpyflow_pylint_badge.json)](https://github.com/MathisFederico/Pyflow/actions/workflows/python-pylint.yml) +[![Total coverage Codacy Badge](https://app.codacy.com/project/badge/Coverage/ddd03302fd7c4849b452959753bc0939)](https://www.codacy.com/gh/MathisFederico/Pyflow/dashboard?utm_source=github.com&utm_medium=referral&utm_content=MathisFederico/Pyflow&utm_campaign=Badge_Coverage) +[![Unit coverage badge](https://img.shields.io/endpoint?url=https%3A%2F%2Fgist.githubusercontent.com%2FMathisFederico%2F00ce73155619a4544884ca6d251954b3%2Fraw%2Fpyflow_unit_coverage_badge.json)](https://github.com/MathisFederico/Pyflow/actions/workflows/python-coverage.yml) +[![Integration coverage badge](https://img.shields.io/endpoint?url=https%3A%2F%2Fgist.githubusercontent.com%2FMathisFederico%2F00ce73155619a4544884ca6d251954b3%2Fraw%2Fpyflow_integration_coverage_badge.json)](https://github.com/MathisFederico/Pyflow/actions/workflows/python-coverage.yml) [![Licence - GPLv3](https://img.shields.io/github/license/MathisFederico/Crafting?style=plastic)](https://www.gnu.org/licenses/) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](CONTRIBUTING.md) @@ -52,7 +52,7 @@ Make sure you have Python 3 installed. You can download it from [here](https://w Clone the current repo: ```bash -git clone https://github.com/MathisFederico/OpenCodeBlocks/ +git clone https://github.com/MathisFederico/Pyflow/ ``` Install the dependencies @@ -64,7 +64,7 @@ pip install -r requirements.txt Run ! ```bash -python -m opencodeblocks +python -m pyflow ``` ## Contributing diff --git a/coverage_score.py b/coverage_score.py index abf9031b..d9ffc243 100644 --- a/coverage_score.py +++ b/coverage_score.py @@ -1,4 +1,4 @@ -# OpenCodeBlock an open-source tool for modular visual programing in python +# Pyflow an open-source tool for modular visual programing in python # Copyright (C) 2021 Mathïs FEDERICO """ Module to get coverage score. """ diff --git a/opencodeblocks/__init__.py b/opencodeblocks/__init__.py deleted file mode 100644 index 8b299e47..00000000 --- a/opencodeblocks/__init__.py +++ /dev/null @@ -1,9 +0,0 @@ -# -*- coding: utf-8 -*- -# OpenCodeBlock an open-source tool for modular visual programing in python -# Copyright (C) 2021 Mathïs FEDERICO - -""" OpenCodeBlocks: An open-source tool for modular visual programing in python """ - -__appname__ = "OpenCodeBlocks" -__author__ = "Mathïs Fédérico" -__version__ = "0.0.1" diff --git a/opencodeblocks/blocks/__init__.py b/opencodeblocks/blocks/__init__.py deleted file mode 100644 index 3a2eca69..00000000 --- a/opencodeblocks/blocks/__init__.py +++ /dev/null @@ -1,10 +0,0 @@ -# OpenCodeBlock an open-source tool for modular visual programing in python -# Copyright (C) 2021 Mathïs FEDERICO - -""" Module for the OCB Blocks of different types. """ - -from opencodeblocks.blocks.sliderblock import OCBSliderBlock -from opencodeblocks.blocks.codeblock import OCBCodeBlock -from opencodeblocks.blocks.markdownblock import OCBMarkdownBlock -from opencodeblocks.blocks.drawingblock import OCBDrawingBlock -from opencodeblocks.blocks.containerblock import OCBContainerBlock diff --git a/opencodeblocks/blocks/widgets/__init__.py b/opencodeblocks/blocks/widgets/__init__.py deleted file mode 100644 index d62d3431..00000000 --- a/opencodeblocks/blocks/widgets/__init__.py +++ /dev/null @@ -1,8 +0,0 @@ -# OpenCodeBlock an open-source tool for modular visual programing in python -# Copyright (C) 2021 Mathïs FEDERICO - -""" Module for the OCB Blocks Widgets. """ - -from opencodeblocks.blocks.widgets.blocksplitter import OCBSplitter -from opencodeblocks.blocks.widgets.blocktitle import OCBTitle -from opencodeblocks.blocks.widgets.blocksizegrip import OCBSizeGrip diff --git a/opencodeblocks/core/__init__.py b/opencodeblocks/core/__init__.py deleted file mode 100644 index 58401fca..00000000 --- a/opencodeblocks/core/__init__.py +++ /dev/null @@ -1,2 +0,0 @@ -# OpenCodeBlock an open-source tool for modular visual programing in python -# Copyright (C) 2021 Mathïs FEDERICO diff --git a/opencodeblocks/graphics/__init__.py b/opencodeblocks/graphics/__init__.py deleted file mode 100644 index 58401fca..00000000 --- a/opencodeblocks/graphics/__init__.py +++ /dev/null @@ -1,2 +0,0 @@ -# OpenCodeBlock an open-source tool for modular visual programing in python -# Copyright (C) 2021 Mathïs FEDERICO diff --git a/pyflow/__init__.py b/pyflow/__init__.py new file mode 100644 index 00000000..8fdd529a --- /dev/null +++ b/pyflow/__init__.py @@ -0,0 +1,9 @@ +# -*- coding: utf-8 -*- +# Pyflow an open-source tool for modular visual programing in python +# Copyright (C) 2021 Mathïs FEDERICO + +""" Pyflow: An open-source tool for modular visual programing in python """ + +__appname__ = "Pyflow" +__author__ = "Mathïs Fédérico" +__version__ = "0.0.1" diff --git a/opencodeblocks/__main__.py b/pyflow/__main__.py similarity index 83% rename from opencodeblocks/__main__.py rename to pyflow/__main__.py index 65a22ba3..7fa58de8 100644 --- a/opencodeblocks/__main__.py +++ b/pyflow/__main__.py @@ -1,4 +1,4 @@ -# OpenCodeBlock an open-source tool for modular visual programing in python +# Pyflow an open-source tool for modular visual programing in python # Copyright (C) 2021 Mathïs FEDERICO # pylint:disable=wrong-import-position @@ -11,7 +11,7 @@ asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy()) from qtpy.QtWidgets import QApplication -from opencodeblocks.graphics.window import OCBWindow +from pyflow.graphics.window import OCBWindow sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", "..")) diff --git a/pyflow/blocks/__init__.py b/pyflow/blocks/__init__.py new file mode 100644 index 00000000..a22024d9 --- /dev/null +++ b/pyflow/blocks/__init__.py @@ -0,0 +1,10 @@ +# Pyflow an open-source tool for modular visual programing in python +# Copyright (C) 2021 Mathïs FEDERICO + +""" Module for the OCB Blocks of different types. """ + +from pyflow.blocks.sliderblock import OCBSliderBlock +from pyflow.blocks.codeblock import OCBCodeBlock +from pyflow.blocks.markdownblock import OCBMarkdownBlock +from pyflow.blocks.drawingblock import OCBDrawingBlock +from pyflow.blocks.containerblock import OCBContainerBlock diff --git a/opencodeblocks/blocks/block.py b/pyflow/blocks/block.py similarity index 96% rename from opencodeblocks/blocks/block.py rename to pyflow/blocks/block.py index 9aafddf7..52da0c52 100644 --- a/opencodeblocks/blocks/block.py +++ b/pyflow/blocks/block.py @@ -1,4 +1,4 @@ -# OpenCodeBlock an open-source tool for modular visual programing in python +# Pyflow an open-source tool for modular visual programing in python # Copyright (C) 2021 Mathïs FEDERICO # pylint:disable=unused-argument @@ -16,19 +16,19 @@ QWidget, ) -from opencodeblocks.core.serializable import Serializable -from opencodeblocks.graphics.socket import OCBSocket -from opencodeblocks.blocks.widgets import OCBSplitter, OCBSizeGrip, OCBTitle +from pyflow.core.serializable import Serializable +from pyflow.graphics.socket import OCBSocket +from pyflow.blocks.widgets import OCBSplitter, OCBSizeGrip, OCBTitle if TYPE_CHECKING: - from opencodeblocks.scene.scene import OCBScene + from pyflow.scene.scene import OCBScene BACKGROUND_COLOR = QColor("#E3212121") class OCBBlock(QGraphicsItem, Serializable): - """Base class for blocks in OpenCodeBlocks.""" + """Base class for blocks in Pyflow.""" DEFAULT_DATA = { "title": "New block", @@ -52,7 +52,7 @@ def __init__( title: Union[OCBTitle, str] = DEFAULT_DATA["title"], parent: Optional["QGraphicsItem"] = None, ): - """Base class for blocks in OpenCodeBlocks. + """Base class for blocks in Pyflow. Args: block_type: Block type. diff --git a/opencodeblocks/blocks/codeblock.py b/pyflow/blocks/codeblock.py similarity index 97% rename from opencodeblocks/blocks/codeblock.py rename to pyflow/blocks/codeblock.py index ba312697..19b05e23 100644 --- a/opencodeblocks/blocks/codeblock.py +++ b/pyflow/blocks/codeblock.py @@ -1,4 +1,4 @@ -# OpenCodeBlock an open-source tool for modular visual programing in python +# Pyflow an open-source tool for modular visual programing in python # Copyright (C) 2021 Mathïs FEDERICO """ Module for the base OCB Code Block. """ @@ -15,10 +15,10 @@ from ansi2html import Ansi2HTMLConverter -from opencodeblocks.blocks.block import OCBBlock +from pyflow.blocks.block import OCBBlock -from opencodeblocks.blocks.executableblock import OCBExecutableBlock -from opencodeblocks.graphics.pyeditor import PythonEditor +from pyflow.blocks.executableblock import OCBExecutableBlock +from pyflow.graphics.pyeditor import PythonEditor conv = Ansi2HTMLConverter() diff --git a/opencodeblocks/blocks/containerblock.py b/pyflow/blocks/containerblock.py similarity index 84% rename from opencodeblocks/blocks/containerblock.py rename to pyflow/blocks/containerblock.py index df00a483..b2aec37b 100644 --- a/opencodeblocks/blocks/containerblock.py +++ b/pyflow/blocks/containerblock.py @@ -3,7 +3,7 @@ """ from PyQt5.QtWidgets import QVBoxLayout -from opencodeblocks.blocks.block import OCBBlock +from pyflow.blocks.block import OCBBlock class OCBContainerBlock(OCBBlock): @@ -18,10 +18,10 @@ def __init__(self, **kwargs): # Due to the overall structure of the code, this cannot be removed, as the # scene should be able to serialize blocks. # This is not due to bad code design and should not be removed. - from opencodeblocks.graphics.view import ( + from pyflow.graphics.view import ( OCBView, ) # pylint: disable=cyclic-import - from opencodeblocks.scene.scene import OCBScene # pylint: disable=cyclic-import + from pyflow.scene.scene import OCBScene # pylint: disable=cyclic-import self.layout = QVBoxLayout(self.root) self.layout.setContentsMargins( diff --git a/opencodeblocks/blocks/drawingblock.py b/pyflow/blocks/drawingblock.py similarity index 98% rename from opencodeblocks/blocks/drawingblock.py rename to pyflow/blocks/drawingblock.py index e4ec7a46..269104b4 100644 --- a/opencodeblocks/blocks/drawingblock.py +++ b/pyflow/blocks/drawingblock.py @@ -7,7 +7,7 @@ from PyQt5.QtCore import Qt, pyqtSignal from PyQt5.QtGui import QColor, QMouseEvent, QPaintEvent, QPainter from PyQt5.QtWidgets import QPushButton, QWidget -from opencodeblocks.blocks.executableblock import OCBExecutableBlock +from pyflow.blocks.executableblock import OCBExecutableBlock eps = 1 diff --git a/opencodeblocks/blocks/executableblock.py b/pyflow/blocks/executableblock.py similarity index 99% rename from opencodeblocks/blocks/executableblock.py rename to pyflow/blocks/executableblock.py index a6adb77e..91b8a56a 100644 --- a/opencodeblocks/blocks/executableblock.py +++ b/pyflow/blocks/executableblock.py @@ -7,8 +7,8 @@ from networkx.algorithms.traversal.breadth_first_search import bfs_edges -from opencodeblocks.blocks.block import OCBBlock -from opencodeblocks.graphics.socket import OCBSocket +from pyflow.blocks.block import OCBBlock +from pyflow.graphics.socket import OCBSocket class OCBExecutableBlock(OCBBlock): diff --git a/opencodeblocks/blocks/markdownblock.py b/pyflow/blocks/markdownblock.py similarity index 96% rename from opencodeblocks/blocks/markdownblock.py rename to pyflow/blocks/markdownblock.py index 7c953b00..d184030c 100644 --- a/opencodeblocks/blocks/markdownblock.py +++ b/pyflow/blocks/markdownblock.py @@ -9,8 +9,8 @@ from PyQt5.Qsci import QsciLexerMarkdown, QsciScintilla from PyQt5.QtCore import Qt from PyQt5.QtGui import QColor, QFont -from opencodeblocks.blocks.block import OCBBlock -from opencodeblocks.graphics.theme_manager import theme_manager +from pyflow.blocks.block import OCBBlock +from pyflow.graphics.theme_manager import theme_manager class OCBMarkdownBlock(OCBBlock): diff --git a/opencodeblocks/blocks/sliderblock.py b/pyflow/blocks/sliderblock.py similarity index 95% rename from opencodeblocks/blocks/sliderblock.py rename to pyflow/blocks/sliderblock.py index 0fa580b2..e64615fe 100644 --- a/opencodeblocks/blocks/sliderblock.py +++ b/pyflow/blocks/sliderblock.py @@ -1,4 +1,4 @@ -# OpenCodeBlock an open-source tool for modular visual programing in python +# Pyflow an open-source tool for modular visual programing in python """ Exports OCBSliderBlock. @@ -7,7 +7,7 @@ from typing import OrderedDict from PyQt5.QtCore import Qt from PyQt5.QtWidgets import QHBoxLayout, QLabel, QLineEdit, QSlider, QVBoxLayout -from opencodeblocks.blocks.executableblock import OCBExecutableBlock +from pyflow.blocks.executableblock import OCBExecutableBlock class OCBSliderBlock(OCBExecutableBlock): diff --git a/pyflow/blocks/widgets/__init__.py b/pyflow/blocks/widgets/__init__.py new file mode 100644 index 00000000..bcbaef76 --- /dev/null +++ b/pyflow/blocks/widgets/__init__.py @@ -0,0 +1,8 @@ +# Pyflow an open-source tool for modular visual programing in python +# Copyright (C) 2021 Mathïs FEDERICO + +""" Module for the OCB Blocks Widgets. """ + +from pyflow.blocks.widgets.blocksplitter import OCBSplitter +from pyflow.blocks.widgets.blocktitle import OCBTitle +from pyflow.blocks.widgets.blocksizegrip import OCBSizeGrip diff --git a/opencodeblocks/blocks/widgets/blocksizegrip.py b/pyflow/blocks/widgets/blocksizegrip.py similarity index 100% rename from opencodeblocks/blocks/widgets/blocksizegrip.py rename to pyflow/blocks/widgets/blocksizegrip.py diff --git a/opencodeblocks/blocks/widgets/blocksplitter.py b/pyflow/blocks/widgets/blocksplitter.py similarity index 100% rename from opencodeblocks/blocks/widgets/blocksplitter.py rename to pyflow/blocks/widgets/blocksplitter.py diff --git a/opencodeblocks/blocks/widgets/blocktitle.py b/pyflow/blocks/widgets/blocktitle.py similarity index 98% rename from opencodeblocks/blocks/widgets/blocktitle.py rename to pyflow/blocks/widgets/blocktitle.py index f9a50e18..de187992 100644 --- a/opencodeblocks/blocks/widgets/blocktitle.py +++ b/pyflow/blocks/widgets/blocktitle.py @@ -10,7 +10,7 @@ from PyQt5.QtGui import QFocusEvent, QFont, QMouseEvent from PyQt5.QtWidgets import QLineEdit, QWidget -from opencodeblocks.core.serializable import Serializable +from pyflow.core.serializable import Serializable class OCBTitle(QLineEdit, Serializable): diff --git a/pyflow/core/__init__.py b/pyflow/core/__init__.py new file mode 100644 index 00000000..a474fac2 --- /dev/null +++ b/pyflow/core/__init__.py @@ -0,0 +1,2 @@ +# Pyflow an open-source tool for modular visual programing in python +# Copyright (C) 2021 Mathïs FEDERICO diff --git a/opencodeblocks/core/serializable.py b/pyflow/core/serializable.py similarity index 94% rename from opencodeblocks/core/serializable.py rename to pyflow/core/serializable.py index 4ed6505d..de75c58e 100644 --- a/opencodeblocks/core/serializable.py +++ b/pyflow/core/serializable.py @@ -1,4 +1,4 @@ -# OpenCodeBlock an open-source tool for modular visual programing in python +# Pyflow an open-source tool for modular visual programing in python # Copyright (C) 2021 Mathïs FEDERICO """ Module for the Serializable base class """ diff --git a/pyflow/graphics/__init__.py b/pyflow/graphics/__init__.py new file mode 100644 index 00000000..a474fac2 --- /dev/null +++ b/pyflow/graphics/__init__.py @@ -0,0 +1,2 @@ +# Pyflow an open-source tool for modular visual programing in python +# Copyright (C) 2021 Mathïs FEDERICO diff --git a/opencodeblocks/graphics/edge.py b/pyflow/graphics/edge.py similarity index 96% rename from opencodeblocks/graphics/edge.py rename to pyflow/graphics/edge.py index b0a683f4..ebdde342 100644 --- a/opencodeblocks/graphics/edge.py +++ b/pyflow/graphics/edge.py @@ -1,4 +1,4 @@ -# OpenCodeBlock an open-source tool for modular visual programing in python +# Pyflow an open-source tool for modular visual programing in python # Copyright (C) 2021 Mathïs FEDERICO """ Module for the OCB Edge. """ @@ -15,13 +15,13 @@ QWidget, ) -from opencodeblocks.core.serializable import Serializable -from opencodeblocks.graphics.socket import OCBSocket +from pyflow.core.serializable import Serializable +from pyflow.graphics.socket import OCBSocket class OCBEdge(QGraphicsPathItem, Serializable): - """Base class for directed edges in OpenCodeBlocks.""" + """Base class for directed edges in Pyflow.""" DEFAULT_DATA = {"path_type": "bezier"} MANDATORY_FIELDS = {"source", "destination"} @@ -39,7 +39,7 @@ def __init__( source_socket: OCBSocket = None, destination_socket: OCBSocket = None, ): - """Base class for edges in OpenCodeBlocks. + """Base class for edges in Pyflow. Args: edge_width: Width of the edge. diff --git a/opencodeblocks/graphics/kernel.py b/pyflow/graphics/kernel.py similarity index 98% rename from opencodeblocks/graphics/kernel.py rename to pyflow/graphics/kernel.py index 6cea732d..75be07e0 100644 --- a/opencodeblocks/graphics/kernel.py +++ b/pyflow/graphics/kernel.py @@ -4,7 +4,7 @@ from typing import Tuple from jupyter_client.manager import start_new_kernel -from opencodeblocks.graphics.worker import Worker +from pyflow.graphics.worker import Worker class Kernel: diff --git a/opencodeblocks/graphics/pyeditor.py b/pyflow/graphics/pyeditor.py similarity index 91% rename from opencodeblocks/graphics/pyeditor.py rename to pyflow/graphics/pyeditor.py index 19b02c82..ce65dfa8 100644 --- a/opencodeblocks/graphics/pyeditor.py +++ b/pyflow/graphics/pyeditor.py @@ -1,4 +1,4 @@ -# OpenCodeBlock an open-source tool for modular visual programing in python +# Pyflow an open-source tool for modular visual programing in python # Copyright (C) 2021 Mathïs FEDERICO """ Module for OCB in block python editor. """ @@ -14,22 +14,22 @@ QWheelEvent, ) from PyQt5.Qsci import QsciScintilla, QsciLexerPython -from opencodeblocks.graphics.theme_manager import theme_manager +from pyflow.graphics.theme_manager import theme_manager -from opencodeblocks.blocks.block import OCBBlock +from pyflow.blocks.block import OCBBlock if TYPE_CHECKING: - from opencodeblocks.graphics.view import OCBView + from pyflow.graphics.view import OCBView POINT_SIZE = 11 class PythonEditor(QsciScintilla): - """In-block python editor for OpenCodeBlocks.""" + """In-block python editor for Pyflow.""" def __init__(self, block: OCBBlock): - """In-block python editor for OpenCodeBlocks. + """In-block python editor for Pyflow. Args: block: Block in which to add the python editor widget. diff --git a/opencodeblocks/graphics/socket.py b/pyflow/graphics/socket.py similarity index 93% rename from opencodeblocks/graphics/socket.py rename to pyflow/graphics/socket.py index 366b1f29..3a5f11b4 100644 --- a/opencodeblocks/graphics/socket.py +++ b/pyflow/graphics/socket.py @@ -1,4 +1,4 @@ -# OpenCodeBlock an open-source tool for modular visual programing in python +# Pyflow an open-source tool for modular visual programing in python # Copyright (C) 2021 Mathïs FEDERICO """ Module for OCB Sockets """ @@ -11,16 +11,16 @@ from PyQt5.QtGui import QBrush, QColor, QPainter, QPen, QPolygon from PyQt5.QtWidgets import QGraphicsItem, QStyleOptionGraphicsItem, QWidget -from opencodeblocks.core.serializable import Serializable +from pyflow.core.serializable import Serializable if TYPE_CHECKING: - from opencodeblocks.graphics.edge import OCBEdge - from opencodeblocks.blocks.block import OCBBlock + from pyflow.graphics.edge import OCBEdge + from pyflow.blocks.block import OCBBlock class OCBSocket(QGraphicsItem, Serializable): - """Base class for sockets in OpenCodeBlocks.""" + """Base class for sockets in Pyflow.""" DEFAULT_DATA = { "type": "undefined", @@ -43,7 +43,7 @@ def __init__( linewidth: float = DEFAULT_DATA["metadata"]["linewidth"], linecolor: str = DEFAULT_DATA["metadata"]["linecolor"], ): - """Base class for sockets in OpenCodeBlocks. + """Base class for sockets in Pyflow. Args: block: Block containing the socket. diff --git a/opencodeblocks/graphics/theme.py b/pyflow/graphics/theme.py similarity index 100% rename from opencodeblocks/graphics/theme.py rename to pyflow/graphics/theme.py diff --git a/opencodeblocks/graphics/theme_manager.py b/pyflow/graphics/theme_manager.py similarity index 97% rename from opencodeblocks/graphics/theme_manager.py rename to pyflow/graphics/theme_manager.py index f1a7f89d..aa4ff21f 100644 --- a/opencodeblocks/graphics/theme_manager.py +++ b/pyflow/graphics/theme_manager.py @@ -11,7 +11,7 @@ from PyQt5.QtGui import QFontDatabase from PyQt5.QtCore import pyqtSignal, QObject -from opencodeblocks.graphics.theme import Theme +from pyflow.graphics.theme import Theme class ThemeManager(QObject): diff --git a/opencodeblocks/graphics/view.py b/pyflow/graphics/view.py similarity index 98% rename from opencodeblocks/graphics/view.py rename to pyflow/graphics/view.py index 152f192c..2f130017 100644 --- a/opencodeblocks/graphics/view.py +++ b/pyflow/graphics/view.py @@ -1,4 +1,4 @@ -# OpenCodeBlock an open-source tool for modular visual programing in python +# Pyflow an open-source tool for modular visual programing in python # Copyright (C) 2021 Mathïs FEDERICO """ Module for the OCB View """ @@ -13,11 +13,11 @@ from PyQt5.sip import isdeleted -from opencodeblocks.scene import OCBScene -from opencodeblocks.graphics.socket import OCBSocket -from opencodeblocks.graphics.edge import OCBEdge -from opencodeblocks.blocks.block import OCBBlock -from opencodeblocks.blocks.codeblock import OCBCodeBlock +from pyflow.scene import OCBScene +from pyflow.graphics.socket import OCBSocket +from pyflow.graphics.edge import OCBEdge +from pyflow.blocks.block import OCBBlock +from pyflow.blocks.codeblock import OCBCodeBlock EPS: float = 1e-10 # To check if blocks are of size 0 diff --git a/opencodeblocks/graphics/widget.py b/pyflow/graphics/widget.py similarity index 90% rename from opencodeblocks/graphics/widget.py rename to pyflow/graphics/widget.py index 5399ba28..a63fa22b 100644 --- a/opencodeblocks/graphics/widget.py +++ b/pyflow/graphics/widget.py @@ -1,4 +1,4 @@ -# OpenCodeBlock an open-source tool for modular visual programing in python +# Pyflow an open-source tool for modular visual programing in python # Copyright (C) 2021 Mathïs FEDERICO """ Module for the OCB Widget """ @@ -8,8 +8,8 @@ from PyQt5.QtWidgets import QVBoxLayout, QWidget from PyQt5.QtCore import Qt -from opencodeblocks.scene import OCBScene -from opencodeblocks.graphics.view import OCBView +from pyflow.scene import OCBScene +from pyflow.graphics.view import OCBView class OCBWidget(QWidget): @@ -61,7 +61,7 @@ def savepath(self, value: str): def save(self): self.scene.save(self.savepath) - def saveAsJupyter(self, filepath:str): + def saveAsJupyter(self, filepath: str): """Save the current graph notebook as a regular python notebook""" self.scene.save_to_ipynb(filepath) diff --git a/opencodeblocks/graphics/window.py b/pyflow/graphics/window.py similarity index 97% rename from opencodeblocks/graphics/window.py rename to pyflow/graphics/window.py index 78db449b..cd03e89a 100644 --- a/opencodeblocks/graphics/window.py +++ b/pyflow/graphics/window.py @@ -1,4 +1,4 @@ -# OpenCodeBlock an open-source tool for modular visual programing in python +# Pyflow an open-source tool for modular visual programing in python # Copyright (C) 2021 Mathïs FEDERICO # pylint:disable=too-many-instance-attributes @@ -17,15 +17,15 @@ QMdiArea, ) -from opencodeblocks.graphics.widget import OCBWidget -from opencodeblocks.graphics.theme_manager import theme_manager +from pyflow.graphics.widget import OCBWidget +from pyflow.graphics.theme_manager import theme_manager -from opencodeblocks.qss import loadStylesheets +from pyflow.qss import loadStylesheets class OCBWindow(QMainWindow): - """Main window of the OpenCodeBlocks Qt-based application.""" + """Main window of the Pyflow Qt-based application.""" def __init__(self): super().__init__() @@ -457,7 +457,7 @@ def activeMdiChild(self) -> OCBWidget: return None def readSettings(self): - settings = QSettings("AutopIA", "OpenCodeBlocks") + settings = QSettings("AutopIA", "Pyflow") pos = settings.value("pos", QPoint(200, 200)) size = settings.value("size", QSize(400, 400)) self.move(pos) @@ -466,7 +466,7 @@ def readSettings(self): self.showMaximized() def writeSettings(self): - settings = QSettings("AutopIA", "OpenCodeBlocks") + settings = QSettings("AutopIA", "Pyflow") settings.setValue("pos", self.pos()) settings.setValue("size", self.size()) settings.setValue("isMaximized", self.isMaximized()) diff --git a/opencodeblocks/graphics/worker.py b/pyflow/graphics/worker.py similarity index 95% rename from opencodeblocks/graphics/worker.py rename to pyflow/graphics/worker.py index ea339952..f87ba6cc 100644 --- a/opencodeblocks/graphics/worker.py +++ b/pyflow/graphics/worker.py @@ -1,4 +1,4 @@ -# OpenCodeBlock an open-source tool for modular visual programing in python +# Pyflow an open-source tool for modular visual programing in python # Copyright (C) 2021 Mathïs FEDERICO """ Module to create and manage multi-threading workers """ diff --git a/opencodeblocks/qss/__init__.py b/pyflow/qss/__init__.py similarity index 81% rename from opencodeblocks/qss/__init__.py rename to pyflow/qss/__init__.py index 208e3fc4..60836f75 100644 --- a/opencodeblocks/qss/__init__.py +++ b/pyflow/qss/__init__.py @@ -1,4 +1,4 @@ -# OpenCodeBlock an open-source tool for modular visual programing in python +# Pyflow an open-source tool for modular visual programing in python # Copyright (C) 2021 Mathïs FEDERICO """ Module for the OCB qss and styles. """ @@ -8,7 +8,7 @@ from PyQt5.QtCore import QFile from PyQt5.QtWidgets import QApplication -from opencodeblocks.qss import dark_resources +from pyflow.qss import dark_resources def loadStylesheets(filenames: List[str]): diff --git a/opencodeblocks/qss/dark_resources.py b/pyflow/qss/dark_resources.py similarity index 100% rename from opencodeblocks/qss/dark_resources.py rename to pyflow/qss/dark_resources.py diff --git a/opencodeblocks/qss/ocb.qss b/pyflow/qss/ocb.qss similarity index 100% rename from opencodeblocks/qss/ocb.qss rename to pyflow/qss/ocb.qss diff --git a/opencodeblocks/qss/ocb_dark.qss b/pyflow/qss/ocb_dark.qss similarity index 100% rename from opencodeblocks/qss/ocb_dark.qss rename to pyflow/qss/ocb_dark.qss diff --git a/opencodeblocks/scene/__init__.py b/pyflow/scene/__init__.py similarity index 51% rename from opencodeblocks/scene/__init__.py rename to pyflow/scene/__init__.py index 5da0fc6b..593113ba 100644 --- a/opencodeblocks/scene/__init__.py +++ b/pyflow/scene/__init__.py @@ -1,6 +1,6 @@ -# OpenCodeBlock an open-source tool for modular visual programing in python +# Pyflow an open-source tool for modular visual programing in python # Copyright (C) 2021 Mathïs FEDERICO """ Module for the OCBScene creation and manipulations. """ -from opencodeblocks.scene.scene import OCBScene +from pyflow.scene.scene import OCBScene diff --git a/opencodeblocks/scene/clipboard.py b/pyflow/scene/clipboard.py similarity index 94% rename from opencodeblocks/scene/clipboard.py rename to pyflow/scene/clipboard.py index c7fd021c..95c81c29 100644 --- a/opencodeblocks/scene/clipboard.py +++ b/pyflow/scene/clipboard.py @@ -1,4 +1,4 @@ -# OpenCodeBlock an open-source tool for modular visual programing in python +# Pyflow an open-source tool for modular visual programing in python # Copyright (C) 2021 Mathïs FEDERICO """ Module for the handling an OCBScene clipboard operations. """ @@ -9,11 +9,11 @@ import json from PyQt5.QtWidgets import QApplication -from opencodeblocks.graphics.edge import OCBEdge +from pyflow.graphics.edge import OCBEdge if TYPE_CHECKING: - from opencodeblocks.scene import OCBScene - from opencodeblocks.graphics.view import OCBView + from pyflow.scene import OCBScene + from pyflow.graphics.view import OCBView class SceneClipboard: diff --git a/opencodeblocks/scene/from_ipynb_conversion.py b/pyflow/scene/from_ipynb_conversion.py similarity index 97% rename from opencodeblocks/scene/from_ipynb_conversion.py rename to pyflow/scene/from_ipynb_conversion.py index aaefbfd9..d7803d07 100644 --- a/opencodeblocks/scene/from_ipynb_conversion.py +++ b/pyflow/scene/from_ipynb_conversion.py @@ -4,9 +4,9 @@ from PyQt5.QtGui import QFontMetrics, QFont -from opencodeblocks.scene.ipynb_conversion_constants import * -from opencodeblocks.graphics.theme_manager import theme_manager -from opencodeblocks.graphics.pyeditor import POINT_SIZE +from pyflow.scene.ipynb_conversion_constants import * +from pyflow.graphics.theme_manager import theme_manager +from pyflow.graphics.pyeditor import POINT_SIZE def ipynb_to_ipyg(data: OrderedDict, use_theme_font: bool = True) -> OrderedDict: diff --git a/opencodeblocks/scene/history.py b/pyflow/scene/history.py similarity index 95% rename from opencodeblocks/scene/history.py rename to pyflow/scene/history.py index 945079fe..676c3cd1 100644 --- a/opencodeblocks/scene/history.py +++ b/pyflow/scene/history.py @@ -1,4 +1,4 @@ -# OpenCodeBlock an open-source tool for modular visual programing in python +# Pyflow an open-source tool for modular visual programing in python # Copyright (C) 2021 Mathïs FEDERICO """ Module for the handling an OCBScene history. """ @@ -6,7 +6,7 @@ from typing import TYPE_CHECKING, Any if TYPE_CHECKING: - from opencodeblocks.scene import OCBScene + from pyflow.scene import OCBScene class SceneHistory: diff --git a/opencodeblocks/scene/ipynb_conversion_constants.py b/pyflow/scene/ipynb_conversion_constants.py similarity index 100% rename from opencodeblocks/scene/ipynb_conversion_constants.py rename to pyflow/scene/ipynb_conversion_constants.py diff --git a/opencodeblocks/scene/scene.py b/pyflow/scene/scene.py similarity index 94% rename from opencodeblocks/scene/scene.py rename to pyflow/scene/scene.py index 60b86814..c3e6b1bc 100644 --- a/opencodeblocks/scene/scene.py +++ b/pyflow/scene/scene.py @@ -1,4 +1,4 @@ -# OpenCodeBlock an open-source tool for modular visual programing in python +# Pyflow an open-source tool for modular visual programing in python # Copyright (C) 2021 Mathïs FEDERICO """ Module for the OCB Scene """ @@ -13,15 +13,15 @@ from PyQt5.QtGui import QColor, QPainter, QPen from PyQt5.QtWidgets import QGraphicsScene -from opencodeblocks.core.serializable import Serializable -from opencodeblocks.blocks.block import OCBBlock -from opencodeblocks.graphics.edge import OCBEdge -from opencodeblocks.scene.clipboard import SceneClipboard -from opencodeblocks.scene.history import SceneHistory -from opencodeblocks.graphics.kernel import Kernel -from opencodeblocks.scene.from_ipynb_conversion import ipynb_to_ipyg -from opencodeblocks.scene.to_ipynb_conversion import ipyg_to_ipynb -from opencodeblocks import blocks +from pyflow.core.serializable import Serializable +from pyflow.blocks.block import OCBBlock +from pyflow.graphics.edge import OCBEdge +from pyflow.scene.clipboard import SceneClipboard +from pyflow.scene.history import SceneHistory +from pyflow.graphics.kernel import Kernel +from pyflow.scene.from_ipynb_conversion import ipynb_to_ipyg +from pyflow.scene.to_ipynb_conversion import ipyg_to_ipynb +from pyflow import blocks class OCBScene(QGraphicsScene, Serializable): diff --git a/opencodeblocks/scene/to_ipynb_conversion.py b/pyflow/scene/to_ipynb_conversion.py similarity index 96% rename from opencodeblocks/scene/to_ipynb_conversion.py rename to pyflow/scene/to_ipynb_conversion.py index 98e78878..a079cf99 100644 --- a/opencodeblocks/scene/to_ipynb_conversion.py +++ b/pyflow/scene/to_ipynb_conversion.py @@ -4,7 +4,7 @@ import copy -from opencodeblocks.scene.ipynb_conversion_constants import * +from pyflow.scene.ipynb_conversion_constants import * def ipyg_to_ipynb(data: OrderedDict) -> OrderedDict: diff --git a/pylint_score.py b/pylint_score.py index cf64757e..b983c8e9 100644 --- a/pylint_score.py +++ b/pylint_score.py @@ -1,4 +1,4 @@ -# OpenCodeBlock an open-source tool for modular visual programing in python +# Pyflow an open-source tool for modular visual programing in python # Copyright (C) 2021 Mathïs FEDERICO """ Module to get pylint score. """ @@ -54,7 +54,7 @@ def register(linter): if __name__ == "__main__": - options = ["opencodeblocks", "--output-format=pylint_score.MyReporterClass"] + options = ["pyflow", "--output-format=pylint_score.MyReporterClass"] results = Run(options, exit=False) score = results.linter.stats.global_note score_min = 8.0 diff --git a/tests/__init__.py b/tests/__init__.py index c7144c9a..fc97eed2 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -1,4 +1,4 @@ -# OpenCodeBlock an open-source tool for modular visual programing in python +# Pyflow an open-source tool for modular visual programing in python # Copyright (C) 2021 Mathïs FEDERICO -""" Tests for the opencodeblocks package. """ +""" Tests for the pyflow package. """ diff --git a/tests/integration/__init__.py b/tests/integration/__init__.py index 59a9200d..419e85cc 100644 --- a/tests/integration/__init__.py +++ b/tests/integration/__init__.py @@ -1,4 +1,4 @@ -# OpenCodeBlock an open-source tool for modular visual programing in python +# Pyflow an open-source tool for modular visual programing in python # Copyright (C) 2021 Mathïs FEDERICO """ diff --git a/tests/integration/blocks/__init__.py b/tests/integration/blocks/__init__.py index da40e082..e0d043db 100644 --- a/tests/integration/blocks/__init__.py +++ b/tests/integration/blocks/__init__.py @@ -1,4 +1,4 @@ -# OpenCodeBlock an open-source tool for modular visual programing in python +# Pyflow an open-source tool for modular visual programing in python # Copyright (C) 2021 Mathïs FEDERICO """ diff --git a/tests/integration/blocks/test_block.py b/tests/integration/blocks/test_block.py index 93d42bce..39ab970d 100644 --- a/tests/integration/blocks/test_block.py +++ b/tests/integration/blocks/test_block.py @@ -1,4 +1,4 @@ -# OpenCodeBlock an open-source tool for modular visual programing in python +# Pyflow an open-source tool for modular visual programing in python # Copyright (C) 2021 Mathïs FEDERICO """ @@ -11,7 +11,7 @@ from PyQt5.QtCore import QPointF -from opencodeblocks.blocks.block import OCBBlock +from pyflow.blocks.block import OCBBlock from tests.integration.utils import apply_function_inapp, CheckingQueue, start_app diff --git a/tests/integration/blocks/test_codeblock.py b/tests/integration/blocks/test_codeblock.py index 3c304a0a..9418caf4 100644 --- a/tests/integration/blocks/test_codeblock.py +++ b/tests/integration/blocks/test_codeblock.py @@ -1,4 +1,4 @@ -# OpenCodeBlock an open-source tool for modular visual programing in python +# Pyflow an open-source tool for modular visual programing in python # Copyright (C) 2021 Mathïs FEDERICO """ @@ -12,7 +12,7 @@ from PyQt5.QtCore import QPointF -from opencodeblocks.blocks.codeblock import OCBCodeBlock +from pyflow.blocks.codeblock import OCBCodeBlock from tests.integration.utils import apply_function_inapp, CheckingQueue, start_app diff --git a/tests/integration/blocks/test_flow.py b/tests/integration/blocks/test_flow.py index 4bd3747e..ac864559 100644 --- a/tests/integration/blocks/test_flow.py +++ b/tests/integration/blocks/test_flow.py @@ -1,4 +1,4 @@ -# OpenCodeBlock an open-source tool for modular visual programing in python +# Pyflow an open-source tool for modular visual programing in python # Copyright (C) 2021 Mathïs FEDERICO """ @@ -8,7 +8,7 @@ import pytest import time -from opencodeblocks.blocks.codeblock import OCBCodeBlock +from pyflow.blocks.codeblock import OCBCodeBlock from tests.integration.utils import apply_function_inapp, CheckingQueue, start_app diff --git a/tests/integration/test_window.py b/tests/integration/test_window.py index 06a084bd..62cf5fd2 100644 --- a/tests/integration/test_window.py +++ b/tests/integration/test_window.py @@ -1,4 +1,4 @@ -# OpenCodeBlock an open-source tool for modular visual programing in python +# Pyflow an open-source tool for modular visual programing in python # Copyright (C) 2021 Mathïs FEDERICO """ @@ -9,7 +9,7 @@ import pytest from pytest_mock import MockerFixture -from opencodeblocks.graphics.window import OCBWindow +from pyflow.graphics.window import OCBWindow class TestWindow: diff --git a/tests/integration/utils.py b/tests/integration/utils.py index 53a5ab1c..d34d8b9d 100644 --- a/tests/integration/utils.py +++ b/tests/integration/utils.py @@ -1,4 +1,4 @@ -# OpenCodeBlock an open-source tool for modular visual programing in python +# Pyflow an open-source tool for modular visual programing in python # Copyright (C) 2021 Mathïs FEDERICO """ @@ -16,9 +16,9 @@ from qtpy.QtWidgets import QApplication import pytest_check as check import warnings -from opencodeblocks.graphics.widget import OCBWidget +from pyflow.graphics.widget import OCBWidget -from opencodeblocks.graphics.window import OCBWindow +from pyflow.graphics.window import OCBWindow STOP_MSG = "stop" CHECK_MSG = "check" diff --git a/tests/unit/__init__.py b/tests/unit/__init__.py index e7bad5eb..2e33fcf8 100644 --- a/tests/unit/__init__.py +++ b/tests/unit/__init__.py @@ -1,4 +1,4 @@ -# OpenCodeBlock an open-source tool for modular visual programing in python +# Pyflow an open-source tool for modular visual programing in python # Copyright (C) 2021 Mathïs FEDERICO -""" Unit tests for the opencodeblocks package. """ +""" Unit tests for the pyflow package. """ diff --git a/tests/unit/scene/__init__.py b/tests/unit/scene/__init__.py index d3971bdf..47614f0e 100644 --- a/tests/unit/scene/__init__.py +++ b/tests/unit/scene/__init__.py @@ -1,4 +1,4 @@ -# OpenCodeBlock an open-source tool for modular visual programing in python +# Pyflow an open-source tool for modular visual programing in python # Copyright (C) 2021 Mathïs FEDERICO -""" Unit tests for the opencodeblocks scene module. """ +""" Unit tests for the pyflow scene module. """ diff --git a/tests/unit/scene/test_clipboard.py b/tests/unit/scene/test_clipboard.py index d28b2087..cdf77d64 100644 --- a/tests/unit/scene/test_clipboard.py +++ b/tests/unit/scene/test_clipboard.py @@ -1,13 +1,13 @@ -# OpenCodeBlock an open-source tool for modular visual programing in python +# Pyflow an open-source tool for modular visual programing in python # Copyright (C) 2021 Mathïs FEDERICO -""" Unit tests for the opencodeblocks history module. """ +""" Unit tests for the pyflow history module. """ import pytest from pytest_mock import MockerFixture import pytest_check as check -from opencodeblocks.scene.clipboard import SceneClipboard +from pyflow.scene.clipboard import SceneClipboard class TestSerializeSelected: diff --git a/tests/unit/scene/test_history.py b/tests/unit/scene/test_history.py index 30fe0964..bd2dd8a6 100644 --- a/tests/unit/scene/test_history.py +++ b/tests/unit/scene/test_history.py @@ -1,13 +1,13 @@ -# OpenCodeBlock an open-source tool for modular visual programing in python +# Pyflow an open-source tool for modular visual programing in python # Copyright (C) 2021 Mathïs FEDERICO -""" Unit tests for the opencodeblocks history module. """ +""" Unit tests for the pyflow history module. """ import pytest from pytest_mock import MockerFixture import pytest_check as check -from opencodeblocks.scene.history import SceneHistory +from pyflow.scene.history import SceneHistory class TestUndo: @@ -23,7 +23,7 @@ def setup(self, mocker: MockerFixture): def test_undo(self, mocker: MockerFixture): """should allow for undo without breaking the history stack.""" - mocker.patch("opencodeblocks.scene.history.SceneHistory.restore") + mocker.patch("pyflow.scene.history.SceneHistory.restore") check.equal(self.history.history_stack, ["A", "B", "C", "D"]) check.equal(self.history.history_stack[self.history.current], "D") @@ -36,7 +36,7 @@ def test_undo(self, mocker: MockerFixture): def test_undo_nostack(self, mocker: MockerFixture): """should allow to undo without any change if the history stack is empty.""" - mocker.patch("opencodeblocks.scene.history.SceneHistory.restore") + mocker.patch("pyflow.scene.history.SceneHistory.restore") self.history.history_stack = [] self.history.current = -1 @@ -49,7 +49,7 @@ def test_undo_nostack(self, mocker: MockerFixture): def test_undo_end_of_stack(self, mocker: MockerFixture): """should allow to undo without any change if at the end of the history stack.""" - mocker.patch("opencodeblocks.scene.history.SceneHistory.restore") + mocker.patch("pyflow.scene.history.SceneHistory.restore") self.history.current = 0 check.equal(self.history.history_stack, ["A", "B", "C", "D"]) @@ -75,7 +75,7 @@ def setup(self, mocker: MockerFixture): def test_redo(self, mocker: MockerFixture): """should allow for redo without changing the history stack.""" - mocker.patch("opencodeblocks.scene.history.SceneHistory.restore") + mocker.patch("pyflow.scene.history.SceneHistory.restore") check.equal(self.history.history_stack, ["A", "B", "C", "D"]) check.equal(self.history.history_stack[self.history.current], "B") @@ -88,7 +88,7 @@ def test_redo(self, mocker: MockerFixture): def test_redo_nostack(self, mocker: MockerFixture): """should allow to redo without any change if the history stack is empty.""" - mocker.patch("opencodeblocks.scene.history.SceneHistory.restore") + mocker.patch("pyflow.scene.history.SceneHistory.restore") self.history.history_stack = [] self.history.current = -1 @@ -101,7 +101,7 @@ def test_redo_nostack(self, mocker: MockerFixture): def test_redo_end_of_stack(self, mocker: MockerFixture): """should allow to redo without any change if at the beggining of the history stack.""" - mocker.patch("opencodeblocks.scene.history.SceneHistory.restore") + mocker.patch("pyflow.scene.history.SceneHistory.restore") self.history.current = 3 check.equal(self.history.history_stack, ["A", "B", "C", "D"]) diff --git a/tests/unit/scene/test_ipynb_conversion.py b/tests/unit/scene/test_ipynb_conversion.py index 88d1a4cf..9376644b 100644 --- a/tests/unit/scene/test_ipynb_conversion.py +++ b/tests/unit/scene/test_ipynb_conversion.py @@ -5,8 +5,8 @@ import pytest_check as check import json -from opencodeblocks.scene.from_ipynb_conversion import ipynb_to_ipyg, is_title -from opencodeblocks.scene.ipynb_conversion_constants import BLOCK_TYPE_TO_NAME +from pyflow.scene.from_ipynb_conversion import ipynb_to_ipyg, is_title +from pyflow.scene.ipynb_conversion_constants import BLOCK_TYPE_TO_NAME class TestIpynbConversion: diff --git a/utils.py b/utils.py index aef55d62..9dc01a49 100644 --- a/utils.py +++ b/utils.py @@ -1,4 +1,4 @@ -# OpenCodeBlock an open-source tool for modular visual programing in python +# Pyflow an open-source tool for modular visual programing in python # Copyright (C) 2021 Mathïs FEDERICO """ Module for badges colors """ From 20822e585ce5c557c21a7e33338277c5d94a403b Mon Sep 17 00:00:00 2001 From: AlexandreSajus Date: Wed, 5 Jan 2022 19:25:25 +0100 Subject: [PATCH 09/18] :hammer: restructured the tree --- pyflow/__main__.py | 1 - pyflow/blocks/block.py | 2 +- pyflow/blocks/codeblock.py | 2 +- pyflow/blocks/executableblock.py | 4 +--- pyflow/{graphics => core}/edge.py | 2 +- pyflow/{graphics => core}/kernel.py | 2 +- pyflow/{graphics => core}/pyeditor.py | 0 pyflow/{graphics => core}/socket.py | 2 +- pyflow/{graphics => core}/worker.py | 0 pyflow/graphics/view.py | 4 ++-- pyflow/scene/clipboard.py | 2 +- pyflow/scene/from_ipynb_conversion.py | 2 +- pyflow/scene/scene.py | 4 ++-- 13 files changed, 12 insertions(+), 15 deletions(-) rename pyflow/{graphics => core}/edge.py (99%) rename pyflow/{graphics => core}/kernel.py (99%) rename pyflow/{graphics => core}/pyeditor.py (100%) rename pyflow/{graphics => core}/socket.py (99%) rename pyflow/{graphics => core}/worker.py (100%) diff --git a/pyflow/__main__.py b/pyflow/__main__.py index 7fa58de8..ca29b6aa 100644 --- a/pyflow/__main__.py +++ b/pyflow/__main__.py @@ -5,7 +5,6 @@ import os import sys import asyncio -from PyQt5 import QtGui if os.name == "nt": # If on windows asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy()) diff --git a/pyflow/blocks/block.py b/pyflow/blocks/block.py index 52da0c52..917b0b4f 100644 --- a/pyflow/blocks/block.py +++ b/pyflow/blocks/block.py @@ -17,7 +17,7 @@ ) from pyflow.core.serializable import Serializable -from pyflow.graphics.socket import OCBSocket +from pyflow.core.socket import OCBSocket from pyflow.blocks.widgets import OCBSplitter, OCBSizeGrip, OCBTitle if TYPE_CHECKING: diff --git a/pyflow/blocks/codeblock.py b/pyflow/blocks/codeblock.py index 19b05e23..96b54de3 100644 --- a/pyflow/blocks/codeblock.py +++ b/pyflow/blocks/codeblock.py @@ -18,7 +18,7 @@ from pyflow.blocks.block import OCBBlock from pyflow.blocks.executableblock import OCBExecutableBlock -from pyflow.graphics.pyeditor import PythonEditor +from pyflow.core.pyeditor import PythonEditor conv = Ansi2HTMLConverter() diff --git a/pyflow/blocks/executableblock.py b/pyflow/blocks/executableblock.py index 91b8a56a..a8b02668 100644 --- a/pyflow/blocks/executableblock.py +++ b/pyflow/blocks/executableblock.py @@ -5,10 +5,8 @@ from PyQt5.QtCore import QTimer from PyQt5.QtWidgets import QApplication -from networkx.algorithms.traversal.breadth_first_search import bfs_edges - from pyflow.blocks.block import OCBBlock -from pyflow.graphics.socket import OCBSocket +from pyflow.core.socket import OCBSocket class OCBExecutableBlock(OCBBlock): diff --git a/pyflow/graphics/edge.py b/pyflow/core/edge.py similarity index 99% rename from pyflow/graphics/edge.py rename to pyflow/core/edge.py index ebdde342..7f1b297e 100644 --- a/pyflow/graphics/edge.py +++ b/pyflow/core/edge.py @@ -16,7 +16,7 @@ ) from pyflow.core.serializable import Serializable -from pyflow.graphics.socket import OCBSocket +from pyflow.core.socket import OCBSocket class OCBEdge(QGraphicsPathItem, Serializable): diff --git a/pyflow/graphics/kernel.py b/pyflow/core/kernel.py similarity index 99% rename from pyflow/graphics/kernel.py rename to pyflow/core/kernel.py index 75be07e0..e4348466 100644 --- a/pyflow/graphics/kernel.py +++ b/pyflow/core/kernel.py @@ -4,7 +4,7 @@ from typing import Tuple from jupyter_client.manager import start_new_kernel -from pyflow.graphics.worker import Worker +from pyflow.core.worker import Worker class Kernel: diff --git a/pyflow/graphics/pyeditor.py b/pyflow/core/pyeditor.py similarity index 100% rename from pyflow/graphics/pyeditor.py rename to pyflow/core/pyeditor.py diff --git a/pyflow/graphics/socket.py b/pyflow/core/socket.py similarity index 99% rename from pyflow/graphics/socket.py rename to pyflow/core/socket.py index 3a5f11b4..866ef168 100644 --- a/pyflow/graphics/socket.py +++ b/pyflow/core/socket.py @@ -14,7 +14,7 @@ from pyflow.core.serializable import Serializable if TYPE_CHECKING: - from pyflow.graphics.edge import OCBEdge + from pyflow.core.edge import OCBEdge from pyflow.blocks.block import OCBBlock diff --git a/pyflow/graphics/worker.py b/pyflow/core/worker.py similarity index 100% rename from pyflow/graphics/worker.py rename to pyflow/core/worker.py diff --git a/pyflow/graphics/view.py b/pyflow/graphics/view.py index 2f130017..d706644e 100644 --- a/pyflow/graphics/view.py +++ b/pyflow/graphics/view.py @@ -14,8 +14,8 @@ from pyflow.scene import OCBScene -from pyflow.graphics.socket import OCBSocket -from pyflow.graphics.edge import OCBEdge +from pyflow.core.socket import OCBSocket +from pyflow.core.edge import OCBEdge from pyflow.blocks.block import OCBBlock from pyflow.blocks.codeblock import OCBCodeBlock diff --git a/pyflow/scene/clipboard.py b/pyflow/scene/clipboard.py index 95c81c29..85bfb210 100644 --- a/pyflow/scene/clipboard.py +++ b/pyflow/scene/clipboard.py @@ -9,7 +9,7 @@ import json from PyQt5.QtWidgets import QApplication -from pyflow.graphics.edge import OCBEdge +from pyflow.core.edge import OCBEdge if TYPE_CHECKING: from pyflow.scene import OCBScene diff --git a/pyflow/scene/from_ipynb_conversion.py b/pyflow/scene/from_ipynb_conversion.py index d7803d07..3f918056 100644 --- a/pyflow/scene/from_ipynb_conversion.py +++ b/pyflow/scene/from_ipynb_conversion.py @@ -6,7 +6,7 @@ from pyflow.scene.ipynb_conversion_constants import * from pyflow.graphics.theme_manager import theme_manager -from pyflow.graphics.pyeditor import POINT_SIZE +from pyflow.core.pyeditor import POINT_SIZE def ipynb_to_ipyg(data: OrderedDict, use_theme_font: bool = True) -> OrderedDict: diff --git a/pyflow/scene/scene.py b/pyflow/scene/scene.py index c3e6b1bc..9ee8fe6d 100644 --- a/pyflow/scene/scene.py +++ b/pyflow/scene/scene.py @@ -15,10 +15,10 @@ from pyflow.core.serializable import Serializable from pyflow.blocks.block import OCBBlock -from pyflow.graphics.edge import OCBEdge +from pyflow.core.edge import OCBEdge from pyflow.scene.clipboard import SceneClipboard from pyflow.scene.history import SceneHistory -from pyflow.graphics.kernel import Kernel +from pyflow.core.kernel import Kernel from pyflow.scene.from_ipynb_conversion import ipynb_to_ipyg from pyflow.scene.to_ipynb_conversion import ipyg_to_ipynb from pyflow import blocks From ffe4655425621992529dad454a30bc8f10cb9774 Mon Sep 17 00:00:00 2001 From: AlexandreSajus Date: Wed, 5 Jan 2022 19:26:24 +0100 Subject: [PATCH 10/18] :wrench: renamed block extensions --- blocks/{empty.ocbb => empty.pfb} | 0 blocks/{markdown.ocbb => markdown.pfb} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename blocks/{empty.ocbb => empty.pfb} (100%) rename blocks/{markdown.ocbb => markdown.pfb} (100%) diff --git a/blocks/empty.ocbb b/blocks/empty.pfb similarity index 100% rename from blocks/empty.ocbb rename to blocks/empty.pfb diff --git a/blocks/markdown.ocbb b/blocks/markdown.pfb similarity index 100% rename from blocks/markdown.ocbb rename to blocks/markdown.pfb From 9050c3c254351a46dad26b66a5e7fb3b5e580eae Mon Sep 17 00:00:00 2001 From: AlexandreSajus Date: Wed, 5 Jan 2022 20:28:35 +0100 Subject: [PATCH 11/18] :beetle: fixed the readme badges --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index cb4d4915..92ebe5e4 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,11 @@ # PyFlow -[![Pytest badge](https://github.com/MathisFederico/Pyflow/actions/workflows/python-tests.yml/badge.svg?branch=master)](https://github.com/MathisFederico/Pyflow/actions/workflows/python-tests.yml) -[![Codacy Badge](https://app.codacy.com/project/badge/Grade/ddd03302fd7c4849b452959753bc0939)](https://www.codacy.com/gh/MathisFederico/Pyflow/dashboard?utm_source=github.com&utm_medium=referral&utm_content=MathisFederico/Pyflow&utm_campaign=Badge_Grade) -[![Pylint badge](https://img.shields.io/endpoint?url=https%3A%2F%2Fgist.githubusercontent.com%2FMathisFederico%2F00ce73155619a4544884ca6d251954b3%2Fraw%2Fpyflow_pylint_badge.json)](https://github.com/MathisFederico/Pyflow/actions/workflows/python-pylint.yml) -[![Total coverage Codacy Badge](https://app.codacy.com/project/badge/Coverage/ddd03302fd7c4849b452959753bc0939)](https://www.codacy.com/gh/MathisFederico/Pyflow/dashboard?utm_source=github.com&utm_medium=referral&utm_content=MathisFederico/Pyflow&utm_campaign=Badge_Coverage) -[![Unit coverage badge](https://img.shields.io/endpoint?url=https%3A%2F%2Fgist.githubusercontent.com%2FMathisFederico%2F00ce73155619a4544884ca6d251954b3%2Fraw%2Fpyflow_unit_coverage_badge.json)](https://github.com/MathisFederico/Pyflow/actions/workflows/python-coverage.yml) -[![Integration coverage badge](https://img.shields.io/endpoint?url=https%3A%2F%2Fgist.githubusercontent.com%2FMathisFederico%2F00ce73155619a4544884ca6d251954b3%2Fraw%2Fpyflow_integration_coverage_badge.json)](https://github.com/MathisFederico/Pyflow/actions/workflows/python-coverage.yml) +[![Pytest badge](https://github.com/MathisFederico/opencodeblocks/actions/workflows/python-tests.yml/badge.svg?branch=master)](https://github.com/MathisFederico/opencodeblocks/actions/workflows/python-tests.yml) +[![Codacy Badge](https://app.codacy.com/project/badge/Grade/ddd03302fd7c4849b452959753bc0939)](https://www.codacy.com/gh/MathisFederico/opencodeblocks/dashboard?utm_source=github.com&utm_medium=referral&utm_content=MathisFederico/opencodeblocks&utm_campaign=Badge_Grade) +[![Pylint badge](https://img.shields.io/endpoint?url=https%3A%2F%2Fgist.githubusercontent.com%2FMathisFederico%2F00ce73155619a4544884ca6d251954b3%2Fraw%2Fopencodeblocks_pylint_badge.json)](https://github.com/MathisFederico/opencodeblocks/actions/workflows/python-pylint.yml) +[![Total coverage Codacy Badge](https://app.codacy.com/project/badge/Coverage/ddd03302fd7c4849b452959753bc0939)](https://www.codacy.com/gh/MathisFederico/opencodeblocks/dashboard?utm_source=github.com&utm_medium=referral&utm_content=MathisFederico/opencodeblocks&utm_campaign=Badge_Coverage) +[![Unit coverage badge](https://img.shields.io/endpoint?url=https%3A%2F%2Fgist.githubusercontent.com%2FMathisFederico%2F00ce73155619a4544884ca6d251954b3%2Fraw%2Fopencodeblocks_unit_coverage_badge.json)](https://github.com/MathisFederico/opencodeblocks/actions/workflows/python-coverage.yml) +[![Integration coverage badge](https://img.shields.io/endpoint?url=https%3A%2F%2Fgist.githubusercontent.com%2FMathisFederico%2F00ce73155619a4544884ca6d251954b3%2Fraw%2Fopencodeblocks_integration_coverage_badge.json)](https://github.com/MathisFederico/opencodeblocks/actions/workflows/python-coverage.yml) [![Licence - GPLv3](https://img.shields.io/github/license/MathisFederico/Crafting?style=plastic)](https://www.gnu.org/licenses/) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](CONTRIBUTING.md) From 918b8f5ba01f3af2bb73865b54aaadb08fc21030 Mon Sep 17 00:00:00 2001 From: AlexandreSajus Date: Wed, 5 Jan 2022 21:00:47 +0100 Subject: [PATCH 12/18] :beetle: fixes codacy? --- .github/workflows/codacy-coverage.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/codacy-coverage.yml b/.github/workflows/codacy-coverage.yml index 1a872fb6..0df87960 100644 --- a/.github/workflows/codacy-coverage.yml +++ b/.github/workflows/codacy-coverage.yml @@ -25,7 +25,7 @@ jobs: - name: Build unit + integration coverage using pytest-cov run: | /sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -screen 0 1920x1080x24 -ac +extension GLX - pytest -s --cov=pyflow --cov-report=xml:coverage.xml tests + pytest -s --cov=opencodeblocks --cov-report=xml:coverage.xml tests env: DISPLAY: :99 - name: Run codacy-coverage-reporter From 4938edeb4b19751659c608b65ab8b9f3910d5194 Mon Sep 17 00:00:00 2001 From: AlexandreSajus Date: Wed, 5 Jan 2022 21:07:21 +0100 Subject: [PATCH 13/18] Revert ":beetle: fixes codacy?" This reverts commit 918b8f5ba01f3af2bb73865b54aaadb08fc21030. --- .github/workflows/codacy-coverage.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/codacy-coverage.yml b/.github/workflows/codacy-coverage.yml index 0df87960..1a872fb6 100644 --- a/.github/workflows/codacy-coverage.yml +++ b/.github/workflows/codacy-coverage.yml @@ -25,7 +25,7 @@ jobs: - name: Build unit + integration coverage using pytest-cov run: | /sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -screen 0 1920x1080x24 -ac +extension GLX - pytest -s --cov=opencodeblocks --cov-report=xml:coverage.xml tests + pytest -s --cov=pyflow --cov-report=xml:coverage.xml tests env: DISPLAY: :99 - name: Run codacy-coverage-reporter From f16fe21c554964fb6712740dc5ca72a2a31acf71 Mon Sep 17 00:00:00 2001 From: AlexandreSajus Date: Wed, 5 Jan 2022 21:23:23 +0100 Subject: [PATCH 14/18] :wrench: fixes Codacy issues --- pyflow/graphics/theme_manager.py | 1 + pyflow/graphics/widget.py | 2 ++ pyflow/qss/dark_resources.py | 14 ++++++++------ 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/pyflow/graphics/theme_manager.py b/pyflow/graphics/theme_manager.py index aa4ff21f..d967a76f 100644 --- a/pyflow/graphics/theme_manager.py +++ b/pyflow/graphics/theme_manager.py @@ -45,6 +45,7 @@ def __init__(self, parent=None): @property def selected_theme_index(self): + """Return the index of the selected theme""" return self._selected_theme_index @selected_theme_index.setter diff --git a/pyflow/graphics/widget.py b/pyflow/graphics/widget.py index a63fa22b..db89e000 100644 --- a/pyflow/graphics/widget.py +++ b/pyflow/graphics/widget.py @@ -59,6 +59,7 @@ def savepath(self, value: str): self.updateTitle() def save(self): + """Save the current graph to the current save path.""" self.scene.save(self.savepath) def saveAsJupyter(self, filepath: str): @@ -66,6 +67,7 @@ def saveAsJupyter(self, filepath: str): self.scene.save_to_ipynb(filepath) def load(self, filepath: str): + """Load a graph from a file.""" self.scene.load(filepath) self.savepath = filepath diff --git a/pyflow/qss/dark_resources.py b/pyflow/qss/dark_resources.py index 1c2aad50..5bb92814 100644 --- a/pyflow/qss/dark_resources.py +++ b/pyflow/qss/dark_resources.py @@ -1,10 +1,12 @@ -# -*- coding: utf-8 -*- +""" +Resource object code + +Created by: The Resource Compiler for PyQt5 (Qt v5.11.2) -# Resource object code -# -# Created by: The Resource Compiler for PyQt5 (Qt v5.11.2) -# -# WARNING! All changes made in this file will be lost! +WARNING! All changes made in this file will be lost! +""" + +# -*- coding: utf-8 -*- from qtpy import QtCore From 168dd5753ffa186b673bbe46d40d34a0f5821805 Mon Sep 17 00:00:00 2001 From: AlexandreSajus Date: Wed, 5 Jan 2022 21:24:13 +0100 Subject: [PATCH 15/18] :wrench: adds docstrings --- pyflow/graphics/window.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pyflow/graphics/window.py b/pyflow/graphics/window.py index cd03e89a..893621df 100644 --- a/pyflow/graphics/window.py +++ b/pyflow/graphics/window.py @@ -237,6 +237,7 @@ def createMenus(self): self.menuBar().addSeparator() def updateThemeMenu(self): + """Update the theme selection menu.""" self.thememenu.clear() theme_names = theme_manager().list_themes() for i, theme in enumerate(theme_names): @@ -247,6 +248,7 @@ def updateThemeMenu(self): self.themeMapper.setMapping(action, i) def updateWindowMenu(self): + """Update the window menu.""" self.windowMenu.clear() self.windowMenu.addAction(self._actClose) self.windowMenu.addAction(self._actCloseAll) @@ -457,6 +459,7 @@ def activeMdiChild(self) -> OCBWidget: return None def readSettings(self): + """Read the settings from the config file.""" settings = QSettings("AutopIA", "Pyflow") pos = settings.value("pos", QPoint(200, 200)) size = settings.value("size", QSize(400, 400)) @@ -466,12 +469,14 @@ def readSettings(self): self.showMaximized() def writeSettings(self): + """Write the settings to the config file.""" settings = QSettings("AutopIA", "Pyflow") settings.setValue("pos", self.pos()) settings.setValue("size", self.size()) settings.setValue("isMaximized", self.isMaximized()) def setActiveSubWindow(self, window): + """Set the active subwindow to the given window.""" if window: self.mdiArea.setActiveSubWindow(window) From 70511a1b6f3f3f33081374e4fb013b786913e081 Mon Sep 17 00:00:00 2001 From: AlexandreSajus Date: Wed, 5 Jan 2022 21:55:34 +0100 Subject: [PATCH 16/18] :wrench: fixes Codacy issues --- pyflow/__main__.py | 4 ++++ pyflow/blocks/drawingblock.py | 2 ++ pyflow/graphics/window.py | 5 +++-- pyflow/qss/dark_resources.py | 6 ++++-- utils.py | 2 ++ 5 files changed, 15 insertions(+), 4 deletions(-) diff --git a/pyflow/__main__.py b/pyflow/__main__.py index ca29b6aa..7d13e2c8 100644 --- a/pyflow/__main__.py +++ b/pyflow/__main__.py @@ -2,6 +2,10 @@ # Copyright (C) 2021 Mathïs FEDERICO # pylint:disable=wrong-import-position +""" +Pyflow main module, run this to launch Pyflow +""" + import os import sys import asyncio diff --git a/pyflow/blocks/drawingblock.py b/pyflow/blocks/drawingblock.py index 269104b4..7a7b3a64 100644 --- a/pyflow/blocks/drawingblock.py +++ b/pyflow/blocks/drawingblock.py @@ -1,5 +1,7 @@ # pylint:disable=unused-argument +""" Module for the base OCB Drawing Block. """ + from math import floor import json from typing import OrderedDict diff --git a/pyflow/graphics/window.py b/pyflow/graphics/window.py index 893621df..9ca5559d 100644 --- a/pyflow/graphics/window.py +++ b/pyflow/graphics/window.py @@ -71,10 +71,10 @@ def __init__(self): self.show() def createToolBars(self): - pass + """Does nothing, but is required by the QMainWindow interface.""" def updateMenus(self): - pass + """Does nothing, but is required by the QMainWindow interface.""" def createActions(self): """Create all menu actions.""" @@ -490,4 +490,5 @@ def onMoveToItems(self): current_window.moveToItems() def setTheme(self, theme_index): + """Set the theme of the application.""" theme_manager().selected_theme_index = theme_index diff --git a/pyflow/qss/dark_resources.py b/pyflow/qss/dark_resources.py index 5bb92814..9a1f60f9 100644 --- a/pyflow/qss/dark_resources.py +++ b/pyflow/qss/dark_resources.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + """ Resource object code @@ -6,8 +8,6 @@ WARNING! All changes made in this file will be lost! """ -# -*- coding: utf-8 -*- - from qtpy import QtCore qt_resource_data = b"\ @@ -504,12 +504,14 @@ def qInitResources(): + """Initialize the qt resources.""" QtCore.qRegisterResourceData( rcc_version, qt_resource_struct, qt_resource_name, qt_resource_data ) def qCleanupResources(): + """Cleanup the qt resources.""" QtCore.qUnregisterResourceData( rcc_version, qt_resource_struct, qt_resource_name, qt_resource_data ) diff --git a/utils.py b/utils.py index 9dc01a49..59141d56 100644 --- a/utils.py +++ b/utils.py @@ -7,10 +7,12 @@ def interpolate(weight, x, y): + """Linear interpolation between x and y, given a weight.""" return x * weight + (1 - weight) * y def score_to_rgb_color(score, score_min, score_max): + """Convert a score to a color.""" normalized_score = max(0, (score - score_min) / (score_max - score_min)) hsv_color = (interpolate(normalized_score, 0.33, 0), 1, 1) rgb_color = hsv_to_rgb(*hsv_color) From 701a547bf1f7651ce9a9355a7fd8e0b3d23384b9 Mon Sep 17 00:00:00 2001 From: AlexandreSajus Date: Wed, 5 Jan 2022 21:59:08 +0100 Subject: [PATCH 17/18] :wrench: adds docstring --- pyflow/qss/__init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pyflow/qss/__init__.py b/pyflow/qss/__init__.py index 60836f75..8b1d3ea3 100644 --- a/pyflow/qss/__init__.py +++ b/pyflow/qss/__init__.py @@ -12,6 +12,7 @@ def loadStylesheets(filenames: List[str]): + """Load the stylesheets from the given filenames.""" styles = "" for filename in filenames: file = QFile(filename) From b6b3c9f333a01b7013e4996910343ee3dc1e51cc Mon Sep 17 00:00:00 2001 From: Alexandre Sajus Date: Wed, 5 Jan 2022 22:30:39 +0100 Subject: [PATCH 18/18] Update CONTRIBUTING.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Mathïs Fédérico <60117466+MathisFederico@users.noreply.github.com> --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index cf86980f..90dc0fef 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -62,7 +62,7 @@ This section was inspired by [This repository](https://github.com/schneegans/dyn ## Creating a new block type -You can checkout [this commit](https://github.com/MathisFederico/Pyflow/commits/2305e3c92d88d2fd32644e7eab4c4e40246675d3) which contains the minimal amount of code required to +You can checkout [this commit](https://github.com/Bycelium/Pyflow/commits/2305e3c92d88d2fd32644e7eab4c4e40246675d3) which contains the minimal amount of code required to create a new block type. ## Version Numbers