Skip to content

Add BLE, C4, ISC, and PERF lints - #3579

Merged
flying-sheep merged 4 commits into
mainfrom
pa/sim-lints
Apr 11, 2025
Merged

Add BLE, C4, ISC, and PERF lints#3579
flying-sheep merged 4 commits into
mainfrom
pa/sim-lints

Conversation

@flying-sheep

Copy link
Copy Markdown
Member

@flying-sheep flying-sheep added Development Process 🚀 needs retroactive review This PR has been merged but could use some eyes on it labels Apr 11, 2025
@flying-sheep flying-sheep added this to the 1.11.2 milestone Apr 11, 2025
@flying-sheep flying-sheep changed the title Add C4, ISC, and PERF lints Add BLE, C4, ISC, and PERF lints Apr 11, 2025
@codecov

codecov Bot commented Apr 11, 2025

Copy link
Copy Markdown

❌ 1 Tests Failed:

Tests completed Failed Passed Skipped
1973 1 1972 90
View the top 1 failed test(s) by shortest run time
tests/test_datasets.py::test_burczynski06
Stack Traces | 125s run time
#x1B[0m#x1B[37m@pytest#x1B[39;49;00m.mark.internet#x1B[90m#x1B[39;49;00m
    #x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mtest_burczynski06#x1B[39;49;00m():#x1B[90m#x1B[39;49;00m
        #x1B[94mwith#x1B[39;49;00m pytest.warns(#x1B[96mUserWarning#x1B[39;49;00m, match=#x1B[33mr#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[33mVariable names are not unique#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m):#x1B[90m#x1B[39;49;00m
>           adata = sc.datasets.burczynski06()#x1B[90m#x1B[39;49;00m

