diff options
| author | bozokopic <bozo.kopic@gmail.com> | 2018-04-09 09:25:32 +0200 |
|---|---|---|
| committer | bozokopic <bozo.kopic@gmail.com> | 2018-04-09 09:25:32 +0200 |
| commit | 234d2def50f630e54d4d184dcb3f3df63437f49e (patch) | |
| tree | 23260ac1b12b89f5efb8819f0eb57628f5d21010 /src_py | |
| parent | 1a7bbad8a6295db02d3e66a8d601b5e9da1e9057 (diff) | |
build refactoring
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(): |
