Commit graph

2598 commits

Author SHA1 Message Date
Dan Halbert
d35c2e34b0 tests/circuitpython-manual/pwmio: shrink png images 2024-06-21 14:16:59 -04:00
Tim
59e604c783 move pwm test to tests/circuitpython-manual 2024-06-20 09:58:37 -07:00
2f3d371762 update expected result due to addition of audiomp3 module 2024-05-30 14:49:09 -05:00
Dan Halbert
40e4e97368 Merge branch '9.0.x' of https://github.com/adafruit/circuitpython into 9.0.5-merge-to-main 2024-05-22 10:18:56 -04:00
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
9e878f7b3d synthio: Calculate LFO.value at construction
Originally, the only (non-debug) way to make an LFO calculate its value
was to associate it with a playing synthesizer.

This posed a problem for LFOs that had "power on values" other than 0,
and where the value was used other than to internally drive a note
property.

Now, an initial, possibly non-zero value is calculated at object
construction time:

```py
>>> l = synthio.LFO(offset = 1)
>>> l.value
1.0
```

Note that this happens just once at construction; it does not happen when
updating LFO properties:
```py
>>> l.offset = 2
>>> l.value
1.0
```
2024-05-14 18:27:57 -05:00
1be36bd7cb Add floppyio to unix port, test mfm decoding 2024-04-02 15:42:28 -05:00
Scott Shawcroft
001740f2d7
Merge pull request #9117 from jepler/getenv-strings-must-be-quoted
settings.toml: explicitly check that strings must be quoted
2024-03-29 10:35:18 -07:00
ce64daa86e settings.toml: explicitly check that strings must be quoted 2024-03-29 09:20:30 -05:00
Dan Halbert
c035ade1fd
Merge pull request #9065 from SAK917/expand-objdeque-implementation
Expand objdeque implementation
2024-03-26 19:28:07 -04:00
SAK917
9b1c8ec61b Tests for expanded deque functionality 2024-03-19 23:12:05 -07:00
Dan Halbert
dc69c29dac rename ports/nrf to ports/nordic 2024-03-19 17:36:57 -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