Unverified Commit abe32cef authored by AUTOMATIC1111's avatar AUTOMATIC1111 Committed by GitHub
Browse files

Merge pull request #10285 from akx/ruff-spacing

Indentation + ruff whitespace fixes
parents b4aaa339 49a55b41
Loading
Loading
Loading
Loading
+102 −100
Original line number Original line Diff line number Diff line
@@ -25,6 +25,7 @@ def crop_image(im, settings):
        elif is_portrait(settings.crop_width, settings.crop_height):
        elif is_portrait(settings.crop_width, settings.crop_height):
            scale_by = settings.crop_height / im.height
            scale_by = settings.crop_height / im.height



    im = im.resize((int(im.width * scale_by), int(im.height * scale_by)))
    im = im.resize((int(im.width * scale_by), int(im.height * scale_by)))
    im_debug = im.copy()
    im_debug = im.copy()


@@ -260,6 +261,7 @@ def image_entropy(im):
    hist = hist[hist > 0]
    hist = hist[hist > 0]
    return -np.log2(hist / hist.sum()).sum()
    return -np.log2(hist / hist.sum()).sum()



def centroid(pois):
def centroid(pois):
    x = [poi.x for poi in pois]
    x = [poi.x for poi in pois]
    y = [poi.y for poi in pois]
    y = [poi.y for poi in pois]
+9 −9
Original line number Original line Diff line number Diff line
@@ -1841,15 +1841,15 @@ def versions_html():


    return f"""
    return f"""
version: <a href="https://github.com/AUTOMATIC1111/stable-diffusion-webui/commit/{commit}">{tag}</a>
version: <a href="https://github.com/AUTOMATIC1111/stable-diffusion-webui/commit/{commit}">{tag}</a>
 

python: <span title="{sys.version}">{python_version}</span>
python: <span title="{sys.version}">{python_version}</span>
 

torch: {getattr(torch, '__long_version__',torch.__version__)}
torch: {getattr(torch, '__long_version__',torch.__version__)}
 

xformers: {xformers_version}
xformers: {xformers_version}
 

gradio: {gr.__version__}
gradio: {gr.__version__}
 

checkpoint: <a id="sd_checkpoint_hash">N/A</a>
checkpoint: <a id="sd_checkpoint_hash">N/A</a>
"""
"""


+3 −2
Original line number Original line Diff line number Diff line
@@ -6,6 +6,7 @@ extend-select = [
  "B",
  "B",
  "C",
  "C",
  "I",
  "I",
  "W",
]
]


exclude = [
exclude = [
@@ -20,7 +21,7 @@ ignore = [
	"I001", # Import block is un-sorted or un-formatted
	"I001", # Import block is un-sorted or un-formatted
	"C901", # Function is too complex
	"C901", # Function is too complex
	"C408", # Rewrite as a literal
	"C408", # Rewrite as a literal

	"W605", # invalid escape sequence, messes with some docstrings
]
]


[tool.ruff.per-file-ignores]
[tool.ruff.per-file-ignores]
+44 −42
Original line number Original line Diff line number Diff line
import unittest
import unittest
import requests
import requests



class UtilsTests(unittest.TestCase):
class UtilsTests(unittest.TestCase):
    def setUp(self):
    def setUp(self):
        self.url_options = "http://localhost:7860/sdapi/v1/options"
        self.url_options = "http://localhost:7860/sdapi/v1/options"
@@ -58,5 +59,6 @@ class UtilsTests(unittest.TestCase):
    def test_embeddings(self):
    def test_embeddings(self):
        self.assertEqual(requests.get(self.url_embeddings).status_code, 200)
        self.assertEqual(requests.get(self.url_embeddings).status_code, 200)



if __name__ == "__main__":
if __name__ == "__main__":
    unittest.main()
    unittest.main()
+1 −1

File changed.

Contains only whitespace changes.

+1 −1

File changed.

Contains only whitespace changes.

+7 −7

File changed.

Contains only whitespace changes.

+19 −19

File changed.

Contains only whitespace changes.

+2 −2

File changed.

Contains only whitespace changes.

+3 −3

File changed.

Contains only whitespace changes.

+2 −2

File changed.

Contains only whitespace changes.

+4 −4

File changed.

Contains only whitespace changes.

+1 −1

File changed.

Contains only whitespace changes.

+2 −2

File changed.

Contains only whitespace changes.

+1 −1

File changed.

Contains only whitespace changes.

+1 −1

File changed.

Contains only whitespace changes.

+7 −7

File changed.

Contains only whitespace changes.

+2 −2

File changed.

Contains only whitespace changes.

+1 −1

File changed.

Contains only whitespace changes.

+6 −6

File changed.

Contains only whitespace changes.

+2 −2

File changed.

Contains only whitespace changes.

+8 −8

File changed.

Contains only whitespace changes.

+3 −3

File changed.

Contains only whitespace changes.

+16 −16

File changed.

Contains only whitespace changes.

+1 −1

File changed.

Contains only whitespace changes.

+2 −2

File changed.

Contains only whitespace changes.

+1 −1

File changed.

Contains only whitespace changes.

+1 −1

File changed.

Contains only whitespace changes.

+1 −1

File changed.

Contains only whitespace changes.

+1 −1

File changed.

Contains only whitespace changes.

+2 −2

File changed.

Contains only whitespace changes.

+1 −1

File changed.

Contains only whitespace changes.

+1 −1

File changed.

Contains only whitespace changes.

+9 −9

File changed.

Contains only whitespace changes.

+1 −1

File changed.

Contains only whitespace changes.

+26 −26

File changed.

Contains only whitespace changes.

+1 −1

File changed.

Contains only whitespace changes.

+6 −6

File changed.

Contains only whitespace changes.

+2 −2

File changed.

Contains only whitespace changes.

+3 −3

File changed.

Contains only whitespace changes.

+7 −7

File changed.

Contains only whitespace changes.

Loading