C# CallDeferred() won't take function names in pascal case

Godot version:
3.0
Issue description:

CallDeferred doesn't accept the pascal case method name in C#.
While using C# scripting you must pass in the 'snake case' function name same as GDScript.
I think that this causes confusion when all other names are changed to pascal case in C#.
It caused me quite a bit of confusion. Perhaps if it is not an issue changing the function could throw an error if the function name passed in is not recognized?
Steps to reproduce:
call CallDeferred and pass in a function name in pascal case e.g. "AddChild" and watch it not work.

CC @neikeq

@akien-mga @neikeq you can close this thread, because this definitely works currently in my project. Snippet https://gist.github.com/exts/73e82b7f77c89ccd0802283d686b5266

I'm finding that as of 3.0.3rc2 we are unable to access methods from the godot API with camel case:
using Godot;

public class Node : Godot.Node
{
    public override void _Ready()
    {
        CallDeferred("SetName", "NewName"); // This has no effect
        //SetName("NewName");   // This would work if uncommented
    }
}

@KellyThomas that sounds like a different issue than the title suggests.

So I was testing some code because this didn't make sense. Why would CallDeferred work on my autoload methods and execute my switch scene code, but not be able to execute godot api method names.
When I was testing I wanted to just make sure code was executing and I tested this snippet in one of my object nodes that I instance in.
        public void DeferredNewName(string name)
        {
            Print("hello2");
            SetName($"{name}_name");
        }

        public void ChangeName(string name)
        {
            Print("Called");
            CallDeferred("DeferredNewName", name);
        }

So I call ChangeName and "Called" gets printed 4 times and so does hello2. The methods are getting through, but the api methods aren't being executed. As you can see here https://i.imgur.com/YK165dq.png (in output window)
I switch CallDeferred to Call and everything works as expected. Why is CallDeferred not executing api methods? Seems like a weird edge case.

Also having the problem in Godot Mono 3.1 beta 2. DeferredCall passing "AddChild" or nameof(AddChild) does not work, but passing "add_child" does.

This applies both to Call and CallDeferred. The reason this happens is because we do not search the methods in the engine classes. I think I know how to fix this, but there is still the problem of objects which do not have a C# script attached. Here is an example:
var myNode = new Node();
myNode.Call("AddChild", this);

Supposing I fix this issue, the above code still would not work because myNode does not have a C# script attached, therefore it will never go through our calling process.
I think it would be confusing to allow PascalCase names in Call and CallDeferred if it only worked when there is a C# script attached. I think we either support it everywhere (somehow) or nowhere.

If we want to support this everywhere, I think we would need a call hook here in Object::call:
https://github.com/godotengine/godot/blob/6cd4006fb3f20ac756517aa0f70720a870f9617a/core/object.cpp#L944

@reduz What do you think? Would you be ok about adding a fallback at the end of Object::call?

@neikeq I was just wondering... what about converting all CamelCase methods to snake_case on-the-fly, both for C#'s Call/Connect/CallDeferred/FuncRef bindings and for methods defined in C# scripts?

@bojidar-bg I don't like the idea performance-wise, but it wouldn't solve this issue either since the cause of this issue is that we have no control over this (unless there is a C# script attached, in which case we could fix it, but it would be confusing as I explained above).

@neikeq Well, it is fixable since you are calling into Godot from mono. So, if the bindings don't just blindly call the function, but fix the string to snake_case... it might sort-of work.

But that does not include calls being made from other places. Like signals connected from the editor. And I still don't like the runtime overhead it would have.

As seen in #37284, the same applies to properties, not only methods.

I suggest replacing the method name parameter with a method reference. For C# it seems more correct and faster than using strings, and I think this change would also solve the problem
From: CallDeferred("SetName", "NewName");
To:      CallDeferred(SetName, "NewName");

You can create a Callable from a delegate so you could use it to call deferred:
new Callable(SetName).CallDeferred("NewName");

We could add an overload to Object that takes a delegate and creates the Callable for you:
public void CallDeferred(Delegate @delegate, params object[] args)
{
    return new Callable(@delegate).CallDeferred(args);
}

You can create a Callable from a delegate so you could use it to call deferred:
new Callable(SetName).CallDeferred("NewName");

We could add an overload to Object that takes a delegate and creates the Callable for you:
public void CallDeferred(Delegate @delegate, params object[] args)
{
    new Callable(@delegate).CallDeferred(args);
}

This doesn't appear to work in Godot 4.1 as Callable now looks like it wants a GodotTarget and the method name as a string in the constructor, making it pretty much the same as object.callDeferred(methodName, params).

The Callable API changed a bit before the 4.0 release. To construct a Callable from a delegate, use the Callable.From methods:
Callable.From<string>(SetName).CallDeferred("NewName");

You can also use the MethodName class to get a cached StringName:
new Callable(MethodName.SetName, this).CallDeferred("NewName");


introduced new attribute - videoElementSelector

In one customer's case I encountered videos playing in the background. They would be automatically tracked which is not desired. I introduced new attribute that allows to narrow down videos observed.

I also used this PR to introduce some fixes in descriptions demanded by Content Editor


[Forwardport] [main] Update 10_basic.yml

Forwardport of https://github.com/opensearch-project/OpenSearch/pull/16343 to main

@gaobinlong please take a look, thank you!


AttributeError: 'NoneType' object has no attribute 'set_value'

After upgrading to the most recent version 2024.10.0 my switch is no longer working. I have now rolled back to version 2022.7.0 and it is working again. Hardware is a Raspberry Pi 4.
The error message is:
AttributeError: 'NoneType' object has no attribute 'set_value'
The switch is configured as:
switch:

platform: rpi_gpio
switches:

port: 6
name: "orp"
unique_id: "orp_switch_port_6"

and the debug file is below:
2024-10-25 16:05:09.359 DEBUG (MainThread) [custom_components.rpi_gpio.hub] in turn_on 27
2024-10-25 16:05:09.359 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [547406852976] Unexpected exception
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 245, in handle_call_service
response = await hass.services.async_call(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/core.py", line 2761, in async_call
response_data = await coro
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/core.py", line 2804, in _execute_service
return await target(service_call)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 996, in entity_service_call
single_response = await _handle_entity_call(
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1068, in _handle_entity_call
result = await task
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1712, in async_toggle
await self.async_turn_on(**kwargs)
File "/config/custom_components/rpi_gpio/switch.py", line 102, in async_turn_on
self._hub.turn_on(self._port)
File "/config/custom_components/rpi_gpio/hub.py", line 151, in turn_on
self._lines.set_value(port, Value.ACTIVE)
^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'set_value'

Just to add to this, I have had to roll back as well, whilst I didnt see the error reported here, I had completely different behaviour of the GPIO pins in HA, I control a relay to mimic a button press for a gate, and a relay switch to see the state of the gate.  I had to completely reboot the host before it worked for a bit with the new version, then on restarts of HA, it didn't seem to report the GPIO pins in HA, ie it wouldn't open the gate, relay never activated, and it lost the state of the reed switch, just reported open all the time.

Hi @alastaid, I'm not able to repro the same problem but I will be glad to investigate.
Can you enable debug logging for the integration, restart home assistant and send all the logs or at least the ones which start with custom_components.rpi_gpio?

Not sure yet what the problem is but there is some anomaly here.
startup rpi_gpio hub supposed to be executed and traced as part of the HA startup sequence but it seems it happen really late in your case. Did you wait for everything to finish booting before you started to play with it?
Also I dont see the same problem from your original trace so not sure what really changed.
Last one, you mention reed switch, can you explain? are you talking about sensor or a switch? I thought reed switch is a type of sensor which changes status based on magnetic power. But maybe I dont understand the setup.

Hi, sorry firstly I jumped on this thread the initial logs weren't mine. Hence the difference from the original trace.  Second, it is possible I didn't wait for HA to fully restart hence while it was late. It maybe worth focussing on the reed switch, which is a magnet and reciever attached to the gate making and breaking the circuit.  My GPIO setup is as follows:
cover:

platform: rpi_gpio
invert_state: true
relay_time: 1
covers:

relay_pin: 27
state_pin: 22
name: 'gate'
unique_id: "Front_Gate_relay_pin_27_state_pin_22"

I rolled back to 2022.7 and enabled debugging, to show what happens when it works, but I get nothing in the logs (is this what you would expect).  But last time I installed 2024.10, I got no state change on pin 22 which is the reed switch. Is it perhaps because I am using "invert_state: true" ? Thanks

Same problem here with version 2024.10.0 running HA 2024.10 on a Pi 4
Config:
switch:
  - platform: rpi_gpio
    switches:
      - port: 16
        invert_logic: true
        unique_id: "front_door_opener"
        name: "Front Door Opener"

Log:
AttributeError: 'NoneType' object has no attribute 'set_value'
2024-10-25 16:39:36.159 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [546972619040] Unexpected exception
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 245, in handle_call_service
    response = await hass.services.async_call(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2761, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2804, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 996, in entity_service_call
    single_response = await _handle_entity_call(
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1068, in _handle_entity_call
    result = await task
             ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/lock/__init__.py", line 239, in async_handle_unlock_service
    await self.async_unlock(**self.add_default_code(kwargs))
  File "/usr/src/homeassistant/homeassistant/components/template/lock.py", line 193, in async_unlock
    await self.async_run_script(
  File "/usr/src/homeassistant/homeassistant/components/template/template_entity.py", line 563, in async_run_script
    await script.async_run(
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 1795, in async_run
    return await asyncio.shield(create_eager_task(run.async_run()))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 463, in async_run
    await self._async_step(log_exceptions=False)
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 527, in _async_step
    self._handle_exception(
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 557, in _handle_exception
    raise exception
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 525, in _async_step
    await getattr(self, handler)()
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 763, in _async_call_service_step
    response_data = await self._async_run_long_action(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 726, in _async_run_long_action
    return await long_task
           ^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2761, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2804, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 996, in entity_service_call
    single_response = await _handle_entity_call(
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1068, in _handle_entity_call
    result = await task
             ^^^^^^^^^^
  File "/config/custom_components/rpi_gpio/switch.py", line 102, in async_turn_on
    self._hub.turn_on(self._port)
  File "/config/custom_components/rpi_gpio/hub.py", line 151, in turn_on
    self._lines.set_value(port, Value.ACTIVE)
    ^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'set_value'

@srempfer , any chance you have another GPIO integration installed on the same box?
It seems like the initialization failed as the GPIO was busy.

I'm not sure what other GPIO integration there is to install but like other have said, works perfectly with version 2022.7.0 and fails with version 2024.10.0. I can provide a list of my installed Integrations if you think that would help.

I understand it worked with the previous version. The latest version uses a completely different GPIO codebase as the old one is obsolete and didn't support RPi5. As there was a major rewrite with how we use the GPIO it could be that things that used to work in the past will fail with the latest version.
To help debug the issue I created a new PR which improve error handling and have better traces. It will be great if you will move to this latest version when it is released (or just apply the single file that I changed manually if you know how to do it) and provide the debug tracing. If the traces will not reveal anything that I would want to see what other integrations are loaded. Those shows up in the log starting with We found a custom integration ...

I also have the same problem: RPI4 and hass 2024.10.4. My logs are very similar to the ones already posted here.
Reverting back to rpi_gpio 2022.7.0 works great!
Will love to try again as soon as a new version is available.

I just released 2024.10.1 release. Please install that version and supply debug logs for the integration. I added traces which will help find what's going on.

Here is my config:
cover:

platform: rpi_gpio
invert_state: true
relay_time: 1
covers:

relay_pin: 27
state_pin: 22
name: 'gate'
unique_id: "Front_Gate_relay_pin_27_state_pin_22"

Logs on 2024.10.1, with pin 27 working as it should, except it goes live on HA restart and opens the gate.  The state pin on 22 doesn't work properly, it does change state sometimes but not inline with the gate opening. FYI I do also have a container running some dotnet code controlling other GPIO pins:
2024-10-26 14:19:03.023 DEBUG (MainThread) [custom_components.rpi_gpio.hub] auto discovering gpio device
2024-10-26 14:19:03.024 DEBUG (MainThread) [custom_components.rpi_gpio.hub] verify_gpiochip: /dev/gpiochip0 is a gpiochip_device
2024-10-26 14:19:03.025 DEBUG (MainThread) [custom_components.rpi_gpio.hub] verify_gpiochip gpiodevice: /dev/gpiochip0 has pinctrl
2024-10-26 14:19:03.025 DEBUG (MainThread) [custom_components.rpi_gpio.hub] using gpio_device: /dev/gpiochip0
2024-10-26 14:19:03.026 DEBUG (MainThread) [custom_components.rpi_gpio.cover] setup_platform: {'platform': 'rpi_gpio', 'invert_state': True, 'relay_time': 1, 'covers': [{'relay_pin': 27, 'state_pin': 22, 'name': 'gate', 'unique_id': 'Front_Gate_relay_pin_27_state_pin_22'}], 'invert_relay': False, 'state_pull_mode': 'UP'}
2024-10-26 14:19:03.026 DEBUG (MainThread) [custom_components.rpi_gpio.cover] GPIODCover init: 27:22 - gate - Front_Gate_relay_pin_27_state_pin_22 - 1
2024-10-26 14:19:03.027 DEBUG (MainThread) [custom_components.rpi_gpio.hub] in add_cover 27 22
2024-10-26 14:19:03.027 DEBUG (MainThread) [custom_components.rpi_gpio.hub] in add_switch 27
2024-10-26 14:19:03.027 DEBUG (MainThread) [custom_components.rpi_gpio.hub] in add_sensor 22
2024-10-26 14:19:03.032 DEBUG (MainThread) [custom_components.rpi_gpio.hub] current value for port 22: False
2024-10-26 14:19:06.862 WARNING (ImportExecutor_0) [homeassistant.components.device_tracker.const] SOURCE_TYPE_ROUTER was used from ping_arp, this is a deprecated constant which will be removed in HA Core 2025.1. Use SourceType.ROUTER instead, please report it to the author of the 'ping_arp' custom integration
2024-10-26 14:19:13.988 WARNING (MainThread) [homeassistant.util.loop] Detected blocking call to load_default_certs with args (<ssl.SSLContext object at 0x7f92d5ebd0>, <Purpose.SERVER_AUTH: _ASN1Object(nid=129, shortname='serverAuth', longname='TLS Web Server Authentication', oid='<IP_ADDRESS>.<IP_ADDRESS>.1')>) inside the event loop by custom integration 'tesla_custom' at custom_components/tesla_custom/init.py, line 174: controller = TeslaAPI( (offender: /usr/local/lib/python3.12/ssl.py, line 713: context.load_default_certs(purpose)), please create a bug report at https://github.com/alandtse/tesla/issues
2024-10-26 14:19:24.057 DEBUG (MainThread) [custom_components.rpi_gpio.hub] startup rpi_gpio hub
2024-10-26 14:19:24.058 DEBUG (MainThread) [custom_components.rpi_gpio.hub] updating lines: {27: gpiod.LineSettings(direction=Direction.OUTPUT, edge_detection=Edge.NONE, bias=Bias.AS_IS, drive=Drive.PUSH_PULL, active_low=False, debounce_period=datetime.timedelta(0), event_clock=Clock.MONOTONIC, output_value=Value.INACTIVE), 22: gpiod.LineSettings(direction=Direction.INPUT, edge_detection=Edge.BOTH, bias=Bias.PULL_UP, drive=Drive.PUSH_PULL, active_low=True, debounce_period=datetime.timedelta(microseconds=50000), event_clock=Clock.REALTIME, output_value=Value.INACTIVE)}
2024-10-26 14:19:24.077 DEBUG (MainThread) [custom_components.rpi_gpio.hub] Start listener
2024-10-26 14:20:17.348 DEBUG (SyncWorker_4) [custom_components.rpi_gpio.hub] in turn_on 27
2024-10-26 14:20:18.349 DEBUG (SyncWorker_4) [custom_components.rpi_gpio.hub] in turn_off 27
2024-10-26 14:20:45.912 DEBUG (MainThread) [custom_components.rpi_gpio.hub] Event:
2024-10-26 14:21:04.418 DEBUG (SyncWorker_12) [custom_components.rpi_gpio.hub] in turn_on 27
2024-10-26 14:21:05.418 DEBUG (SyncWorker_12) [custom_components.rpi_gpio.hub] in turn_off 27
2024-10-26 14:21:32.853 DEBUG (SyncWorker_12) [custom_components.rpi_gpio.hub] in turn_on 27
2024-10-26 14:21:33.854 DEBUG (SyncWorker_12) [custom_components.rpi_gpio.hub] in turn_off 27
2024-10-26 14:21:34.300 DEBUG (MainThread) [custom_components.rpi_gpio.hub] Event:
2024-10-26 14:22:02.848 DEBUG (MainThread) [custom_components.rpi_gpio.hub] Event:

On further testing I would ignore my previous comments, what has thrown me is the new states exhibited, ie "is opening" and "is closing".  Previously as soon as the gates opened a bit the state would change to open.  Now it waits a while before changing to open, but is reliable, and consistent (I wasn't waiting for the gate to fully open before closing hence thought it wasnt working).   Thanks for all your work with this, Alastair

I'm not aware of any other GPIO integration installed on the same box.
Here is the debug log with version  2024.10.1
2024-10-26 16:27:48.127 DEBUG (MainThread) [custom_components.rpi_gpio.hub] auto discovering gpio device
2024-10-26 16:27:48.128 DEBUG (MainThread) [custom_components.rpi_gpio.hub] verify_gpiochip: /dev/gpiochip0 is a gpiochip_device
2024-10-26 16:27:48.130 DEBUG (MainThread) [custom_components.rpi_gpio.hub] verify_gpiochip gpiodevice: /dev/gpiochip0 has pinctrl
2024-10-26 16:27:48.130 DEBUG (MainThread) [custom_components.rpi_gpio.hub] using gpio_device: /dev/gpiochip0
2024-10-26 16:27:48.131 DEBUG (MainThread) [custom_components.rpi_gpio.switch] setup_platform: {'platform': 'rpi_gpio', 'switches': [{'port': 16, 'invert_logic': True, 'unique_id': 'front_door_opener', 'name': 'Front Door Opener', 'drive': 'PUSH_PULL', 'persistent': False, 'pull_mode': 'AS_IS'}]}
2024-10-26 16:27:48.132 DEBUG (MainThread) [custom_components.rpi_gpio.switch] GPIODSwitch init: 16 - Front Door Opener - front_door_opener - active_low: True - bias: AS_IS - drive: PUSH_PULL - persistent: False
2024-10-26 16:27:48.132 DEBUG (MainThread) [custom_components.rpi_gpio.hub] in add_switch 16
2024-10-26 16:28:26.897 DEBUG (MainThread) [custom_components.rpi_gpio.hub] startup rpi_gpio hub
2024-10-26 16:28:26.897 DEBUG (MainThread) [custom_components.rpi_gpio.hub] updating lines: {16: gpiod.LineSettings(direction=Direction.OUTPUT, edge_detection=Edge.NONE, bias=Bias.AS_IS, drive=Drive.PUSH_PULL, active_low=True, debounce_period=datetime.timedelta(0), event_clock=Clock.MONOTONIC, output_value=Value.INACTIVE)}
2024-10-26 16:28:26.914 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved (None)
Traceback (most recent call last):
  File "/config/custom_components/rpi_gpio/hub.py", line 99, in startup
    self.update_lines()
  File "/config/custom_components/rpi_gpio/hub.py", line 132, in update_lines
    self._lines = gpiod.request_lines(
                  ^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/gpiod/__init__.py", line 54, in request_lines
    return chip.request_lines(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/gpiod/chip.py", line 316, in request_lines
    req_internal = self._chip.request_lines(line_cfg, consumer, event_buffer_size)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
OSError: [Errno 16] Resource busy

@srempfer , this looks like the logs from 2024.10.0. Can you re-download the release and try again?

I re-downlaoded the version via HACS, checked that the correct version in HACS is displayed but got the same log output.
So I checked the downlaoded files in the custom_components/rpi_gpio folder and found out that it contains the manifest.json with the version entry 2024.10.0.
Removed and installed it again, but still the same version in the manifest.json.
@tomer-w:
I digged deeper and noticed the the changes of Minor error handing and tracing improvements (#308) are included.
So I compared the tag 2024.10.1 with the main branch and noticed that it not contain the changes Improve detection libgpiod issues (#309) and the bump of the manifest version.

Hi @srempfer, seems you are right. No idea how that happened. Anyhow, I just created new version 2024.10.2 which has those changes and also trace the actual version into the log so it will be easier to understand what's going on next time. Can you try this new version and send the logs? sorry for the trouble.

Now it shows the correct version
2024-10-26 19:47:20.276 DEBUG (MainThread) [custom_components.rpi_gpio] rpi_gpio integration starting. Version: 2024.10.2
2024-10-26 19:47:20.276 DEBUG (MainThread) [custom_components.rpi_gpio.hub] auto discovering gpio device
2024-10-26 19:47:20.276 DEBUG (MainThread) [custom_components.rpi_gpio.hub] verify_gpiochip: /dev/gpiochip0 is a gpiochip_device
2024-10-26 19:47:20.279 DEBUG (MainThread) [custom_components.rpi_gpio.hub] verify_gpiochip gpiodevice: /dev/gpiochip0 has pinctrl
2024-10-26 19:47:20.279 DEBUG (MainThread) [custom_components.rpi_gpio.hub] using gpio_device: /dev/gpiochip0
2024-10-26 19:47:20.280 DEBUG (MainThread) [custom_components.rpi_gpio.switch] setup_platform: {'platform': 'rpi_gpio', 'switches': [{'port': 16, 'invert_logic': True, 'unique_id': 'front_door_opener', 'name': 'Front Door Opener', 'pull_mode': 'AS_IS', 'persistent': False, 'drive': 'PUSH_PULL'}]}
2024-10-26 19:47:20.280 DEBUG (MainThread) [custom_components.rpi_gpio.switch] GPIODSwitch init: 16 - Front Door Opener - front_door_opener - active_low: True - bias: AS_IS - drive: PUSH_PULL - persistent: False
2024-10-26 19:47:20.281 DEBUG (MainThread) [custom_components.rpi_gpio.hub] in add_switch 16
2024-10-26 19:47:20.281 DEBUG (MainThread) [custom_components.rpi_gpio.hub] original line info: <LineInfo offset=16 name="GPIO16" used=True consumer="rpi_rf_mod:red" direction=Direction.OUTPUT active_low=False bias=Bias.UNKNOWN drive=Drive.PUSH_PULL edge_detection=Edge.NONE event_clock=Clock.MONOTONIC debounced=False debounce_period=0:00:00>
2024-10-26 19:47:59.228 DEBUG (MainThread) [custom_components.rpi_gpio.hub] startup rpi_gpio hub
2024-10-26 19:47:59.229 DEBUG (MainThread) [custom_components.rpi_gpio.hub] updating lines: {16: gpiod.LineSettings(direction=Direction.OUTPUT, edge_detection=Edge.NONE, bias=Bias.AS_IS, drive=Drive.PUSH_PULL, active_low=True, debounce_period=datetime.timedelta(0), event_clock=Clock.MONOTONIC, output_value=Value.INACTIVE)}
2024-10-26 19:47:59.232 ERROR (MainThread) [custom_components.rpi_gpio.hub] Failed to update lines: [Errno 16] Resource busy

Woohoo!! we found it. You can see in the log that is says: used=True consumer="rpi_rf_mod:red". Someone took the lease on this GPIO line. Any idea what is it?

Here is my debug logs from 10.02:
2024-10-26 20:40:47.375 DEBUG (MainThread) [custom_components.rpi_gpio] rpi_gpio integration starting. Version: 2024.10.2
2024-10-26 20:40:47.375 DEBUG (MainThread) [custom_components.rpi_gpio.hub] auto discovering gpio device
2024-10-26 20:40:47.376 DEBUG (MainThread) [custom_components.rpi_gpio.hub] verify_gpiochip: /dev/gpiochip0 is a gpiochip_device
2024-10-26 20:40:47.378 DEBUG (MainThread) [custom_components.rpi_gpio.hub] verify_gpiochip gpiodevice: /dev/gpiochip0 has pinctrl
2024-10-26 20:40:47.379 DEBUG (MainThread) [custom_components.rpi_gpio.hub] using gpio_device: /dev/gpiochip0
2024-10-26 20:40:47.380 DEBUG (MainThread) [custom_components.rpi_gpio.binary_sensor] setup_platform: {'platform': 'rpi_gpio', 'sensors': [{'port': 16, 'pull_mode': 'UP', 'invert_logic': True, 'bouncetime': 50, 'name': 'garagedoor_switch'}]}
2024-10-26 20:40:47.380 DEBUG (MainThread) [custom_components.rpi_gpio.binary_sensor] GPIODBinarySensor init: 16 - garagedoor_switch - rpi_gpio_16_garagedoor_switch
2024-10-26 20:40:47.380 DEBUG (MainThread) [custom_components.rpi_gpio.hub] in add_sensor 16
2024-10-26 20:40:47.381 DEBUG (MainThread) [custom_components.rpi_gpio.hub] original line info:
2024-10-26 20:40:47.383 DEBUG (MainThread) [custom_components.rpi_gpio.hub] current value for port 16: True
2024-10-26 20:40:47.415 DEBUG (MainThread) [custom_components.rpi_gpio.cover] setup_platform: {'platform': 'rpi_gpio', 'invert_relay': True, 'invert_state': True, 'state_pull_mode': 'UP', 'relay_time': 1, 'covers': [{'relay_pin': 21, 'state_pin': 20, 'name': 'Garagedörr', 'unique_id': 'garage_door'}]}
2024-10-26 20:40:47.416 DEBUG (MainThread) [custom_components.rpi_gpio.cover] GPIODCover init: 21:20 - Garagedörr - garage_door - 1
2024-10-26 20:40:47.416 DEBUG (MainThread) [custom_components.rpi_gpio.hub] in add_cover 21 20
2024-10-26 20:40:47.416 DEBUG (MainThread) [custom_components.rpi_gpio.hub] in add_switch 21
2024-10-26 20:40:47.419 DEBUG (MainThread) [custom_components.rpi_gpio.hub] original line info:
2024-10-26 20:40:47.419 DEBUG (MainThread) [custom_components.rpi_gpio.hub] in add_sensor 20
2024-10-26 20:40:47.419 DEBUG (MainThread) [custom_components.rpi_gpio.hub] original line info:
2024-10-26 20:40:47.420 DEBUG (MainThread) [custom_components.rpi_gpio.hub] current value for port 20: True
Hope you can find something useful.
Thank you for your work letting us still using GPIO!

@Emlben , are you sure those are all the relevant logs? I would expect more traces from the integration a bit later when HA finalize the startup phase.
Also, I already see something is wrong here but I don't have a clue yet what's going on. Are you sure there is no other software using GPIO lines?

@Emlben , are you sure those are all the relevant logs? I would expect more traces from the integration a bit later when HA finalize the startup phase. Also, I already see something is wrong here but I don't have a clue yet what's going on. Are you sure there is no other software using GPIO lines?

Not to my knowledge at least. I am running hass in docker on raspian.
Deconz is the only other thing on that machine. As others have stated: it works on 7.0 (Yes, I read that this has new code base ;) - so that statement must be read in that context )
Went back to 7.0 and then to 10.2 again: now the last line appeared:
2024-10-26 20:57:16.836 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration rpi_gpio which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2024-10-26 20:57:32.601 DEBUG (MainThread) [custom_components.rpi_gpio] rpi_gpio integration starting. Version: 2024.10.2
2024-10-26 20:57:32.602 DEBUG (MainThread) [custom_components.rpi_gpio.hub] auto discovering gpio device
2024-10-26 20:57:32.602 DEBUG (MainThread) [custom_components.rpi_gpio.hub] verify_gpiochip: /dev/gpiochip0 is a gpiochip_device
2024-10-26 20:57:32.605 DEBUG (MainThread) [custom_components.rpi_gpio.hub] verify_gpiochip gpiodevice: /dev/gpiochip0 has pinctrl
2024-10-26 20:57:32.605 DEBUG (MainThread) [custom_components.rpi_gpio.hub] using gpio_device: /dev/gpiochip0
2024-10-26 20:57:32.606 DEBUG (MainThread) [custom_components.rpi_gpio.cover] setup_platform: {'platform': 'rpi_gpio', 'invert_relay': True, 'invert_state': True, 'state_pull_mode': 'UP', 'relay_time': 1, 'covers': [{'relay_pin': 21, 'state_pin': 20, 'name': 'Garagedörr', 'unique_id': 'garage_door'}]}
2024-10-26 20:57:32.606 DEBUG (MainThread) [custom_components.rpi_gpio.cover] GPIODCover init: 21:20 - Garagedörr - garage_door - 1
2024-10-26 20:57:32.607 DEBUG (MainThread) [custom_components.rpi_gpio.hub] in add_cover 21 20
2024-10-26 20:57:32.607 DEBUG (MainThread) [custom_components.rpi_gpio.hub] in add_switch 21
2024-10-26 20:57:32.612 DEBUG (MainThread) [custom_components.rpi_gpio.hub] original line info:
2024-10-26 20:57:32.613 DEBUG (MainThread) [custom_components.rpi_gpio.hub] in add_sensor 20
2024-10-26 20:57:32.614 DEBUG (MainThread) [custom_components.rpi_gpio.hub] original line info:
2024-10-26 20:57:32.615 DEBUG (MainThread) [custom_components.rpi_gpio.hub] current value for port 20: True
2024-10-26 20:57:32.664 DEBUG (MainThread) [custom_components.rpi_gpio.binary_sensor] setup_platform: {'platform': 'rpi_gpio', 'sensors': [{'port': 16, 'pull_mode': 'UP', 'invert_logic': True, 'bouncetime': 50, 'name': 'garagedoor_switch'}]}
2024-10-26 20:57:32.664 DEBUG (MainThread) [custom_components.rpi_gpio.binary_sensor] GPIODBinarySensor init: 16 - garagedoor_switch - rpi_gpio_16_garagedoor_switch
2024-10-26 20:57:32.665 DEBUG (MainThread) [custom_components.rpi_gpio.hub] in add_sensor 16
2024-10-26 20:57:32.667 DEBUG (MainThread) [custom_components.rpi_gpio.hub] original line info:
2024-10-26 20:57:32.679 DEBUG (MainThread) [custom_components.rpi_gpio.hub] current value for port 16: True
2024-10-26 20:58:10.627 DEBUG (MainThread) [custom_components.rpi_gpio.hub] startup rpi_gpio hub
2024-10-26 20:58:10.627 DEBUG (MainThread) [custom_components.rpi_gpio.hub] updating lines: {21: gpiod.LineSettings(direction=Direction.OUTPUT, edge_detection=Edge.NONE, bias=Bias.AS_IS, drive=Drive.PUSH_PULL, active_low=True, debounce_period=datetime.timedelta(0), event_clock=Clock.MONOTONIC, output_value=Value.INACTIVE), 20: gpiod.LineSettings(direction=Direction.INPUT, edge_detection=Edge.BOTH, bias=Bias.PULL_UP, drive=Drive.PUSH_PULL, active_low=True, debounce_period=datetime.timedelta(microseconds=50000), event_clock=Clock.REALTIME, output_value=Value.ACTIVE), 16: gpiod.LineSettings(direction=Direction.INPUT, edge_detection=Edge.BOTH, bias=Bias.PULL_UP, drive=Drive.PUSH_PULL, active_low=True, debounce_period=datetime.timedelta(microseconds=50000), event_clock=Clock.REALTIME, output_value=Value.ACTIVE)}
2024-10-26 20:58:10.628 ERROR (MainThread) [custom_components.rpi_gpio.hub] Failed to update lines: (22, 'Invalid argument')

and maybe also showing my config entries:
cover:

platform: rpi_gpio
invert_relay: true
invert_state: true
state_pull_mode: "UP"
relay_time: 1.0
covers:

relay_pin: 21
state_pin: 20
name: 'Garagedörr'
unique_id: 'garage_door'

binary_sensor:

platform: rpi_gpio
sensors:
- port: 16
pull_mode: 'UP'
invert_logic: true
bouncetime: 50
name: garagedoor_switch

Thanks for the hint with the consumer="rpi_rf_mod:red".
Now I remembered again that I started two years ago with a HM-MOD-RPI-PCB to control my Homatic thermostats.
A year ago I switched to the USB dongle and totally forgot that I've still the overlay active.
I commented out the following lines of the /boot/config.txt again
# Uncomment this to enable GPIO support for RPI-RF-MOD/HM-MOD-RPI-PCB
#enable_uart=1
#dtparam=i2c_arm=on
#dtoverlay=miniuart-bt
#dtoverlay=rpi-rf-mod

and now it works.
@tomer-w : Thank you for the hint and the great trace output you added.

@Emlben , for the sake of simplicity, can you comment out the cover and keep only the binary sensor and restart? I wonder if the problem relates to the device or configuration.

@Emlben , for the sake of simplicity, can you comment out the cover and keep only the binary sensor and restart? I wonder if the problem relates to the device or configuration.

I have now tried commenting out both the cover and the binary sensor one at a time.
I still get the: Failed to update lines: (22, 'Invalid argument')
regardless of which one i comment out.
Both are working without any issues when using 2022.7.0.
Just adding the logs from may latest restart with both configurations active - for the sake of it ;)
2024-10-27 10:40:38.401 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration rpi_gpio which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant 2024-10-27 10:40:50.736 DEBUG (MainThread) [custom_components.rpi_gpio] rpi_gpio integration starting. Version: 2024.10.2 2024-10-27 10:40:50.736 DEBUG (MainThread) [custom_components.rpi_gpio.hub] auto discovering gpio device 2024-10-27 10:40:50.736 DEBUG (MainThread) [custom_components.rpi_gpio.hub] verify_gpiochip: /dev/gpiochip0 is a gpiochip_device 2024-10-27 10:40:50.737 DEBUG (MainThread) [custom_components.rpi_gpio.hub] verify_gpiochip gpiodevice: /dev/gpiochip0 has pinctrl 2024-10-27 10:40:50.737 DEBUG (MainThread) [custom_components.rpi_gpio.hub] using gpio_device: /dev/gpiochip0 2024-10-27 10:40:50.738 DEBUG (MainThread) [custom_components.rpi_gpio.cover] setup_platform: {'platform': 'rpi_gpio', 'invert_relay': True, 'invert_state': True, 'state_pull_mode': 'UP', 'relay_time': 1, 'covers': [{'relay_pin': 21, 'state_pin': 20, 'name': 'Garagedörr', 'unique_id': 'garage_door'}]} 2024-10-27 10:40:50.738 DEBUG (MainThread) [custom_components.rpi_gpio.cover] GPIODCover init: 21:20 - Garagedörr - garage_door - 1 2024-10-27 10:40:50.739 DEBUG (MainThread) [custom_components.rpi_gpio.hub] in add_cover 21 20 2024-10-27 10:40:50.739 DEBUG (MainThread) [custom_components.rpi_gpio.hub] in add_switch 21 2024-10-27 10:40:50.739 DEBUG (MainThread) [custom_components.rpi_gpio.hub] original line info: <LineInfo offset=21 name="GPIO21" used=False consumer="None" direction=Direction.INPUT active_low=False bias=Bias.UNKNOWN drive=Drive.PUSH_PULL edge_detection=Edge.NONE event_clock=Clock.MONOTONIC debounced=False debounce_period=0:00:00> 2024-10-27 10:40:50.739 DEBUG (MainThread) [custom_components.rpi_gpio.hub] in add_sensor 20 2024-10-27 10:40:50.739 DEBUG (MainThread) [custom_components.rpi_gpio.hub] original line info: <LineInfo offset=20 name="GPIO20" used=False consumer="None" direction=Direction.INPUT active_low=False bias=Bias.UNKNOWN drive=Drive.PUSH_PULL edge_detection=Edge.NONE event_clock=Clock.MONOTONIC debounced=False debounce_period=0:00:00> 2024-10-27 10:40:50.741 DEBUG (MainThread) [custom_components.rpi_gpio.hub] current value for port 20: True 2024-10-27 10:40:53.313 DEBUG (MainThread) [custom_components.rpi_gpio.binary_sensor] setup_platform: {'platform': 'rpi_gpio', 'sensors': [{'port': 16, 'pull_mode': 'UP', 'invert_logic': True, 'bouncetime': 50, 'name': 'garagedoor_switch'}]} 2024-10-27 10:40:53.313 DEBUG (MainThread) [custom_components.rpi_gpio.binary_sensor] GPIODBinarySensor init: 16 - garagedoor_switch - rpi_gpio_16_garagedoor_switch 2024-10-27 10:40:53.313 DEBUG (MainThread) [custom_components.rpi_gpio.hub] in add_sensor 16 2024-10-27 10:40:53.315 DEBUG (MainThread) [custom_components.rpi_gpio.hub] original line info: <LineInfo offset=16 name="GPIO16" used=False consumer="None" direction=Direction.INPUT active_low=False bias=Bias.UNKNOWN drive=Drive.PUSH_PULL edge_detection=Edge.NONE event_clock=Clock.MONOTONIC debounced=False debounce_period=0:00:00> 2024-10-27 10:40:53.317 DEBUG (MainThread) [custom_components.rpi_gpio.hub] current value for port 16: True 2024-10-27 10:44:35.337 DEBUG (MainThread) [custom_components.rpi_gpio.hub] startup rpi_gpio hub 2024-10-27 10:44:35.338 DEBUG (MainThread) [custom_components.rpi_gpio.hub] updating lines: {21: gpiod.LineSettings(direction=Direction.OUTPUT, edge_detection=Edge.NONE, bias=Bias.AS_IS, drive=Drive.PUSH_PULL, active_low=True, debounce_period=datetime.timedelta(0), event_clock=Clock.MONOTONIC, output_value=Value.INACTIVE), 20: gpiod.LineSettings(direction=Direction.INPUT, edge_detection=Edge.BOTH, bias=Bias.PULL_UP, drive=Drive.PUSH_PULL, active_low=True, debounce_period=datetime.timedelta(microseconds=50000), event_clock=Clock.REALTIME, output_value=Value.ACTIVE), 16: gpiod.LineSettings(direction=Direction.INPUT, edge_detection=Edge.BOTH, bias=Bias.PULL_UP, drive=Drive.PUSH_PULL, active_low=True, debounce_period=datetime.timedelta(microseconds=50000), event_clock=Clock.REALTIME, output_value=Value.ACTIVE)} 2024-10-27 10:44:35.342 ERROR (MainThread) [custom_components.rpi_gpio.hub] Failed to update lines: (22, 'Invalid argument')

@Emlben, I tried your configuration on my setup and it works fine. Also the traces you provide show that you dont have the same problem which other people had here about GPIO line which was already used by another component. I have to say I dont know why the call to chip.request_lines from the libgpiod library is failing with error 22: Invalid argument.
We will need to keep investigating this but I dont have any quick help here other than using the old version for now.

@Emlben, some idea to test:
Can you update the manifest.json file to replace:
"requirements": [ "gpiod>=2.0.2" ]

with
"requirements": [ "gpiod>=2.2.1" ]

and restart HA.
It seems there were some old bugs in the library and maybe you have an older copy of it somehow.
I will submit a PR with this change later but want to see if it helps in your case.

@Emlben, some idea to test: Can you update the manifest.json file to replace:
"requirements": [ "gpiod>=2.0.2" ]

with
"requirements": [ "gpiod>=2.2.1" ]

Unfortunately no improvement.
But, I suddenly realize what could be the reason:
I am still on 32 bit OS, and by that I have learned that libs might very well not be maintained any more.
I have that issue on ESP-home.
My technical debt is increasing... Need to get my head around to fix that...
I am not saying that is the issue in this case - but it is a theory ;)

Bummer. I hoped the lib update will do it. I have 2 RPis, one RPi4-64bit and one RPi5-64bit, so it might be that. But, I cant prove it is, so you will have to try it out :(.

will do when time is right!
Thank you very much for your efforts!
I´ll just stick to 2022.07 for now and watch my debt grow.. ;)

Hi @tomer-w it has only just occured to me that 1-Wire SysBus is also using GPIO. Could this be what is causing the busy error?

@STELTZ-MANIA ,  you might be right. Anyhow, since the original release I improved a lot the error handling and tracing of the issue around busy error. Can you install the latest version - 2024.10.3 and send us the latest debug logs. It should provide what component is using the GPIO. I hope it will help in your case as well.

@tomer-w I just installed the latest version again and now it's working perfectly! Furthermore, it would appear that this was a configuration issue the whole time on my behalf with a Port clash between a switch I had configured using rpi_gpio and the default port being used by onewire.
2024-10-29 19:55:48.198 INFO (MainThread) [homeassistant.setup] Setting up switch
2024-10-29 19:55:48.199 INFO (MainThread) [homeassistant.setup] Setting up rpi_gpio
2024-10-29 19:55:48.201 INFO (MainThread) [homeassistant.setup] Setup of domain rpi_gpio took 0.00 seconds
2024-10-29 19:55:48.202 INFO (MainThread) [homeassistant.components.switch] Setting up rpi_gpio.switch
2024-10-29 19:55:48.207 ERROR (MainThread) [custom_components.rpi_gpio.hub] Port 5 already in use by onewire@0
2024-10-29 19:55:48.208 ERROR (MainThread) [homeassistant.components.switch] Error adding entity switch.ph for domain switch with platform rpi_gpio
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 595, in _async_add_entities
await coro
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 909, in _async_add_entity
await entity.add_to_platform_finish()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1365, in add_to_platform_finish
await self.async_added_to_hass()
File "/config/custom_components/rpi_gpio/switch.py", line 98, in async_added_to_hass
self._hub.add_switch(self, self._port, self._active_low, self._bias, self._drive_mode)
File "/config/custom_components/rpi_gpio/hub.py", line 158, in add_switch
self.verify_port_ready(port)
File "/config/custom_components/rpi_gpio/hub.py", line 97, in verify_port_ready
raise HomeAssistantError(f"Port {port} already in use by {info.consumer}")
homeassistant.exceptions.HomeAssistantError: Port 5 already in use by onewire@0
I actually thought onewire was using Port 4.
I cannot thank you enough for your efforts and perseverance.

I'm closing this bug as there were multiple fixes here which made the original reported issue not relevant anymore. There is one report on an issue which we suspect might be related to 32bit HA but this is not verified and not related to the initial report here.
If anyone who is using the latest version is facing an issue, please open a new issue with debug logs.
https://github.com/thecode/ha-rpi_gpio/pull/308
https://github.com/thecode/ha-rpi_gpio/pull/309
https://github.com/thecode/ha-rpi_gpio/pull/313


Why do you violate the constraints and use to_string (your self-invented name) instead of str (the magic method name for converting to a string) ?

It's very surprising. I had to dig into the library internals to get the source without dot executable. Also I think that dot executable should not be called at all when the output format is dot.

The to_string methods were introduced some time ago, in https://github.com/erocarrera/pydot/commit/c0233c6aae32d11d2dc1e0f836c0bcf8b2fab6d0#diff-44fda7721399b25e8cb06471016a3454R485.  One motivation for not implementing __str__ could be considering the conversion to string as a transformation to an output format, instead of the "string representation" of the constructs. Documenting this method in a tutorial would be one way to point at it. Another possible change is to implement __str__, though not sure whether this aligns with the original design intent.

The method pydot.Graph.to_string does not call the dot executable, it works in pure Python.
The method pydot.Dot.write_dot does call the dot executable. The reason is that dot computes a layout for the graph, and the resulting file contains coordinate information (which can be useful to other tools, for example for translating to LaTeX).
For example, to_string can give:
'strict graph G {\n1;\n2;\n1 -- 2;\n}\n'

and for the same graph write_dot dumps:
strict graph G {
	graph [bb="0,0,54,108"];
	node [label="\N"];
	1	 [height=0.5,
		pos="27,90",
		width=0.75];
	2	 [height=0.5,
		pos="27,18",
		width=0.75];
	1 -- 2	 [pos="27,71.697 27,60.846 27,46.917 27,36.104"];
}

Thank you for the answer. I vote for implementing str.


React/front end

The data is being fetched from back end api created in rails app
fetched data is being displayed
when the page is refreshed the displayed data changes for another fetched data

Hi @newtonah0,  👋🏻👋🏻
Your project is complete!  There is nothing else to say other than... it's time to merge it :shipit:
Congratulations! 🎉

Highlights

[ ]  Descriptive PR⭐
[ ]  No Linters error 🤩
[ ] Messages displayed well 🔥
[ ] Good job working on the component and redux setup ⭐🙏🏻

Optional suggestions
Every comment with the [OPTIONAL] prefix won't stop the approval of this PR. However, I strongly recommend you to take them into account as they can make your code better. Some of them were simply missed by the previous reviewer and addressing them will really improve your application.
Cheers, and Happy coding!👏👏👏
Feel free to leave any questions or comments in the PR thread if something is not 100% clear.
Please, remember to tag me in your question so I can receive the notification.

As described in the Code reviews limits policy  you have a limited number of reviews per project (check the exact number in your Dashboard). If you think that the code review was not fair, you can request a second opinion using this form.


Add README to make the production instance more discoverable.

The URL to the production instance isn't currently anywhere in this repository.  This PR changes that.
Alternatively (or additionally), the repository's URL could be set to the production instance's URL (by clicking the gear icon that's above the words "No description, website, or topics provided" in https://github.com/phy1729/zsh-guide).

I've added a workflow to deploy to GitHub Pages and added that as the repository's URL. Thanks for reminding me this existed :slightly_smiling_face: .


git plugin's track-tags option isn't enough for gnulib's git-version-gen

When the track-tags option of the git plugin is enabled, it generates a slimmed-down .git directory enough for git describe and git log to succeed.
However gnulib's git-version-gen script relies on git log . which doesn't work, and returns an error like
fatal: unable to read tree 1bdaa2ce628b458ab6a7c9e03023a9aed221cf75

Looks like simply writing .tarball-version is enough to convince git-version-gen to do nothing.

Turns out there are bootstrap commands where this workaround doesn't really work.


:bug: fixes opening of url in browser

fixes #77
See also https://github.com/dotnet/runtime/issues/28005#issuecomment-485532113

Great job! Thanks!


Lot's of warning message when starting a fresh local chain now

Two places needed to be adjusted:

nodeos/snapshot.go complains it cannot find snapshot in warning, but it's a fresh chain. Message is in warning and it's misleading because we talk about a replay, which it not the case here. I suggest we move that to INFO and improve the message
Now that nodeos maps it's warning to zap level, it's annoying to have them by default. We should probably try to tweak it to have ERROR only. That might prove harder than it seems because the level is at the app level while we would need to tweak it for a particular package here.

Note also that I was not able to choose a label for this issue, no label seems to fit here, where is the enhancement like label?
$ ./dfuseeos start
Starting dfuse for EOSIO with config file './dfuse.yaml'
Launching applications: abicodec,apiproxy,blockmeta,dashboard,dgraphql,eosq,eosws,fluxdb,merger,mindreader,node-manager,relayer,search-archive,search-indexer,search-live,search-router,trxdb-loader
Your instance should be ready in a few seconds, here some relevant links:

  Dashboard:        http://localhost:8081

  Explorer & APIs:  http://localhost:8080
  GraphiQL:         http://localhost:8080/graphiql

Cannot find latest snapshot, will replay from blocks.log (nodeos/snapshot.go:153)
warn  2020-05-08T21:58:27.837 thread-0  platform_timer_accurac:64     compute_and_print_ti ] Checktime timer accuracy on this platform and hardware combination is poor; accuracy of subjective transaction deadline enforcement will suffer (log_plugin/to_zap_log_plugin.go:53)
warn  2020-05-08T21:58:27.856 thread-0  controller.cpp:583            startup              ] No existing chain state or fork database. Initializing fresh blockchain state and resetting fork database (log_plugin/to_zap_log_plugin.go:53)
warn  2020-05-08T21:58:27.857 thread-0  controller.cpp:452            initialize_blockchai ] Initializing new blockchain with genesis state (log_plugin/to_zap_log_plugin.go:53)
Cannot find latest snapshot, will replay from blocks.log (nodeos/snapshot.go:153)
warn  2020-05-08T21:58:28.699 thread-0  platform_timer_accurac:64     compute_and_print_ti ] Checktime timer accuracy on this platform and hardware combination is poor; accuracy of subjective transaction deadline enforcement will suffer (log_plugin/to_zap_log_plugin.go:53)
warn  2020-05-08T21:58:28.706 thread-0  controller.cpp:583            startup              ] No existing chain state or fork database. Initializing fresh blockchain state and resetting fork database (log_plugin/to_zap_log_plugin.go:53)
warn  2020-05-08T21:58:28.706 thread-0  controller.cpp:452            initialize_blockchai ] Initializing new blockchain with genesis state (log_plugin/to_zap_log_plugin.go:53)

I fixed #1 (replay...)
For #2, I don,t think we should do this now. let's keep levels aligned. pushing to a new "improvement" issue


Packaged Electron app throws Cannot find module error

Please tell us about your environment:

winston version?

[ ] winston@2
[x] winston@3

node -v outputs:

C:\Users\path-to-project>node -v
v15.14.0

Operating System? Windows 10
Language? ES6/7

What is the problem?
I am using winston logger in an Electron app, when I run the app with npm start, the logger works just fine without any errors.
But when I package my app with any packager like electron-packager or electron-forge, it gives me an error as below -
Uncaught Error: Cannot find module '../adapters/process.env'
Require stack:
-<EMAIL_ADDRESS>-<EMAIL_ADDRESS>- C:\Users\path-to-pkg\resources\app\node_modules\winston\lib\winston\exception-handler.js
- C:\Users\path-to-pkg\resources\app\node_modules\winston\lib\winston\logger.js
- C:\Users\path-to-pkg\resources\app\node_modules\winston\lib\winston\create-logger.js
- C:\Users\path-to-pkg\resources\app\node_modules\winston\lib\winston.js
- C:\Users\path-to-pkg\resources\app\js\log_dat.js
- C:\Users\path-to-pkg\resources\app\index.html
    at Module._resolveFilename (internal/modules/cjs/loader.js:798)
    at Function../lib/common/reset-search-paths.ts.Module._resolveFilename (reset-search-paths.ts:42)
    at Module._load (internal/modules/cjs/loader.js:691)
    at Function.Module._load (electron/js2c/asar.js:748)
    at Module.require (internal/modules/cjs/loader.js:853)
    at require (internal/modules/cjs/helpers.js:74)
    at Object.<anonymous> (C:\Users\path-to-pkg\resources\app\node_modules\@dabh\diagnostics\node\development.js:30)
    at Object.<anonymous> (C:\Users\path-to-pkg\resources\app\node_modules\@dabh\diagnostics\node\development.js:38)
    at Module._compile (internal/modules/cjs/loader.js:968)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:986)

What do you expect to happen instead?
The logger should work just fine as it does before packaging, this only happens when the app is run as packaged.
Other information
I don't know what else I should look for, I tried

[x] removing all winston instances
[x] re-installing node_modules

but nothing has worked so far.
This is my log_dat.js file -
const path = require('path')
const { createLogger, format, transports } = require('winston');

// Create logger
const logger = createLogger({
  level: 'info',
  format: format.combine(
    format.timestamp({
      format: 'YYYY-MM-DD HH:mm:ss'
    }),
    format.errors({ stack: true }),
    format.splat(),
    format.printf(info => `${[info.timestamp]} - ${info.label} - ${info.level.toUpperCase()} - ${info.message}`),
    format.align()
  ),
  defaultMeta: { service: 'user-service' },
  transports: [
    new transports.File({
      filename: path.resolve(__dirname, '..', 'logs', 'node-error.log'),
      level: 'error',
      maxsize: 100000,
      maxFiles: 5,
      tailable: true
    }),
    new transports.File({
      filename: path.resolve(__dirname, '..', 'logs', 'node-combined.log'),
      maxsize: 100000,
      maxFiles: 10,
      tailable: true
    })
  ],
  exitOnError: false
})

module.exports = {
  logger: logger
}

I took a closer look at how the app was getting packaged, so I started from the package.json file which first got modified when I imported my project with electron-forge.
So I looked at the config section and found that electron-forge was ignoring a bunch of files and directories. It included this glob pattern ".*.env", after removing this, now everything is working all good. So I guess it ignored some .env files that are required by winston to run.
But I would like to know, will removing this glob pattern ".*.env" expose some sensitive .env files in the project?
Or how could I just allow the .env files required by winston and ignore everything else?

Hello @mrr0b0t-0x1 i am also getting error as ../../connect not found i am using this import in elrctron.js when i am using npm run watch every thing works fine but when i run .exe file this error occurs

Hi.
I'm receiving the same error but is for "logform".
Running in dev mode is everything OK. after build and run EXE, the errors occurs.
My Deps:
"dependencies": {
    "@quasar/extras": "^1.15.5",
    "@stripe/terminal-js": "^0.11.2",
    "axios": "^1.1.3",
    "concurrently": "^7.6.0",
    "mitt": "^3.0.0",
    "moment": "^2.29.4",
    "path": "^0.12.7",
    "quasar": "^2.10.2",
    "sass": "1.32.12",
    "simple-keyboard": "^3.4.184",
    "toad-scheduler": "^2.0.0",
    "uuid": "^9.0.0",
    "vue": "^3.2.43",
    "vue-router": "^4.1.6",
    "winston": "^3.10.0",
    "winston-daily-rotate-file": "^4.7.1",
    "winston-transport": "^4.5.0",
    "zod": "^3.21.4"
  },

I tried install logform as dependency and the error change to "Coul'd not find module '@colours/color/safe'.
Any Help?

Hi. I'm getting the same error. When I use the "cnpm install" install command, then the error appears.  When I'm using "yarn", The error disappeared.

Hi, someone found solution ?


Questions about secondary development

Outline is awesome project. Thanks so much. You've been a big help already.
We plan to do some simple secondary development based on Outline. For example, add a user login interface. There is two way that: Add HTML and other content directly in the outline project or add some content in each build project. Which one is better?
Thanks. @trevj @alalamav

@Sean-Wang Thanks for trying Outline!
So, I'm not sure I understand your second option: "add some content in each build project". Are you considering changes to the client(s), server manager, or both?

For my understanding:
he is asking for use outline souce code and build his own stuff.
And also, he is wondering which one is better for user login with password. Html (probably SQL way to login) or outline project shows up an user name and password.
you can build you own json/database and use either way to login. It won't bother, but build you own sql give your more freedom choice. I personally not willing to let project developer to build this.(cuz it is not necessary lol, a simple mini sql can hold all the stuff)

For my understanding:
he is asking for use outline souce code and build his own stuff.
And also, he is wondering which one is better for user login with password. Html (probably SQL way to login) or outline project shows up an user name and password.
you can build you own json/database and use either way to login. It won't bother, but build you own sql give your more freedom choice. I personally not willing to let project developer to build this.(cuz it is not necessary lol, a simple mini sql can hold all the stuff)

Yeah, we want to build our own stuff.

@Sean-Wang In that case, I recommend adding it to the "web app", under src/www. Any changes you make there will be included on all platforms.

@Sean-Wang In that case, I recommend adding it to the "web app", under src/www. Any changes you make there will be included on all platforms.

Thank you for your reply. @trevj


hackersPad

Ready to submit your project? Nice job! Hopefully you've read the submission guidelines. If not, make sure to read them first.
If you're unsure about the format, make sure to check out the Orpheuspad example and follow the format there.
If this PR isn't a submission, that's okay too! If there's anything about this PR template that seems confusing, let me know in #hackpad on the slack!

Assuming this is part of @MrDomocle 's workshop - approved!
Fill out the order form here: https://forms.hackclub.com/hackpad, please note that you are part of the workshop!


Does Appium for Mac support third party applications like "skype" and others or just supports only apple's native desktop applications like facetime and calculator for desktop automation

Hello everyone ,
i'm trying to automate one of our companies desktop application
Initially i have gone through the steps from this link :  https://github.com/appium/appium-for-mac
and i was able to successfully automate Apple Face-time desktop application through appium-for-mac
i had the identifiers and xpaths so it was fine, but the problem is when ever i try to build the xpath or find the elements name for the third party desktop apps for example (skype) it does not generate the xpath at all a simple example :
Facetime end call button xpath : "/AXApplication[@AXTitle='FaceTime']/AXWindow[@AXTitle='FaceTime' and @AXSubrole='AXStandardWindow']/AXButton[@AXTitle='End']";
But for my application if i try to identify any elements and try build the xpath it like this:
"/AXTextField[@AXSubrole='AXUnknown']"
what is the difference my question is  :
-> do we need to sign the application like same we do for mobile apps
-> or there is any documentation or any link how to automate third party desktop apps other than apple native apps @mykola-mokhnach @jlipps @penguinho @imurchie

We should be able to automate any mac os desktop application.
It's working fine for my desktop application
Better to use absolute xpath
Ex:"/AXApplication[@AXTitle='Enrollment']/AXWindow[@AXTitle='Native Enrollment']/AXTextField[@AXPlaceholderValue='Username']"

I have the same question. I seems some of the 3p app work (some Chinese dictionary app) but some don't (e.g. slack).

As far as I know, this only supports apps that are developed using the standard mac OS UI APIs. So hybrid apps (Slack) or Qt apps probably won't work.


Add SECURITY_CONTACTS to the cluster registry repo

/sig multicluster
Does anyone else want to volunteer to be a security contact?
/assign @madhusudancs @pmorie @font

@perotinus Thanks for adding this! I will volunteer as well. :)

Thank you, @font! I added you to the list.


An option to skip or customize UV quantization in gltfpack

Hello.
We have an application where you can reassign materials on some objects.
The materials to choose from are stored in the same gltf file as the rest of the model, but some of them are assigned to dummy meshes, so that various tools wouldn't delete them. Also materials are tiled, therefore UV range on the target primitive is outside [0..1]. But on dummies UV range IS 0..1,
So because the range is different the tool must scale UV's differently on different materials for dequantizing, therefore we can't reassign the materials anymore. (I mean we can, but UVs will scale incorrectly)
I see 3 solutions on gltfpack's side

an option to skip UV quantization entirely
an option to use boundaries from the entire file to compute scale for UVs
an ability to provide explicit UV boundaries per material (or per primitive)

It feels reasonable to have some option to this effect, ideally that would solve #194 at the same time.
Also noting that KHR_materials_variants is fully supported by gltfpack and seems like a more direct way to attack your specific use case.


fix: Avoid use documentScanner on regular camera

Using regular camera on a application with react-native-document-scanner-plugin package installed causes the following runtime exception crahsing the app.

Failure delivering result ResultInfo{who=null, request=1, result=-1, data=null} to activity {com.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void com.websitebeaver.documentscanner.DocumentScanner.handleDocumentScanIntentResult(androidx.activity.result.ActivityResult)' on a null object reference

This PR prevents use documentScanner when it's not available

Can you explain what you mean by using regular camera? Did you create a react native app that uses this plugin and another camera plugin?
Could the problem be that the same request code is being used?
private static final int DOCUMENT_SCAN_REQUEST = 1;

Can you explain what you mean by using regular camera? Did you create a react native app that uses this plugin and another camera plugin?

Exactly that!, The project uses expo-image-picker to take pictures too.

Could the problem be that the same request code is being used?

Probably yes, apparently it uses the same value
object ImagePickerConstants {
  const val TAG = "ExponentImagePicker"
  const val REQUEST_LAUNCH_CAMERA = 1
  ...

fixed in https://github.com/WebsiteBeaver/react-native-document-scanner-plugin/releases/tag/0.3.0
https://github.com/WebsiteBeaver/react-native-document-scanner-plugin/commit/38d8e6be4a4626d17d7fc650fb039c44b3652aee change requestCode from 1 to a number less likely to be used by another plugin


No linter diagnostics reported

Hey! Trying to use LSP-pyls in a project, I can get code completion working, but not any of the linters

Running on Mac
LSP version 1.2.12
Sublime Text 4099
Using poetry for package/venv management
I have no user-visible errors

User settings file
// Settings in here override those in "LSP-pyls/LSP-pyls.sublime-settings"

{
  "settings": {
    "pyls.configurationSources": ["flake8"],
    "pyls.plugins.pycodestyle.enabled": false,
    "pyls.plugins.flake8_lint.enabled": true,
    "pyls.plugins.pyls_mypy.enabled": true,
    "pyls.plugins.pyls_mypy.live_mode": false,
    "pyls.plugins.pyls_black.enabled": true,
    "pyls.plugins.pyls_isort.enabled": true,
  },
}

What I expect
To get mypy/flake8 warnings/diagnostics shown in Sublime.
Renames, code-completion and go-to-reference is working, the things I expect are depending on JEDI.
What I've tried
Enabling the different linters from the overall lsp settings under the pyls key, the lsp-pyls settings, and project settings.
Since I'm using poetry, I thought something might be up with the PATH vars, to I tried adding the env section to these different locations as well, but it didn't work either.
  "env": {
    "PYTHONPATH": "$sublime_py_files_dir:$packages:/Users/username/Library/Caches/pypoetry/virtualenvs/backend-GAy6QZlK-py3.8",
    "MYPY_PATH": "$sublime_py_files_dir:$packages:/Users/username/Library/Caches/pypoetry/virtualenvs/backend-GAy6QZlK-py3.8"
  },

Works for me

with these settings:
// Settings in here override those in "LSP-pyls/LSP-pyls.sublime-settings"
{
    "settings": {
        "pyls.configurationSources": [
            "flake8"
        ],
        "pyls.plugins.pycodestyle.enabled": false,
        "pyls.plugins.flake8_lint.enabled": true
    }
}

Do you perhaps have diagnostics turned off in Packages/User/LSP.sublime-settings?

Yeah, I expect something is up with my specific setup here.
No, these are my fairly minimal settings.
// Settings in here override those in "LSP/LSP.sublime-settings"
{
  "log_debug": true,
  "log_stderr": true,
  "log_server": ["panel"],
  "show_diagnostics_panel_on_save": 1,
}

If I enable pyflakes or pycodestyle (still with "pyls.configurationSources": ["flake8"] , then I get diagnostics from them, but flake8 isn't working. Looking at the exposed config for the vscode version [1]  the option pyls.plugins.flake8_lint.enabled also doesn't seem to be exposed 🤔
And for mypy, I expect there's something up with my PYTHONPATH/MYPY_PATH, when I change the settings to explicitly include the project venv, It starts showing me type-errors. But it also can't find the implementations for the libraries/modules in that venv folder...
// Settings in here override those in "LSP-pyls/LSP-pyls.sublime-settings"
{
  "settings": { ... },
  // After adding this, mypy starts showing results
  "env": {
    "PYTHONPATH": "/Users/<some-long-path>/backend/.venv/lib/python3.8/site-packages",
    "MYPY_PATH": "/Users/<some-long-path>/backend/.venv/lib/python3.8/site-packages",
  }
}

So I think I probably have two different issues on my hand.

https://github.com/palantir/python-language-server/blob/develop/vscode-client/package.json

It seems the option is actually called "pyls.plugins.flake8.enabled": true,. I've updated schema on master to use that since I can only make it work with that one.

Aha! Yeah, setting "pyls.plugins.flake8.enabled": true, works on my end as well.
As for the mypy stuff, I think I just have to sort out all the proper PATH/PYTHONPATH/MYPYPATH settings in my environment.
Thanks for the help! I'll go ahead and close this now then 😃


refactor: transform for-of

Modernize Code
Requires prior PRs to be merged in order:  #95, #97

PR closed as parent PR has been invalidated.


webpack: move WebpackBundle to separate file

close #121
release v1.1.0 (close #124)

We should bump invenio-assets version after the release.

@ChiaraBi can you remove the spaces in base.js? It is breaking the webpack build 😢
--- a/invenio_theme/assets/js/invenio_theme/base.js
+++ b/invenio_theme/assets/js/invenio_theme/base.js
@@ -5,7 +5,7 @@
  * Invenio is free software; you can redistribute it and/or modify it
  * under the terms of the MIT License; see LICENSE file for more details.
  */
- // eslint-disable-next-line no-unused-vars
- import jquery from 'jquery/dist/jquery'
- // eslint-disable-next-line no-unused-vars
- import bootstrap from 'bootstrap-sass/assets/javascripts/bootstrap'
+// eslint-disable-next-line no-unused-vars
+import jquery from 'jquery/dist/jquery'
+// eslint-disable-next-line no-unused-vars
+import bootstrap from 'bootstrap-sass/assets/javascripts/bootstrap'


Starting web service when sending

Hello
I have a question.
This web service and handlers that we register:
	if config.ConfigData.Functions.HttpFileServer {

		//如果启用http文件服务器，启用下面的路由
		httpServer.HandleFunc("/", handlers.IndexFileHandler)
		httpServer.HandleFunc("/uploads/", handlers.FileServerHandler)
		httpServer.Handle("/static/", http.StripPrefix("/static/", http.FileServer(http.FS(static.EmbeddedStaticFiles))))
	}
	/*发送接收部分*/
	if config.ConfigData.Functions.LocalSendServer {

		httpServer.HandleFunc("/api/localsend/v2/prepare-upload", handlers.PrepareReceive)
		httpServer.HandleFunc("/api/localsend/v2/upload", handlers.ReceiveHandler)
		httpServer.HandleFunc("/api/localsend/v2/info", handlers.GetInfoHandler)
		httpServer.HandleFunc("/send", handlers.NormalSendHandler)       // 上传处理程序
		httpServer.HandleFunc("/receive", handlers.NormalReceiveHandler) // 下载处理程序

	}

Do they serve any purpose when you are sending a file to another machine? (with -mode send flag)
Because I disabled the httpServer entirely, and it sends the file successfully.
The program exits when it's done sending the file, do it doesn't make sense to receive files from a third machine at the same time.

Hello I have a question.
This web service and handlers that we register:
	if config.ConfigData.Functions.HttpFileServer {

		//如果启用http文件服务器，启用下面的路由
		httpServer.HandleFunc("/", handlers.IndexFileHandler)
		httpServer.HandleFunc("/uploads/", handlers.FileServerHandler)
		httpServer.Handle("/static/", http.StripPrefix("/static/", http.FileServer(http.FS(static.EmbeddedStaticFiles))))
	}
	/*发送接收部分*/
	if config.ConfigData.Functions.LocalSendServer {

		httpServer.HandleFunc("/api/localsend/v2/prepare-upload", handlers.PrepareReceive)
		httpServer.HandleFunc("/api/localsend/v2/upload", handlers.ReceiveHandler)
		httpServer.HandleFunc("/api/localsend/v2/info", handlers.GetInfoHandler)
		httpServer.HandleFunc("/send", handlers.NormalSendHandler)       // 上传处理程序
		httpServer.HandleFunc("/receive", handlers.NormalReceiveHandler) // 下载处理程序

	}

Do they serve any purpose when you are sending a file to another machine? (with -mode send flag) Because I disabled the httpServer entirely, and it sends the file successfully.
The program exits when it's done sending the file, do it doesn't make sense to receive files from a third machine at the same time.

I initially planned to develop a command-line program that could be used both as a local cloud drive and for temporary file transfer. So I wrote the web part, implementing functionalities similar to a NAS. At the time, I was also considering adding file management and image management features to the web interface, but I didn't continue the development due not having enough time.

No worries.
I just wanted to make sure they are not needed so I can disable them for sending.
Thanks.
I was thinking about a TUI or Test-based user interface like lazydocker and lazygit, so I can run it on any Unix machine, even *BSD, even with no GUI.
But it serves the purpose right now.


Cannot open "recent" markdown files from Windows Taskbar

Issue Type: Bug

Open vscode on windows, pin it to taskbar
Create a markdown file, take note of name/location it was saved.
Close the markdown file.
Right click on vscode windows taskbar icon
Select the markdown file under the "Recent" list
Observe the error below:

"The item you selected is unavailable.  It might have been moved, renamed, or removed.  Do you want to remove it from the list?"

VS Code version: Code 1.48.1 (3dd905126b34dcd4de81fa624eb3a8cbe7485f13, 2020-08-19T17:12:13.244Z)
OS version: Windows_NT x64 10.0.18363

System Info

Item
Value

CPUs
Intel(R) Core(TM) i7-7660U CPU @ 2.50GHz (4 x 2496)

GPU Status
2d_canvas: enabledflash_3d: enabledflash_stage3d: enabledflash_stage3d_baseline: enabledgpu_compositing: enabledmultiple_raster_threads: enabled_onoop_rasterization: disabled_offprotected_video_decode: enabledrasterization: enabledskia_renderer: disabled_off_okvideo_decode: enabledviz_display_compositor: enabled_onviz_hit_test_surface_layer: disabled_off_okwebgl: enabledwebgl2: enabled

Load (avg)
undefined

Memory (System)
15.92GB (8.56GB free)

Process Argv
C:\Users\tjbar.omnisharp~omnisharp.json

Screen Reader
no

VM
0%

Extensions (9)

Extension
Author (truncated)
Version

spellright
ban
3.0.52

vsc-material-theme
Equ
32.8.0

vsc-material-theme-icons
equ
1.2.0

dotnet-test-explorer
for
0.7.4

csharpextensions
jch
1.3.1

csharp
ms-
1.23.1

powershell
ms-
2020.6.0

hide-gitignored
npx
1.1.0

code-spell-checker
str
1.9.0

(1 theme extensions excluded)

Notes:
I first thought this was a windows issue, but I tried the same steps with notepad and had no problems which made me wonder if it is something specific to vs code.  I have observed this with multiple files in multiple locations  See this screenshot to clarify what I'm referring to:

Opening the file in vscode from the File > Open prompt or other means doesn't cause any issues.

I cannot reproduce, this error should only appear for files that do not exist anymore on disk. Is this a special file system? Network drive? UNC?

Afraid not, a typical windows laptop referring to a local file within the same user profile 😬
I'll try reproducing on another machine today

Can you try to reproduce with our nightly insider builds? You can give our preview releases a try from: https://code.visualstudio.com/insiders/

Update: I reproduced on another system.  Same effect weather it's recent or pinned by the way.
Pending: need to try with preview build.
Thanks for your help/patience

Thanks


some problem with run_long_form_static.py

When I finished executing ASQA.sh, there was no result in my  ASQA.out file :
WARNING 05-09 14:07:49 config.py:467] Casting torch.bfloat16 to torch.float16. INFO 05-09 14:07:49 llm_engine.py:73] Initializing an LLM engine with config: model='/mnt/data/home/usera6k04/project/self-rag/llama2-7b', tokenizer='/mnt/data/home/usera6k04/project/self-rag/llama2-7b', tokenizer_mode=auto, revision=None, tokenizer_revision=None, trust_remote_code=False, dtype=torch.float16, max_seq_len=4096, download_dir='.cache', load_format=auto, tensor_parallel_size=1, quantization=None, enforce_eager=False, seed=0) INFO 05-09 14:08:20 llm_engine.py:223] # GPU blocks: 302, # CPU blocks: 512 INFO 05-09 14:08:22 model_runner.py:394] Capturing the model for CUDA graphs. This may lead to unexpected consequences if the model is not static. To run the model in eager mode, set 'enforce_eager=True' or use '--enforce-eager' in the CLI. INFO 05-09 14:08:26 model_runner.py:437] Graph capturing finished in 4 secs.
2.when I execute FactScore.sh, a error in my FactScore.error.out
`Special tokens have been added in the vocabulary, make sure the associated word embeddings are fine-tuned or trained.
Special tokens have been added in the vocabulary, make sure the associated word embeddings are fine-tuned or trained.
Special tokens have been added in the vocabulary, make sure the associated word embeddings are fine-tuned or trained.
Special tokens have been added in the vocabulary, make sure the associated word embeddings are fine-tuned or trained.

Processed prompts:   0%|          | 0/1 [00:00<?, ?it/s]
Processed prompts: 100%|██████████| 1/1 [00:00<00:00,  1.80it/s]
Processed prompts: 100%|██████████| 1/1 [00:00<00:00,  1.80it/s]
Processed prompts:   0%|          | 0/1 [00:00<?, ?it/s]
Processed prompts: 100%|██████████| 1/1 [00:00<00:00,  1.14it/s]
Processed prompts: 100%|██████████| 1/1 [00:00<00:00,  1.14it/s]
Traceback (most recent call last):
File "run_long_form_static.py", line 441, in
main()
File "run_long_form_static.py", line 380, in main
"cat": item["cat"], "intermediate": intermediate["original_splitted_sentences"][0]})
KeyError: 'original_splitted_sentences'`

May I ask how you solve this?


Feature: record / sort by folder size

What feature or improvement do you think would benefit Files?
This is like the most thing I've wanted for the default windows explorer, to just show the folder size on the list
for now like I'm managing my steam games, I want to sort my games by size to delete the games occupy the most space and free up my disk space
but true most people won't need it and it will use a lot of resource by recursively scanning the file sizes
so here's two ways to done the idea:

use a indexer to index every file in the computer, make size scanning faster to like 10-20ms?
make user select to turn this feature on or just right click select "Scan Size" things etc.

Requirements

Record folder size in metadata
Refresh loading folder size button as a icon in the size tab / record all selected folder's size in a right click menu

Files Version
<IP_ADDRESS>
Windows Version
10.0.19045.3930
Comments
Image 1: Plan A - Make every folder in the size tab have a refresh button

Image 2: Plan B - Fetch folder size in the right click tab

Thanks for the feedback!
Let me clarify.

You mean you want a page listing up all files sorted by Size?

If so, that is already requested as a feature of richer search options, while this feature requires much work to be done and we're exploring a new design to achieve more easily.
If not, and if you meant to sort by Size in a folder, you can already do that by clicking Size column. That sort setting will be saved in our database and so the sort settings are hold even after relaunch unless you clean up or uninstall.

Make every folder in the size tab have a refresh button
We have a folder watcher to keep up with the latest information of folders and files. But if you want to do that manually you can click Refresh button on the address bar.

Fetch folder size in the right click tab
You can get folder size from properties window. You might need to enable that option in Settings. You can find the option in Files & folders settings page.

Yes, but the particular its listing the folder's size instead of only listing the file's size.
I want the size can be stored and shown clearly in the size tab so that it can be faster when managing every folder to be deleted of not.
The properties window can only show one item at a time and it do not provides to sort every folder by size, that's what i meant.
P.S. the properties window recalculates the whole folder's size every time you opened it so the size data it's not stored, which can lead to issues.

You can already have Files calculate folder size in Files settings > Files & Folders > Calculate folder sizes. This will update when the changes to the folder.


my own kube-schedule

Problem:
I am trying to deploy replicas of the same microservice into differents nodes. I think it is not possible
using the default kubernetes primitives.
Proposed Solution:
I am developing a solution using a java client. I want to create a extension of the kube-scheduler that make possible the deploy of the replicas of a same microservice into different nodes.
How can I do that?

Pretty straight forward, just follow:
https://kubernetes.io/docs/tasks/administer-cluster/configure-multiple-schedulers/

thank you. Just to make it clearer, I will try to do that with a java-client

Just some additional mileage, but at the bottom line it should be pretty similar. Good luck!

Have you seen https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#inter-pod-affinity-and-anti-affinity-beta-feature ?
Simple anti-affinity using service name or some label should probably do what you want.


java.lang.IllegalStateException: You must call initSharedInstance before calling getSharedInstance

Got a crash on one customer device.
Amplify: 1.5.1
Android version: Android 6.0
Device: Galaxy A3(2016) (a3xeltekx)
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.alexvas.dvr/com.alexvas.dvr.activity.ManageCamerasActivity}: android.view.InflateException: Binary XML file line #11: Binary XML file line #1: Error inflating class com.github.stkent.amplify.prompt.DefaultLayoutPromptView
	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3319)
	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3415)
	at android.app.ActivityThread.access$1100(ActivityThread.java:229)
	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1821)
	at android.os.Handler.dispatchMessage(Handler.java:102)
	at android.os.Looper.loop(Looper.java:148)
	at android.app.ActivityThread.main(ActivityThread.java:7325)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
Caused by: android.view.InflateException: Binary XML file line #11: Binary XML file line #1: Error inflating class com.github.stkent.amplify.prompt.DefaultLayoutPromptView
	at android.view.LayoutInflater.inflate(LayoutInflater.java:551)
	at android.view.LayoutInflater.inflate(LayoutInflater.java:429)
	at android.view.LayoutInflater.inflate(LayoutInflater.java:380)
	at android.support.v7.app.m.b(SourceFile:288)
	at android.support.v7.app.e.setContentView(SourceFile:140)
	at com.alexvas.dvr.activity.ManageCamerasActivity.onCreate(SourceFile:232)
	at android.app.Activity.performCreate(Activity.java:6904)
	at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1136)
	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3266)
	... 9 more
