how to control the color codes for specific bacteria

Hi,
Dokdo  has been very useful for me, and thanks again for the v1.10
I was wondering is there any way to control the color codes for specific bacteria and the order in the bar.
I have two different set of data but my control is the same for both.
Now, i wanted to keep for some bacteria (top 10-15) same color codes. so, i used RGB color codes to control the type of color but color is changing based on the abundance i guess...and also order,
If you see attached images, from the left, first 2 bars are same for both figures, but color codes for bacteria and order in the bar has changed.
Any suggestion to control them?
I hope i explained myself,
Thanks

@khemlalnirmalkar,
There are a number of ways to achieve what you are describing:

If the two datasets you are trying to plot are coming from two separate .qzv files (taxa-bar-plots.qzv), then use the colors option to manually control the order of colors based on the identity of taxa. For example:

dokdo.taxa_abundance_bar_plot(qzv_file1, ...,  colors=['tab:blue', 'tab:orange', 'tab:green', 'tab:red', ...])
dokdo.taxa_abundance_bar_plot(qzv_file2, ..., colors=['tab:blue', 'tab:red', 'tab:green', 'tab:orange', ...])

# Color mapping (for simplicity, only showing the first four taxa):
# p__Firmicutes    > tab:blue
# p_Proteobacteria > tab:orange
# p_Actinobacteria > tab:green
# p_Bacteriodetes  > tab:red

[Recommended method] If there is only one .qzv file, you can use options like include_samples or sample_names to select a group of samples to display and to automatically set all the taxa to have matched colors between the plots:

dokdo.taxa_abundance_bar_plot(qzv_file3, ..., include_samples={'body-site': ['left palm']}, sort_by_mean2=False)
dokdo.taxa_abundance_bar_plot(qzv_file3, ..., include_samples={'body-site': ['right palm']}, sort_by_mean2=False)

# dokdo.taxa_abundance_bar_plot(qzv_file3, ..., sample_names=['A1', 'A2', 'A3', ...], sort_by_mean3=False)
# dokdo.taxa_abundance_bar_plot(qzv_file3, ..., sample_names=['B1', 'B2', 'B3', ...], sort_by_mean3=False)

Here, the important thing is you must include sort_by_mean2=False for include_samples and sort_by_mean3=False for samples_names.
For more details, please see the 9th example from the method's documentation page where it says:

We can make multiple bar charts grouped by body-site. When making a grouped bar chart, it’s important to include sort_by_mean2=False in order to have the same bar colors for the same taxa across different groups.

I hope this helps, and let me know if you need further help.

hi,
Thanks for the quick response,
I decided to use your second option, but please the attached image and my codes,
i added show legend=true for 2 different plots and colors are not matching,
I guess i am missing something
*************************** please see below
fig, [ax1, ax2, ax3, ax4] = plt.subplots(1, 4, figsize=(16, 7), gridspec_kw={'width_ratios': [2, 2, 2, 2]})
kwargs = dict(level=6, count=10, sort_by_mean2=False)
qzv_file = '/media/scebmeta/raw_backup/DoD_fastqs/finalRun_analysis/3932480_Nirmalkar/part4/mergd_GrpAnB/taxa-bar-plots.qzv'
dokdo.taxa_abundance_bar_plot(qzv_file,
level=6,
ax=ax1,
count=10,
sort_by_mean3=False,
sort_by_mean2=False,
colors=['#FF5533', '#3B7A57', '#6890F0','#A040A0','#F8D030', '#E0C068', '#EE99AC', '#C03028', '#78C850', '#332B00'],
group='DonOrder',
group_order=['Donors_Fin6', 'Donors_Fin7', 'Donors_Fin8'],
legend_short=True,
artist_kwargs=dict(title='Fv Donors', legend_loc='lower right', xticklabels_fontsize=14, yticklabels_fontsize=12, ylabel_fontsize=14)),
fig1= plt.gcf()
#plt.gca().xaxis.set_tick_params(rotation = 30)
dokdo.taxa_abundance_bar_plot(qzv_file,
level=6,
ax=ax2,
count=10,
sort_by_mean3=False,
sort_by_mean2=False,
colors=['#FF5533', '#3B7A57', '#6890F0','#A040A0','#F8D030', '#E0C068', '#EE99AC', '#C03028', '#78C850', '#332B00'],
group='DonOrder',
group_order=['Donors_UMN1', 'Donors_UMN2'],
figsize=(10, 7),
legend_short=True,
artist_kwargs=dict(title='UMN Donors',show_legend=True, legend_loc='lower right', xticklabels_fontsize=14, hide_ylabel=True,
hide_yticks=True)),
fig1= plt.gcf()
#plt.gca().xaxis.set_tick_params(rotation = 30),
dokdo.taxa_abundance_bar_plot(qzv_file,
level=6,
ax=ax3,
count=10,
sort_by_mean3=False,
sort_by_mean2=False,
colors=['#FF5533', '#3B7A57', '#6890F0','#A040A0','#F8D030', '#E0C068', '#EE99AC', '#C03028', '#78C850', '#332B00'],
group='DonOrder',
group_order=['Baseline_A', 'Vanco_A', 'EndPart_01_A', 'EndPart_02_A'],
figsize=(10, 7),
legend_short=True,
artist_kwargs=dict(title='Group A', xticklabels_fontsize=14, hide_ylabel=True,
hide_yticks=True)),
fig1= plt.gcf()
#plt.gca().xaxis.set_tick_params(rotation = 30),
dokdo.taxa_abundance_bar_plot(qzv_file,
level=6,
ax=ax4,
count=10,
sort_by_mean3=False,
sort_by_mean2=False,
colors=['#FF5533', '#3B7A57', '#6890F0','#A040A0','#F8D030', '#E0C068', '#EE99AC', '#C03028', '#78C850', '#332B00'],
group='DonOrder',
group_order=['Baseline_B', 'Vanco_B', 'EndPart_01_B', 'EndPart_02_B'],
legend_short=True,
artist_kwargs=dict(title='Group B', xticklabels_fontsize=14, hide_ylabel=True,
hide_yticks=True)),
plt.legend(bbox_to_anchor=(1, 1), loc=2, facecolor='white')
plt.tight_layout()
#plt.xticks(fontsize=13)
#plt.yticks(fontsize=13)
#set_xlabel("", fontsize=25, fontweight='bold')
fig1= plt.gcf()
#plt.gca().xaxis.set_tick_params(rotation = 30)
#fig1.savefig('GrpAB_genus_barpltT10.svg')
#fig1.savefig('GrpAB_genus_barpltT10.png', dpi=500)

Thanks,

@khemlalnirmalkar,
I think I know what the problem is. Basically, how the second method normally works is you maintain the original order of taxa in the .qzv file. This should work for cases involving individual samples. However, because you are using the group option (which was introduced lately as you would remember), you are essentially creating a new order of taxa every time the method is called. I will have to think about this a little, but in the meantime you may want to use the method 1 above. I will work on this ASAP.

Okay, sounds great,
I will use 1st for now,
Thanks you so much for being super supportive,
Best,
Khem

@khemlalnirmalkar,
I fixed the issue! It turns out the problem was the group_order option causing changes in the order of taxa. See the fixed example below:

import dokdo

import matplotlib.pyplot as plt
%matplotlib inline

import numpy as np
np.random.seed(1)

import seaborn as sns
sns.set()

qzv_file = 'data/moving-pictures-tutorial/taxa-bar-plots.qzv'

fig, [ax1, ax2, ax3, ax4] = plt.subplots(1, 4, figsize=(16, 7))

kwargs = dict(level=6,
              count=8,
              sort_by_mean2=False)

dokdo.taxa_abundance_bar_plot(qzv_file,
                              ax=ax1,
                              group='body-site',
                              group_order=['gut'],
                              legend_short=True,
                              **kwargs,
                              artist_kwargs=dict(title='gut',
                                                 show_legend=True))

dokdo.taxa_abundance_bar_plot(qzv_file,
                              ax=ax2,
                              group='body-site',
                              group_order=['left palm'],
                              legend_short=True,
                              **kwargs,
                              artist_kwargs=dict(title='left palm',
                                                 hide_ylabel=True,
                                                 hide_yticks=True,
                                                 show_legend=True))

dokdo.taxa_abundance_bar_plot(qzv_file,
                              ax=ax3,
                              group='body-site',
                              group_order=['right palm'],
                              legend_short=True,
                              **kwargs,
                              artist_kwargs=dict(title='right palm',
                                                 hide_ylabel=True,
                                                 hide_yticks=True,
                                                 show_legend=True))

dokdo.taxa_abundance_bar_plot(qzv_file,
                              ax=ax4,
                              group='body-site',
                              group_order=['tongue'],
                              legend_short=True,
                              **kwargs,
                              artist_kwargs=dict(title='tongue',
                                                 hide_ylabel=True,
                                                 hide_yticks=True,
                                                 show_legend=True))

plt.tight_layout()
plt.savefig('fixed.png')

Please re-install the 1.10.0-dev version with the fix. I just made a commit on it. Let me know if the problem persists.

wowww, thank you so much for solving the issue so fast,
appreciated,
One more question, hope the last one,
If you see my previous figure, bar widths are different. Is there any option to control or keep the same?
I tried, but didn't work and also legend font size (e.g. legend_fontsize=12) didn't work.

@khemlalnirmalkar,
It's a bit tricky because bar widths are controlled by many factors including the method itself, the width ratio of subplots, etc.
The easiest solution that comes to my mind is playing with the gridspec_kw option until the bars look to have about the same width like shown below:

import dokdo

import matplotlib.pyplot as plt
%matplotlib inline

import numpy as np
np.random.seed(1)

import seaborn as sns
sns.set()

qzv_file = 'data/moving-pictures-tutorial/taxa-bar-plots.qzv'

fig, [ax1, ax2, ax3, ax4] = plt.subplots(1, 4, figsize=(16, 7), gridspec_kw={'width_ratios': [1, 1.75, 1, 1]})

kwargs = dict(level=6,
              count=8,
              sort_by_mean2=False)

dokdo.taxa_abundance_bar_plot(qzv_file,
                              ax=ax1,
                              group='body-site',
                              group_order=['gut'],
                              legend_short=True,
                              **kwargs,
                              artist_kwargs=dict(title='gut',
                                                 show_legend=True))

dokdo.taxa_abundance_bar_plot(qzv_file,
                              ax=ax2,
                              group='body-site',
                              group_order=['left palm', 'right palm'],
                              legend_short=True,
                              **kwargs,
                              artist_kwargs=dict(title='left palm',
                                                 hide_ylabel=True,
                                                 hide_yticks=True,
                                                 show_legend=True))

