diff options
Diffstat (limited to 'src_py')
| -rw-r--r-- | src_py/opcut/csp.py | 4 | ||||
| -rw-r--r-- | src_py/opcut/doit/jsopcut.py | 12 |
2 files changed, 4 insertions, 12 deletions
diff --git a/src_py/opcut/csp.py b/src_py/opcut/csp.py index da8906a..8d91697 100644 --- a/src_py/opcut/csp.py +++ b/src_py/opcut/csp.py @@ -60,8 +60,8 @@ def _fitness(state): sum(i.width * i.height for i in panel_state.outputs)) / total_area result -= (_fitness_K * - min(i.width * i.height for i in panel_state.outputs, + min((i.width * i.height for i in panel_state.outputs), default=0) * - max(i.width * i.height for i in panel_state.inputs, + max((i.width * i.height for i in panel_state.inputs), default=0)) / (total_area * total_area) return result diff --git a/src_py/opcut/doit/jsopcut.py b/src_py/opcut/doit/jsopcut.py index fcfd8dc..4fbbe69 100644 --- a/src_py/opcut/doit/jsopcut.py +++ b/src_py/opcut/doit/jsopcut.py @@ -1,6 +1,5 @@ import json import yaml -import subprocess from pathlib import Path from opcut.doit import _common @@ -22,20 +21,13 @@ def task_jsopcut_clean(): def task_jsopcut_install_deps(): """JsOpcut - install dependencies""" - def patch(): - subprocess.Popen(['patch', '-r', '/dev/null', '--forward', '-p0', - '-i', 'node_modules.patch'], - stdout=subprocess.DEVNULL, - stderr=subprocess.DEVNULL).wait() - - return {'actions': ['yarn install', - patch]} + return {'actions': ['yarn install']} def task_jsopcut_remove_deps(): """JsOpcut - remove dependencies""" - return {'actions': [(_common.rm_rf, ['node_modules', 'yarn.lock'])]} + return {'actions': [(_common.rm_rf, ['node_modules'])]} def task_jsopcut_gen(): |