Caused by: android.view.InflateException: Binary XML file line #1: Error inflating class com.github.stkent.amplify.prompt.DefaultLayoutPromptView
	at android.view.LayoutInflater.createView(LayoutInflater.java:657)
	at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:776)
	at android.view.LayoutInflater.parseInclude(LayoutInflater.java:966)
	at android.view.LayoutInflater.rInflate(LayoutInflater.java:843)
	at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:810)
	at android.view.LayoutInflater.inflate(LayoutInflater.java:527)
	... 17 more
Caused by: java.lang.reflect.InvocationTargetException
	at java.lang.reflect.Constructor.newInstance(Native Method)
	at android.view.LayoutInflater.createView(LayoutInflater.java:631)
	... 22 more
Caused by: java.lang.IllegalStateException: You must call initSharedInstance before calling getSharedInstance.
	at com.github.stkent.amplify.b.a.b(SourceFile:101)
	at com.github.stkent.amplify.prompt.a.<init>(SourceFile:113)
	at com.github.stkent.amplify.prompt.DefaultLayoutPromptView.<init>(SourceFile:52)
	at com.github.stkent.amplify.prompt.DefaultLayoutPromptView.<init>(SourceFile:44)
	... 24 more

This is the code used for initialising Amplify
                DefaultLayoutPromptView promptView
                        = (DefaultLayoutPromptView) findViewById(R.id.prompt_view);

                if (promptView != null) {
                    promptView.addPromptEventListener(new IEventListener() {
                        @Override
                        public void notifyEventTriggered(@NonNull final IEvent event) {
                          // My code
                        }
                    });
                    Amplify.getSharedInstance().promptIfReady(promptView);
                }

