From e28a662d7ce3e63929da5e5cb9e89bad64ad9fbb Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 30 Dec 2019 13:44:54 +0100 Subject: [PATCH 1/4] Speed up mypy checking Checking Cura takes up most of the time, but during that time we could check for the plugins. --- run_mypy.py | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/run_mypy.py b/run_mypy.py index 6be424bda8..d93e1cafc8 100644 --- a/run_mypy.py +++ b/run_mypy.py @@ -1,8 +1,9 @@ #!/usr/bin/env python import os import sys -import subprocess - +from multiprocessing.dummy import Pool +from functools import partial +from subprocess import call # A quick Python implementation of unix 'where' command. def where(exe_name: str, search_path: str = os.getenv("PATH")) -> str: @@ -62,21 +63,23 @@ def main(): mods = ["cura"] + plugins + findModules("plugins/VersionUpgrade") success_code = 0 - for mod in mods: - print("------------- Checking module {mod}".format(**locals())) - if sys.platform == "win32": - result = subprocess.run([mypy_module, "-p", mod, "--ignore-missing-imports"]) - else: - result = subprocess.run([sys.executable, mypy_module, "-p", mod, "--ignore-missing-imports"]) - if result.returncode != 0: - print("\nModule {mod} failed checking. :(".format(**locals())) - success_code = 1 - if success_code: - print("\n\nSome modules failed checking!") + + pool = Pool(2) # Run two commands at once + + if sys.platform == "win32": + commands = ["%s -p %s --ignore-missing-imports" % (mypy_module, mod) for mod in mods] else: - print("\n\nDone checking. All is good.") + commands = ["%s %s -p %s --ignore-missing-imports" % (sys.executable, mypy_module, mod) for mod in mods] + + for i, returncode in enumerate(pool.imap(partial(call, shell=True), commands)): + if returncode != 0: + print("\nCommand %s failed checking. :(" % commands[i]) + success_code = 1 + if success_code: + print("MYPY check was compleded, but did not pass") + else: + print("MYPY check was compleded and passed with flying colors") return success_code - if __name__ == "__main__": - sys.exit(main()) + sys.exit(main()) \ No newline at end of file From c7dbb1477a9cd12cc06475b9e9fa80be49085e38 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 31 Dec 2019 11:07:11 +0100 Subject: [PATCH 2/4] Remove maximum on small feature speed You can make the small features print FASTER if you like, as well. There is no physical or computational constraint there. Discovered during investigation of #6866. --- resources/definitions/fdmprinter.def.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/definitions/fdmprinter.def.json b/resources/definitions/fdmprinter.def.json index e13f3e6f8b..46d194c6a0 100644 --- a/resources/definitions/fdmprinter.def.json +++ b/resources/definitions/fdmprinter.def.json @@ -7650,7 +7650,7 @@ "default_value": 50, "minimum_value": "1", "minimum_value_warning": "25", - "maximum_value": "100", + "maximum_value_warning": "100", "settable_per_mesh": true }, "small_feature_speed_factor_0": @@ -7663,7 +7663,7 @@ "value": "small_feature_speed_factor", "minimum_value": "1", "minimum_value_warning": "25", - "maximum_value": "100", + "maximum_value_warning": "100", "settable_per_mesh": true } } From bf57a61c48bffc8c678ec4f7ae1a7689b250fd87 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Tue, 31 Dec 2019 11:35:37 +0100 Subject: [PATCH 3/4] Fix settings overlapping after collapse I can't figure out why we ever set the min size to be negative, but it was ocasonally making the layout stumble --- resources/qml/Settings/SettingView.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/qml/Settings/SettingView.qml b/resources/qml/Settings/SettingView.qml index 5aea939728..bddd82c802 100644 --- a/resources/qml/Settings/SettingView.qml +++ b/resources/qml/Settings/SettingView.qml @@ -251,7 +251,7 @@ Item id: delegate width: scrollView.width - height: provider.properties.enabled === "True" ? UM.Theme.getSize("section").height : - contents.spacing + height: provider.properties.enabled === "True" ? UM.Theme.getSize("section").height : 0 Behavior on height { NumberAnimation { duration: 100 } } opacity: provider.properties.enabled === "True" ? 1 : 0 Behavior on opacity { NumberAnimation { duration: 100 } } From 81c4c22d6348e645629ecb8259d2b9090cda3abe Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Tue, 31 Dec 2019 14:42:10 +0100 Subject: [PATCH 4/4] Fix that invisible items would still add spacing --- resources/qml/Settings/SettingView.qml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/resources/qml/Settings/SettingView.qml b/resources/qml/Settings/SettingView.qml index bddd82c802..419af782cf 100644 --- a/resources/qml/Settings/SettingView.qml +++ b/resources/qml/Settings/SettingView.qml @@ -222,7 +222,6 @@ Item ListView { id: contents - spacing: UM.Theme.getSize("default_lining").height cacheBuffer: 1000000 // Set a large cache to effectively just cache every list item. model: UM.SettingDefinitionsModel @@ -251,7 +250,7 @@ Item id: delegate width: scrollView.width - height: provider.properties.enabled === "True" ? UM.Theme.getSize("section").height : 0 + height: provider.properties.enabled === "True" ? UM.Theme.getSize("section").height + 2 * UM.Theme.getSize("default_lining").height : 0 Behavior on height { NumberAnimation { duration: 100 } } opacity: provider.properties.enabled === "True" ? 1 : 0 Behavior on opacity { NumberAnimation { duration: 100 } }