#x1B[1m#x1B[31mtests/test_datasets.py#x1B[0m:38: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
#x1B[1m#x1B[.../hostedtoolcache/Python/3.13.2.........................../x64/lib/python3.13.../scanpy/datasets/_utils.py#x1B[0m:24: in wrapper
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m f(*args, **kwargs)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../hostedtoolcache/Python/3.13.2.........................../x64/lib/python3.13.../scanpy/datasets/_datasets.py#x1B[0m:132: in burczynski06
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m read(filename, backup_url=url)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../hostedtoolcache/Python/3.13.2.........................../x64/lib/python3.13.../site-packages/legacy_api_wrap/__init__.py#x1B[0m:82: in fn_compatible
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m fn(*args_all, **kw)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../hostedtoolcache/Python/3.13.2.........................../x64/lib/python3.13........./site-packages/scanpy/readwrite.py#x1B[0m:150: in read
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m _read(#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../hostedtoolcache/Python/3.13.2.........................../x64/lib/python3.13........./site-packages/scanpy/readwrite.py#x1B[0m:880: in _read
    #x1B[0madata = _read_softgz(filename)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../hostedtoolcache/Python/3.13.2.........................../x64/lib/python3.13........./site-packages/scanpy/readwrite.py#x1B[0m:954: in _read_softgz
    #x1B[0m#x1B[94mfor#x1B[39;49;00m line #x1B[95min#x1B[39;49;00m file:#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../hostedtoolcache/Python/3.13.2.........................../x64/lib/python3.13/gzip.py#x1B[0m:339: in read1
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m #x1B[96mself#x1B[39;49;00m._buffer.read1(size)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[.../hostedtoolcache/Python/3.13.2.........................../x64/lib/python3.13/_compression.py#x1B[0m:68: in readinto
    #x1B[0mdata = #x1B[96mself#x1B[39;49;00m.read(#x1B[96mlen#x1B[39;49;00m(byte_view))#x1B[90m#x1B[39;49;00m
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <gzip._GzipReader object at 0x7fbf48f2dc00>, size = 8192

    #x1B[0m#x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mread#x1B[39;49;00m(#x1B[96mself#x1B[39;49;00m, size=-#x1B[94m1#x1B[39;49;00m):#x1B[90m#x1B[39;49;00m
        #x1B[94mif#x1B[39;49;00m size < #x1B[94m0#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            #x1B[94mreturn#x1B[39;49;00m #x1B[96mself#x1B[39;49;00m.readall()#x1B[90m#x1B[39;49;00m
        #x1B[90m# size=0 is special because decompress(max_length=0) is not supported#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        #x1B[94mif#x1B[39;49;00m #x1B[95mnot#x1B[39;49;00m size:#x1B[90m#x1B[39;49;00m
            #x1B[94mreturn#x1B[39;49;00m #x1B[33mb#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        #x1B[90m# For certain input data, a single#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        #x1B[90m# call to decompress() may not return#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        #x1B[90m# any data. In this case, retry until we get some data or reach EOF.#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        #x1B[94mwhile#x1B[39;49;00m #x1B[94mTrue#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            #x1B[94mif#x1B[39;49;00m #x1B[96mself#x1B[39;49;00m._decompressor.eof:#x1B[90m#x1B[39;49;00m
                #x1B[90m# Ending case: we've come to the end of a member in the file,#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
                #x1B[90m# so finish up this member, and read a new gzip header.#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
                #x1B[90m# Check the CRC and file size, and set the flag so we read#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
                #x1B[90m# a new member#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
                #x1B[96mself#x1B[39;49;00m._read_eof()#x1B[90m#x1B[39;49;00m
                #x1B[96mself#x1B[39;49;00m._new_member = #x1B[94mTrue#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
                #x1B[96mself#x1B[39;49;00m._decompressor = #x1B[96mself#x1B[39;49;00m._decomp_factory(#x1B[90m#x1B[39;49;00m
                    **#x1B[96mself#x1B[39;49;00m._decomp_args)#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
            #x1B[94mif#x1B[39;49;00m #x1B[96mself#x1B[39;49;00m._new_member:#x1B[90m#x1B[39;49;00m
                #x1B[90m# If the _new_member flag is set, we have to#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
                #x1B[90m# jump to the next member, if there is one.#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
                #x1B[96mself#x1B[39;49;00m._init_read()#x1B[90m#x1B[39;49;00m
                #x1B[94mif#x1B[39;49;00m #x1B[95mnot#x1B[39;49;00m #x1B[96mself#x1B[39;49;00m._read_gzip_header():#x1B[90m#x1B[39;49;00m
                    #x1B[96mself#x1B[39;49;00m._size = #x1B[96mself#x1B[39;49;00m._pos#x1B[90m#x1B[39;49;00m
                    #x1B[94mreturn#x1B[39;49;00m #x1B[33mb#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
                #x1B[96mself#x1B[39;49;00m._new_member = #x1B[94mFalse#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
            #x1B[90m# Read a chunk of data from the file#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[94mif#x1B[39;49;00m #x1B[96mself#x1B[39;49;00m._decompressor.needs_input:#x1B[90m#x1B[39;49;00m
                buf = #x1B[96mself#x1B[39;49;00m._fp.read(READ_BUFFER_SIZE)#x1B[90m#x1B[39;49;00m
                uncompress = #x1B[96mself#x1B[39;49;00m._decompressor.decompress(buf, size)#x1B[90m#x1B[39;49;00m
            #x1B[94melse#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
                uncompress = #x1B[96mself#x1B[39;49;00m._decompressor.decompress(#x1B[33mb#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, size)#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
            #x1B[94mif#x1B[39;49;00m #x1B[96mself#x1B[39;49;00m._decompressor.unused_data != #x1B[33mb#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
                #x1B[90m# Prepend the already read bytes to the fileobj so they can#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
                #x1B[90m# be seen by _read_eof() and _read_gzip_header()#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
                #x1B[96mself#x1B[39;49;00m._fp.prepend(#x1B[96mself#x1B[39;49;00m._decompressor.unused_data)#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
            #x1B[94mif#x1B[39;49;00m uncompress != #x1B[33mb#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
                #x1B[94mbreak#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[94mif#x1B[39;49;00m buf == #x1B[33mb#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
>               #x1B[94mraise#x1B[39;49;00m #x1B[96mEOFError#x1B[39;49;00m(#x1B[33m"#x1B[39;49;00m#x1B[33mCompressed file ended before the #x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
                               #x1B[33m"#x1B[39;49;00m#x1B[33mend-of-stream marker was reached#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31mE               EOFError: Compressed file ended before the end-of-stream marker was reached#x1B[0m

#x1B[1m#x1B[.../hostedtoolcache/Python/3.13.2.........................../x64/lib/python3.13/gzip.py#x1B[0m:549: EOFError

#x1B[33mDuring handling of the above exception, another exception occurred:#x1B[0m

    #x1B[0m#x1B[37m@pytest#x1B[39;49;00m.mark.internet#x1B[90m#x1B[39;49;00m
    #x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mtest_burczynski06#x1B[39;49;00m():#x1B[90m#x1B[39;49;00m
>       #x1B[94mwith#x1B[39;49;00m pytest.warns(#x1B[96mUserWarning#x1B[39;49;00m, match=#x1B[33mr#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[33mVariable names are not unique#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m):#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31mE       Failed: DID NOT WARN. No warnings of type (<class 'UserWarning'>,) were emitted.#x1B[0m
#x1B[1m#x1B[31mE        Emitted warnings: [].#x1B[0m

#x1B[1m#x1B[31mtests/test_datasets.py#x1B[0m:37: Failed

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development Process 🚀 needs retroactive review This PR has been merged but could use some eyes on it

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant