Commit graph

2587 commits

Author SHA1 Message Date
49cbbd198a Fix chaining non-built-in exceptions 2024-05-21 16:41:39 -04:00
41eee0d5ea Add tests for chained exceptions (failing) 2024-05-21 16:41:39 -04:00
Scott Shawcroft
0cf3a66c81
Provide language code to string descriptors
This improves #8885 but doesn't fix the read error.
2024-02-23 15:51:12 -08:00
KB Sriram
e675ea3ca4 Add tests for bit_length()
Also verified the tests fail without the fix in https://github.com/adafruit/circuitpython/pull/4845
Fixes https://github.com/adafruit/circuitpython/issues/4846
2024-02-17 20:26:37 -08:00
Bill Sideris
0d550722af
Fix the rest of the tests 2024-02-17 00:35:40 +02:00
Bill Sideris
750912d193
Fix some cmdline tests 2024-02-16 20:40:17 +02:00
foamyguy
3c969c41ef remove if, remove +/- 1, add blit test 2024-02-05 09:32:22 -06:00
Dan Halbert
2a082e05f9
Merge pull request #8851 from dhalbert/fix-dict-subclass-keys
py/objdict.c: fix keys() for dict subclasses
2024-01-30 22:57:00 -05:00
8b30494146 Fix copying B to G in bitmapfilter.blend 2024-01-30 10:45:56 -06:00
e089f323f1 Update expected result with the additional test vectors 2024-01-29 16:07:08 -06:00
943825f8be Add bitmapfilter.blend
This can perform arbitrary channel mixing between two images.
Alpha blend & maximum functions are demonstrated in the test.
However, it should make most of the usual photo editing blends
possible. (for dissolve, fill a mask bitmap with random values,
which may be expensive to do from circuitpython code; we can
specifically accelerate it if we need to)
2024-01-29 11:15:35 -06:00
Dan Halbert
25deb94fc2 py/objdict.c: fix keys() for dict subclasses 2024-01-27 15:29:58 -05:00
Scott Shawcroft
283aac23be
Fix subclassing dict
The get, set and del item methods didn't correctly lookup the value
from the parent native instance because the functions took the type
from the instance.

Fixes #8758
2024-01-23 15:39:57 -08:00
961a63b3ee
Require use of the ChannelMixer / ChannelScaler types in mix()
.. and update the test accordingly, fixing a bug discovered in the
process.
2024-01-18 17:16:44 -06:00
2e9e3fe3ab
tests: Remove file that should not have been added. 2024-01-16 14:58:41 -06:00
0c36c1558e
Remove morph9, we're tight on flash space as it is
.. and no specific use case for morph9 is known that can't be done
with mix+morph.

Saves ~1800 bytes on Memento
2024-01-15 14:08:13 -06:00
42a822d543
remove unused code 2024-01-15 11:36:38 -06:00
6e553e763c
Add, test morph9
morph9 is a form of morph which performs 9 different convolutions,
like a version of mix where each coefficient is a (2n+1)x(2n+1) matrix.

Most use cases are covered by morph-then-mix, but some advanced operations
may be more efficient to implement via morph9.
2024-01-12 17:32:45 -06:00
6d30ff527a
Add false_color 2024-01-12 10:48:26 -06:00
ff22baa37f
Add lookup table (LUT) 2024-01-11 14:40:01 -06:00
415432e942
Fix solarize to operate in YUV, add test 2024-01-11 14:37:36 -06:00
790e8902f8
Use a test pattern for mix filter, not blinka 2024-01-11 11:59:45 -06:00
7e1c05edf5
morph: accommodate fractional add values 2024-01-09 17:11:53 -06:00
e02c72b0da
Update morph test to use the factored out bitmap routine 2024-01-09 15:01:10 -06:00
36411203ff
Add bitmapfilter.mix
This allows operations between channels in an image. It can be used for
the following use cases:
 * Conversion to B&W or sepia
 * Adding color casts
 * Mixing or swapping arbitrary channels
 * Inverting or scaling arbitrary channels