dokdo.taxa_abundance_bar_plot(qzv_file,
                              ax=ax3,
                              group='body-site',
                              group_order=['right palm'],
                              legend_short=True,
                              **kwargs,
                              artist_kwargs=dict(title='right palm',
                                                 hide_ylabel=True,
                                                 hide_yticks=True,
                                                 show_legend=True))

dokdo.taxa_abundance_bar_plot(qzv_file,
                              ax=ax4,
                              group='body-site',
                              group_order=['tongue'],
                              legend_short=True,
                              **kwargs,
                              artist_kwargs=dict(title='tongue',
                                                 hide_ylabel=True,
                                                 hide_yticks=True,
                                                 show_legend=True))

plt.tight_layout()
plt.savefig('fixed.png')

Okay, make sense,
Thanks,
What about legend font size (e.g. legend_fontsize=12)? i tried to change but didn't work.

Can you show me an example of code where you used the legend_fontsize option but the output didn't reflect the change? As you can see from the attached photo, it works fine in my end (legend_fontsize=25):

import dokdo

import matplotlib.pyplot as plt
%matplotlib inline

import numpy as np
np.random.seed(1)

import seaborn as sns
sns.set()

qzv_file = 'data/moving-pictures-tutorial/taxa-bar-plots.qzv'

fig, [ax1, ax2, ax3, ax4] = plt.subplots(1, 4, figsize=(16, 7), gridspec_kw={'width_ratios': [1, 1.75, 1, 1]})

kwargs = dict(level=6,
              count=8,
              sort_by_mean2=False)

dokdo.taxa_abundance_bar_plot(qzv_file,
                              ax=ax1,
                              group='body-site',
                              group_order=['gut'],
                              legend_short=True,
                              **kwargs,
                              artist_kwargs=dict(title='gut',
                                                 show_legend=True))

dokdo.taxa_abundance_bar_plot(qzv_file,
                              ax=ax2,
                              group='body-site',
                              group_order=['left palm', 'right palm'],
                              legend_short=True,
                              **kwargs,
                              artist_kwargs=dict(title='left palm',
                                                 hide_ylabel=True,
                                                 hide_yticks=True,
                                                 show_legend=True))

dokdo.taxa_abundance_bar_plot(qzv_file,
                              ax=ax3,
                              group='body-site',
                              group_order=['right palm'],
                              legend_short=True,
                              **kwargs,
                              artist_kwargs=dict(title='right palm',
                                                 hide_ylabel=True,
                                                 hide_yticks=True,
                                                 show_legend=True))

dokdo.taxa_abundance_bar_plot(qzv_file,
                              ax=ax4,
                              group='body-site',
                              group_order=['tongue'],
                              legend_short=True,
                              **kwargs,
                              artist_kwargs=dict(title='tongue',
                                                 hide_ylabel=True,
                                                 hide_yticks=True,
                                                 show_legend=True,
                                                 legend_fontsize=25))

plt.tight_layout()
plt.savefig('fixed.png')

If you see both images, legend font size I change from 14 to 26, nothing happened,
Sorry about the quality of the image,
Yours working,
Probably some issue from my side,

Got it. It's because you're re-drawing the legend after the method call with:
plt.legend(bbox_to_anchor=(1, 1), loc=2, facecolor='white')

Instead of doing that, just add an additional subplot and then plot only the legend in that extra subplot as I recommended in the website: https://dokdo.readthedocs.io/en/latest/dokdo_api.html#plotting-legend-separately

Also, I'm closing this because the original issue has been resolved. But please don't hesitate to ask any follow-up questions.

Okay, thank you so much for everything,

Hi @sbslee,
Did you change the options for "artist_kwargs=dict(title='Group B', xticklabels_fontsize=14, hide_ylabel=True,
hide_yticks=True)), in version 1.14?
it was a useful function to play with title and font size,
do you recommend to use version 1.10 for this function or something can be implemented in version 1.14 (i hope i ma not missing the options here?
Thanks

@khemlalnirmalkar,
As noted in CHANGELOG, the artist_kwargs option was removed  in a series of previous releases (1.10.0 and 1.11.0). You can read why in #19, but long story short: artist_kwargs was getting unnecessarily complicated.
That being said, please note everything that could be once achieved by artist_kwargs can be still done by using the matplotlib package, which is how it was supposed to be in the first place. I was being too ambitious when I tried to capture what the matplotlib package can do with single optional argument. For example, your artist_kwargs=dict(title='Group B', xticklabels_fontsize=14, hide_ylabel=True, hide_yticks=True)) has the same effect as:
import dokdo
import matplotlib.pyplot as plt
%matplotlib inline
import seaborn as sns
sns.set()
qza_file = '/Users/sbslee/Desktop/dokdo/data/moving-pictures-tutorial/unweighted_unifrac_pcoa_results.qza'
metadata_file = '/Users/sbslee/Desktop/dokdo/data/moving-pictures-tutorial/sample-metadata.tsv'
ax = dokdo.beta_2d_plot(qza_file, figsize=(5, 5))
ax.set_title('Group B')
ax.tick_params(axis='x', which='major', labelsize=14)
ax.set_yticks([])
plt.tight_layout()
plt.savefig('artist_kwargs.png')

Of course, the downside is that you need to learn some semantics of matplotlib but I guarantee you will thank me later once you've learned them :) They are extremely useful.

@sbslee Thanks
Yes, i started checking the options,


Change string template literal interpolation syntax to comply with spec

Purpose
Resolves #13461
Resolves #10566

Codecov Report

:exclamation: No coverage uploaded for pull request base (master@50aef30). Click here to learn what that means.
The diff coverage is 100%.

@@            Coverage Diff            @@
##             master   #13465   +/-   ##
=========================================
  Coverage          ?   63.99%
  Complexity        ?      659
=========================================
  Files             ?     2148
  Lines             ?    94305
  Branches          ?    12414
=========================================
  Hits              ?    60355
  Misses            ?    29053
  Partials          ?     4897

Impacted Files
Coverage Δ
Complexity Δ

...ang/langserver/formatting/FormattingSourceGen.java
52.52% <100%> (ø)
0 <0> (?)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 50aef30...53ce356. Read the comment docs.

@Shan1024 Can you have a look into this?

@pranavan15 Additionally we should use the same for XML template as well.

@pranavan15 Additionally we should use the same for XML template as well.

Ack. I created a git issue to track this[1]. I will address this in a separate PR.
[1] https://github.com/ballerina-platform/ballerina-lang/issues/13718


Update SignalR Client Features matrix

A few updates:

Added transports
Added Azure SignalR support - every client supports it, but we do get questions like "can I use the service with Java?" so it's helpful to confirm that in the matrix, and technically the client has to do some (very minimal) work to support it. I put this at the top, because it's so awesome 😉, and that messed up the visual diff a bit (sorry!).
Added note about issue tracking automatic reconnect

Don't we need versions in here?

The document has monikerRange: '>= aspnetcore-3.0' in its metadata.

That's not useful for client versions. For example, when we introduce streaming in the java client, or reconnect in the java client. ASP.NET Core 3.0 is insufficient.

Perhaps if the matrix includes a minimum version number instead of just a check box? I can sketch that out.

https://github.com/aspnet/AspNetCore.Docs/pull/14744


Fix the three_party_random test properly

Some clown forgot to feed a fresh index into the second call to
random(), so we were getting a collision with 1/31 probability.
Fix that.

Thanks for fixing it!


/tmp/yazi directory ownership issue on multi-user Linux

What system are you running Yazi on?
Linux X11
What terminal are you running Yazi in?
iTerm2 SSH
yazi --debug output
Yazi
    Version: 0.3.0 (7a380c2 2024-08-01)
    Debug  : false
    OS     : linux-x86_64 (unix)

Ya
    Version: No such file or directory (os error 2)

Emulator
    Emulator.via_env: ("xterm-256color", "")
    Emulator.via_csi: Ok(Iterm2)
    Emulator.detect : Iterm2

Adapter
    Adapter.matches: Iterm2

Desktop
    XDG_SESSION_TYPE: None
    WAYLAND_DISPLAY : None
    DISPLAY         : None

SSH
    shared.in_ssh_connection: true

WSL
    /proc/sys/fs/binfmt_misc/WSLInterop: false

Variables
    SHELL              : Some("/bin/zsh")
    EDITOR             : Some("vim")
    YAZI_FILE_ONE      : None
    YAZI_CONFIG_HOME   : None
    ZELLIJ_SESSION_NAME: None

Text Opener
    default: Some(Opener { run: "${EDITOR:=vi} \"$@\"", block: true, orphan: false, desc: "$EDITOR", for_: None, spread: true })
    block  : Some(Opener { run: "${EDITOR:=vi} \"$@\"", block: true, orphan: false, desc: "$EDITOR", for_: None, spread: true })

tmux
    TMUX   : false
    Version: tmux 3.2a

Dependencies
    file             : 5.41
    ueberzugpp       : No such file or directory (os error 2)
    ffmpegthumbnailer: No such file or directory (os error 2)
    magick           : No such file or directory (os error 2)
    fzf              : 0.54.3
    fd               : 10.1.0
    rg               : 14.1.0
    chafa            : No such file or directory (os error 2)
    zoxide           : 0.9.4
    7z               : No such file or directory (os error 2)
    7zz              : 24.08
    jq               : No such file or directory (os error 2)

Did you try the latest nightly build to see if the problem got fixed?
No, and I'll explain why below
Describe the bug
There is a bug in yazi when used on multi-user Linux systems. The issue arises when the application creates the /tmp/yazi directory, which is generated with ownership tied to the user who first runs the command. This leads to permission issues when other users try to interact with or clear the cache, causing functionality problems.
The issue arose when I discovered that after restarting the system, only a specific user could batch rename files, and PDF previews were not working. After using "sudo yazi --clear-cache", I could use both functions as usual, but another user who was previously able to use these functions could no longer do so. I suspect this might be a permission issue with /tmp/yazi.
Minimal reproducer

On a multi-user Linux system, log in as user asd.
Run the following command:
sudo yazi --clear-cache
Observe that the /tmp/yazi directory is created with ownership as user asd.
ll /tmp shows drwxr-xr-x 2 asd usr_grp 4.0K Aug 20 22:12 yazi and other users can't write to the /tmp/yazi folder

Anything else?
No response

Any idea how to fix it?
I ran ls /tmp and it looks like all the subdirectories in /tmp are set to 755 or lower. If we change /tmp/yazi to 777, it might cause some security issues.

Maybe you can create a directory with the suffix of UID

Please try https://github.com/sxyazi/yazi/pull/1541

If I already have an old /tmp/yazi directory, I need to clean it up manually for now. Yazi will regenerate the iamge cache in the new directory, but I still have cached images in the old one. Can we simply rename the old /tmp/yazi directory to /tmp/yazi-{uid} for a single user?