@alexeyvasilyev where and how is your Amplify instance initialized?
This may be related to #166 also.

Hmm, this is a real puzzler. That exception is thrown when the DefaultLayoutPromptView is inflated, but I have no idea how that inflation can possibly be occurring before the Application class is created 😕
Are you able to reliably reproduce this locally? I'll have a play with the test app and see if I can force the issue there. I'm guessing if you're only seeing it rarely and in the wild then it's due to the app process being killed to reclaim resources. Do you have any additional data about the customer device that could be relevant (e.g. is it rooted? what Android version is it running? which Amplify version is included in that app version? etc.). Thanks in advance for any info you can provide!

No. Cannot reproduce that at all.
No additional data available.

@alexeyvasilyev are you using multi dex in your application?

No.
On Wed, Jul 5, 2017, 15:26 Stuart Kent<EMAIL_ADDRESS>wrote:

Reopened #167 https://github.com/stkent/amplify/issues/167.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/stkent/amplify/issues/167#event-1150808680, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AA6y3NgI67eJddVAGBwc_rsk07eGjvbJks5sK4EFgaJpZM4L3Hu3
.

--
Best regards,
Alex.

Ni multidex.

Are you still only seeing this crash on a single device, or is it reported on different devices/API levels?

I do not see more crashes.

