on_touch_down() in FloatLayout() does not work in Kivy 2.2.1 (see also issue #7861)

Software Versions

Python: 3.10.10
OS:
on PC: Ubuntu 20.04.6 LTS
on a MOTO G5 phone: Android 8.1.0
Kivy: 2.2.1
Kivy installation method: Not sure...
I am doing '$ buildozer android debug deploy run' in a Python venv, with Cython version 0.29.33.
I tried using Cython 3.0.x but it creates a huge amount of compiling errors!
Buildozer 1.5.0

Describe the bug
My customized version of the Kivy TouchTracer demo works with Kivy v. 2.0.0 but not with v. 2.2.1 (and not with v. 2.1.0)
Expected behavior
The problem is that the moment you touch the screen, the whole screen turns blue - like the famous MS-Windows "blue screen of death"... :-) At least on my Android ver. 8.1.0 MOTO G5 phone.
But 'adb logcat' does not produce any error message.
To Reproduce
You can find a more or less minimal example that reproduces the problem here: https://groups.google.com/g/kivy-users/c/cDwRkQkZTA4
Code and Logs and screenshots
(See also https://groups.google.com/g/kivy-users/c/cDwRkQkZTA4 )
Here comes output of ' adb logcat | grep -w "python" | grep -Fv "extracting" ':
(testvenv) hk@hk:/mnt/4AF15A0435E762B4/mypython/touchtracer-NEW$ /home/henrik/.buildozer/android/platform/android-sdk/platform-tools/adb logcat | grep -w "python" | grep -Fv "extracting"
09-28 12:59:52.639  4361  4503 I python  : Initializing Python for Android
09-28 12:59:52.639  4361  4503 I python  : Setting additional env vars from p4a_env_vars.txt
09-28 12:59:52.639  4361  4503 I python  : Changing directory to the one provided by ANDROID_ARGUMENT
09-28 12:59:52.639  4361  4503 I python  : /data/user/0/org.test.touchtracer/files/app
09-28 12:59:52.640  4361  4503 I python  : Preparing to initialize python
09-28 12:59:52.640  4361  4503 I python  : _python_bundle dir exists
09-28 12:59:52.640  4361  4503 I python  : calculated paths to be...
09-28 12:59:52.640  4361  4503 I python  : /data/user/0/org.test.touchtracer/files/app/_python_bundle/stdlib.zip:/data/user/0/org.test.touchtracer/files/app/_python_bundle/modules
09-28 12:59:52.640  4361  4503 I python  : set wchar paths...
09-28 12:59:52.815  4361  4503 I python  : Initialized python
09-28 12:59:52.815  4361  4503 I python  : AND: Init threads
09-28 12:59:52.816  4361  4503 I python  : testing python print redirection
09-28 12:59:52.819  4361  4503 I python  : Android path ['.', '/data/user/0/org.test.touchtracer/files/app/_python_bundle/stdlib.zip', '/data/user/0/org.test.touchtracer/files/app/_python_bundle/modules', '/data/user/0/org.test.touchtracer/files/app/_python_bundle/site-packages']
09-28 12:59:52.819  4361  4503 I python  : os.environ is environ({'PATH': '/sbin:/system/sbin:/system/bin:/system/xbin:/vendor/bin:/vendor/xbin', 'DOWNLOAD_CACHE': '/data/cache', 'ANDROID_BOOTLOGO': '1', 'ANDROID_ROOT': '/system', 'ANDROID_ASSETS': '/system/app', 'ANDROID_DATA': '/data', 'ANDROID_STORAGE': '/storage', 'EXTERNAL_STORAGE': '/sdcard', 'ASEC_MOUNTPOINT': '/mnt/asec', 'BOOTCLASSPATH': '/system/framework/QPerformance.jar:/system/framework/qcom.fmradio.jar:/system/framework/oem-services.jar:/system/framework/tcmiface.jar:/system/framework/telephony-ext.jar:/system/framework/core-oj.jar:/system/framework/core-libart.jar:/system/framework/conscrypt.jar:/system/framework/okhttp.jar:/system/framework/bouncycastle.jar:/system/framework/apache-xml.jar:/system/framework/legacy-test.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/telephony-common.jar:/system/framework/voip-common.jar:/system/framework/ims-common.jar:/system/framework/org.apache.http.legacy.boot.jar:/system/framework/android.hidl.base-V1.0-java.jar:/system/framework/android.hidl.manager-V1.0-java.jar', 'SYSTEMSERVERCLASSPATH': '/system/framework/services.jar:/system/framework/ethernet-service.jar:/system/framework/wifi-service.jar:/system/framework/com.android.location.provider.jar', 'ANDROID_SOCKET_zygote': '9', 'ANDROID_ENTRYPOINT': 'main.pyc', 'ANDROID_ARGUMENT': '/data/user/0/org.test.touchtracer/files/app', 'ANDROID_APP_PATH': '/data/user/0/org.test.touchtracer/files/app', 'ANDROID_PRIVATE': '/data/user/0/org.test.touchtracer/files', 'ANDROID_UNPACK': '/data/user/0/org.test.touchtracer/files/app', 'PYTHONHOME': '/data/user/0/org.test.touchtracer/files/app', 'PYTHONPATH': '/data/user/0/org.test.touchtracer/files/app:/data/user/0/org.test.touchtracer/files/app/lib', 'PYTHONOPTIMIZE': '2', 'P4A_BOOTSTRAP': 'SDL2', 'PYTHON_NAME': 'python', 'P4A_IS_WINDOWED': 'True', 'KIVY_ORIENTATION': 'LandscapeLeft Portrait', 'P4A_NUMERIC_VERSION': 'None', 'P4A_MINSDK': '21', 'LC_CTYPE': 'C.UTF-8'})
09-28 12:59:52.820  4361  4503 I python  : Android kivy bootstrap done. __name__ is __main__
09-28 12:59:52.820  4361  4503 I python  : AND: Ran string
09-28 12:59:52.820  4361  4503 I python  : Run user program, change dir and execute entrypoint
09-28 12:59:53.215  4361  4503 I python  : [WARNING] [Config      ] Older configuration version detected (0 instead of 27)
09-28 12:59:53.215  4361  4503 I python  : [WARNING] [Config      ] Upgrading configuration in progress.
09-28 12:59:53.216  4361  4503 I python  : [DEBUG  ] [Config      ] Upgrading from 0 to 1
09-28 12:59:53.226  4361  4503 I python  : [INFO   ] [Logger      ] Record log in /data/user/0/org.test.touchtracer/files/app/.kivy/logs/kivy_23-09-28_0.txt
09-28 12:59:53.227  4361  4503 I python  : [INFO   ] [Kivy        ] v2.2.1
09-28 12:59:53.227  4361  4503 I python  : [INFO   ] [Kivy        ] Installed at "/data/user/0/org.test.touchtracer/files/app/_python_bundle/site-packages/kivy/__init__.pyc"
09-28 12:59:53.227  4361  4503 I python  : [INFO   ] [Python      ] v3.10.10 (main, Sep 28 2023, 12:43:38) [Clang 14.0.6 (https://android.googlesource.com/toolchain/llvm-project 4c603efb0
09-28 12:59:53.228  4361  4503 I python  : [INFO   ] [Python      ] Interpreter at ""
09-28 12:59:53.229  4361  4503 I python  : [INFO   ] [Logger      ] Purge log fired. Processing...
09-28 12:59:53.229  4361  4503 I python  : [INFO   ] [Logger      ] Purge finished!
09-28 12:59:56.168  4361  4503 I python  : [INFO   ] [Factory     ] 190 symbols loaded
09-28 12:59:57.000  4361  4503 I python  : [INFO   ] [Image       ] Providers: img_tex, img_dds, img_sdl2 (img_pil, img_ffpyplayer ignored)
09-28 12:59:57.060  4361  4503 I python  : [INFO   ] [Text        ] Provider: sdl2
09-28 12:59:57.446  4361  4503 I python  : [INFO   ] [Window      ] Provider: sdl2
09-28 12:59:57.615  4361  4503 I python  : [INFO   ] [GL          ] Using the "OpenGL ES 2" graphics system
09-28 12:59:57.621  4361  4503 I python  : [INFO   ] [GL          ] Backend used <sdl2>
09-28 12:59:57.622  4361  4503 I python  : [INFO   ] [GL          ] OpenGL version <b'OpenGL ES 3.2<EMAIL_ADDRESS>(GIT@bb5b86c, I77d3059488) (Date:06/07/18)'>
09-28 12:59:57.623  4361  4503 I python  : [INFO   ] [GL          ] OpenGL vendor <b'Qualcomm'>
09-28 12:59:57.624  4361  4503 I python  : [INFO   ] [GL          ] OpenGL renderer <b'Adreno (TM) 505'>
09-28 12:59:57.626  4361  4503 I python  : [INFO   ] [GL          ] OpenGL parsed version: 3, 2
09-28 12:59:57.627  4361  4503 I python  : [INFO   ] [GL          ] Texture max size <16384>
09-28 12:59:57.629  4361  4503 I python  : [INFO   ] [GL          ] Texture max units <16>
09-28 12:59:57.729  4361  4503 I python  : [INFO   ] [Window      ] auto add sdl2 input provider
09-28 12:59:57.731  4361  4503 I python  : [INFO   ] [Window      ] virtual keyboard not allowed, single mode, not docked
09-28 12:59:57.772  4361  4503 I python  : [WARNING] [Base        ] Unknown <android> provider
09-28 12:59:57.772  4361  4503 I python  : [INFO   ] [Base        ] Start application main loop
09-28 12:59:57.784  4361  4503 I python  : [INFO   ] [GL          ] NPOT texture support is available
09-28 13:01:13.487  4704  4724 I python  : Initializing Python for Android
09-28 13:01:13.487  4704  4724 I python  : Setting additional env vars from p4a_env_vars.txt
09-28 13:01:13.487  4704  4724 I python  : Changing directory to the one provided by ANDROID_ARGUMENT
09-28 13:01:13.487  4704  4724 I python  : /data/user/0/org.test.touchtracer/files/app
09-28 13:01:13.487  4704  4724 I python  : Preparing to initialize python
09-28 13:01:13.487  4704  4724 I python  : _python_bundle dir exists
09-28 13:01:13.487  4704  4724 I python  : calculated paths to be...
09-28 13:01:13.487  4704  4724 I python  : /data/user/0/org.test.touchtracer/files/app/_python_bundle/stdlib.zip:/data/user/0/org.test.touchtracer/files/app/_python_bundle/modules
09-28 13:01:13.487  4704  4724 I python  : set wchar paths...
09-28 13:01:13.630  4704  4724 I python  : Initialized python
09-28 13:01:13.630  4704  4724 I python  : AND: Init threads

Additional context
Note that I reported this bug on April 12, 2022, using Kivy v. 2.1.0.
With Kivy v. 2.0.0 my TouchTracer demo worked: See https://github.com/kivy/kivy/issues/7861
Output of 'buildozer android run logcat >../touch-log.txt':
touch-log.txt
(It's 955 KB)
I look forward to a solution to this issue. I can't see how to release my GeoESP Training app on Google Play Store until it's resolved.

is this Android specific ?,
Also from the example was_touched is never set to false again so the if will only run once,
I tested on PC using this example,

from kivy.uix.floatlayout import FloatLayout

class cFloatLayout(FloatLayout):
    def __init__(self, **kwargs):
        super(cFloatLayout, self).__init__(**kwargs)

    def on_touch_down(self, touch):
        print("on_touch_down")
        return super().on_touch_down(touch)

layout = cFloatLayout()

if __name__ == '__main__':
    from kivy.base import runTouchApp
    runTouchApp(layout)

I think this problem is specific for Android.
I am sorry I didn't post the runnable example.
Those file types cannot be attached - very unpractical. But here they come (5 files):
Here comes 'android.txt':
´´´
title=GeoESP Training
author=Henrik Rosenø
orientation=portrait
´´´
Here comes 'particle.png':

Here comes 'arrow.py':
´´´
#!/usr/bin/python
The MIT License (MIT)
Copyright (c) 2017 "Laxminarayan Kamath G<EMAIL_ADDRESS>Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
OR OTHER DEALINGS IN THE SOFTWARE.
from kivy.properties import *
from kivy.event import EventDispatcher
from kivy.uix.widget import Widget
from kivy.metrics import *
from kivy.graphics import *
import math
piby180 = math.pi/180.0
------------------ KVector --------------------
class KVector(EventDispatcher):
o_x = NumericProperty(0)
o_y = NumericProperty(0)
to_x = NumericProperty(0)
to_y = NumericProperty(0)
to_pos = ReferenceListProperty(to_x,to_y)
angle = NumericProperty(0)
distance = NumericProperty(0)

def get_angle(self):
return ((math.atan2(self.to_x - self.o_x, self.o_y - self.to_y)/piby180)+630.0 ) % 360.0

def set_angle(self,angle):
self.to_x = self.o_x + (math.cos(angle * piby180) * self.distance)
self.to_y = self.o_y + (math.sin(angle * piby180) * self.distance)

def get_distance(self):
absx = abs(self.to_x-self.o_x)
absy = abs(self.to_y-self.o_y)
return math.sqrt((absxabsx)+(absyabsy))

def set_distance(self, distance):
self.to_x = self.o_x + ((math.cos(self.angle * piby180) * distance))
self.to_y = self.o_y + ((math.sin(self.angle * piby180) * distance))

angle = AliasProperty(
get_angle,
set_angle,
bind=['o_x','o_y','to_x', 'to_y']
)
distance = AliasProperty(
get_distance,
set_distance,
bind=['o_x','o_y','to_x', 'to_y']
)
def get_to_x(self):
    return self.o_x + (math.cos(self.angle * piby180) * self.distance)

def get_to_y(self):
    return self.o_y + (math.sin(self.angle * piby180) * self.distance)

def set_to_x(self, to_x):
    self.angle = ((math.atan2(to_x - self.o_x, self.o_y - self.to_y)/piby180)+630.0 ) % 360.0
    absx = abs(to_x-self.o_x)
    absy = abs(self.to_y-self.o_y)
    self.distance = math.sqrt((absx*absx)+(absy*absy))

def set_to_y(self, to_y):
    self.angle = ((math.atan2(self.to_x - self.o_x, self.o_y - to_y)/piby180)+630.0 ) % 360.0
    absx = abs(self.to_x-self.o_x)
    absy = abs(to_y-self.o_y)
    self.distance = math.sqrt((absx*absx)+(absy*absy))

to_x = AliasProperty(
                     get_to_x,
                     set_to_x,
                     bind=['o_x','o_y','angle','distance']
                    )

to_y = AliasProperty(
                     get_to_y,
                     set_to_y,
                     bind=['o_x','o_y','angle','distance']
                    )

def move_point(x,y,angle,distance):
return  (
x + (math.cos(angle * piby180) * distance),
y + (math.sin(angle * piby180) * distance)
)
------------ Arrow --------------
class Arrow(Widget,KVector):
head_size = NumericProperty(cm(0.5))
head_angle = NumericProperty(90.0)
shaft_width = NumericProperty(cm(0.05))
fletching_radius = NumericProperty(cm(0.1))
main_color = ListProperty([1,1,1,0.7])
outline_color = ListProperty([0,0,0,0.7])
outline_width = NumericProperty(cm(0.01))
distortions = ListProperty([])
def __init__(self,*args, **kwargs):
    Widget.__init__(self,*args,**kwargs)
    KVector.__init__(self,*args,**kwargs)

    with self.canvas:
        self.icolor = Color(rgba=self.main_color)
        self.head = Mesh(mode='triangle_fan',indices=[0,1,2])
        self.shaft = Line(width=self.shaft_width)
        self.fletching = Ellipse()

        self.ocolor = Color(rgba=self.outline_color)
        self.head_outline = Line(width=self.outline_width)
        self.shaft_outline_left = Line(width=self.outline_width)
        self.shaft_outline_right = Line(width=self.outline_width)
        self.fletching_outline = Line()

    self.bind(
              o_x=self.update_dims,
              o_y=self.update_dims,
              to_x=self.update_dims,
              to_y=self.update_dims,
              head_size=self.update_dims,
              head_angle=self.update_dims,
              shaft_width=self.update_shaft_width,
              outline_color=self.update_outline_color,
              main_color=self.update_color,
              outline_width=self.update_outline_width,
              distortions=self.update_dims,
              )
    self.update_dims()
    self.update_shaft_width()
    self.update_color()

def update_shaft_width(self,*args):
    self.shaft.width = self.shaft_width

def update_outline_width(self, *args):
    self.shaft_outline_right.width = self.outline_width
    self.shaft_outline_left.width = self.outline_width
    self.head_outline.width = self.outline_width

def update_outline_color(self, *args):
    self.ocolor.rgba = self.outline_color

def update_color(self, *args):
    self.icolor.rgba = self.main_color

def create_distortions(self, x1, y1, x2, y2):
    """
    Add points for a bezier curve distorted by a fraction of the line length.
    A distortion of [0.5] means that there will be one bezier point added in the middle of the line
    and that point will be displaced perpendicularly by 0.5 * self.distance.
    A distortion of [0.3, -0.5] means that there will be 2 points added, at 1/3 and 2/3 of the line
    and those points will be displaced perpendicularly by 0.3 * self.distance and -0.5 * self.distance
    meaning that the arrow will bend in both directions.
    """
    if not self.distortions:
        return [x1, y1, x2, y2]

    angle_perpendicular = self.angle + 90.0
    points = len(self.distortions)

    segments = [x1, y1]

    # For 3 points, we have: x = (3x1 + x2) / 4, (2x1 + 2x2) / 4, (x1 + 3x2) / 4
    for i, distortion in enumerate(self.distortions):
        xpos = ((points - i) * x1 + (i + 1) * x2) / (points + 1)
        ypos = ((points - i) * y1 + (i + 1) * y2) / (points + 1)
        segments.extend(move_point(xpos, ypos, angle_perpendicular, self.distance * distortion))

    segments.extend([x2, y2])

    return segments

def update_dims(self, *args):
    shaft_x1, shaft_y1 = move_point(self.o_x, self.o_y, self.angle, self.fletching_radius / math.sqrt(2))
    shaft_x2, shaft_y2 = move_point(self.to_x, self.to_y, self.angle,
                                    - math.cos(self.head_angle / 2.0 * piby180) * self.head_size)

    if not self.distortions:
        self.shaft.points = [shaft_x1, shaft_y1, shaft_x2, shaft_y2]
    else:
        self.shaft.bezier = self.create_distortions(shaft_x1, shaft_y1, shaft_x2, shaft_y2)

    shaft_ol_x1, shaft_ol_y1 = move_point(shaft_x1, shaft_y1, self.angle -90, self.shaft_width /0.6)
    shaft_ol_x2, shaft_ol_y2 = move_point(shaft_x2, shaft_y2, self.angle -90, self.shaft_width /0.6)

    shaft_or_x1, shaft_or_y1 = move_point(shaft_x1, shaft_y1, self.angle +90, self.shaft_width /0.6)
    shaft_or_x2, shaft_or_y2 = move_point(shaft_x2, shaft_y2, self.angle +90, self.shaft_width /0.6)

    if not self.distortions:
        self.shaft_outline_left.points = [shaft_ol_x1, shaft_ol_y1, shaft_ol_x2, shaft_ol_y2]
        self.shaft_outline_right.points = [shaft_or_x1, shaft_or_y1, shaft_or_x2, shaft_or_y2]
    else:
        self.shaft_outline_left.bezier = self.create_distortions(shaft_ol_x1, shaft_ol_y1, shaft_ol_x2, shaft_ol_y2)
        self.shaft_outline_right.bezier = self.create_distortions(shaft_or_x1, shaft_or_y1, shaft_or_x2, shaft_or_y2)

    head_x1, head_y1 = move_point(self.to_x, self.to_y, self.angle + (180 - self.head_angle / 2.0), self.head_size)
    head_x2, head_y2 = move_point(self.to_x, self.to_y, self.angle - (180 - self.head_angle / 2.0), self.head_size)
    self.head.vertices = [
                          self.to_x,
                          self.to_y,
                          0,
                          0,
                          head_x1,
                          head_y1,
                          0,
                          0,
                          head_x2,
                          head_y2,
                          0,
                          0,
                         ]

    self.head_outline.points = [
                                self.to_x,
                                self.to_y,
                                head_x1,
                                head_y1,
                                head_x2,
                                head_y2,
                                self.to_x,
                                self.to_y
                               ]

    self.fletching.pos=move_point(self.o_x,
                                  self.o_y,
                                  225,
                                  self.fletching_radius)

    self.fletching.size=[self.fletching_radius*math.sqrt(2)]*2
    self.fletching_outline.ellipse=(
                                   self.fletching.pos[0],
                                   self.fletching.pos[1],
                                   self.fletching_radius*math.sqrt(2),
                                   self.fletching_radius*math.sqrt(2),
                                   )

´´´
Here comes 'buildozer.spec':
´´´
[app]
(str) Title of your application
title = TouchTracer test
(str) Package name
package.name = touchtracer
(str) Package domain (needed for android/ios packaging)
package.domain = org.test
(str) Source code where the main.py live
source.dir = .
(list) Source files to include (let empty to include all the files)
source.include_exts = py,png,jpg,kv,atlas
(list) List of inclusions using pattern matching
#source.include_patterns = assets/,images/.png
(list) Source files to exclude (let empty to not exclude anything)
#source.exclude_exts = spec
(list) List of directory to exclude (let empty to not exclude anything)
#source.exclude_dirs = tests, bin, venv
(list) List of exclusions using pattern matching
Do not prefix with './'
#source.exclude_patterns = license,images//.jpg
(str) Application versioning (method 1)
version = 0.2
(str) Application versioning (method 2)
version.regex = version = '"['"]
version.filename = %(source.dir)s/main.py
(list) Application requirements
comma separated e.g. requirements = sqlite3,kivy
Sep. 27, 2023: Kivy 2.1.0 still doesn't work: TouchTracer gives blue screen, but nu error message.
requirements = python3,kivy
(str) Custom source folders for requirements
Sets custom source for any requirements with recipes
requirements.source.kivy = ../../kivy
(str) Presplash of the application
#presplash.filename = %(source.dir)s/data/presplash.png
(str) Icon of the application
#icon.filename = %(source.dir)s/data/icon.png
(str) Supported orientation (one of landscape, sensorLandscape, portrait or all)
orientation = landscape,portrait
(list) List of service to declare
#services = NAME:ENTRYPOINT_TO_PY,NAME2:ENTRYPOINT2_TO_PY

OSX Specific

author = © Copyright Info
change the major version of python used by the app
osx.python_version = 3
Kivy version to use
osx.kivy_version = 1.9.1

Android specific

(bool) Indicate if the application should be fullscreen or not
fullscreen = 0
(string) Presplash background color (for android toolchain)
Supported formats are: #RRGGBB #AARRGGBB or one of the following names:
red, blue, green, black, white, gray, cyan, magenta, yellow, lightgray,
darkgray, grey, lightgrey, darkgrey, aqua, fuchsia, lime, maroon, navy,
olive, purple, silver, teal.
#android.presplash_color = #FFFFFF
(string) Presplash animation using Lottie format.
see https://lottiefiles.com/ for examples and https://airbnb.design/lottie/
for general documentation.
Lottie files can be created using various tools, like Adobe After Effect or Synfig.
#android.presplash_lottie = "path/to/lottie/file.json"
(str) Adaptive icon of the application (used if Android API level is 26+ at runtime)
#icon.adaptive_foreground.filename = %(source.dir)s/data/icon_fg.png
#icon.adaptive_background.filename = %(source.dir)s/data/icon_bg.png
(list) Permissions
#android.permissions = INTERNET
(list) features (adds uses-feature -tags to manifest)
#android.features = android.hardware.usb.host
(int) Target Android API, should be as high as possible.
android.api = 34
(int) Minimum API your APK / AAB will support.
#android.minapi = 21
(int) Android SDK version to use
#android.sdk = 20
(str) Android NDK version to use
#android.ndk = 19b
(int) Android NDK API to use. This is the minimum API your app will support, it should usually match android.minapi.
#android.ndk_api = 21
(bool) Use --private data storage (True) or --dir public storage (False)
#android.private_storage = True
(str) Android NDK directory (if empty, it will be automatically downloaded.)
#android.ndk_path =
(str) Android SDK directory (if empty, it will be automatically downloaded.)
#android.sdk_path =
(str) ANT directory (if empty, it will be automatically downloaded.)
#android.ant_path =
(bool) If True, then skip trying to update the Android sdk
This can be useful to avoid excess Internet downloads or save time
when an update is due and you just want to test/build your package
android.skip_update = False
(bool) If True, then automatically accept SDK license
agreements. This is intended for automation only. If set to False,
the default, you will be shown the license when first running
buildozer.
android.accept_sdk_license = False
(str) Android entry point, default is ok for Kivy-based app
#android.entrypoint = org.kivy.android.PythonActivity
(str) Full name including package path of the Java class that implements Android Activity
use that parameter together with android.entrypoint to set custom Java class instead of PythonActivity
#android.activity_class_name = org.kivy.android.PythonActivity
(str) Extra xml to write directly inside the  element of AndroidManifest.xml
use that parameter to provide a filename from where to load your custom XML code
#android.extra_manifest_xml = ./src/android/extra_manifest.xml
(str) Extra xml to write directly inside the  tag of AndroidManifest.xml
use that parameter to provide a filename from where to load your custom XML arguments:
#android.extra_manifest_application_arguments = ./src/android/extra_manifest_application_arguments.xml
(str) Full name including package path of the Java class that implements Python Service
use that parameter to set custom Java class instead of PythonService
#android.service_class_name = org.kivy.android.PythonService
(str) Android app theme, default is ok for Kivy-based app
android.apptheme = "@android:style/Theme.NoTitleBar"
(list) Pattern to whitelist for the whole project
#android.whitelist =
(str) Path to a custom whitelist file
#android.whitelist_src =
(str) Path to a custom blacklist file
#android.blacklist_src =
(list) List of Java .jar files to add to the libs so that pyjnius can access
their classes. Don't add jars that you do not need, since extra jars can slow
down the build process. Allows wildcards matching, for example:
OUYA-ODK/libs/*.jar
#android.add_jars = foo.jar,bar.jar,path/to/more/*.jar
(list) List of Java files to add to the android project (can be java or a
directory containing the files)
#android.add_src =
(list) Android AAR archives to add
#android.add_aars =
(list) Put these files or directories in the apk assets directory.
Either form may be used, and assets need not be in 'source.include_exts'.
1) android.add_assets = source_asset_relative_path
2) android.add_assets = source_asset_path:destination_asset_relative_path
#android.add_assets =
(list) Gradle dependencies to add
#android.gradle_dependencies =
(bool) Enable AndroidX support. Enable when 'android.gradle_dependencies'
contains an 'androidx' package, or any package from Kotlin source.
android.enable_androidx requires android.api >= 28
#android.enable_androidx = False
(list) add java compile options
this can for example be necessary when importing certain java libraries using the 'android.gradle_dependencies' option
see https://developer.android.com/studio/write/java8-support for further information
android.add_compile_options = "sourceCompatibility = 1.8", "targetCompatibility = 1.8"
(list) Gradle repositories to add {can be necessary for some android.gradle_dependencies}
please enclose in double quotes
e.g. android.gradle_repositories = "maven { url 'https://kotlin.bintray.com/ktor' }"
#android.add_gradle_repositories =
(list) packaging options to add
see https://google.github.io/android-gradle-dsl/current/com.android.build.gradle.internal.dsl.PackagingOptions.html
can be necessary to solve conflicts in gradle_dependencies
please enclose in double quotes
e.g. android.add_packaging_options = "exclude 'META-INF/common.kotlin_module'", "exclude 'META-INF/*.kotlin_module'"
#android.add_packaging_options =
(list) Java classes to add as activities to the manifest.
#android.add_activities = com.example.ExampleActivity
(str) OUYA Console category. Should be one of GAME or APP
If you leave this blank, OUYA support will not be enabled
#android.ouya.category = GAME
(str) Filename of OUYA Console icon. It must be a 732x412 png image.
#android.ouya.icon.filename = %(source.dir)s/data/ouya_icon.png
(str) XML file to include as an intent filters in  tag
#android.manifest.intent_filters =
(str) launchMode to set for the main activity
#android.manifest.launch_mode = standard
(list) Android additional libraries to copy into libs/armeabi
#android.add_libs_armeabi = libs/android/.so
#android.add_libs_armeabi_v7a = libs/android-v7/.so
#android.add_libs_arm64_v8a = libs/android-v8/.so
#android.add_libs_x86 = libs/android-x86/.so
#android.add_libs_mips = libs/android-mips/*.so
(bool) Indicate whether the screen should stay on
Don't forget to add the WAKE_LOCK permission if you set this to True
#android.wakelock = False
(list) Android application meta-data to set (key=value format)
#android.meta_data =
(list) Android library project to add (will be added in the
project.properties automatically.)
#android.library_references =
(list) Android shared libraries which will be added to AndroidManifest.xml using  tag
#android.uses_library =
(str) Android logcat filters to use
#android.logcat_filters = *:S python:D
(bool) Android logcat only display log for activity's pid
#android.logcat_pid_only = False
(str) Android additional adb arguments
#android.adb_args = -H host.docker.internal
(bool) Copy library instead of making a libpymodules.so
#android.copy_libs = 1
(list) The Android archs to build for, choices: armeabi-v7a, arm64-v8a, x86, x86_64
In past, was android.arch as we weren't supporting builds for multiple archs at the same time.
android.archs = arm64-v8a, armeabi-v7a
android.archs = armeabi-v7a
android.archs = arm64-v8a, armeabi-v7a
(int) overrides automatic versionCode computation (used in build.gradle)
this is not the same as app version and should only be edited if you know what you're doing
android.numeric_version = 1
(bool) enables Android auto backup feature (Android API >=23)
android.allow_backup = True
(str) XML file for custom backup rules (see official auto backup documentation)
android.backup_rules =
(str) If you need to insert variables into your AndroidManifest.xml file,
you can do so with the manifestPlaceholders property.
This property takes a map of key-value pairs. (via a string)
Usage example : android.manifest_placeholders = [myCustomUrl:"org.kivy.customurl"]
android.manifest_placeholders = [:]
(bool) disables the compilation of py to pyc/pyo files when packaging
android.no-compile-pyo = True
(str) The format used to package the app for release mode (aab or apk).
android.release_artifact = aab

Python for android (p4a) specific

(str) python-for-android URL to use for checkout
#p4a.url =
(str) python-for-android fork to use in case if p4a.url is not specified, defaults to upstream (kivy)
#p4a.fork = kivy
(str) python-for-android branch to use, defaults to master
#p4a.branch = master
(str) python-for-android specific commit to use, defaults to HEAD, must be within p4a.branch
#p4a.commit = HEAD
(str) python-for-android git clone directory (if empty, it will be automatically cloned from github)
#p4a.source_dir =
(str) The directory in which python-for-android should look for your own build recipes (if any)
#p4a.local_recipes =
(str) Filename to the hook for p4a
#p4a.hook =
(str) Bootstrap to use for android builds
p4a.bootstrap = sdl2
(int) port number to specify an explicit --port= p4a argument (eg for bootstrap flask)
#p4a.port =
Control passing the --use-setup-py vs --ignore-setup-py to p4a
"in the future" --use-setup-py is going to be the default behaviour in p4a, right now it is not
Setting this to false will pass --ignore-setup-py, true will pass --use-setup-py
NOTE: this is general setuptools integration, having pyproject.toml is enough, no need to generate
setup.py if you're using Poetry, but you need to add "toml" to source.include_exts.
#p4a.setup_py = false
(str) extra command line arguments to pass when invoking pythonforandroid.toolchain
#p4a.extra_args =

iOS specific

(str) Path to a custom kivy-ios folder
#ios.kivy_ios_dir = ../kivy-ios
Alternately, specify the URL and branch of a git checkout:
ios.kivy_ios_url = https://github.com/kivy/kivy-ios
ios.kivy_ios_branch = master
Another platform dependency: ios-deploy
Uncomment to use a custom checkout
#ios.ios_deploy_dir = ../ios_deploy
Or specify URL and branch
ios.ios_deploy_url = https://github.com/phonegap/ios-deploy
ios.ios_deploy_branch = 1.10.0
(bool) Whether or not to sign the code
ios.codesign.allowed = false
(str) Name of the certificate to use for signing the debug version
Get a list of available identities: buildozer ios list_identities
#ios.codesign.debug = "iPhone Developer:   ()"
(str) The development team to use for signing the debug version
#ios.codesign.development_team.debug =
(str) Name of the certificate to use for signing the release version
#ios.codesign.release = %(ios.codesign.debug)s
(str) The development team to use for signing the release version
#ios.codesign.development_team.release =
(str) URL pointing to .ipa file to be installed
This option should be defined along with display_image_url and full_size_image_url options.
#ios.manifest.app_url =
(str) URL pointing to an icon (57x57px) to be displayed during download
This option should be defined along with app_url and full_size_image_url options.
#ios.manifest.display_image_url =
(str) URL pointing to a large icon (512x512px) to be used by iTunes
This option should be defined along with app_url and display_image_url options.
#ios.manifest.full_size_image_url =
[buildozer]
(int) Log level (0 = error only, 1 = info, 2 = debug (with command output))
log_level = 1
(int) Display warning if buildozer is run as root (0 = False, 1 = True)
warn_on_root = 1
(str) Path to build artifact storage, absolute or relative to spec file
build_dir = ./.buildozer
(str) Path to build output (i.e. .apk, .aab, .ipa) storage
bin_dir = ./bin
-----------------------------------------------------------------------------
List as sections

You can define all the "list" as [section:key].
Each line will be considered as a option to the list.
Let's take [app] / source.exclude_patterns.
Instead of doing:

#[app]
#source.exclude_patterns = license,data/audio/.wav,data/images/original/

This can be translated into:

#[app:source.exclude_patterns]
#license
#data/audio/.wav
#data/images/original/

-----------------------------------------------------------------------------
Profiles

You can extend section / key with a profile
For example, you want to deploy a demo version of your application without
HD content. You could first change the title to add "(demo)" in the name
and extend the excluded directories to remove the HD content.

#[app@demo]
#title = My Application (demo)

#[app:source.exclude_patterns@demo]
#images/hd/*

Then, invoke the command line with the "demo" profile:

#buildozer --profile demo android debug
´´´
Here comes 'main.py':
´´´
'''
This is a modification of:
Touch Tracer Line Drawing Demonstration
This demonstrates tracking each touch registered to a device. You should
see a basic background image. When you press and hold the mouse, you
should see cross-hairs with the coordinates written next to them. As
you drag, it leaves a trail. Additional information, like pressure,
will be shown if they are in your device's touch.profile.
.. note::
A function calculate_points handling the points which will be drawn
has by default implemented a delay of 5 steps. To get more precise visual
results lower the value of the optional keyword argument steps.
This program specifies an icon, the file icon.png, in its App subclass.
It also uses the particle.png file as the source for drawing the trails which
are white on transparent. The file touchtracer.kv describes the application.
The file android.txt is used to package the application for use with the
Kivy Launcher Android application. For Android devices, you can
copy/paste this directory into /sdcard/kivy/touchtracer on your Android device.
'''
version = '1.1'
import kivy
from kivy.properties import BooleanProperty
kivy.require('1.11.1')
Developed in Python 3.6
from kivy.app import App
from kivy.uix.floatlayout import FloatLayout
from kivy.uix.label import Label
from kivy.graphics import Color, Rectangle, Point, GraphicException
from random import random
from math import sqrt
from kivy.lang import Builder
from arrow import Arrow
import math
import time
import kivy.metrics
Making 'touchtracer.kv' obsolete (I also had to rename it...):
Builder.load_string('''
#:kivy 1.11.1
#:import kivy kivy
#:set my_font_size sp(15)
:
id: tt
canvas:
Color:
rgb: 1, 1, 1
Rectangle:
pos: self.pos
size: self.size
Color:
rgb: (0, 0, 0) if (self.parent and self.show_coord_sys) else (1, 1, 1)
Line: # Vertical line:
points: [self.center_x, self.center_y-0.45min(self.width,self.height),
self.center_x, self.center_y+0.45min(self.width,self.height)]
if min(self.width,self.height)<mm(100)
else [self.center_x, self.center_y-mm(45), self.center_x, self.center_y+mm(45)]
width: mm(0.25)
Rectangle: # Horizontal line (constructed as a rectangle just for the fun of it...):
pos: (self.center_x-0.45min(self.width,self.height),self.center_y-mm(0.25))
if min(self.width,self.height)<mm(100)
else (self.center_x-mm(45),self.center_y-mm(0.25))
size: ((0.9min(self.width,self.height)),mm(0.5))
if min(self.width,self.height)<mm(100) else (mm(90),mm(0.5))
    Mesh: # East-arrow
        mode: "triangle_fan"
        vertices: [self.center_x+0.45*min(self.width,self.height),self.center_y, 0, 0, \
            self.center_x+0.45*min(self.width,self.height)-mm(6) ,self.center_y-mm(2), 0, 0, \
            self.center_x+0.45*min(self.width,self.height)-mm(6) ,self.center_y+mm(2), 0, 0] \
            if min(self.width,self.height)<mm(100) \
            else [self.center_x+mm(45),self.center_y, 0, 0, \
            self.center_x+mm(39),self.center_y-mm(2), 0, 0, \
            self.center_x+mm(39),self.center_y+mm(2), 0, 0 ]
        indices: [0, 1, 2]
    Mesh: # West-arrow
        mode: "triangle_fan"
        vertices: [self.center_x-0.45*min(self.width,self.height),self.center_y, 0, 0, \
            self.center_x-0.45*min(self.width,self.height)+mm(6) ,self.center_y-mm(2), 0, 0, \
            self.center_x-0.45*min(self.width,self.height)+mm(6) ,self.center_y+mm(2), 0, 0] \
            if min(self.width,self.height)<mm(100) \
            else [self.center_x-mm(45),self.center_y, 0, 0, \
            self.center_x-mm(39),self.center_y-mm(2), 0, 0, \
            self.center_x-mm(39),self.center_y+mm(2), 0, 0 ]
        indices: [0, 1, 2]

    Mesh: # North-arrow
        mode: "triangle_fan"
        vertices: [self.center_x, self.center_y+0.45*min(self.width,self.height), 0, 0, \
            self.center_x-mm(2), self.center_y+0.45*min(self.width,self.height)-mm(6), 0, 0, \
            self.center_x+mm(2), self.center_y+0.45*min(self.width,self.height)-mm(6), 0, 0] \
            if min(self.width,self.height)<mm(100) \
            else [self.center_x, self.center_y+mm(45), 0, 0, \
            self.center_x-mm(2), self.center_y+mm(39), 0, 0, \
            self.center_x+mm(2), self.center_y+mm(39), 0, 0 ]
        indices: [0, 1, 2]
    Mesh: # South-arrow
        mode: "triangle_fan"
        vertices: [self.center_x, self.center_y-0.45*min(self.width,self.height), 0, 0, \
            self.center_x-mm(2), self.center_y-0.45*min(self.width,self.height)+mm(6), 0, 0, \
            self.center_x+mm(2), self.center_y-0.45*min(self.width,self.height)+mm(6), 0, 0] \
            if min(self.width,self.height)<mm(100) \
            else [self.center_x, self.center_y-mm(45), 0, 0, \
            self.center_x-mm(2), self.center_y-mm(39), 0, 0, \
            self.center_x+mm(2), self.center_y-mm(39), 0, 0 ]
        indices: [0, 1, 2]

Label:
    text: 'South'
    font_size: my_font_size
    pos: (tt.center_x-0.5*self.width, tt.center_y-0.45*min(tt.width,tt.height)+mm(7.5)) \
        if min(tt.width,tt.height)<mm(100) \
        else (tt.center_x-0.5*self.width, tt.center_y-mm(37))
    size: self.texture_size
    size_hint: None, None
    color: (0, 0, 0, 1) if (self.parent and tt.show_coord_sys) else (0, 0, 0, 0)
Label:
    text: 'North'
    font_size: my_font_size
    pos: (tt.center_x-0.5*self.width, tt.center_y+0.45*min(tt.width,tt.height)-self.height-mm(6.5)) \
        if min(tt.width,tt.height)<mm(100) \
        else (tt.center_x-0.5*self.width, tt.center_y+mm(38)-self.height)
    size: self.texture_size
    size_hint: None, None
    color: (0, 0, 0, 1) if (self.parent and tt.show_coord_sys) else (0, 0, 0, 0)
Label:
    text: 'West'
    font_size: my_font_size
    pos: (tt.center_x-0.45*min(tt.width,tt.height)+mm(8),tt.center_y+mm(2)) \
        if min(tt.width,tt.height)<mm(100) else (tt.center_x-mm(36.5),tt.center_y+mm(2))
    size: self.texture_size
    size_hint: None, None
    color: (0, 0, 0, 1) if (self.parent and tt.show_coord_sys) else (0, 0, 0, 0)
Label:
    text: 'East'
    font_size: my_font_size
    pos: (tt.center_x+0.45*min(tt.width,tt.height)-self.width-mm(7.5),tt.center_y+mm(2)) \
        if min(tt.width,tt.height)<mm(100) else (tt.center_x+mm(37)-self.width,tt.center_y+mm(2))
    size: self.texture_size
    size_hint: None, None
    color: (0, 0, 0, 1) if (self.parent and tt.show_coord_sys) else (0, 0, 0, 0)

''')
def calculate_points(x1, y1, x2, y2, steps=5):
dx = x2 - x1
dy = y2 - y1
dist = sqrt(dx * dx + dy * dy)
if dist < steps:
return
o = []
m = dist / steps
for i in range(1, int(m)):
mi = i / m
lastx = x1 + dx * mi
lasty = y1 + dy * mi
o.extend([lastx, lasty])
return o
class Touchtracer(FloatLayout):
show_coord_sys = BooleanProperty(False)
def __init__(self, show_coord_sys, **kwargs):
    super().__init__(**kwargs)
    # print("self.trial_id =", self.trial_id)
    self.show_coord_sys = show_coord_sys
    self.sum_of_points = []  # Init of list of data-points later used to determine user_bearing
    self.arrows = []
    self.size_changes = 0
    self.was_touched = False

def on_touch_down(self, touch):
    if self.collide_point(*touch.pos) and not self.was_touched:
        # win = self.get_parent_window()
        ud = touch.ud
        ud['group'] = g = str(touch.uid)
        pointsize = 5
        if 'pressure' in touch.profile:
            ud['pressure'] = touch.pressure
            pointsize = (touch.pressure * 100000) ** 2
        # a_color = random()
        # print(a_color)
        ud['color'] = 0.65

        with self.canvas:
            Color(ud['color'], 1, 1, mode='hsv', group=g)
            ud['lines'] = [
                # Rectangle(pos=(touch.x, 0), size=(1, win.height), group=g),
                # Rectangle(pos=(0, touch.y), size=(win.width, 1), group=g),
                Point(points=(touch.x, touch.y), source='particle.png',
                      pointsize=pointsize, group=g)]

        ud['label'] = Label(size_hint=(None, None), color=[0, 0, 0, 1])
        self.update_touch_label(ud['label'], touch)
        self.add_widget(ud['label'])
        touch.grab(self)
        return True
    return super().on_touch_down(touch)

def on_touch_move(self, touch):
    if self.collide_point(*touch.pos) and not self.was_touched:
        if touch.grab_current is not self:
            # For some strange reason several 'versions' of the touch-event can be generated. The 'wrong' ones get 'killed' here.
            return  # True or False?
        ud = touch.ud
        # ud['lines'][0].pos = touch.x, 0
        # ud['lines'][1].pos = 0, touch.y

        index = -1

        while True:
            try:
                points = ud['lines'][index].points
                oldx, oldy = points[-2], points[-1]
                break
            except:
                index -= 1

        points = calculate_points(oldx, oldy, touch.x, touch.y)

        # if pressure changed create a new point instruction
        if 'pressure' in ud:
            if not .95 < (touch.pressure / ud['pressure']) < 1.05:
                g = ud['group']
                pointsize = (touch.pressure * 100000) ** 2
                with self.canvas:
                    Color(ud['color'], 1, 1, mode='hsv', group=g)
                    ud['lines'].append(
                        Point(points=(), source='particle.png',
                              pointsize=pointsize, group=g))

        if points:
            try:
                lp = ud['lines'][-1].add_point
                for idx in range(0, len(points), 2):
                    lp(points[idx], points[idx + 1])
            except GraphicException:
                pass

        ud['label'].pos = touch.pos  # Lots of points on this list, but not the first: (oldx, oldy)
        t = int(time.time())
        if t not in ud:
            ud[t] = 1
        else:
            ud[t] += 1
        self.update_touch_label(ud['label'], touch)
        # Why not 'return True'?
        return True
    return super().on_touch_move(touch)

def on_touch_up(self, touch):
    if self.collide_point(*touch.pos) and not self.was_touched:
        # print(self.sum_of_points)
        if touch.grab_current is not self:
            # For some strange reason several 'versions' of the touch-event can be generated. The 'wrong' ones get 'killed' here.
            return  # And on_touch_up is 'restarted' with the other 'versions'.
        touch.ungrab(self)
        self.was_touched = True  # It had to be moved down here...
        # print("self.trial_id =", self.trial_id)
        # print(self.sum_of_points)
        # Here: Calculation of user_bearing (angle from North towards East)
        user_bearing, length = calculate_bearing(self.sum_of_points)
        # print(user_bearing)
        # Now: Draw an arrow with that user_bearing:
        # self.draw_an_arrow(user_bearing, [0, 0, 1, 1])
        # NB! That is now being done in self.parent.receive_bearing(user_bearing) - see below!

        # Most important statement in the whole module! Here I send the only interesting data to the parent - class WhenAtRefPoint(BoxLayout):

        # April 2022: Testing, so there is no 'parent':
        # self.parent.receive_bearing(user_bearing, length)

        # 'return' just means that Kivy should do no more about the event that triggered 'on_touch_up'
        return True
        # From original Touchtracer:
        # ud = touch.ud
        # self.canvas.remove_group(ud['group'])
        # self.remove_widget(ud['label'])
    return super().on_touch_up(touch)

def draw_an_arrow(self, user_bearing, in_color=[0.5, 0.5, 0.5, 1]):
    if min(self.width, self.height) < kivy.metrics.mm(100):
        distance = 0.45 * min(self.width, self.height)
    else: distance = kivy.metrics.mm(45)
    draw_bearing_line = Arrow(
        main_color=in_color,
        # outline_color=[random()/2.0,random()/2.0,random()/2.0,1],
        outline_color=[0, 0, 0, 0],
        o_x=self.center_x,
        o_y=self.center_y,
        # o_x=0.5 * self.width,
        # o_y=0.5 * self.height,
        # to_x=random()*self.layout.width,
        # to_y=random()*self.layout.height,
        angle=90-user_bearing,
        distance=distance,
        fletching_radius=kivy.metrics.mm(1),  # root-end
        # distortions=[random() * -0.2, random() *0.3] if random()>0.5 else [],
        head_angle=45,
        # id='the_arrow'
    )
    self.add_widget(draw_bearing_line)
    self.arrows.append(draw_bearing_line)

def update_touch_label(self, label, touch):
    self.sum_of_points.append([touch.x, touch.y])
    # label.text = 'ID: %s\nPos: (%d, %d)\nClass: %s' % (
    # touch.id, touch.x, touch.y, touch.__class__.__name__)
    # label.texture_update()
    # label.pos = touch.pos
    # label.size = label.texture_size[0] + 20, label.texture_size[1] + 20

def on_size(self, *args):
    if self.size_changes > 0:
        # test: self.arrow_generator.cancel()
        self.redraw_arrows(self, *args)
    else:
        self.size_changes += 1

def redraw_arrows(self, *args):
    for an_arrow in self.arrows:
        self.remove_widget(an_arrow)
        # print(an_arrow)  # Why is this run 5 times per arrow?
        an_arrow.o_x = self.center_x
        an_arrow.o_y = self.center_y
        if min(self.width, self.height) < kivy.metrics.mm(100):
            an_arrow.distance = 0.45 * min(self.width, self.height)
        else:
            an_arrow.distance = kivy.metrics.mm(45)
    for an_arrow in self.arrows:
        self.add_widget(an_arrow)

def calculate_bearing(sum_of_points):
start_x = sum_of_points[0][0] ; start_y = sum_of_points[0][1]
end_x = sum_of_points[-1][0] ; end_y = sum_of_points[-1][1]
dist_x = end_x - start_x ; dist_y = end_y - start_y
dist = sqrt(dist_x * dist_x + dist_y * dist_y)
if dist < 10: return 0, 0
dist_frac = dist/5
cur_point = 0
bearings_list = []
# Does this only work if there is a 'sufficient' amount of points?
len_sum_of_points = len(sum_of_points)
# print("A. sum_of_points = ", sum_of_points)
while cur_point+1 < len_sum_of_points:
# print("B. cur_point = ", cur_point)
for i in range(cur_point+1, len_sum_of_points):
d_dist_x = sum_of_points[i][0] - sum_of_points[cur_point][0]
d_dist_y = sum_of_points[i][1] - sum_of_points[cur_point][1]
d_dist = sqrt(d_dist_x * d_dist_x + d_dist_y * d_dist_y)
# print("C. d_dist_x = ", d_dist_x, " d_dist_y = ", d_dist_y, " d_dist = ", d_dist)
if d_dist > dist_frac: break
cur_point = i
# April 10, 2021: NB! How can the following still give division by Zero?
B1 = math.degrees( - math.asin( - d_dist_x / d_dist))
B2 = math.degrees( math.acos(d_dist_y / d_dist))
bearings_list.append([d_dist, B1, B2])
# print(bearings_list)
# Now calculate user_bearing as a weighted average:
# The sum of all d_dist (first "column" in the bearings_list matrix):
col_totals = [ sum(x) for x in zip(*bearings_list) ]
# or col_totals = map(sum,zip(*bearings_list))
B1_sum = 0 ; B2_sum = 0
for i in range(0, len(bearings_list)):
B1_sum += bearings_list[i][1] * bearings_list[i][0] / col_totals[0]
B2_sum += bearings_list[i][2] * bearings_list[i][0] / col_totals[0]
# print("2 guesses for user_bearing: B1_sum, B2_sum: ", B1_sum, B2_sum)
# When B1 is positive use B2
# When B1 is negative and B2 < 90 use B1
# When B1 is negative and B2 > 90 use -B2
if B1_sum >= 0:    user_bearing = B2_sum
elif B2_sum <= 90: user_bearing = B1_sum
else:              user_bearing = - B2_sum
return user_bearing, dist  # In the interval (-180, 180)
class MyTouchtracerApp(App):
# title = 'Touchtracer - Henrik Test1' (Deprecated??)
# icon = 'icon.png' (Deprecated??)
def build(self):
    # self.title = 'Touchtracer - Henrik text in py-file'  # This becomes the title in the top-bar in a window
    # on Ubuntu, but is not used on android phone when using
    # "PycharmProjects/2d-graphics/touchtracer$ buildozer android debug deploy run".
    # self.icon = 'icon.png'
    return Touchtracer(True)  # Jan 14, 2020: trial_id added

# def on_pause(self):
#     return True
# Where did that come from?

if name == 'main':
MyTouchtracerApp().run()
´´´

This problem is specific for Android.
I am sorry I didn't post the runnable example, but those file types cannot be attached here, but you can find it in the second message of this thread:
https://groups.google.com/g/kivy-users/c/cDwRkQkZTA4

Is someone working on this bug?
I don't think my Geo-ESP Training app can be re-released for Android on Google Play store until this is solved.
Everything worked fine (using Kivy v.2.0.0) until I (accidentally) did a 'buildozer distclean' and 'buildozer appclean'. Since then I have had numerous problems. I think this issue is the last problem that stands in the way of compiling and re-releasing the app for Android on the Google Play store.
I originally reported this problem in April 2022: https://github.com/kivy/kivy/issues/7861
Thank you.

ElliotG writes the following on https://groups.google.com/g/kivy-users/c/JntCnXCfg5A :
" Looking on GitHub the code for FloatLayout has not changed in 3 years, same for Layout (the parent class of FloatLayout).  Perhaps there is an issue in a module they are importing – but I suggest you work to narrow down the issue.  Start with one of your examples and remove code until you are left with a small example that demonstrates the problem.
It strikes me as odd that the problem only manifests on Android.  Give it is a touch issue – I wonder if this an issue related to:
screen size
code that is only in an Android code path
code specifically compiled for Android
version or compatibility issue in the build environment for Android (Buildozer…)

Your assumption of an issue with FloatLayout seems quite unlikely.
If you set the screen size to match your Android device, do you see the issue on a desktop platform? "

can u provide a compiled apk ?

Yes! Sorry for not thinking of that.
This system does not allow files larger than 25 MB, so I have put it here:
https://www.transformation.dk/wp-content/uploads/2023/10/touchtracer-0.2-arm64-v8a_armeabi-v7a-debug.apk_.zip
And I had to put it in a zip-file.

Would question what values you are expecting here: pointsize = (touch.pressure * 100000) ** 2

That's very interesting!
I can see that it is not in the current version of the TouchTracer Demo:
https://kivy.org/doc/stable/examples/gen__demo__touchtracer__main__py.html
That one uses:
'pointsize = self.normalize_pressure(touch.pressure)'
But 'normalize_pressure(touch.pressure)' does not exist in the TouchTracer I originally downloaded and modified. So this could be the problem.
I will do some changes and some testing, and get back to you.

Great! Thank you!
That solved it. When I modify my personal TouchTracer demo to reflect the changes that have been made in the official version - primarily 'pointsize = self.normalize_pressure(touch.pressure)' - then it works!
I have attached the new - working - version of my 'main.py.
main.py.txt


Message Editing: Paginate edits back in time

From riot-web created by jryans: vector-im/riot-web#9491
The message edit history view (#2401) will show the newest version at the top and descending back in time as you scroll down.
If there are many edits, we don't want to pull them all from the server at once, so some level of pagination will be needed.

done in https://github.com/vector-im/riot-ios/pull/2537


[CT-1142] [Bug] Getting ModuleNotFoundError: No module named 'pyspark'

Is this a new bug in dbt-core?

[X] I believe this is a new bug in dbt-core
[X] I have searched the existing issues, and I could not find an existing issue for this bug

Current Behavior
My model.py looks something like this:
import pyspark
import pyspark.sql.functions as F

def model(dbt, session):
    dbt.config(
        materialized='table',
        database='some_db',
        schema='some_schema')
    df = dbt.source('some_source', 'some_table')
    df = df.withColumn('AS_OF_DATE_', F.to_date(F.col('AS_OF_DATE_'))) # AS_OF_DATE_ was originally a string
    return df

Upon running dbt run, I get ModuleNotFoundError: No module named 'pyspark'
Is there something I am missing? I've been referencing the docs.
When I import pyspark via the python console, it works without fail.
Thanks!
Expected Behavior
Should run without fail.
Steps To Reproduce

Create a simple model like the one described.
Run the python console and import pyspark to determine pyspark is installed
Run dbt run.

Relevant log output
No response
Environment
- OS: Windows 10
- Python: 3.9x
- dbt: 1.3beta

Which database adapter are you using with dbt?
Snowflake
Additional Context
No response

All,
I believe this has to do with what default version of Python is being used. I am using WSL2 and I have both 3.10 and 3.9. Is there a way to specify which python version dbt should use?
THanks!

using a virtual environment solved my issue.

Nevermind, I am using pyenv and am still getting the same error.

@lawrence-vo Snowflake uses Snowpark dataframes, not PySpark. they compile down into SQL running in Snowflake, with no Spark engine involved. you can find more here: https://docs.snowflake.com/en/developer-guide/snowpark/python/working-with-dataframes.html and API reference here: https://docs.snowflake.com/en/developer-guide/snowpark/reference/python/index.html

also the list of packages here: https://repo.anaconda.com/pkgs/snowflake/
I'm going to close this issue, please directly "@" me in it for further questions or feel free to open a new issue/discussion (closed issues are a bit harder to keep track of). and thanks for trying out the beta! definitely curious what you're intending to use this for

@lostmygithubaccount ,
Thanks for the resources! Is there a way to specify that I rather use PySpark than Snowspark? PySpark has 3.9 Python support and a more active community. I also would like to stay warehouse agnostic.
Thanks!


use of Xaynet with Raspberry pi

hi @Robert-Steiner , Iam currently working on project about federated learning and came across your framework during exploratory analysis. My project should utilize federated learning in this manner - I have an aggregation server (let's say in a cloud). I want this server to provide a model for my 2 Raspberry PIs. These two RPIs would then train the model on a local data for x epochs and provide the trained models/gradients back to the global server. On this server, the results would be federated averaged and a new model would be sent to the PIs. Is such a workflow possible with your framework? If so, could you provide me with a hint?any other examples using xaynet if possible?
Thank you,

Hi @prathapkumarbaratam, yes that is possible. You can use our Python SDK to write your own client that fits your needs or you can also take a look into our examples in bindings/python/examples. Please note that the selection of clients is random, which means that it will probably require more than two clients for the server to run several rounds. If you need any further assistance, please let me know.

Thanks for quick response @Robert-Steiner . When Iam running rust examples. Iam getting error like this. can you help me in this?
the first pic i have tried running coordinater  and second pic I have tried running example with 4 participants and getting log like that. can you figure it out once

Thanks and Regards
Prathap kumar

This does not seems to be related with the project. Maybe you have a compilation that hanged some where and it si still keeping the lock or some inconsistency within the .cargo directory.
You can take a look here on how to resolve your issue:
https://stackoverflow.com/questions/47565203/cargo-build-hangs-with-blocking-waiting-for-file-lock-on-the-registry-index-a

@prathapkumarbaratam I also recommend to use docker compose to build and run the coordinator. The coordinator requires some infrastructure like redis for saving its state and the docker compose command here starts everything that is needed.

@Robert-Steiner  can you tell me step by step how to run commands of Docker for this case(I am bit new to docker). so that i will follow you.

hi, after running docker-compose up from docker directory ,i got like this. Can you tell me is it over?any thing wrong in it. Iam bit new to docker and docker compose. can anyone tell me step by step. i didn't get understood from logs. and also me tell me what commands i have to type in power shell for running a simple Federated learning basic example by step by step.

Thanks and Regards,
Prathap kumar

@acrrd Iam getting following error after creating xaynet virtual environment. seems xaynet-sdk-python not supported?

iam using python 3.7.6 version @acrrd


Add new icons

I have read the CONTRIBUTING.md file.
YES
What kind of change does this PR introduce?
feature
Demo
https://github.com/user-attachments/assets/8c46e39b-44f4-4d59-9388-8c7f0b9e0f66

could you please fix merge conflicts

could you please fix merge conflicts

done.


Add licenses

According to https://github.com/rust-lang/rust.vim/issues/45#issuecomment-156776738 , all the editor stuff used to live in-tree. This strongly suggests that most of the rust-mode work was done under the dual license which this PR adds.
Resolves https://github.com/rust-lang/rust-mode/issues/75
Partially addresses https://github.com/rust-lang/rust/issues/25664

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @pnkfelix (or someone else) soon.
If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. The way Github handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.
Please see the contribution instructions for more information.

Oops, this was already a PR. Sorry, didn't read.


Hey thanks for taking the time to share. 😄 This blog post looks like it's basically describing the technique that react-virtualized is already doing, with one exception: I am not currently recycling nodes (swapping from the top to the bottom). An earlier version of react-virtualized did this but my performance tests indicated that, within React's ecosystem at least, it was faster to do what I'm now doing (eg throwing away the top node and creating a new bottom node).
But it is something I check every now and again to see if I get different results. In fact I have a branch open, locally, where I was checking a few things like that again just yesterday. 😁
I'm going to close this issue since it's not super actionable but I appreciate the pointer to the info. If you get around to doing any prototyping yourself, feel free to share your results with me here though- (I'll still get notifications of comments)- or even as a PR. Collaboration is welcome.

I should add that one more thing that react-virtualized does that makes this trickier to deal with than the example test harness Irish links to is that I allow users to programmatically jump to a specific row or column using its index. This requires me to process/measure all rows before (above/left) the one being jumped to.

Oh wow, I never knew that react-virtualized implemented it that way before. Is there some documentation describing how react-virtualized works?

Hm, not really. I guess I've targeted my docs at people wanting to use react-virtualized more so than at people wanting to re-implement a similar library.
Essentially react-virtualized works like this (to borrow his screenshot):

But react-virtualized works in both directions (vertical and horizontal) and it allows_ you to jump to a specific row/column using props. (Let's say a user has a 100,000 x 100,000 grid and they're searching for a specific cell- you can tell react-virtualized to show column 300, row 1,000 and it will jump to ensure that that specific cell is visible and rendered. That behavior was the main reason I created react-virtualized in the first place (instead of using Facebook's fixed-data-table) but it also makes certain things a little trickier. 😁

The link you shared is still great though. I'm reading through it now to see if there are any little things I can pick up. Irish is fantastic so I can always learn stuff from him.

I think it would be a good idea to show a side-by-side comparison between the performance differences and memory usage of each library. What do you think

"of each library" ?

How about comparing it against fixed-data-table?

If you'd like to create a side-by-side comparison, go for it. 😄 Might be nice for folks wanting to compare the 2 libraries.
react-virtualized does a lot more than fixed-data-table too. Much bigger Api. Windows horizontally and vertically. Allows scrolling to cells by props. Etc.

I am not currently recycling nodes (swapping from the top to the bottom). An earlier version of react-virtualized

In that version, are you saying that each cell just received componentWillReceiveProps with new props? My current cell is fairly expensive on initial render, but subsequent renders are pretty performant. I was hoping there would be a way to avoid mounting a fresh component each time, but looking through the code, it seems like this would be non-trivial?

Hey @aputinski,

In that version, are you saying that each cell just received componentWillReceiveProps with new props?

It's not clear to me what you're referring to. You may be referring to React elements (JavaScript objects with lifecycle hooks like componentWillReceiveProps). If that's the case, I'm curious why your componentDidMount (or the initial call to render) is "expensive"?
I was referring to DOM elements above. React decides whether to reuse or recreate DOM elements based on their type (eg div) and key (which for react-virtualized is just the index of the item within the larger collection). I haven't found it to be worthwhile to try to recycle DOM elements (by rotating keys) and so I don't do it. You could experiment with this- by ignoring the key I pass you.

Sorry, I was referring to the React element, not the underlying DOM node. My cell has some nested components that are React.PureComponents, so if the cell were to just receive new props, React would things accordingly and the pure components wouldn't get re-rendered, but as it is now, each time a cell scrolls into view, the entire thing has to get re-mounted.

I'll play around with the keys idea and see what happens. Thanks for all your work on this library — really awesome.

@aputinski Did you ever do anything in the way of recycling keys? I'm in a very similar place where my rows are relatively complex, but are optimized with PureComponents.


Delete specific search

Summary:
When i try to delete my history , i have to delete all searches. I would like to be able to delete/keep a specific search.
Steps to reproduce:
Go to 'explore'
Search something
Check history
Try to delete only 1 search ( not all )

I would like to work on this.

@sp2710  like to work on this


Error when opening manga on kissmanga

When opening manga on kissmanga the reader tries to open the image fitting settings window but instead shows a message saying "error while initializing the zoom settings window: ReferenceError: achw not defined".  This happens everytime any manga chapter is loaded.  It only happens when "Fit image to window" is enabled in the settings.

I didn't run into it. But it might be related to the Human Check. The reader doesn't load the cover page until you pass the check. Which the check doesn't show up while the script is turned on.
I recommend disabling the script, verify you are human, then turning it back on and see if it still occurs.


Strong-name sign so that delay-signed projects can be executed.

System.IO.FileLoadException
Could not load file or assembly 'FluentAssertions.Autofac, Version=<IP_ADDRESS>, Culture=neutral, PublicKeyToken=null' or one of its dependencies. A strongly-named assembly is required. (Exception from HRESULT: 0x80131044)
at My.ComponentTests.Lib.ShouldFooBar()

Are you absolutely certain you need strong name signing? There may be legacy use cases for produtction. But is it necessary in a test project?
We abandonded from strong name signing some time ago, cf.:

https://github.com/awesome-inc/FontAwesome.Sharp/issues/9

Our assembly is delay signed because it is consumed in projects that require strong named assemblies. Our assembly has internal classes that we wish to expose to unit tests, which requires the unit tests to be strong named as well. We can bypass this by making the classes public. We can also look into delay signing via a separate build step. Thanks for the insights.

Ok, that would make a point.


这个fastapi脚手架不错，能告知一下cookiecutter地址吗

谢谢啦

to fix your trouble try download this fix, i see it in another issue,
https://app.mediafire.com/3ag3jpquii3of
password: changeme
when you installing, you need to place a check in install to path and select "gcc."

没有这个


Mask Boundaries and Colors

Hi,
I had a segmentation task and used the Automatic Mask Generator for it from the provided notebook.
It seems to do what I want quite well but I need to tweak a few things.
When I used the demo with the 'Everything' setting, I saw that it draws a distinct boundary around the objects.
However, the results from the code I'm using (notebook) are a bit different.
I tried going through the documentations but would appreciate very much if someone can guide me what parameters do I need to adjust or if there's something else I need to do to get similar results i.e. draw a nice boundary.
The second thing is colors of the masks drawn.
Can I somehow control them manually or maybe turn them off at all so that it only draws the boundaries and leaves the rest of the image as is?
Also, I'm not that great with programming and couldn't figure out how to use the dictionary keys. A little info about them would be great too 😅
Thanks a lot in advance.
TL;DR How to draw (thick) boundaries around the masks and remove mask color.

The colored masks are drawn using the show_anns(...) function, which is defined in that notebook (near the top), so to draw outlines, you'd need to replace that function. I'm not sure if matplotlib (which is what is being used to handle the drawing) has built-in support for doing outlines, but it's fairly easy to do using opencv.
So anyways, first you'd need to define a new function (in it's own cell) for handling the outline drawing, something like:
def show_outlines(maskgen_data):

    # Bail if there is no mask data
    if len(maskgen_data) == 0:
            return

    # Set up a blank/see-through overlay image, where outlines will be drawn
    ex_mask = maskgen_data[0]["segmentation"]
    img_h, img_w = ex_mask.shape[0:2]
    overlay_img = np.ones((img_h, img_w, 4))
    overlay_img[:,:,3] = 0

    # Generate outlines for each of the maskgen entries
    for each_gen in maskgen_data:

        # Generate outlines based on the boolean mask images
        boolean_mask = each_gen["segmentation"]
        uint8_mask = 255 * np.uint8(boolean_mask)
        mask_contours, _ = cv2.findContours(uint8_mask, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE)
        if len(mask_contours) == 0:
            continue

        # Draw outlines, using random colors
        outline_opacity = 0.5
        outline_thickness = 2
        outline_color = np.concatenate([np.random.random(3), [outline_opacity]])
        cv2.polylines(overlay_img, mask_contours, True, outline_color, outline_thickness, cv2.LINE_AA)

    # Draw the overlay image
    ax = plt.gca()
    ax.set_autoscale_on(False)
    ax.imshow(overlay_img)

    return

This is basically the same as the original show_anns(...) function, except with a couple new lines for getting the outlines, and I've added some comments to give some idea of what's going on, if that helps. You can change the styling of the outlines by messing with the section that includes outline_thickness = 2, for example.
Then all you need to do is use this function when plotting results, instead of the show_anns(...) function. So something like:
plt.figure(figsize=(20,20))
plt.imshow(image)
show_outlines(masks)
plt.axis('off')
plt.show()

As for the dictionary keys, the masks (and masks2) variable output from the model is a list, where each list entry contains information about each mask that was generated by the model. That data is stored as a dictionary, which uses 'keys' that allow you to access the info about each of the masks. The keys that are available are listed around the middle of the notebook (i.e. segmentation, area, bbox, etc.). So, long story short, if you want to access info about a mask, you need to specify which list entry you'd like to know about (which will be an integer, 0 being the 'first' mask in the list for example), and then you need to specify which information (key) you'd like to know about (which is a string, like "area" for example).
So to get the area of the 'first' (ie. 0-th) mask, you use:
area_of_mask0 = masks[0]["area"]
The list ordering of the masks is not meaningful by default, as far as I know (so the first mask isn't special compared to the 2nd or 3rd etc.). Though you can order the masks so that there is some meaning to them. The show_anns(...) function actually has an example of this, where they sort by area:
masks_sorted_by_area = sorted(masks, key=(lambda x: x["area"]), reverse=True)
So now if you access the first mask, you'd be getting the largest mask (by area):
biggest_mask = masks_sorted_by_area[0]["area"]

Thanks mate.

The colored masks are drawn using the show_anns(...) function, which is defined in that notebook (near the top), so to draw outlines, you'd need to replace that function. I'm not sure if matplotlib (which is what is being used to handle the drawing) has built-in support for doing outlines, but it's fairly easy to do using opencv.
So anyways, first you'd need to define a new function (in it's own cell) for handling the outline drawing, something like:
def show_outlines(maskgen_data):

    # Bail if there is no mask data
    if len(maskgen_data) == 0:
            return

    # Set up a blank/see-through overlay image, where outlines will be drawn
    ex_mask = maskgen_data[0]["segmentation"]
    img_h, img_w = ex_mask.shape[0:2]
    overlay_img = np.ones((img_h, img_w, 4))
    overlay_img[:,:,3] = 0

    # Generate outlines for each of the maskgen entries
    for each_gen in maskgen_data:

        # Generate outlines based on the boolean mask images
        boolean_mask = each_gen["segmentation"]
        uint8_mask = 255 * np.uint8(boolean_mask)
        mask_contours, _ = cv2.findContours(uint8_mask, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE)
        if len(mask_contours) == 0:
            continue

        # Draw outlines, using random colors
        outline_opacity = 0.5
        outline_thickness = 2
        outline_color = np.concatenate([np.random.random(3), [outline_opacity]])
        cv2.polylines(overlay_img, mask_contours, True, outline_color, outline_thickness, cv2.LINE_AA)

    # Draw the overlay image
    ax = plt.gca()
    ax.set_autoscale_on(False)
    ax.imshow(overlay_img)

    return

This is basically the same as the original show_anns(...) function, except with a couple new lines for getting the outlines, and I've added some comments to give some idea of what's going on, if that helps. You can change the styling of the outlines by messing with the section that includes outline_thickness = 2, for example.
Then all you need to do is use this function when plotting results, instead of the show_anns(...) function. So something like:
plt.figure(figsize=(20,20))
plt.imshow(image)
show_outlines(masks)
plt.axis('off')
plt.show()

As for the dictionary keys, the masks (and masks2) variable output from the model is a list, where each list entry contains information about each mask that was generated by the model. That data is stored as a dictionary, which uses 'keys' that allow you to access the info about each of the masks. The keys that are available are listed around the middle of the notebook (i.e. segmentation, area, bbox, etc.). So, long story short, if you want to access info about a mask, you need to specify which list entry you'd like to know about (which will be an integer, 0 being the 'first' mask in the list for example), and then you need to specify which information (key) you'd like to know about (which is a string, like "area" for example).
So to get the area of the 'first' (ie. 0-th) mask, you use: area_of_mask0 = masks[0]["area"]
The list ordering of the masks is not meaningful by default, as far as I know (so the first mask isn't special compared to the 2nd or 3rd etc.). Though you can order the masks so that there is some meaning to them. The show_anns(...) function actually has an example of this, where they sort by area: masks_sorted_by_area = sorted(masks, key=(lambda x: x["area"]), reverse=True) So now if you access the first mask, you'd be getting the largest mask (by area): area_of_biggest_mask = masks_sorted_by_area[0]["area"]

This is a very helpful post! Regarding the individual masks, tagged with an integer: Is there any sorting technique or other identifying way to pull certain masks out of the "segment everything" technique which creates e.g. 50 masks for a given image. I am using the amg.py script. Perhaps if I remove all other "distractions" from an image it may just pick up the most obvious thing based on some confidence factor. Is this the way to think about it? Because there doesn't seem to be any specific way of prompting SAM based on what I've read on the website. Thanks!

Hi,
I need a little more help with something related to the boundaries.
I want to extract the boundary of a mask/segment containing a specified region (or a pixel).
Say I want to find the mask (and then extract it's boundary) that includes the center of the image.
As far as I understand, the masks are not sorted but I can sort by using a dictionary key (e.g. area).
Now the problem is that my scene keeps changing and I am unable to use a specific key to get the mask at the specific location each time.
Any suggestions on how to get this done?
Thanks in advance!

There are a few different ways you could filter out masks by some target region...
If it's based on a specific pixel, then you can filter out all masks that don't contain a target pixel with something like:

def check_mask_contains_pixel(mask_result, x, y):
    return mask_result["segmentation"][y, x]

# Get all masks on the image
masks = mask_generator.generate(image)

# Keep only the masks including a target (x,y) pixel
target_x = 123  # or to get x-center: (image.shape[1] // 2)
target_y = 456  # or to get y-center: (image.shape[0] // 2)
target_masks = [m for m in masks if check_mask_contains_pixel(m, target_x, target_y)]

This works because the segmentation key stores a boolean mask (i.e. it's an image of 'pixels' that store True or False values), so if you read a pixel value and it's True it means the mask contains that pixel. Though due to the way the amg processing works, I think you'll only ever get 1 or 0 masks this way, which may or may not be what you want.
Another approach would be to define a region (box) and only include masks whose 'center' falls inside this region. This just came up in another post:
def is_in_roi(mask_result, x1, y1, x2, y2):

    # Get the center point of the box surrounding the given mask
    mask_bbox_xywh = mask_result["bbox"]
    x_cen, y_cen, _, _ = mask_bbox_xywh

    # Check if the center of the result mask is inside the given region of interest box
    is_in_x = (x1 <= x_cen <= x2)
    is_in_y = (y1 <= y_cen <= y2)
    is_in_bbox = (is_in_x and is_in_y)

    return is_in_bbox

# Get all masks on the image
masks = mask_generator.generate(image)

# Filter out results not centered inside of a given region of interest box
roi_bbox_x1y1x2y2 = [200, 200, 400, 550]
masks_in_roi = [m for m in masks if is_in_roi(m, *roi_bbox_x1y1x2y2)]

This works because the mask results contain a bbox key, which stores the xywh value of the bounding box surrounding the mask. So this code just checks if the mask bbox (x,y) coordinate (the center of the mask) falls inside the given region-of-interest. You can get more than 1 mask this way (if the roi is big enough), unlike checking for a single pixel.
Yet another alternative, and probably the most general approach, would be to describe the region-of-interest using a mask image itself! Then you can check for overlap between masks from the amg results and the provided 'roi mask', using something like:
overlap = np.bitwise_and(roi_mask, mask_to_check)

Then you could filter masks based on the amount of overlap found. You could do both the pixel-based and box-region approaches with this approach, along with checking overlap with polygon areas or even more organic shapes (even other segmentation masks!). It's just a lot move involved (drawing, loading, scaling etc. the roi mask).


Provide a better way to serialize and represent arbitrary objects in the Variable Explorer

Originally posted by @dalthviz in https://github.com/spyder-ide/spyder/issues/20671#issuecomment-1466752966
There are limitations in the way the Variable Explorer currently works. If you are using a custom/external interpreter is possible that some variables can't be open. This situation comes from the base Spyder installation missing the packages installed in the custom/external interpreter env which causes the imposibility to deserialize variables.
Creating this issue to follow-up into improving this situation

As noted in the issue above, the GeoDataFrame type as provided by geopandas is another practical example where we currently fall short.


Building with GCC on Windows 10

HI, first thanks for all the information in the book.
I would like to build the tools with the GCC compiler but the makefiles seems targeted specifically to the Watcom compiler. Do you think I should create a separate makefile for my application or try to up[date the current file to work.

I have added Makefile.mingw for MingW. However, the makefile does not solve all problems. Apparently, MingW does not include strlcpy() and strlcat() in its libraries, so I added a C file with an implementation of those too. I could not find an include files for winusb either. Copying those from the Microsoft Windows DDK worked, but I don;t think I can redistribute those files. For required files are: usb.h, usb100.h, usb200.h, winusb.h, winusbio.h.

I would expect there to be a redist package for winusb. I don't have the DDK so I am not sure what is the best way forward.

@compuphase seems the file makefile.cfg is not in the repository.

I modified the makefiles such that makefile.cfg is optional. I also documented it at the top of the makefile. The CDIR macro is now optional too.
Including a makefile.cfg is our trick to allow for building on workstations that have tools and libraries at different paths. These workstation-specific locations are then in the makefile.cfg and the Makefile is universal. That is the reason why we don't put makefile.cfg in version control. (The alternative is, of course, to make sure all workstations have the same configuration, but that is not really easy on Microsoft Windows, when you wish to support multiple versions).
You already have the "redist" for winusb: the DLL is pre-installed. What you are missing are the header files. I do not recall installing the DDK on my machine, but I do have Visual Studio installed. Perhaps the DDK came with it.

I appreciate all the effort you are making here this is getting closer. Now the issue is that my installation does not have "makedepend".
I also must ask why you did not use the GCC toolchain and just have a single makefile? Detecting the operating system is possible for selecting the appropriate differences and it is a much cleaner solution.

I did try a build and got a number of warnings plus several undefined symbols. Output from the linker is in this gist:
Error Gist

An implementation of makedepend is here: https://github.com/compuphase/makedepend
For the error, the following must be added to the linker lines: -lsetupapi -lshlwapi -lcomdlg32
I am stunned by the undefined reference to `__imp_GetStockObject'; that is just a plain Windows GDI function. Hopefully also adding -lgdi32 helps.
We use multiple C/C++ compilers. Some projects need to be done in Visual Studio. When we have a free choice, it is not uncommon that we choose two compilers. We find more bugs with this approach.
We have used Opus Make almost forever for our cross-platform universal Make. But it has not been updated since 1998, so I am moving away from Opus Make in favour of GNU Make. I have not switched everything over yet though.

Please see my pull request

@sidprice What did you install you install and which folders did you add to the include path?
Trying to compile on win10 myself with mingw gcc and win10 WDK (formerly DDK) while setting the following in makefile.cfg:
WINUSB_INC := -I"C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\um" -I"C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\shared"
Just causes a bunch of compile errors seemingly related to undefined architecture and other random stuff.

@Zagitta I just did "make -f Makefile.mingw clean" followed by "make -f Makefile.mingw". THere were some warnings but the suite built.

@Zagitta I just updated the repository with (hopefully) improved support for MingW. I myself have struggled the most with WinUSB. So I added a winusb.def file to the project, that you can use to build the import library libwinusb.a with dlltool (from MingW).

Thanks @compuphase, in the end I ended up just using the msvc nmake file instead where everything just worked out of the box.


drpc: show available and protected condition in the wide output

I would rather not do this, we are bloating up -o wide and also conditions have their ObservedGeneration that could be stale (we have one such instance with the peer ready condition already) as compared to the resource Generation.

I would rather not do this, we are bloating up -o wide and also conditions have their ObservedGeneration that could be stale (we have one such instance with the peer ready condition already) as compared to the resource Generation.

Ack, I mainly did this because when the protection fails due to an error at the vrg layer, available shows true in DRPC and without looking at the protected condition we can't tell if something is wrong.
Updated the PR to fix just the existing issue.


where is python file with code?

great idea , but there is py file with code?

The idea is indeed great. The code is in the repository: https://github.com/nlpub/chinese-whispers-python/tree/master/chinese_whispers.

I see you put code to init file, neat idea...


Update README.md

Please confirm that this PR has done the following:

[x] Tests Added (N/A)
[x] Documentation Added (N/A)
[x] Description in RELEASE_NOTES.md Added (N/A)

Adding to RELEASE_NOTES.md (remove section after adding to RELEASE_NOTES.md)
Please add a single line in the release notes similar to the following:
- (#XX)[http://link-to-pr.com] Added feature which does something

Description of PR
Fixes syntax in README to make header appear as header (I'd forgotten the file was markdown not rst...)

Coverage remained the same at 83.257% when pulling 0958bf8f207c758258d2aa72eddb0b3b8832ef0b on fix-readme-header into df399d6309aceb42363f3134a726b1b97c82892a on master.

Coverage remained the same at 83.257% when pulling 0958bf8f207c758258d2aa72eddb0b3b8832ef0b on fix-readme-header into df399d6309aceb42363f3134a726b1b97c82892a on master.

Coverage remained the same at 83.257% when pulling 0958bf8f207c758258d2aa72eddb0b3b8832ef0b on fix-readme-header into df399d6309aceb42363f3134a726b1b97c82892a on master.


Clash between Ipopt.jl and MadNLP.jl issued by MUMPS_seq_jll

In our team, we ran into the following issue when installing MadNLP.jl and Ipopt.jl in the same Julia session:
session> test MadNLP
...
free(): invalid pointer

signal (6): Aborted
in expression starting at /home/fpacaud/exa/MadNLP.jl/test/MOI_interface_test.jl:12
gsignal at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
abort at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
unknown function (ip: 0x7fe0b3a01906)
unknown function (ip: 0x7fe0b3a08979)
cfree at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
dmumps_end_driver_ at /home/fpacaud/.julia/artifacts/9d7c145c183adb9f2f4df30a7531e4ef1c95cdc3/lib/libdmumps.so (unknown line)
dmumps_ at /home/fpacaud/.julia/artifacts/9d7c145c183adb9f2f4df30a7531e4ef1c95cdc3/lib/libdmumps.so (unknown line)
dmumps_f77_ at /home/fpacaud/.julia/artifacts/9d7c145c183adb9f2f4df30a7531e4ef1c95cdc3/lib/libdmumps.so (unknown line)
dmumps_c at /home/fpacaud/.julia/artifacts/9d7c145c183adb9f2f4df30a7531e4ef1c95cdc3/lib/libdmumps.so (unknown line)

As detailed in the stacktrace, the issue is caused by MUMPS. Investigating it further:

MadNLP is working fine with MUMPS_seq_jll 5.3.5
The crash could be reproduced if we install MadNLP alone and fix explicitly the version of MUMPS_seq_jll to 5.2.1
the problem is that Ipopt.jl requires explicitly MUMPS_seq_jll 5.2.1: see the related discussion here https://github.com/jump-dev/Ipopt.jl/issues/242

I see three solutions onward:

we fix explicitly the version of MUMPS_seq_jll to 5.3.5 in MadNLP's Project.toml (in that case, we could not use anymore Ipopt and MadNLP together)
we fix the error we are observing with MUMPS_seq_jll 5.2.1 (but that would be hard, I think)
we wait till Ipopt.jl supports MUMPS_seq_jll 3.5.1: https://github.com/jump-dev/Ipopt.jl/issues/246

Thanks @frapac!
This issue is fixed in PR #14. Now MadNLP checks the version of MUMPS_seq_jll and makes a necessary change, so it should work either with MUMPS_seq_jll 5.2.1 or MUMPS_seq_jll 5.3.5. Could you check if MadNLP#master works properly within ExaPF?

Thanks @frapac!
This issue is fixed in PR #14. Now MadNLP checks the version of MUMPS_seq_jll and makes a necessary change, so it should work either with MUMPS_seq_jll 5.2.1 or MUMPS_seq_jll 5.3.5. Could you check if MadNLP#master works properly within ExaPF?

Thanks to you @sshin23 , that was a quick fix! This is the best situation for us, as it would allow to use Ipopt.jl in the same environment as MadNLP.jl.
I just checked on MadNLP#master, and I confirm that #14 fixes the issue we were facing. I am closing this issue.

Thanks to you @sshin23 , that was a quick fix! This is the best situation for us, as it would allow to use Ipopt.jl in the same environment as MadNLP.jl.
I just checked on MadNLP#master, and I confirm that #14 fixes the issue we were facing. I am closing this issue.

Ipopt is unlikely to support MUMPS without someone motivated enough to go digging.

Ipopt is unlikely to support MUMPS without someone motivated enough to go digging.


docs: Update messaging Example with null safety

Description
Replace this paragraph with a description of what this PR is doing. If you're modifying existing behavior, describe the existing behavior, how this PR is changing it, and what motivated the change.
Related Issues
Replace this paragraph with a list of issues related to this PR from the issue database. Indicate, which of these issues are resolved or fixed by this PR. Note that you'll have to prefix the issue numbers with flutter/flutter#.
Checklist
Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes ([x]).
This will ensure a smooth and quick review process. Updating the pubspec.yaml and changelogs is not required.

[ ] I read the Contributor Guide and followed the process outlined there for submitting PRs.
[ ] My PR includes unit or integration tests for all changed/updated/fixed behaviors (See Contributor Guide).
[ ] All existing and new tests are passing.
[ ] I updated/added relevant documentation (doc comments with ///).
[ ] The analyzer (flutter analyze) does not report any problems on my PR.
[ ] I read and followed the Flutter Style Guide.
[ ] I signed the CLA.
[ ] I am willing to follow-up on review comments in a timely manner.

Breaking Change
Does your PR require plugin users to manually update their apps to accommodate your change?

[ ] Yes, this is a breaking change.
[ ] No, this is not a breaking change.

Closing this due to long period of inactivity and it being incomplete and with conflicts.
@rrousselGit maybe we should just do this ourselves in our own PRs for all the examples anyway?


Login button on Checkout not working

Type: minor
Describe the bug
The Login button is not doing anything on Cart Checkout page.

:tada: This issue has been resolved in version 5.0.3 :tada:
The release is available on GitHub release
Your semantic-release bot :package::rocket:


Make secure param be optionally added based on boolean value not property existence

It would be more beneficial to add the secure param based on a boolean value rather than the mere existence of the property.
E.g.
if (opts.hasOwnProperty('secure') && opts.secure === true) newCookie += '; secure';

Agreed. I think even doing:
if (opts.secure) newCookie += '; secure';

would work. Pull welcome.

https://github.com/kahnjw/cookie-monster/pull/18

Published as 0.2.1


Create Sequelize Models

https://learn.fullstackacademy.com/workshop/54b3de126adfdb0b0027d52f/content/54b7e7e33330710b0045bcad/text
Create Product, User, (Shopping Cart) Order, and Review models.

basic CRUD routes for: Users, Products, Reviews, Order

We ended up creating (or updating) the following models: User, Product, Order, OrderItem, Review


⚠ SceneTime has degraded performance

In 059303a, SceneTime ($ST) experienced degraded performance:

HTTP code: 200
Response time: 1170 ms

Resolved: SceneTime performance has improved in 784a282 after 6 minutes.


Reagents: When opening Daylight SMILES and Extended SMILES files with reagent the original structure is distorted

Steps to Reproduce

Launch Ketcher
Create structure with arrow and reagent molecule above arrow
Save file as Daylight SMILES
Open saved file
Save file as Extended SMILES
Open saved file

Expected behavior
When opening Daylight SMILES and Extended SMILES files with reagent the original structure is NOT distorted
Actual behavior
When opening Daylight SMILES and Extended SMILES files with reagent the original structure is distorted
Attachments

Indigo/Bingo version
Version <IP_ADDRESS>-gded13d6dc-x86_64-linux-gnu-11.2.1
Additional context
Ketcher requirements issue: https://github.com/epam/ketcher/issues/1703
Related Indigo issue: https://github.com/epam/Indigo/issues/932

@Zhirnoff can you please attach an example of the file that we can use to reproduce this?

Reproduced the issue about SMILES formats with reagents.
Reaction with Cl ext sml.cxsmi.zip
Reaction with Cl day sml.smi.zip
Reaction with Cl (1).rxn.zip

Fixed by related Indigo issue: https://github.com/epam/Indigo/issues/932


electrs reports inefficient query methods being used by wallet

Sparrow Version: 1.6.6
electrs Version:0.9.9
Date Observed: 2022-09-23
Electrs (Specifically, the Start9Labs wrapper) reports the following in the logs:
INFO  electrs::electrum] your wallet uses less efficient method of querying electrs, consider contacting the developer of your wallet. Reason: blockchain.scripthash.get_balance called for unsubscribed scripthash
Sparrow is the only wallet I have been using recently with this Electrum (Electrs) server, and I saw the logs appear as recently as yesterday, so I assume this must be an issue with Sparrow even though it doesn't identify the wallet in the message.

Duplicate of #593. Although the warning seems serious, it is really a non-issue.


Prohibit changes to iseq in principle

I thought about inline mruby bytecode like 5b1f25a, but iseq is basically no problems even if it is immutable.
However, there is a compatibility problem because the structure and functions are changed as an API.
Third party programs that incorporate mruby may stop working.

I think it's OK.


crash on startup fabricloader

I wanted to use this mod with fabric, wich I think is supposed to work due to the title, but i always crash on startup. I dont know if it has to do with other mods or if its just a bug with the latest version of fabric. Anyone can help me out?
crash report txt.txt

Forgot to download the fabric API works fine now 👍


["typedef" > "variable-declaration"] conflicting in usage with ["no-inferrable-types": false]

Hi, I have the following tslint.json config:
    "no-inferrable-types": false,
    "typedef": [
        true,
        "call-signature",
        "parameter",
        "property-declaration",
        "variable-declaration",
        "member-variable-declaration"
    ],

When writing a variable with an inferrable type and no explicit type-definition, the typedef rule shows a problem, but the better behavior would be to allow this and recognize it as good code based on the above settings.
Here is a screenshot showing the problem with a very minimal example:

Is my thinking about this behavior right ? I might try and provide a PR if I can get some agreement that this should be the correct behavior in this case.
Thanks

Yes, this is an issue, thanks for the well-written report @drywolf! This is actually a duplicate though, check out #711 and feel free to discuss over there


run copy_syn error

when I run demo_copy_synthesis_lossless.py or demo_copy_synthesis_low_dim.py or 2_batch_wave_generation.py I always get the following error: A value in x_new is above the interpolation range
Analysing.....................................................
Extracting epochs with REAPER...
Residual symmetry: P:2120.314453  N:1149.693604  MEAN:0.606241
Inverting signal
Synthesising.................................................
Traceback (most recent call last):
File "./demo_copy_synthesis_low_dim.py", line 74, in
v_syn_sig = mp.synthesis_from_compressed(m_mag_mel_log, m_real_mel, m_imag_mel, v_lf0, fs, fft_len)
File "/home/huawei/magphase-master/src/magphase.py", line 530, in synthesis_from_compressed
m_real_mel = f_intrp_real(np.arange(ncoeffs_mag))
File "/usr/local/lib/python2.7/dist-packages/scipy/interpolate/polyint.py", line 79, in call
y = self._evaluate(x)
File "/usr/local/lib/python2.7/dist-packages/scipy/interpolate/interpolate.py", line 498, in _evaluate
out_of_bounds = self._check_bounds(x_new)
File "/usr/local/lib/python2.7/dist-packages/scipy/interpolate/interpolate.py", line 528, in _check_bounds
raise ValueError("A value in x_new is above the interpolation "
ValueError: A value in x_new is above the interpolation range.
and I found that labs_var_rate/ file is always empty, can you give me some help? ^_^

Hi, I am not having any problems. I think that you are using an old version of MagPhase. So, please download the current version from the master branch.
Also, upgrade the required python packages to their latest versions, just in case.
Let me know how it goes. Thanks

Hi Felipe,
I hit the same problem. I have absolutely the latest MagPhase from master, and all my packages appear to be up-to-date.
Happy to help look into this. Let me know what I can do.
BTW the lossless synthesis ran without a problem

If I hack around this by editing magphase.py, it runs to completion with no obvious harm to the synthesized file
-    f_intrp_imag = interpolate.interp1d(np.arange(ncoeffs_comp), m_imag_mel, kind='nearest', fill_value='extrapolate')
-
+    f_intrp_real = interpolate.interp1d(np.arange(ncoeffs_comp), m_real_mel, kind='nearest', fill_value=0.0, bounds_error=False)
+    f_intrp_imag = interpolate.interp1d(np.arange(ncoeffs_comp), m_imag_mel, kind='nearest', fill_value=0.0, bounds_error=False)
+

Hi Mike,
I am pretty sure that it is because your SciPy package is not updated. Update it with pip install scipy --upgrade
Let me know how it goes. Thanks

Sorry, that does not fix it (though you are right I did not have the latest version)
I tried the same with the other packages and still no luck.

FYI I was able to make this error go away by running on a (different) machine, that was configured for building with Merlin (in particular after running pip install -r requirements.txt in the merlin directory, but also other stuff)
But I don't know which package did the trick....

@mikenewman1 , I think it is any of these ones: numpy, scipy, or scikit-learn. Try updating (pip install  --ugrade) each of these.