No, any files under /tmp/* will automatically disappear after a reboot, that's not a big deal

Please try #1541

Thank you so much for fixing this bug


Fix for WFLY-16268, Upgrade galleon plugins to 5.2.11.Final

Issue: https://issues.redhat.com/browse/WFLY-16268

/retest

Thanks, @jfdenise


Adding daysRemaining(in:) to DateExtensions.

Addresses #552.
This PR adds a Date extension which returns the number of days remaining in various Calendar.Components such as .month or .year.
Checklist

[x] I checked the Contributing Guidelines before creating this request.
[x] New extensions are written in Swift 5.0.
[x] New extensions support iOS 10.0+ / tvOS 9.0+ / macOS 10.10+ / watchOS 2.0+, or use @available if not.
[x] I have added tests for new extensions, and they passed.
[x] All extensions have a clear comments explaining their functionality, all parameters and return type in English.
[x] All extensions are declared as public.
[x] I have added a changelog entry describing my changes.

NOTE:  This extension uses end(of:) and daysSince(:) extensions, which in turn depend on various other Date extensions.  I assume the following contribution rule does not apply here:

Do not use an existing SwifterSwift extension inside another SwifterSwift extension. All extensions should be able to be copied and pasted and work immediately without having to copy another extension.

          1 Message

:book:
Thank you for submitting a pull request to SwifterSwift. The team will review your submission as soon as possible.

  Generated by :no_entry_sign: Danger


hidden_tag changes in v0.13 are not backward-compatible.

Upgrading from release 0.12 to 0.13 breaks a specific test case that I have in one of my applications.
The exception raised is AttributeError: 'UnboundField' object has no attribute 'data'.
I've defined a hidden field in my form:
class ChangePasswordFormHref(ChangePasswordForm):
    href = HiddenField('Href')

For some reason the href field is not populated when simulating a post with:
resp = self.client.post('/forgot/change', data={'password': 'P@55word_mock1234', 'password_again': 'P@55word_mock1234', 'href': account.href, }, follow_redirects=True)

What makes this even more perplexing is that the test case only breaks if it is run as part of a batch of similar tests. Running it in isolation works fine.
The hidden_tag field is included in my the html template:
{% from '_formhelpers.html' import render_field %}
<form id="forgot_change_form" method="post">
  {{ form.hidden_tag() }}
  {{ render_field(form.password, placeholder='Password', type='password') }}
  {{ render_field(form.password_again, class='form-control', placeholder='Password (again)', type='password') }}
  <fieldset class="ui-grid-solo">

      Submit

  </fieldset>
</form>

The exception occurs when I try to access the hidden href field in the view:
def forgot_change():
    form = ChangePasswordFormHref()

    if request.method == 'GET':
        try:
            account = current_app.stormpath_manager.application.verify_password_reset_token(request.args.get('sptoken'))
            form.href.data = account.href
        except StormpathError:
            abort(400)

    if form.validate_on_submit():
        try:
            account = current_app.stormpath_manager.client.accounts.get(form.href.data) # <-- Exception
            account.password = form.password.data
            account.save()

I've tried to pinpoint the issue without any luck - it might be that I am using Flask-WTF in a non-standard way?

Please include the full traceback.

This doesn't appear to have anything to do with hidden_tag, since you're not using the template when causing the error, you're bypassing it and using the test client.

I can't reproduce your error.  Please update with a Minimal, Complete, and Verifiable Example.
Either you're not using a Flask-WTF form or you've disabled CSRF elsewhere, otherwise this would fail because you aren't sending a CSRF token.  Assuming that's the case, I don't get the error you've posted.


Runtime error when running svhn.py

When running svhn.py, a runtime error occurred, indicating a dimension mismatch.  Both this program and the program under BinaryConnect project have the same problem.  Is there something wrong with the data I downloaded?
hanwentao@hydrogen ~/repo/BinaryNet/Train-time {env2} (master*) % python svhn.py
batch_size = 50
alpha = 0.1
epsilon = 0.0001
activation = binary_net.binary_tanh_unit
binary = True
stochastic = False
H = 1.0
W_LR_scale = Glorot
num_epochs = 200
LR_start = 0.001
LR_fin = 1e-06
LR_decay = 0.96605087899
shuffle_parts = 1
Loading SVHN dataset
Building the CNN...
W_LR_scale = 20.0499
H = 1.0
W_LR_scale = 27.7128
H = 1.0
W_LR_scale = 33.9411
H = 1.0
W_LR_scale = 39.1918
H = 1.0
W_LR_scale = 48.0
H = 1.0
W_LR_scale = 55.4256
H = 1.0
W_LR_scale = 58.4237
H = 1.0
W_LR_scale = 36.9504
H = 1.0
W_LR_scale = 26.2552
H = 1.0
Training...
Traceback (most recent call last):
  File "svhn.py", line 322, in <module>
    test_set.X,test_set.y)
  File "/home/hanwentao/repo/BinaryConnect/binary_connect.py", line 252, in train
    train_loss = train_epoch(X_train,y_train,LR)
  File "/home/hanwentao/repo/BinaryConnect/binary_connect.py", line 218, in train_epoch
    loss += train_fn(X[i*batch_size:(i+1)*batch_size],y[i*batch_size:(i+1)*batch_size],LR)
  File "/home/hanwentao/sandbox/binarize/env2/lib/python2.7/site-packages/theano/compile/function_module.py", line
912, in __call__
    storage_map=getattr(self.fn, 'storage_map', None))
  File "/home/hanwentao/sandbox/binarize/env2/lib/python2.7/site-packages/theano/gof/link.py", line 314, in raise_with_op
    reraise(exc_type, exc_value, exc_trace)
  File "/home/hanwentao/sandbox/binarize/env2/lib/python2.7/site-packages/theano/compile/function_module.py", line
899, in __call__
    self.fn() if output_subset is None else\
ValueError: Input dimension mis-match. (input[1].shape[1] = 1, input[2].shape[1] = 10)
Apply node that caused the error: Elemwise{Composite{(i0 - (i1 * ((i2 * i3) + i4)))}}(TensorConstant{(1, 1) of 1.0}
, targets, Elemwise{sub,no_inplace}.0, Elemwise{true_div,no_inplace}.0, Rebroadcast{1}.0)
Toposort index: 448
Inputs types: [TensorType(float64, (True, True)), TensorType(float64, matrix), TensorType(float64, matrix), TensorT
ype(float64, row), TensorType(float64, row)]
Inputs shapes: [(1, 1), (50, 1), (50, 10), (1, 10), (1, 10)]
Inputs strides: [(8, 8), (8, 8), (80, 8), (80, 8), (80, 8)]
Inputs values: [array([[ 1.]]), 'not shown', 'not shown', 'not shown', 'not shown']
Outputs clients: [[Elemwise{maximum,no_inplace}(TensorConstant{(1, 1) of 0.0}, Elemwise{Composite{(i0 - (i1 * ((i2
* i3) + i4)))}}.0), Elemwise{EQ}(Elemwise{maximum,no_inplace}.0, Elemwise{Composite{(i0 - (i1 * ((i2 * i3) + i4)))}
}.0)]]

HINT: Re-running with most Theano optimization disabled could give you a back-trace of when this node was created.
This can be done with by setting the Theano flag 'optimizer=fast_compile'. If that does not work, Theano optimizations can be disabled with 'optimizer=None'.
HINT: Use the Theano flag 'exception_verbosity=high' for a debugprint and storage map footprint of this apply node.
Closing remaining open files:/home/hanwentao/data/tmp/svhn/h5/valid_32x32.h5...done/home/hanwentao/data/tmp/svhn/h5
/test_32x32.h5...done/home/hanwentao/data/tmp/svhn/h5/splitted_train_32x32.h5...done

Hi @hanwentao , I aslo encountered the same issue. I wonder if you have figured out how to fix it? Thanks!

Your issue may be that the targets are not onehot encoded.
You may want to use this code to onehot the targets:
https://github.com/MatthieuCourbariaux/BinaryNet/blob/master/Train-time/mnist.py#L109


bug: can not start scan

Plugin(s)

[X] Barcode Scanning
[ ] Face Detection
[ ] Face Mesh Detection
[ ] Selfie Segmentation
[ ] Translation

Version
5.3.0
Platform(s)

[X] Android
[ ] iOS
[ ] Web

Current behavior
I have a vue .js app (vue.js 2.0) and add barcode reader package but when start scan show me bellow error
startScan failed.
java.lang.NullPointerException: Attempt to invoke virtual method 'void androidx.camera.view.PreviewView.setScaleType(androidx.camera.view.PreviewView$ScaleType)' on a null object reference
at io.capawesome.capacitorjs.plugins.mlkit.barcodescanning.BarcodeScanner.lambda$startScan$0(BarcodeScanner.java:108)
at io.capawesome.capacitorjs.plugins.mlkit.barcodescanning.BarcodeScanner.$r8$lambda$XoJ4tltbmXkBZjUvzn_RkQLTSis(Unknown Source:0)
at io.capawesome.capacitorjs.plugins.mlkit.barcodescanning.BarcodeScanner$$ExternalSyntheticLambda3.run(Unknown Source:8)
at android.os.Handler.handleCallback(Handler.java:942)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:211)
at android.os.Looper.loop(Looper.java:300)
at android.app.ActivityThread.main(ActivityThread.java:8437)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:560)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:954)
Expected behavior
Start Scanning
Reproduction
capawesome-team/.capacitor-app.
Steps to reproduce

install on vue.js app
copy all sample code for scanning
sync (npx cap sync android)
open (npx cap open android)
debug (on android platform)
show erorr

Other information
No response
Capacitor doctor
[warn] The bundledWebRuntime configuration option has been deprecated. Can be safely deleted.
💊   Capacitor Doctor  💊
Latest Dependencies:
@capacitor/cli: unknown
@capacitor/core: 5.5.1
@capacitor/android: 5.5.1
@capacitor/ios: 5.5.1
Installed Dependencies:
@capacitor/ios: not installed
@capacitor/cli: 5.5.1
@capacitor/android: 5.5.1
@capacitor/core: 5.5.1
[success] Android looking great! 👌
Before submitting

[X] I have read and followed the bug report guidelines.
[X] I have attached links to possibly related issues and discussions.
[X] I understand that incomplete issues (e.g. without reproduction) are closed.

sorry to necrobump but im having the same issue on vue3, tried to add permissions and it even warned me of missing

git url is https://github.com/Imeguras/gora_pickerv2_FrontEnd
A vue based tutorial would be nice

Please provide a Minimal, Reproducible Example (see How to create a Minimal, Reproducible Example) in a public GitHub repository so I can debug the issue.

Please provide a Minimal, Reproducible Example (see How to create a Minimal, Reproducible Example) in a public GitHub repository so I can debug the issue.

https://github.com/Imeguras/minimalVue
i've made this but now its giving me a new error
Uncaught (in promise) Error: The Google Barcode Scanner Module is not available. You must install it first.

Please provide a Minimal, Reproducible Example (see How to create a Minimal, Reproducible Example) in a public GitHub repository so I can debug the issue.

https://github.com/Imeguras/minimalVue i've made this but now its giving me a new error
Uncaught (in promise) Error: The Google Barcode Scanner Module is not available. You must install it first.

ill atempt to fix it first

Please provide a Minimal, Reproducible Example (see How to create a Minimal, Reproducible Example) in a public GitHub repository so I can debug the issue.

https://github.com/Imeguras/minimalVue i've made this but now its giving me a new error
Uncaught (in promise) Error: The Google Barcode Scanner Module is not available. You must install it first.

ill atempt to fix it first

Welp somehow i made it work? I've placed omited some minor steps althouth they were repetitive and tipically just "build" orders, ill try to fix my version and post any results here

welp i somehow fixed it in my main repo,
implementation "com.google.android.gms:play-services-code-scanner:16.1.0"
the above seems to have something to do with it, i also had to sync
it can also be the styles present in the default blank format

@Imeguras Can you share the commit that fixed it?

https://github.com/Imeguras/minimalVue/commit/21d377e5aff546477174248c8a68f1a113488538
this one
my best guess its something related to placing

implementation "com.google.android.gms:play-services-code-scanner:16.1.0"
in the (build.graddle?) file

It fixed both minimal repo and the more complex project i was doing, however very different errors were presented in both one complained about missing some google bar reader library while the other was exactly equal to the one on the OP's post

my best guess its something related to placing

implementation "com.google.android.gms:play-services-code-scanner:16.1.0"
in the (build.graddle?) file

No, it shouldn't have anything to do with that. 🤔 I'm glad it's working for you now.

I had the same issue. I fixed it by enabling data binding in the build.gradle of @capacitor-mlkit/barcode-scanning:
buildFeatures {
  dataBinding true
}
dataBinding {
  enabled = true
}

When debugging the issue, I found that previewView is always null, which means it didn't detect the view or something like that (sorry, I'm not that familiar with how native Android apps are built). After enabling data binding, the issue is gone.
New build.gradle:
ext {
    junitVersion = project.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.13.2'
    androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.6.1'
    androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.1.5'
    androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.5.1'
    androidxCameraCamera2Version = project.hasProperty('androidxCameraCamera2Version') ? rootProject.ext.androidxCameraCamera2Version : '1.1.0'
    androidxCameraCoreVersion = project.hasProperty('androidxCameraCoreVersion') ? rootProject.ext.androidxCameraCoreVersion : '1.1.0'
    androidxCameraLifecycleVersion = project.hasProperty('androidxCameraLifecycleVersion') ? rootProject.ext.androidxCameraLifecycleVersion : '1.1.0'
    androidxCameraViewVersion = project.hasProperty('androidxCameraViewVersion') ? rootProject.ext.androidxCameraViewVersion : '1.1.0'
    mlkitBarcodeScanningVersion = project.hasProperty('mlkitBarcodeScanningVersion') ? rootProject.ext.mlkitBarcodeScanningVersion : '17.1.0'
    playServicesCodeScannerVersion = project.hasProperty('playServicesCodeScannerVersion') ? rootProject.ext.playServicesCodeScannerVersion : '16.0.0'
}

buildscript {
    repositories {
        google()
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:8.0.0'
    }
}

apply plugin: 'com.android.library'

android {
    namespace "io.capawesome.capacitorjs.plugins.mlkit.barcodescanning"
    compileSdkVersion project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 33
    defaultConfig {
        minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 22
        targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 33
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    lintOptions {
        abortOnError false
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_17
        targetCompatibility JavaVersion.VERSION_17
    }
    buildFeatures {
        dataBinding true
    }
    dataBinding {
        enabled = true
    }
}

repositories {
    google()
    mavenCentral()
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation project(':capacitor-android')
    implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion"
    implementation "androidx.camera:camera-camera2:$androidxCameraCamera2Version"
    implementation "androidx.camera:camera-core:$androidxCameraCoreVersion"
    implementation "androidx.camera:camera-lifecycle:$androidxCameraLifecycleVersion"
    implementation "androidx.camera:camera-view:$androidxCameraViewVersion"
    implementation "com.google.mlkit:barcode-scanning:$mlkitBarcodeScanningVersion"
    implementation "com.google.android.gms:play-services-code-scanner:$playServicesCodeScannerVersion"
    testImplementation "junit:junit:$junitVersion"
    androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion"
    androidTestImplementation "androidx.test.espresso:espresso-core:$androidxEspressoCoreVersion"
}

@atoui-zahreddine That's strange. It doesn't work for me. Have you changed anything else?

Btw: I can now reproduce the issue by simply installing the @capacitor-community/apple-sign-in plugin.

@atoui-zahreddine  Alright, seems like i'm doing anything wrong. It's still not working for me. I used the same patch.

For this reason, I am reopening the issue.
I also set a bounty of $50 to solve the issue. I am looking for a clean solution, not a workaround. There is no guarantee that a solution exists. Let me know if anyone wants to work on this.
To reproduce the issue you can simply use the robingenz/capacitor-mlkit-plugin-demo repository and install the capacitor-community/apple-sign-in plugin. Nothing needs to be configured.

from what I can see, data binding should be enable on the demo repository and on the plugin level.
adding :
buildFeatures {
        dataBinding true
    }
    dataBinding {
        enabled = true
    }

In demo-repo/android/app/build.gradle and @capacitor-mlkit/barcode-scanning/android/build.gradle should fix the issue ( it did for me) .
I think there should be a better way to do this, I'll try to find an alternative to this.

@atoui-zahreddine Thank you for the update. That worked for me.

@atoui-zahreddine Yes, here you can find information on how to get paid. Thank you again for taking a look!
Closed by #138

@robingenz  Thank you!
looking forward for more contribution.
expense link : https://opencollective.com/capawesome/expenses/193657

@atoui-zahreddine Thanks. I've just approved your expense.


APIConnectionError in the first Jupyter notebook, lesson 4

I forked the repository to run in GitHub Codespaces. I am loading my API key from a codespaces secret into the .env file. When I run the first code cell that uses the openai module in lesson 4, I get an http error. I tested with a print statement to make sure the OpenAI client is receiving my API key.
I tested with a curl command to see if I could access the openai api from within Codespaces and received the expected result.
curl https://api.openai.com/v1/chat/completions -H "Content-Type: application/json" -H "Authorization: Bearer API_KEY " -d '{"model": "gpt-3.5-turbo",  "messages": [{"role": "user", "content": "Say this is a test!"}], "temperature": 0.7}'
Which makes me think it's a Jupyter environment problem.
Here's the error message:

Hello, i have got same issue when run Exercise 2,

I used latest openai package version 1.61.
I have checked the requirements.txt and downgrade openai from 1.61 to 0.28.0 and got another error. with below picture

Do you have any idea?

Thanks for reporting, will take a look and let you know if we need any additional information!

I just walked through the notebook for Lesson 4 right now. I believe that has been updated now to use the Azure OpenAI provider key/endpoint vs. OpenAI which might be a reason why the call to the OpenAI API works from command-line, but the code fails.
I believe there is an OpenAI-specific set of exercises planned for the lessons. But for now, you will need to use an Azure OpenAI endpoint. If you have issues with that, can you please update this with new details?
cc @koreyspace

Hello, i have got same issue when run Exercise 2,

Hello, i have got a same issue when run Exercise 2

Hello, i have got a same issue when run Exercise 2
curll is ok
curl "https://kuncloud.openai.azure.com/openai/deployments/gpt-35-turbo/chat/completions?api-version=2024-02-15-preview" \   -H "Content-Type: application/json" \   -H "api-key: b23bf538e8b84a07806006e4491dddbfbadkey" \   -d "{   \"messages\": [{\"role\":\"system\",\"content\":\"You are an AI assistant that helps people find information.\"}],   \"max_tokens\": 800,   \"temperature\": 0.7,   \"frequency_penalty\": 0,   \"presence_penalty\": 0,   \"top_p\": 0.95,   \"stop\": null }"
if i run python code in jupypter notebook , got a error
`
import os
from openai import AzureOpenAI
client = AzureOpenAI(
azure_endpoint = "https://kuncloud.openai.azure.com/",
api_key="b23bf538e8b84a07806006e4491dddbfbadkey",
api_version="2024-02-15-preview"
)
message_text = [{"role":"system","content":"You are an AI assistant that helps people find information."}]
completion = client.chat.completions.create(
model="gpt-35-turbo",
messages = message_text,
temperature=0.7,
max_tokens=800,
top_p=0.95,
frequency_penalty=0,
presence_penalty=0,
stop=None
)
 ---------------------------------------------------------------------------
ConnectError                              Traceback (most recent call last)
File /lib/python3.11/site-packages/httpx/_transports/default.py:69, in map_httpcore_exceptions()
68 try:
---> 69     yield
70 except Exception as exc:
File /lib/python3.11/site-packages/httpx/_transports/default.py:233, in HTTPTransport.handle_request(self, request)
232 with map_httpcore_exceptions():
--> 233     resp = self._pool.handle_request(req)
235 assert isinstance(resp.stream, typing.Iterable)
File /lib/python3.11/site-packages/httpcore/_sync/connection_pool.py:216, in ConnectionPool.handle_request(self, request)
215     self._close_connections(closing)
--> 216     raise exc from None
218 # Return the response. Note that in this case we still have to manage
219 # the point at which the response is closed.
File /lib/python3.11/site-packages/httpcore/_sync/connection_pool.py:196, in ConnectionPool.handle_request(self, request)
194 try:
195     # Send the request on the assigned connection.
--> 196     response = connection.handle_request(
197         pool_request.request
198     )
199 except ConnectionNotAvailable:
200     # In some cases a connection may initially be available to
201     # handle a request, but then become unavailable.
202     #
203     # In this case we clear the connection and try again.
File /lib/python3.11/site-packages/httpcore/_sync/connection.py:99, in HTTPConnection.handle_request(self, request)
98     self._connect_failed = True
---> 99     raise exc
101 return self._connection.handle_request(request)
File /lib/python3.11/site-packages/httpcore/_sync/connection.py:76, in HTTPConnection.handle_request(self, request)
75 if self._connection is None:
---> 76     stream = self._connect(request)
78     ssl_object = stream.get_extra_info("ssl_object")
File /lib/python3.11/site-packages/httpcore/_sync/connection.py:122, in HTTPConnection._connect(self, request)
121 with Trace("connect_tcp", logger, request, kwargs) as trace:
--> 122     stream = self._network_backend.connect_tcp(**kwargs)
123     trace.return_value = stream
File /lib/python3.11/site-packages/httpcore/_backends/sync.py:205, in SyncBackend.connect_tcp(self, host, port, timeout, local_address, socket_options)
200 exc_map: ExceptionMapping = {
201     socket.timeout: ConnectTimeout,
202     OSError: ConnectError,
203 }
--> 205 with map_exceptions(exc_map):
206     sock = socket.create_connection(
207         address,
208         timeout,
209         source_address=source_address,
210     )
File /lib/python311.zip/contextlib.py:155, in _GeneratorContextManager.exit(self, typ, value, traceback)
154 try:
--> 155     self.gen.throw(typ, value, traceback)
156 except StopIteration as exc:
157     # Suppress StopIteration unless it's the same exception that
158     # was passed to throw().  This prevents a StopIteration
159     # raised inside the "with" statement from being suppressed.
File /lib/python3.11/site-packages/httpcore/_exceptions.py:14, in map_exceptions(map)
13     if isinstance(exc, from_exc):
---> 14         raise to_exc(exc) from exc
15 raise
ConnectError: [Errno 23] Host is unreachable
The above exception was the direct cause of the following exception:
ConnectError                              Traceback (most recent call last)
File /lib/python3.11/site-packages/openai/_base_client.py:918, in SyncAPIClient._request(self, cast_to, options, remaining_retries, stream, stream_cls)
917 try:
--> 918     response = self._client.send(
919         request,
920         stream=stream or self._should_stream_response_body(request=request),
921         **kwargs,
922     )
923 except httpx.TimeoutException as err:
File /lib/python3.11/site-packages/httpx/_client.py:914, in Client.send(self, request, stream, auth, follow_redirects)
912 auth = self._build_request_auth(request, auth)
--> 914 response = self._send_handling_auth(
915     request,
916     auth=auth,
917     follow_redirects=follow_redirects,
918     history=[],
919 )
920 try:
File /lib/python3.11/site-packages/httpx/_client.py:942, in Client._send_handling_auth(self, request, auth, follow_redirects, history)
941 while True:
--> 942     response = self._send_handling_redirects(
943         request,
944         follow_redirects=follow_redirects,
945         history=history,
946     )
947     try:
File /lib/python3.11/site-packages/httpx/_client.py:979, in Client._send_handling_redirects(self, request, follow_redirects, history)
977     hook(request)
--> 979 response = self._send_single_request(request)
980 try:
File /lib/python3.11/site-packages/httpx/_client.py:1015, in Client._send_single_request(self, request)
1014 with request_context(request=request):
-> 1015     response = transport.handle_request(request)
1017 assert isinstance(response.stream, SyncByteStream)
File /lib/python3.11/site-packages/httpx/_transports/default.py:232, in HTTPTransport.handle_request(self, request)
220 req = httpcore.Request(
221     method=request.method,
222     url=httpcore.URL(
(...)
230     extensions=request.extensions,
231 )
--> 232 with map_httpcore_exceptions():
233     resp = self._pool.handle_request(req)
File /lib/python311.zip/contextlib.py:155, in _GeneratorContextManager.exit(self, typ, value, traceback)
154 try:
--> 155     self.gen.throw(typ, value, traceback)
156 except StopIteration as exc:
157     # Suppress StopIteration unless it's the same exception that
158     # was passed to throw().  This prevents a StopIteration
159     # raised inside the "with" statement from being suppressed.
File /lib/python3.11/site-packages/httpx/_transports/default.py:86, in map_httpcore_exceptions()
85 message = str(exc)
---> 86 raise mapped_exc(message) from exc
ConnectError: [Errno 23] Host is unreachable
The above exception was the direct cause of the following exception:
APIConnectionError                        Traceback (most recent call last)
Cell In[5], line 11
9 # Send a completion call to generate an answer
10 start_phrase = 'Write a tagline for an ice cream shop. '
---> 11 response = client.completions.create(model=deployment_name, prompt=start_phrase, max_tokens=10)
12 print(start_phrase+response.choices[0].text)
File /lib/python3.11/site-packages/openai/_utils/_utils.py:275, in required_args..inner..wrapper(*args, **kwargs)
273             msg = f"Missing required argument: {quote(missing[0])}"
274     raise TypeError(msg)
--> 275 return func(*args, **kwargs)
File /lib/python3.11/site-packages/openai/resources/completions.py:506, in Completions.create(self, model, prompt, best_of, echo, frequency_penalty, logit_bias, logprobs, max_tokens, n, presence_penalty, seed, stop, stream, suffix, temperature, top_p, user, extra_headers, extra_query, extra_body, timeout)
478 @required_args(["model", "prompt"], ["model", "prompt", "stream"])
479 def create(
480     self,
(...)
504     timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
505 ) -> Completion | Stream[Completion]:
--> 506     return self._post(
507         "/completions",
508         body=maybe_transform(
509             {
510                 "model": model,
511                 "prompt": prompt,
512                 "best_of": best_of,
513                 "echo": echo,
514                 "frequency_penalty": frequency_penalty,
515                 "logit_bias": logit_bias,
516                 "logprobs": logprobs,
517                 "max_tokens": max_tokens,
518                 "n": n,
519                 "presence_penalty": presence_penalty,
520                 "seed": seed,
521                 "stop": stop,
522                 "stream": stream,
523                 "suffix": suffix,
524                 "temperature": temperature,
525                 "top_p": top_p,
526                 "user": user,
527             },
528             completion_create_params.CompletionCreateParams,
529         ),
530         options=make_request_options(
531             extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
532         ),
533         cast_to=Completion,
534         stream=stream or False,
535         stream_cls=Stream[Completion],
536     )
File /lib/python3.11/site-packages/openai/_base_client.py:1200, in SyncAPIClient.post(self, path, cast_to, body, options, files, stream, stream_cls)
1186 def post(
1187     self,
1188     path: str,
(...)
1195     stream_cls: type[_StreamT] | None = None,
1196 ) -> ResponseT | _StreamT:
1197     opts = FinalRequestOptions.construct(
1198         method="post", url=path, json_data=body, files=to_httpx_files(files), **options
1199     )
-> 1200     return cast(ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=stream_cls))
File /lib/python3.11/site-packages/openai/_base_client.py:889, in SyncAPIClient.request(self, cast_to, options, remaining_retries, stream, stream_cls)
880 def request(
881     self,
882     cast_to: Type[ResponseT],
(...)
887     stream_cls: type[_StreamT] | None = None,
888 ) -> ResponseT | _StreamT:
--> 889     return self._request(
890         cast_to=cast_to,
891         options=options,
892         stream=stream,
893         stream_cls=stream_cls,
894         remaining_retries=remaining_retries,
895     )
File /lib/python3.11/site-packages/openai/_base_client.py:942, in SyncAPIClient._request(self, cast_to, options, remaining_retries, stream, stream_cls)
939 log.debug("Encountered Exception", exc_info=True)
941 if retries > 0:
--> 942     return self._retry_request(
943         options,
944         cast_to,
945         retries,
946         stream=stream,
947         stream_cls=stream_cls,
948         response_headers=None,
949     )
951 log.debug("Raising connection error")
952 raise APIConnectionError(request=request) from err
File /lib/python3.11/site-packages/openai/_base_client.py:1013, in SyncAPIClient._retry_request(self, options, cast_to, remaining_retries, response_headers, stream, stream_cls)
1009 # In a synchronous context we are blocking the entire thread. Up to the library user to run the client in a
1010 # different thread if necessary.
1011 time.sleep(timeout)
-> 1013 return self._request(
1014     options=options,
1015     cast_to=cast_to,
1016     remaining_retries=remaining,
1017     stream=stream,
1018     stream_cls=stream_cls,
1019 )
File /lib/python3.11/site-packages/openai/_base_client.py:942, in SyncAPIClient._request(self, cast_to, options, remaining_retries, stream, stream_cls)
939 log.debug("Encountered Exception", exc_info=True)
941 if retries > 0:
--> 942     return self._retry_request(
943         options,
944         cast_to,
945         retries,
946         stream=stream,
947         stream_cls=stream_cls,
948         response_headers=None,
949     )
951 log.debug("Raising connection error")
952 raise APIConnectionError(request=request) from err
File /lib/python3.11/site-packages/openai/_base_client.py:1013, in SyncAPIClient._retry_request(self, options, cast_to, remaining_retries, response_headers, stream, stream_cls)
1009 # In a synchronous context we are blocking the entire thread. Up to the library user to run the client in a
1010 # different thread if necessary.
1011 time.sleep(timeout)
-> 1013 return self._request(
1014     options=options,
1015     cast_to=cast_to,
1016     remaining_retries=remaining,
1017     stream=stream,
1018     stream_cls=stream_cls,
1019 )
File /lib/python3.11/site-packages/openai/_base_client.py:952, in SyncAPIClient._request(self, cast_to, options, remaining_retries, stream, stream_cls)
942         return self._retry_request(
943             options,
944             cast_to,
(...)
948             response_headers=None,
949         )
951     log.debug("Raising connection error")
--> 952     raise APIConnectionError(request=request) from err
954 log.debug(
955     'HTTP Request: %s %s "%i %s"', request.method, request.url, response.status_code, response.reason_phrase
956 )
958 try:
APIConnectionError: Connection error.`

这个错误的原因一般都是因为防火墙或者权限的原因，无法访问api；请检查

The reason for this error is usually that a firewall or permissions are blocking access to the api; please check: 1) the correct api access permissions; 2) that there is no firewall between the client application and the api.


Link imported ObjC forward declarations to their Swift definition

On occasion, an Objective-C header will forward declare an interface or protocol that is defined elsewhere in Swift. If the definition were in a Clang module instead, the forward declaration would be linked to its definition. Prior to this patch, this was not the case for @objc exposed Swift declarations. This patch fixes that.

@swift-ci Please test

@swift-ci Please smoke test macOS platform

@swift-ci Please smoke test macOS platform

@swift-ci Please test macOS platform

@swift-ci Please test

@swift-ci Please test

@swift-ci Please test source compatibility

@swift-ci Please test


GCE refresh error

I changed the service account key on GCE to force a provider connection error and got the following stack trace, which should be caught and turned into a log message.  On top of that, I was expecting to see the provider quadicon to show the RED X which indicates a provider connection error but never got it which could be because we are not catching this error.  See the screenshot, provider details says the credentials are valid even though the status message says they are having issues.
[----] E, [2016-02-26T18:40:57.945542 #29140:347998] ERROR -- : MIQ(ManageIQ::Providers::Google::CloudManager::Refresher#refresh) EMS: [GCE], id: [1] Refresh failed
[----] E, [2016-02-26T18:40:57.945859 #29140:347998] ERROR -- : [Signet::AuthorizationError]: Authorization failed.  Server message:
{
  "error" : "invalid_grant"
}  Method:[rescue in block in refresh]
[----] E, [2016-02-26T18:40:57.946114 #29140:347998] ERROR -- : /opt/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/signet-0.7.2/lib/signet/oauth_2/client.rb:981:in `fetch_access_token'
/opt/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/signet-0.7.2/lib/signet/oauth_2/client.rb:998:in `fetch_access_token!'
/opt/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/fog-google-0.1.0/lib/fog/google.rb:179:in `new_pk12_google_client'
/opt/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/fog-google-0.1.0/lib/fog/google.rb:109:in `initialize_google_client'
/opt/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/fog-google-0.1.0/lib/fog/google/compute.rb:1073:in `initialize'
/opt/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/fog-core-1.36.0/lib/fog/core/service.rb:115:in `new'
/opt/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/fog-core-1.36.0/lib/fog/core/service.rb:115:in `new'
/opt/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/fog-core-1.36.0/lib/fog/core/services_mixin.rb:16:in `new'
/opt/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/fog-core-1.36.0/lib/fog/compute.rb:65:in `new'
/var/www/miq/vmdb/app/models/manageiq/providers/google/cloud_manager.rb:78:in `raw_connect'
/var/www/miq/vmdb/app/models/manageiq/providers/google/cloud_manager.rb:91:in `connect'
/var/www/miq/vmdb/app/models/manageiq/providers/google/cloud_manager/refresh_parser.rb:14:in `initialize'
/var/www/miq/vmdb/app/models/manageiq/providers/google/cloud_manager/refresh_parser.rb:9:in `new'
/var/www/miq/vmdb/app/models/manageiq/providers/google/cloud_manager/refresh_parser.rb:9:in `ems_inv_to_hashes'
/var/www/miq/vmdb/app/models/manageiq/providers/google/cloud_manager/refresher.rb:6:in `parse_inventory'
/var/www/miq/vmdb/app/models/ems_refresh/refreshers/ems_refresher_mixin.rb:19:in `block in refresh'
/var/www/miq/vmdb/app/models/ems_refresh/refreshers/ems_refresher_mixin.rb:7:in `each'
/var/www/miq/vmdb/app/models/ems_refresh/refreshers/ems_refresher_mixin.rb:7:in `refresh'
/var/www/miq/vmdb/app/models/manageiq/providers/base_manager/refresher.rb:10:in `refresh'
/var/www/miq/vmdb/app/models/ems_refresh.rb:78:in `block in refresh'
/var/www/miq/vmdb/app/models/ems_refresh.rb:77:in `each'
/var/www/miq/vmdb/app/models/ems_refresh.rb:77:in `refresh'
/var/www/miq/vmdb/app/models/miq_queue.rb:335:in `block in deliver'
/opt/rubies/ruby-2.2.4/lib/ruby/2.2.0/timeout.rb:88:in `block in timeout'
/opt/rubies/ruby-2.2.4/lib/ruby/2.2.0/timeout.rb:32:in `block in catch'
/opt/rubies/ruby-2.2.4/lib/ruby/2.2.0/timeout.rb:32:in `catch'
/opt/rubies/ruby-2.2.4/lib/ruby/2.2.0/timeout.rb:32:in `catch'
/opt/rubies/ruby-2.2.4/lib/ruby/2.2.0/timeout.rb:103:in `timeout'
/var/www/miq/vmdb/app/models/miq_queue.rb:331:in `deliver'
/var/www/miq/vmdb/app/models/miq_queue_worker_base/runner.rb:106:in `deliver_queue_message'
/var/www/miq/vmdb/app/models/miq_queue_worker_base/runner.rb:134:in `deliver_message'
/var/www/miq/vmdb/app/models/miq_queue_worker_base/runner.rb:151:in `block in do_work'
/var/www/miq/vmdb/app/models/miq_queue_worker_base/runner.rb:145:in `loop'
/var/www/miq/vmdb/app/models/miq_queue_worker_base/runner.rb:145:in `do_work'
/var/www/miq/vmdb/app/models/miq_worker/runner.rb:327:in `block in do_work_loop'
/var/www/miq/vmdb/app/models/miq_worker/runner.rb:324:in `loop'
/var/www/miq/vmdb/app/models/miq_worker/runner.rb:324:in `do_work_loop'

Hey @agrare could you take a look at this?

So the Red X did finally show up on the next scheduled refresh, it just took longer than I was expecting.  Also, I think we should catch the log trace and print a prettier log message.

The exception is caught here https://github.com/ManageIQ/manageiq/blob/master/app/models/ems_refresh/refreshers/ems_refresher_mixin.rb#L30 and we explicitly log the backtrace here https://github.com/ManageIQ/manageiq/blob/master/app/models/ems_refresh/refreshers/ems_refresher_mixin.rb#L34.
I confirmed that I see the same error when deleting EC2 credentials as with GCE.  I agree that logging the backtrace doesn't look great in the logs but I think we need some other opinions before just removing it.
@blomquisg what are your thoughts on this?

@miq-bot add_label providers/google

What are the next steps for this?

Well minimally it doesn't appear to be just a GCE issue so it could probably be reassigned to someone else.

@blomquisg what are your thoughts on this?  Catching the exception and turning it into a ERROR message is my preference but what say you?

@blomquisg - is it still the case that this is a more general issue that should be assigned to someone else?

@dajohnso, @erjohnso, there's already an ERROR logged for this just before logging the backtrace:
_log.error("#{log_ems_target} Refresh failed")

I think the problem is that we probably also have to update the quadicon.  The trick here is that the authentication status is not updated until the Schedule Worker runs another authentication check (at least, that's what I remember off hand).  And, the quadicon's green check / red "X" is tied to the authentication status.
I guess the right approach here is to figure out how to update the authentication status anytime an authentication attempt fails in the manager code.
@erjohnso, to your question: yeah, this is more of a general issue.  I'll have someone on my team take a look at it to see what they can make of it.

@agrare before I ask the reporter to close, is this issue still relevant? If yes, who should be assigned.

@JPrause we don't invalidate provider credentials when a refresh fails, that is done by the scheduled auth check so IMO this is notabug and can be closed.


Add try/catch for E211

In the case that nnn is used to remove a file while that file is in an
active buffer, Vim will raise E211 with trace on reentry from nnn. The
trace is somewhat of an eye sore but the E211 message is useful. This
PR adds a try catch for E211, removes the trace and reraises E211.
Fixes: #41

Oops. Confused. I guess this should go to mcchrish/nnn.vim


✨ Scan 'pages' directory without marking files as components

Description
In a Nuxt.js project, the pages directory is used to store all page components. While scanning the project for components, it's important to include the pages directory for comprehensive analysis. However, the issue arises when files within the pages directory are incorrectly marked as components.
Why is this feature needed? Is there a problem that you faced?
As it stands, the component scanner may mistakenly identify files within the pages directory as components. The component scanner should include the pages directory during the scanning process but should not mark the files within it as components. This ensures that page components are properly distinguished from other components in the project.
What is the solution you have in mind?
Adjust the component scanning process to exclude the pages directory from being marked as components, while still scanning it for other purposes. This way, the distinction between page components and other components in the project is maintained.
Additional Information

Nuxt.js version: 3.x.x

This issue is essential for ensuring the accurate identification of components in Nuxt.js projects. Your attention to this matter is greatly appreciated.

@ravut8 Please review

@kittisakLS Looks good, feel free to continue with this issue.


[Hexagon] Remove TVM logging from performance-sensitive parts of runtime

Use HAP messaging instead. This greatly reduced execution overhead.

Please don't use logging.h (LOG, CHECK, etc.) in the Hexagon RT, at least in the performance-sensitive parts of it.
@janetsc @supersat @adstraw

A large part of the slowness came from exception handling, specifically from the failing assertion in FreeHexagonBuffer about trying to free an unknown buffer.  There is something weird going on there and I have disabled that assertion (left the message).

Our local simulator tests would time out after 1h, now they finish within 30 min.  I used a subset of the fp16 conv tests, and without this change they would take about 45s per test, after the change they take about 15s per test.

Our local simulator tests would time out after 1h, now they finish within 30 min. I used a subset of the fp16 conv tests, and without this change they would take about 45s per test, after the change they take about 15s per test.

Have your simulator runs always taken this long, or did this recently start happening?  I am wondering if I introduced this will resource management, and this points to needing to handle Free better after ReleaseResources has been called.  (And that's the root culprit, not the logging, which should only be processed upon a failed check.)

The degradation started a while back, but we didn't notice, because the tests were passing without timing out.  The main contributor to the degradation is the exception being thrown, but I only narrowed it down after creating this PR (I used it locally to unblock our tests---that was an urgent thing to do).
I can revert it, and only remove the actual assertion in free-after-release.  That situation shouldn't be happening---there is something weird going on there.

The degradation started a while back, but we didn't notice, because the tests were passing without timing out. The main contributor to the degradation is the exception being thrown, but I only narrowed it down after creating this PR (I used it locally to unblock our tests---that was an urgent thing to do).
I can revert it, and only remove the actual assertion in free-after-release. That situation shouldn't be happening---there is something weird going on there.

I tested this locally, which I prefer to removing the assert.  This will catch the error if we are operating on the static buffer manager:
void HexagonDeviceAPI::FreeDataSpace(Device dev, void* ptr) {
  CHECK(ptr) << "buffer pointer is null";
  CHECK(IsValidDevice(dev)) << "dev.device_type: " << dev.device_type;
  if (mgr == &hexbuffs) {
    // Free can throw if it is called after ReleaseResources
    try {
      mgr->FreeHexagonBuffer(ptr);
    } catch (int e) {
      LOG(INFO) << "FreeDataSpace called for static manager.  An exception occurred " << e;
    }
  } else {
    mgr->FreeHexagonBuffer(ptr);
  }
}

I tested this locally, which I prefer to removing the assert in FreeHexagonBuffer. This will catch the error if we are operating on the static buffer manager:

This still throws an exception.  The whole point of this is not to throw it.

Ah, I see some tests are throwing this even for runtime_hexbuffs (before ReleaseResources is called.). I'm going to continue to investigate.

Closing this, will come up with a smaller fix.


6lowpan: add length checks in decompressor.

Current coverage is 72.49% (diff: 82.85%)

Merging #938 into master will decrease coverage by 0.17%

@@             master       #938   diff @@
==========================================
  Files           116        117     +1
  Lines         17407      17461    +54
  Methods        2433       2436     +3
  Messages          0          0
  Branches       2116       2112     -4
==========================================
+ Hits          12650      12659     +9
- Misses         4059       4124    +65
+ Partials        698        678    -20

Powered by Codecov. Last update 252bd7d...03bf239


includedir not respected for maxminddb_config.h

In Debian, for co-installation purposes across multiple architectures (a feature called "multi-arch"), it is required that the packages ship identical contents for identical filenames across different architectures.
Since maxminddb_config.h varies by architecture (MMDB_UINT128_IS_BYTE_ARRAY is set to 1 on e.g. i386 but 0 on e.g. amd64, assuming recent toolchain), the only way to do this is to ship header files to /usr/include/<architecture triplet/ which is supported by the Debian toolchain as an include path.
I attempted to do so by passing --includedir to configure, but this resulted into this:
-rw-r--r-- root/root      7069 2015-07-19 02:31 ./usr/include/x86_64-linux-gnu/maxminddb.h
-rw-r--r-- root/root      6429 2015-07-19 02:31 ./usr/include/x86_64-linux-gnu/maxminddb-compat-util.h
-rw-r--r-- root/root       507 2015-07-19 02:31 ./usr/include/maxminddb_config.h

My autoconf foo isn't great, but the above diff seems to fix this:
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,7 +1,7 @@

 include_HEADERS = include/maxminddb.h src/maxminddb-compat-util.h

-include_execdir = $(exec_prefix)/include
+include_execdir = $(includedir)

 nodist_include_exec_HEADERS = include/maxminddb_config.h

Could you send the configure arguments that you are trying to use? The change looks mostly reasonable to me, but I just want to verify the behavior myself.

So I tested this out, and the current use of --exec-prefix seems to work for putting architecture-specific files in the correct directory while leaving the others in PREFIX. However, this does not map well to how Debian, in particular, lays out the files as it creates a separate architecture specific directory in the general includes directory. Do you have any links that document what Debian considers best practices for library authors when it comes to multiarch support? I assume this is a fairly common issue.

For what it's worth, I was just passing --includedir="\$${prefix}/include/$(DEB_HOST_MULTIARCH)". $DEB_HOST_MULTIARCH is just set to the triplet, e.g. x86_64-linux-gnu.
This is necessary because maxminddb_config.h's contents vary between different architectures.

Right. Previously that file was installed to the include directory in the --exec-prefix precisely because it was architecture specific. However this was non-standard, creating more confusion and complexity.


Usage tabs on playground page don't work

https://github.com/user-attachments/assets/60ff5cf2-c783-4d40-837f-92be89595175
Chrome stable, macOS

Weird, it works fine for me here, same setup macOS 14.5 ARM and Chrome stable 127.0.6533.99
Let's see what happens after the release of the new version

I tried with and without ad blocker just in case, same result. Maybe it's just my browser

@rock3r, could you try in another browser (safari) and see if that works for you? I'm inclined to close as we cannot repro it

Must be something weird with my browser, I'll close.


Daniel adebi development

Preliminary Style Check request. Also edited some of my map code so that it now has a path from my dorm to main campus.

Made some style changes


A exiting work! Could you please upload your source code?

Thanks for your attention. The code of LatentGNN will be available soon after the conference. We are working on the code refactor.


fix typo and format table in example

Codecov Report
Patch coverage has no change and project coverage change: -0.12 :warning:

Comparison is base (64742b6) 73.39% compared to head (38a83ae) 73.28%.

:exclamation: Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #999      +/-   ##
==========================================
- Coverage   73.39%   73.28%   -0.12%
==========================================
  Files         136      136
  Lines       15143    15143
==========================================
- Hits        11114    11097      -17
- Misses       3397     3412      +15
- Partials      632      634       +2

see 3 files with indirect coverage changes

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.


fix: incorrect offset in fixUrl function

Fixes #1183

cc @vladfrangu, looks like the new infinite scrolling implementation makes this test flaky. would be good to do something about that, better to have it skipped if it would be too flaky, it can easily just add noise instead of value that way
FAIL test/puppeteer_utils.test.js (7.79 s)
  ● Apify.utils.puppeteer › with launchPuppeteer › infiniteScroll() › stopScrollCallback works

    expect(received).toBe(expected) // Object.is equality

    Expected: true
    Received: false

      398 |                 // The test passes because the Infinite waitForSecs is broken by the callback.
      399 |                 // If it didn't, the test would time out.
    > 400 |                 expect(after).toBe(true);
          |                               ^
      401 |             });
      402 |         });
      403 |

      at Object.<anonymous> (test/puppeteer_utils.test.js:400:31)
          at runMicrotasks (<anonymous>)

cc @vladfrangu, looks like the new infinite scrolling implementation makes this test flaky. would be good to do something about that, better to have it skipped if it would be too flaky, it can easily just add noise instead of value that way
FAIL test/puppeteer_utils.test.js (7.79 s)
  ● Apify.utils.puppeteer › with launchPuppeteer › infiniteScroll() › stopScrollCallback works

    expect(received).toBe(expected) // Object.is equality

    Expected: true
    Received: false

      398 |                 // The test passes because the Infinite waitForSecs is broken by the callback.
      399 |                 // If it didn't, the test would time out.
    > 400 |                 expect(after).toBe(true);
          |                               ^
      401 |             });
      402 |         });
      403 |

      at Object.<anonymous> (test/puppeteer_utils.test.js:400:31)
          at runMicrotasks (<anonymous>)

The issue isn't really the implementation of the scrolling, but the fact that it's not instant like window.scrollBy (to emulate a more human-like scroll), and past tweaking the delay between the scrolls.. I don't think (but do correct me if I'm wrong) there's anything more we can do.. 😢
From my testing, with stopScrollCallback to true it almost scrolls to the bottom at times (increasing the delay between scrolls to 150 made it almost perfect on my PC and in some CIs..). I guess we could increase the delays between scrolls to 250ms instead? Might be more ideal for users too I suppose

Yeah either increase the timeout or disable the test. I already disabled most of the flaky tests in past weeks.

Let's increase the timeout to 250ms and see what happens 👍


Change the letter used to describe a mode

I like the approach of zellij-cb but I don't think associating a letter with a mode satisfies everyone, I have a list of nerd-font icons that could be used to represent different modes so, it would be great if that configuration existed
Plus, the existing icons to indicate sync, zoomed tab etc are pretty bad and I have a few emojis that could be used there as well, so, an inclusion of such an option would also be greatly appreciated

Also, it's not very evident how to convert the source code to a wasm, would be great if you had releases for that

I like the approach of zellij-cb but I don't think associating a letter with a mode satisfies everyone, I have a list of nerd-font icons that could be used to represent different modes so, it would be great if that configuration existed

Thanks for the issue, I'll add the option to set a custom string in the mode.

Plus, the existing icons to indicate sync, zoomed tab etc are pretty bad

I don't use those features and I'm not sure how they look like, so for now it's not planned. I'm open to pull requests or explain the feature a bit better so I can see how easily it can be integrated and I'll add it once I find some time.

Also, it's not very evident how to convert the source code to a wasm, would be great if you had releases for that

I'll add releases in the future but for now you can refer to the installation section in the README: https://github.com/ndavd/zellij-cb#installation.

Added configuration option for mode label override (Check it here). Let me know if this solves your issue.

Hey @ndavd thanks a lot for considering my issue, it'll be a while until I get back to you with a comment, as my circumstances currently don't require facing a terminal prompt. When I do get back around, I'll be sure to update you.


2.0а2 - no more data in entity after renaming.

Running version: converters branch as on 2021-11-28.
On entity rename (if renamed separately or together with device) one reading appears in state, but nothing after rename.
See screenshot - state not changed, but new data from gateway logged.

2021-11-29 14:34:24,563 <IP_ADDRESS> [MQTT] gw/842E14FFFE4DF3CA/MessageReceived b'{"sourceAddress":"0x23D9","eui64":"0x00124B00222E938E","destinationEndpoint":"0x01","clusterId":"0x0405","profileId":"0x0104","sourceEndpoint":"0x01","APSCounter":"0xBB","APSPlayload":"0x18D50A0000213D07","rssi":-73,"linkQuality":108}'
2021-11-29 14:34:24,567 <IP_ADDRESS> [ZIGB] 0x00124b00222e938e (0x23d9) recv {'endpoint': 1, 'cluster': 'humidity', 'command': 'Command.Report_Attributes', 'measured_value': 1853}

^^^ last state change BEFORE entity renamed.
2021-11-29 14:48:38,685 <IP_ADDRESS> [SLBS] 0x00124b00222e938e (0x23d9) read {'commands': [{'commandcli': 'zcl global read 1029 0'}, {'commandcli': 'send 0x23d9 1 1'}]}
2021-11-29 14:48:38,693 <IP_ADDRESS> [MQTT] gw/842E14FFFE4DF3CA/commands b'{"commands":[{"commandcli":"zcl global read 1029 0"},{"commandcli":"send 0x23d9 1 1"}]}'

^^^ at that moment entity renamed (previous state copied ?)
2021-11-29 14:48:38,737 <IP_ADDRESS> [MQTT] gw/842E14FFFE4DF3CA/MessagePreSentCallback b'{"eui64":"0x00124B00222E938E","destinationEndpoint":"0x01","clusterId":"0x0405","profileId":"0x0104","sourceEndpoint":"0x01","APSCounter":"0x1B","APSPlayload":"0x1002000000"}'
2021-11-29 14:48:38,739 <IP_ADDRESS> [ZIGB] 0x00124b00222e938e 0x23d9 send {'endpoint': 1, 'cluster': 'humidity', 'command': 'Command.Read_Attributes', 'value': [0]}
2021-11-29 14:48:38,741 <IP_ADDRESS> [MQTT] log/z3 b'buffer: 10 02 00 00 00 \r'
2021-11-29 14:48:38,742 <IP_ADDRESS> [MQTT] gw/842E14FFFE4DF3CA/executed b'{"command":"send 0x23d9 1 1"}'
...
2021-11-29 14:49:06,544 <IP_ADDRESS> [MQTT] gw/842E14FFFE4DF3CA/devicestatechange b'{"eui64":"0x00124B00222E938E","deviceState":17}'
...
2021-11-29 15:00:07,727 <IP_ADDRESS> [ZIGB] 0x00124b00222e938e (0x23d9) recv {'endpoint': 1, 'cluster': 'humidity', 'command': 'Command.Report_Attributes', 'measured_value': 1773}
2021-11-29 15:00:07,731 <IP_ADDRESS> [MQTT] zigbee/send b'{"cmd":"report","id":2000005207,"did":"lumi.124b00222e938e","time":1638190807815,"rssi":-74,"zseq":235,"dev_src":"0"}'

Other device entities still updates as usual. But renamed - no more till HA Core restart

If rename entity one more time, w/out HA Core restart in between - entity become unavailable for a while, with no state value and no more data from gateway:

Fixed


Update url badges.

Q
A

Is bugfix?
✔

New feature?
❌

Breaks BC?
❌

Tests pass?
✔

Thanks!


feat: Redis - Mark brokerpak plans as deprecated

Customers should be moving to their own plan definitions and they should use v6 redis version
#183863818
Checklist:

[ ] Have you added Release Notes in the docs repositories?
[ ] Have you followed the Conventional Commits specification?

@zucchinidev nice catch - I changed the plan name in a couple of tests


Incompatible with RM 2019.2 EAP

JB is at it again. Just installed the latest 2019.2 EAP and railways doesn't work anymore.

RubyMine 2019.2 EAP
Build #RM-192.4205.37, built on May 23, 2019
Runtime version: 11.0.3+12-b248.2 x86_64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
macOS 10.13

Any news on this?

Hi guys.
This is not JB to blame, this is just selected policy of plugin updates. To make sure the plugin doesn't break new versions of IDE, I just restrict plugin compatibility to the most recent version (like "compatible with 2019.1 only"). While this approach works good for frequently updated plugins, in my case it's a bit time consuming - I have to rebuild the plugin with updated restrictions and without any significant changes each time new IDE version is out. So I decided to switch back to the old approach, when only lower compatible IDE version is set (like "compatible with 2019.1 and above"). So since now plugin will cause problems only when there are indeed some significant API changes in new IDE. I think that would be not so often and that's why we have EAPs for - to test everything works fine before stable release)))
In the meantime I've built new version of Railways plugin (0.8.15), feel free to check it. Please let me know it everything works fine.
Regards.

@basgren I have been using this all week and haven't had any issues. Thanks for getting this out! I really enjoy using this plugin. Saves me a lot of time


Add grid area for drag handle when data-drag-and-drop is true

Closes #4542

Changelog
TreeView is the underlying component in NestedListView which is used for sub-issues. We need to add drag and drop capability for sub-issues. One of the design requirements for that is to have a drag handle on the left most side of each item (sub-issue). Currently, it is not possible to place any element before the toggle.
This PR adds the following:

add a dragAndDrop prop (boolean) to TreeView component. Consumers can set this to true which adds the data-drag-and-drop attribute to the TreeView component. This attribute is used to update the css grid for TreeView.Item, when present. This adds space for the drag handle element that the consumers can pass
add dragHandle prop to TreeView.Item. Consumers can use this to pass the drag element which will be rendered within TreeView.Item
only show dragHandle when user hovers over TreeView.Item
renders default view (the one used currently) when dragAndDrop prop is not passed to TreeView to help keep things as is for other consumers of TreeView

New

Adds ability to render drag handle at the front of the TreeView.Item

Changed

Changed the css grid of TreeView.Item when dragAndDrop prop is passed to TreeView

Removed

Rollout strategy

[ ] Patch release
[x] Minor release
[ ] Major release; if selected, include a written rollout or migration plan
[ ] None; if selected, include a brief description as to why

Testing & Reviewing

Merge checklist

[x] Added/updated tests
[x] Added/updated documentation
[x] Added/updated previews (Storybook)
[x] Changes are SSR compatible
[x] Tested in Chrome
[x] Tested in Firefox
[x] Tested in Safari
[ ] Tested in Edge
[ ] (GitHub staff only) Integration tests pass at github/github (Learn more about how to run integration tests)

@mperrotti @ericwbailey the initial idea was to just have some space before the expand/collapse toggle where users can place any element. I used dragHandle as the example as that is what we were interested in.
If we were to ship with a default recommended style to always have the dragHandle show, I believe the drag and drop logic should also reside within TreeView (at least for onDragStart/onDragEnd). This would complicate things quite a bit for our use-case.
I think the better way to put this is: do you have recommendations on what we could do if we just wanted to place an element before the TreeView.Item toggle? The consumer would handle what that element does (i.e clicking on it, dragging it, etc).

The other thought here is that my understanding of the shape of this work is getting initial functionality in for demo purposes, and then follow up with accessibility tweaks so it does not block the work.

@ayy-bc @ericwbailey Can you say a little more about the demo purposes?
(If it's something urgent with user demos, we can ship this quickly as is and keep iterating on it. If it's internal demos not on production, when we can use a different method to unblock the team)

Curious to hear your thoughts here @mperrotti,
This PR is very specific to drag and drop behavior, which is fine, as long as we also bake-in user feedback for dragging state.

the initial idea was to just have some space before the expand/collapse toggle where users can place any element. I used dragHandle as the example as that is what we were interested in.

On a pattern level, however, the requirement/request from https://github.com/primer/react/issues/4542 and @ayy-bc's comment seems to be 2 things:

an icon button "slot" that is placed before both the expand/collapse button and the leading visual
This feels similar to how we support both trailingVisual and trailingAction at the same time on components like Button, TextInput and PageHeader.
Is this a good case for add a leadingAction slot along with the existing leadingVisual slot on TreeView.Item?

The ability to hide the button with css
This part feels use case specific, so it would be better to put this at the usage site instead of baking it in the component.
To be able to target the leadingAction slot, we would need a reliable selector like [data-component=TreeView.leadingAction]. (We do this in other components like Button, ActionList, UnderlineNav, etc. already)

@ayy-bc Does that seem correct or am I missing a crucial part here?

@siddharthkp thanks for looking into this. We really appreciate it.

Can you say a little more about the demo purposes?

We are planning to ship the first iteration of drag and drop with sub-issues with our currently ongoing epic. The changes will be out in production for everyone flagged into sub-issues to try. Regarding the urgency, it would help us a ton to be able to ship this out soon as we're currently using a local copy of TreeView inside of nested list view to test out our changes.
Regarding your second comment:

Yes, that's spot on. We need an icon button slot before the expand/collapse toggle so we can place the drag handle there.
A little confused about this one. Ideally, the updated grid (with an area for leadingAction ~dragHandle) would apply to all the TreeView.Item's based on some prop/attribute (maybe at the parent TreeView level, and the updated grid with space for leading action is only used when the consumer passes some attribute/prop so as to not break other users of TreeView). Then, the user can pass the icon button (as leading action) to any TreeView.Item and for those that don't have the leading action passed, they would just show some empty space there so as to not break the tree layout (we'll only be rendering drag handles for first level items to begin with).
I'm not the best at styling but if the end user/usage site can pass the leading action (~dragHandle) as a child to the TreeView.Item with the [data-component=TreeView.leadingAction] and if that places the handle in the right place, that should work with us

@ayy-bc @ericwbailey Can you say a little more about the demo purposes?
(If it's something urgent with user demos, we can ship this quickly as is and keep iterating on it. If it's internal demos not on production, when we can use a different method to unblock the team)

Ah, sorry about that! I was referring to internal demos and the eventual adding of more Hubbers to the feature flag. So, no scary public-facing thing we need to rush to address.

For what it's worth, I really like the idea behind leadingAction. I also wonder if we'll run into a future state where the design calls for both drag and drop and a leading action?

For what it's worth, I really like the idea behind leadingAction. I also wonder if we'll run into a future state where the design calls for both drag and drop and a leading action?

Definitely possible! Till now, the pattern has been to put action (or multiple actions) in trailing slots instead of leading

Regarding the urgency, it would help us a ton to be able to ship this out soon as we're currently using a local copy of TreeView inside of nested list view to test out our changes.

Understood. Also, that's a good workaround in the time being!
I'll wait for @mperrotti's thoughts on leadingAction before we conclude on the direction

I like the flexibility of a leadingAction, but I can't think of other possible leading actions since we typically put actions after the item label (in a "trailing" slot).
I feel comfortable moving forward with leadingAction so we can quickly unblock and iterate, but I don't think we need to have both leadingAction and leadingVisual yet.

Great, we have a direction then!
@ayy-bc, I have an implementation in mind, I'll try to finish it tomorrow.
Do you mind if I update your PR itself with the changes? (because we have reviewers here already)

@siddharthkp yeah please feel free to update this PR with the changes you have in mind. Thanks a ton for getting the ball rolling in this one :) I'll take a look at the PR whenever you have your changes in

Leaving notes for myself
TODOs In the story:

[ ] implement fold on click
[ ] implement hide until hovered

TODOs in the component:

[ ] check if leading action should be aria-hidden
[ ] update snapshots
[ ] make the API always render an icon button

@ericwbailey Do you know if should add an aria-hidden to the leading action until we know it's accessibility story? (There's no way to get to it with keyboard navigation either)

@siddharthkp Yup, that'd be great. Ultimately, we'd need it and also tabindex="-1" applied to any interactive element on the leading action to fully suppress it. If you have the capacity to sneak that in now with this PR that'd be great!

Ultimately, we'd need it and also tabindex="-1" applied to any interactive element on the leading action to fully suppress it. If you have the capacity to sneak that in now with this PR that'd be amazing!

Just noticed the changes made since my last review, looks like that would have to live in the application instead of primer/react because primer does not control the contents of the action :(

@langermank Can I get a review for the snapshots


Fix service namespace clash

This PR addresses comments in, and replaces PR #5031, after some git mistakes and cleanups on my part.  Please see that PR for comments.

Addressed uncontentious comments in commit acc6006. PTAL.
Let me know how you feel about the others.

Addressed all issues as discussed inline above (in commit #b790ced).
Please take a look, and merge at your convenience.

I gotta tell you, I think this is more complex than is justified.  The deeper down the rabbit hole this goes, the more I think it should just be a simple open struct of two fields.  Its value is in its self-documenting nature, not in doing deep validation or hard encapsulation.

Yes, you've convinced me.  Actually, I came to much the same conclusion while pondering Clayton's comments  over the weekend. I'll rewrite it and resubmit today.

Thanks.  We can always extend it later if we need to, of course.  But by
then we'll have a demonstrated need.
On Mon, Mar 16, 2015 at 8:11 AM, Quinton Hoole<EMAIL_ADDRESS>wrote:

Yes, you've convinced me. Actually, I came to much the same conclusion
while pondering Clayton's comments over the weekend. I'll rewrite it and
resubmit today.
—
Reply to this email directly or view it on GitHub
https://github.com/GoogleCloudPlatform/kubernetes/pull/5192#issuecomment-81725598
.

Tim - Hopefully addressed all of your concerns in commit 9f7eff3.  PTAL, and let me know whether and how you'd like this all squashed.

Squash to a single commit and I'm happy. modulo the one nit.

Man, googlebot is getting rude.  Now it removes manually fixed CLA tags.

OK Tim, commit cc72eaec3aa3 should do it (fix nit and squash).

lgtm

I don't have time to wait for green, so flagging for oncall tomorrow.


A couple of GDScript fixes

Fix type of range() when used in a for loop, since it's optimized to Vector2/3 or int to not allocate an array.
Fix the return value of a cast when compiling. It was returning the source value instead of the result.

Found those while testing the typed VM and the #43775 fix.

Thanks!