Jaded-Encoding-Thaumaturgy / vs-deband

Various debanding tools for VapourSynth
MIT License
15 stars 7 forks source link

PlaceboGrain Type Error #98

Closed Cwavs closed 4 months ago

Cwavs commented 4 months ago

Running PlaceboGrain with a Tuple for strength seems to give me the following error:


    runpy.run_path(str(script), module.__dict__, module.__name__)
  File "c:\Python312\Lib\runpy.py", line 286, in run_path
    return _run_module_code(code, init_globals, run_name,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "c:\Python312\Lib\runpy.py", line 98, in _run_module_code
    _run_code(code, mod_globals, init_globals,
  File "c:\Python312\Lib\site-packages\vspreview\core\vsenv.py", line 36, in _monkey_runpy_func
    glob_dict = orig_runpy_run_code(*args, **kwargs)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "c:\Python312\Lib\runpy.py", line 88, in _run_code
    exec(code, run_globals)
  File "C:\Users\Cwavs\Desktop\Encoding\JoJo OVA\Ep1.vpy", line 22, in <module>
    grained = PlaceboGrain.grain(den, luma_scaling=0, strength=[10, 5])
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "c:\Python312\Lib\site-packages\stgpytools\types\utils.py", line 180, in _wrapper
    return self.function(obj, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "c:\Python312\Lib\site-packages\vsdeband\noise.py", line 152, in grain
    if max(strength) <= 0.0:
       ^^^^^^^^^^^^^^^^^^^^
TypeError: '<=' not supported between instances of 'list' and 'float'```
Vodes commented 4 months ago

seems like the fix would just be to unpack strength. Idk if it's even PR worthy

Setsugennoao commented 4 months ago

You clearly passed a list instead of a tuple, resulting in strength being ([...], [...])

Then max picks up a list and does [...] <= 0.0

Cwavs commented 4 months ago

My bad, the square brackets in the definition confused me lmao