2024-01-09 15:00:42 -06:00
214ebc3955
morph improvements
* weight can be any sequence (& test it)
 * improve error message
 * correct documentation of ``mask`` vs copypaste from openmv
2024-01-08 08:57:20 -06:00
7e23fac766
bitmapfilter: refine morph, add docs 2024-01-06 13:34:42 -06:00
75be426377
Add "bitmapfilter"
bitmapfilter.morph is taken from openmv's imlib.

It is substantially faster than blur/sharpen implemented in ulab,
by up to 10x. It also avoids making many allocations.
2024-01-05 14:16:00 -06:00
35258215ca
Correct y= argument of JpegDecoder.decode
.. update the tests as well. Don't dump the bitmap when the bitmaps
already compared equal for the crop and position tests.
2024-01-04 13:11:32 -06:00
7724ce3a3d
Test using an IO adapter; remove redundant BytesIO tests 2023-12-24 10:50:01 -06:00
5dd689c38a
jpegio: add bitmaptools.blit like clipping to decode 2023-12-24 10:50:00 -06:00
8d288f9623
jpegio: split open & decode; add support for decoding from files; add test 2023-12-24 10:50:00 -06:00
10907c3521
Add a new test of decoding jpeg image 2023-12-24 10:49:59 -06:00
9477574dfc
Add codeop.compile_command
This function in standard Python is a building block for custom REPLs:
```python
from codeop import compile_command

print("Repl in (Circuit-)Python")
ns = {}

PS1="<<< "
PS2=",,, "
command = ""
while True:
    line = input(PS2 if command else PS1)
    if command:
        command = command + "\n" + line
    else:
        command = line
    try:
        if (code := compile_command(command)):
            command = ""
            exec(code, ns)
    except Exception as e:
        command = ""
        print(e)
```
2023-12-14 09:23:23 -06:00
f7b9a516d8
update test result changed due to new module 2023-12-05 14:05:34 -06:00
19df6adf4c
Update expected test results
some of the numbers have the last two digits changed, it's just noise.
2023-11-21 08:54:08 -06:00
c5be5f349a
Traceback tests are "special" because they need relative paths 2023-11-21 08:54:08 -06:00
5790785eae
endorse updated result 2023-11-21 08:54:08 -06:00
c87abe7580
run-tests: re-add circuitpython tests 2023-11-21 08:54:08 -06:00
5fd8630654
tests: update synthesizer_note test with new expected output 2023-11-21 08:54:07 -06:00
5dc1d389d1
tests: restore getenv_int tests 2023-11-21 08:54:07 -06:00
c92ad33a9c
synthio: allow negative amplitudes
Previously, negative amplitudes were clamped to zero.
Now, they are allowed to range from -ALMOST_ONE to +ALMOST_ONE.
This is useful in certain circumstances, such as using synthio
to create CV-like outputs that can be positive or negative, by
using the amplitude property of the note.
2023-11-21 08:54:07 -06:00
d79bdbbe6b
update test result 2023-11-14 21:31:37 -06:00
eightycc
a4c4c16dd5
Update vfs_fat_ramdisk.py.exp 2023-11-07 13:52:43 -08:00
eightycc
6d1b1700bb
Update vfs_blockdev.py.exp 2023-11-07 13:50:51 -08:00
Bob Abeles
966e6e4fe5 Shrink root dir size for tiny (<=128K) FAT12 fs 2023-11-07 10:24:36 -08:00
David Zurow
37809d7033
Fix typo in TCP server test readme.md 2023-10-26 02:33:10 -04:00
Scott Shawcroft
be30c12a74
Pass subobject into native subscr
This allows PixelBuf to call transmit after setting a value.

Fixes #8488
2023-10-25 11:44:32 -07:00
Scott Shawcroft
63079c75b0
Re-add passing native methods the subclass instance
Fixes #8488
2023-10-24 16:20:51 -07:00
Scott Shawcroft
e62db5adcd
Fix native property setting from subclass 2023-10-24 16:20:51 -07:00