Ah, interesting; thanks!

So it's happening at most once per user? Not consistently happening to the same users?

So far, yes, once per user.

Hmm. Could you please try calling Amplify.initSharedInstance(this)... before calling super.onCreate() in your Application subclass? (Based on this suggestion: https://stackoverflow.com/questions/44891750/crash-when-creating-view-that-relies-on-initialized-singleton#comment76764539_44891776). If you are consistently seeing errors right now, and feel comfortable deploying the suggested change to production, it would help a lot in tracking this one down.

@yomiyusuf any update? Did the suggestion last year resolve the crashes?


Intermediate build files removed after building

The intermediate build files are removed after each build forcing us to rebuild the project from scratch. Is this required or may the build task responsible for the removal be safely removed?
https://github.com/episerver/Quicksilver/blob/master/Sources/EPiServer.Reference.Commerce.Site/EPiServer.Reference.Commerce.Site.csproj#L1023

It should be safe to remove the target. I think the purpose was to create a clean folder for publishing to Github. We'll see if we can remove that in upcoming commits.


add documentation with Sphinx using a theme provided by Read the Docs

include numpydoc in the required libraries

Current coverage is 7.02%

Merging #19 into master will not affect coverage as of 2481d66

@@            master    #19   diff @@
=====================================
  Files           40     40
  Stmts         2748   2748
  Branches         0      0
  Methods          0      0
=====================================
  Hit            193    193
  Partial          0      0
  Missed        2555   2555

Review entire Coverage Diff as of 2481d66

Powered by Codecov. Updated on successful CI builds.


Is there any way to output blank cells from LGPMA model?

Hi,
Thank you for sharing your wonderful source code and pre-trained model.
I would like to output bounding boxes for blank cells in tables, is there any way to output blank cells from LGPMA model?
Best regards 👍

The model would not detect the blank cells. But in the final result, the post-processing will recover all blank cells (Those cells without texts are blank cells).

From what I read from the LGPMA paper, the bounding boxes of the blank cells are also visualized. May I know how to recover the bounding boxes of the blank cells?

Is it correct to understand that the final result means that combination result between LGPMA and OCR model?


[Issue#291]updating algorithm to use RFC1951 rather than RFC1950

This intends to fix Issue #291 as it has surfaced during tests we've been doing.
I'll add more details after I can test it properly, then I'll change PR status to final.

There's a few tests failing, I still haven't gone through them.


AutoScript not launching the RemoteApp Launcher

Hello team,
We are using the web generic script to launch our application via chrome browser. but unfortunately, the auto it script is not invoking via remote app launcher. the launcher window stuck without proceeding further.
Need help solving this.
Regards,

Do you see the error in the IO logs? Have you solved the problem yet?

Hello team,
We are using the web generic script to launch our application via chrome browser. but unfortunately, the auto it script is not invoking via remote app launcher. the launcher window stuck without proceeding further.
Need help solving this.
Regards,

Hi,
As suggested above, please first check the Launcher logs at C:\Users<RDS-account>\AppData\Roaming\OneIdentity\OI-SG-RemoteApp-Launcher
It may be required to add --enable-debug tot he parameters in the RDP App configuration.


Refactor tenant_filter to use new labeling_filter

Motivation
There are additional use cases where resource labeling and querying according to these labels are required, similar to in the flow implemented by the TenantFilter.
Approach
A new LabelingFilter is introduced, taking care of the generic labeling and criteria handling logic, allowing consumers to pass in their own specific logic using a callback function to provide the label value.
The existing TenantFilter is refactored to use this new filter.
Pull Request status

[x] Initial implementation
[x] Refactoring
[x] Unit tests

Coverage increased (+0.07%) to 87.088% when pulling 43dc1d3dff46a99520e85a7ed0fe5da348f71f8a on tenant-filter-refactoring into f37bab8e388081d057b186a4a13389d00496ffca on master.


So this now does a graceful shutdown on the Http server for the HTTP ingester.

sorry, needed another tweak to the exit logic when the ListenAndServe fails.


Title: Issues with Evaluating Results using picai_eval in nnU-Net

Hello,
I am currently working on a project using nnU-Net and have encountered an issue while trying to evaluate my results. I have successfully used nn-UNet for training and nnUNetv2_predict for predicting my test dataset. However, I am facing difficulties in properly evaluating the results, neither with Detection Maps nor with Softmax Volumes.
Here are the details of the issue:
Environment Details:
Path: e:\Hesam\envs\3dunetAghdam\lib\site-packages\sklearn\metrics_ranking.py
Warning: UndefinedMetricWarning: No negative samples in y_true, false positive value should be meaningless
This warning suggests an issue with the evaluation metrics due to the absence of negative samples in y_true.
Evaluation Results:
For Detection Maps:
auroc: NaN
AP: 0.7681818181818182
num_cases: 43
num_lesions: 45
picai_eval_version: 1.4.x
lesion_results: Various values (e.g., 10021_1000021: [1, 1.0, 0.8476386663616025])
For Softmax Volumes:
auroc: NaN
AP: 0.8255997853760775
num_cases: 43
num_lesions: 45
picai_eval_version: 1.4.x
I am unsure why the auroc value is NaN and whether the warning about no negative samples is impacting the evaluation results. Any guidance or suggestions on how to resolve this issue would be greatly appreciated.

Hi @hesam989,
It appears that the set of 43 cases you're evaluating on, are all positive cases (i.e., each case has at least one lesion in the ground truth label). Could that be the case? If so, the case-level diagnostic AUROC is NaN, because there are no negative samples.
Otherwise, the values appear as expected in picai_eval.

I'd like to add to this question: I understood that case-level metrics require a set of lesion-free cases, obviously, as otherwise we can't determine TPs, FPs etc. For the lesion-level evaluation, however, including such lesion-free cases significantly reduces the AP achieved. I think the problem is that the following code:
evaluate(np.zeros((1, 2, 32, 32)), np.zeros((1, 2, 32, 32)))

results in an AP of 0. Isn't that counterintuitive? I'd expect a high metric (indeed, there IS no lesion). Or are we supposed to calculate this metric with cases that contain csPCa only?
Furthermore: calculating the AP for a set of cases and then averaging the value, differs significantly from processing a batch as well.

Hi @mbu93,
The average precision (AP) is a distribution metric, similar to the Area Under the Receiver Operating Characteristic Curve. As such, it is not well-defined for processing single cases. For more info on the AP, please check online resources (e.g., https://www.v7labs.com/blog/mean-average-precision).
In the provided example, the AP is 0 because the metric is not well defined, you need at least a single lesion.
To calculate the correct AP, you should provide the full set of cases, not single cases or batches.

Thanks for the swift response. That makes sense. Using a set of all-zero / all-one mock-predictions-label pairs, the metric returns 100%, as one would expect.

Great! Does that completely solve your issue, or is there anything else?


[FEATURE] parameterize the Folder with Files Document Loader to allow custom file extensions

As a user I'd like to add the ability to add additional file extensions to the folder with files loader so that I can load documents that aren't just text documents or the pre-coded file extensions like code for example.
One suggestion might be to allow a user to add a file extension, and then in a dropdown select from a list of pre-built loaders.
This list would include: JSONLoader, CSVLoader, TextLoader, JSONLinesLoader, PDFLoader, DOCXLoader, EPUBLoader, and UnstructuredLoader

Note: The code needs to be tested, I was unable to get it to build locally even without my changes.

This has a potential issue in that it indexes everything including node_modules, nuget packages, ruby gems, etc..
So might have to open a new ticket for reading the .gitignore file while iterating through the files or adding that as a additional parameter to respect the gitignore file.


Create a class for Chunk

Currently chunks are just bare dictionary objects returned from Library. this makes it hard to refactor how they're represented and what properties they have.
Related to #15 . Helpful for #56, #33, and others.

[x] Update Library.chunks() to return an array of Chunk, not a list of (chunk_id, chunk) (now that chunk.id holds the id)
[x] Have Chunk be the thing that converts the embedding from base 64 to fully expanded
[x] Have Library have an internal dict of cached id -> chunk objects
[x] Add Chunk.remove() which calls chunk.library.remove_chunk(self)
[x] chunk.str should return chunk.text
[x] Cache chunk.id() if it uses canonical id
[x] Have a Chunk.validate() that is called on chunk creation, and move the Chunk validation from Library.validate() to that (when Library is created a Chunk wrapper should be created around each)

Done as of 633eee9


Allow to set/unset auto-commit mode for connections in JdbcRecordReader

I'm having an issue with some JDBC driver that follows the JDBC 3.0 spec that says:
/*
* According to the JDBC 3.0 specification (p.62) the result set
* is closed in the autocommit mode if one of the following occurs:
*
* - all of the rows have been retrieved
* - the associated Statement object is re-executed
* - another Statement object is executed on the same connection
*/

So I am getting a nasty exception because the ResultSet is closed when reader ends reading all rows, but not all batches have been executed.
The JdbcRecordReader should allow to set the connection auto-commit property to avoid this conflict.

This is not related to the auto-commit property of the connection, it is because JdbcRecords hold a reference to the ResultSet (this is due to a limitation in the JDBC API which does not provide an abstraction for a single row).
What you need to do in your case is to map JDBC records to domain objects and dispatch these objects to asynchronous workers. This is actually documented here: https://github.com/j-easy/easy-batch/wiki/writers#performance-notes
I'm closing this issue for now, but feel free to add a comment here if you need further support.


[iox] fix 1784.

#1782
#1664
fix list上resetLoadmore不生效。

list测试代码：http://weex.alibaba-inc.com/playground/e00547623cf1aefcabd413e329b32255
scroller测试代码：http://weex.alibaba-inc.com/playground/6c41fcdb28d1dda7a741f0aaa0766636

Current coverage is 88.44% (diff: 100%)

Merging #1784 into ios-feature-20161208 will not change coverage

@@           ios-feature-20161208      #1784   diff @@
======================================================
  Files                        41         41
  Lines                      2233       2233
  Methods                     354        354
  Messages                      0          0
  Branches                    500        500
======================================================
  Hits                       1975       1975
  Misses                      258        258
  Partials                      0          0

Powered by Codecov. Last update 42a48ec...c3cf43d


Dead link on entropy.rocks (Explorers & Dashboards)

https://bitcoin-only.com/explorers-dashboards
Explorers -> Entropy Rocks
https://entropy.rocks/
I don't know if it's closed.
If this is always the case, I suggest deleting.

Thanks


Use default security profile

Simplify plugin setup by offering the default profile instead of requiring the user to creating a custom Amazon Security Profile.
This is the same security profile as used by the official CLI, therefore, we can just align our URLs to match with theirs:

Use http://<IP_ADDRESS>/cb instead of http://localhost.

Sorry for my late reply and thank you for your very nice PR !
I'm not familiar with the official CLI. Please give me some time to investigate it.

I understood the mechanism of ask-cli. Thank you for your great PR!


add a test for the #previous_version method

Why was this change made? 🤔
Follow on from #2619, adds a test for this method to catch that previous bug
How was this change tested? 🤨
CI, and it will fail until we merge this into #2619
(but it passes if run on that branch)

Just adding the test to #2619