[Concurrency] Allow synchronous functions to be a subtype of 'async' functions

Implement support for synchronous functions being a subtype of 'async' functions to line up with changes to the async/await proposal. This includes:

An implicit conversion from a synchronous function to its async counterpart
The ability for a synchronous function to witness an async protocol requirement

@swift-ci please smoke test

@swift-ci please clean test Windows


Scheduling an auto-merge no longer works in 1.18.4

Description
The "auto-merge when checks succeed" feature was working in 1.18.3, but in 1.18.4, users receive

This pull request is not ready to be merged, check review status and status checks.

Same error message is being seen in #23000 but this is a non-admin scenario, so I thought it probably deserved its own issue.
This is not reproducing on try.gitea.io, but on try, I don't see the auto-merge feature at all, so maybe I'm doing something wrong.
Gitea Version
1.18.4
Can you reproduce the bug on the Gitea demo site?
No
Log Gist
No response
Screenshots

Git Version
2.39.1
Operating System
Ubuntu 20.04.3, aarch64/arm64
How are you running Gitea?
Self-built from 1.18.4 tag with an additional fix to LFS downloads.
Database
PostgreSQL

The biggest (and somewhat related) PR between 1.18.3 and 1.18.4 is  #22812  @zeripath do you have a time to take a look?

OK, I think I understand the problem now.
It's the same problem as #23000 , the problem is that there were bugs on bug, which made the old code happened to work.
When the "force checking" bug was fixed by https://github.com/go-gitea/gitea/pull/22812, other bugs came.
To fix other bugs, I think the code should be like:
skipProtectionCheck := force || auto

CheckPullMergable( ..., skipProtectionCheck bool)

A fix is on the way.

Ah bugs that are hidden due to other bugs - the gift that keeps on giving.
I think this clearly indicates we need some tests for the automerge capability - however, that may mean that it needs some restructuring in order to make it testable.

I think we need to redesign the automerge, we need a queue like what Github did.

Isn't this fixed by #23010 ?

yup Fixed by #23010


Possible?

Is it possible to use this firmware to create an integrated HomeKit lock using this hardware:
https://a.aliexpress.com/_EHdQUiD
https://a.aliexpress.com/_EJBjFXR
what would be the steps to make this work?
Thanks!

Should work on that esp32 relay module, although the relay control part logic should be added into code on successful authentication. HomeSpan has some nice tutorials on that afaik. Make sure you get the PN532 module (red).

Nice. I’m mostly familiar with HAA so hopefully I’ll be able to work with your implementation. The dream would be to have your code integrated into HAA.

HomeSpanUI looks very nice, however, i may move away from HomeSpan in the future as i don't see it as a good fit anymore, but that idea is still brewing so it may not come to fruition.
Regarding the topic of this discussion, GPIO Control is not planned, but anyone interested can just replace the mqtt.publish lines with whatever they want. The HomeSpan library does have a number of example, not sure if any of them are for a relay, however, that should only be a matter of setting the pin HIGH or LOW for open or close whenever needed.

Closing Issue, this can be more extensively discussed on #17


build: split python CI jobs

SUMMARY
The Python CI job currently has 10 tasks within it that all need to be retried if any one of them fails. By splitting CI up, it'll make it easier to retry when one of our flaky tests fails
TEST PLAN
CI
ADDITIONAL INFORMATION

[ ] Has associated issue:
[ ] Changes UI
[ ] Requires DB Migration.
[ ] Confirm DB Migration upgrade and downgrade tested.
[ ] Introduces new feature or API
[ ] Removes existing feature or API

to: @ktmud @mistercrunch @john-bodley

Codecov Report

Merging #11794 (0ee89d7) into master (872a54d) will decrease coverage by 4.45%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master   #11794      +/-   ##
==========================================
- Coverage   67.29%   62.84%   -4.46%
==========================================
  Files         905      448     -457
  Lines       43862    27558   -16304
  Branches     4201        0    -4201
==========================================
- Hits        29519    17320   -12199
+ Misses      14239    10238    -4001
+ Partials      104        0     -104

Flag
Coverage Δ

cypress
?

javascript
?

python
62.84% <ø> (-0.80%)
:arrow_down:

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files
Coverage Δ

superset/views/database/views.py
62.10% <0.00%> (-25.33%)
:arrow_down:

superset/db_engine_specs/mysql.py
79.59% <0.00%> (-12.25%)
:arrow_down:

superset/db_engine_specs/sqlite.py
65.62% <0.00%> (-9.38%)
:arrow_down:

superset/db_engine_specs/presto.py
73.65% <0.00%> (-8.64%)
:arrow_down:

superset/databases/commands/create.py
83.67% <0.00%> (-8.17%)
:arrow_down:

superset/databases/commands/update.py
85.71% <0.00%> (-8.17%)
:arrow_down:

superset/db_engine_specs/base.py
80.53% <0.00%> (-6.94%)
:arrow_down:

superset/sql_validators/base.py
93.33% <0.00%> (-6.67%)
:arrow_down:

superset/views/database/forms.py
83.33% <0.00%> (-5.56%)
:arrow_down:

superset/views/core.py
70.46% <0.00%> (-3.75%)
:arrow_down:

... and 469 more

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 872a54d...0ee89d7. Read the comment docs.


feat: Improve the syntax for conditions with multiple predicates

Working towards implementing support discussed in #2759
Throughout this PR I frequently reference polars.when, and I want to make sure any reviewers have the origin handy.
Tasks
Review

[x] Investigate strange SchemaValidationError https://github.com/vega/altair/pull/3427#issuecomment-2210664643

[x] Redesigned _Conditions -> _Conditional
See commit 12929625ad4c02b834b21366e7d7b045e6915861
Generic w/ constraint on the type of condition allowed, aligning with vega-lite

In addition, there are two ways to encode the data that satisfy the specified condition:

Combining one conditional field definition with a single base value or datum definition.
Combining one or more conditional datum or value definitions with a field, datum, or value definition.

[x] Investigate @mattijn proposed str_as: Literal["value", "datum", "field", ...] as an alternative to str_as_lit https://github.com/vega/altair/pull/3427#issuecomment-2209536374

[x] str_as_lit=False -> str_as="shorthand"
See commit https://github.com/vega/altair/pull/3427/commits/d0784f8bf9f8ee1b80d04a429e1efc00804f18e5
See thread https://github.com/vega/altair/pull/3427#discussion_r1667443802

Core

[x] Add more clearly defined types

[x] Update alt.condition signature with overloads

[x] Extract existing multi-stage parsing logic into new functions
[x] Define utility classes for when-then-otherwise syntax
[x] Reuse/adapt parsing functions for utility classes
[x] Investigate existing function/method(s) that would accept the new conditions

[x] Return of otherwise

[x] Valid anywhere alt.condition is used

[x] Return of then

[x] Valid as encoding input dfc14de (#3427)
[x] Identify other cases https://github.com/vega/altair/pull/3427#discussion_r1626275778

[x] Add top-level when function as entry-point

[x] Rename _when -> when

[x] Refactor to reduce code duplication 38d425f (#3427)
[x] Add docs for when-then-otherwise

[x] Initial docs, for: classes, most new types and functions
[x] when
[x] When.then
[x] Then.when
[x] Then.otherwise
[x] ChainedWhen.then

[x] Add tests for when-then-otherwise

[x] for passing case identified in #3301
[x] for _Then ending conditions
[x] for mixed predicate input

Stretch
These would be nice to have and were demonstrated in https://github.com/vega/altair/issues/2759#issuecomment-2137384675. Each idea comes from polars.when.
However, they need further discussion due to deviating from alt.condition's original behaviour.

[x] Wrap literals passed to then, otherwise in alt.value. 38d425f (#3427)
[x] Wrap kwargs passed to when as alt.datum.key.__eq__(value). 38d425f (#3427)

I found only 2 examples that used alt.condition(**kwargs), for something other than empty:

Selection Detail passes legend=None.
Interactive Scatter Plot and Linked Layered Histogram passes scale=alt.Scale(...).

Solved by moving **kwargs from when -> then, otherwise.

[x] Modify when's predicate argument to be variadic, reducing all predicates as an AND reduction. 38d425f (#3427)

Probably the least contentious

alt.condition already accepts the result of this.
when(predicate, **kwargs) -> when(*predicate, **kwargs) doesn't change the meaning of arguments other than predicate

A concern that I raised when proposing making this change within alt.condition

Awesome @dangotbanned, I tried a few things that were mentioned in #2759 which were working already, yeah!
I tried also two examples of which I was not expecting it to work, but since we are pushing boundaries here.. let me raise them anyways.
I tried to use the _alt._when() method as a replacement for alt.expr.if_().
Eg in this example https://altair-viz.github.io/user_guide/marks/text.html#labels-position-based-on-condition:
import numpy as np
import pandas as pd
import altair as alt

rand = np.random.RandomState(42)
df = pd.DataFrame({
    'xval': range(100),
    'yval': rand.randn(100).cumsum()
})

bind_range = alt.binding_range(min=100, max=300, name='Slider value:  ')
param_width = alt.param(bind=bind_range)

# Examples of how to write both js and python expressions
param_color_js_expr = alt.param(expr=f"{param_width.name} < 200 ? 'red' : 'black'")
param_color_py_expr = alt.param(expr=alt.expr.if_(param_width < 200, 'red', 'black'))

# possible?:
param_color_py_when = alt.param(expr=_alt._when(param_width < 200).then('red').otherwise('black'))

chart = alt.Chart(df).mark_point().encode(
    alt.X('xval').axis(titleColor=param_color_js_expr),
    alt.Y('yval').axis(titleColor=param_color_py_expr)
).add_params(
    param_width,
    param_color_js_expr,
    param_color_py_expr
)
chart

This:
_alt._when(param_width < 200).then('red').otherwise('black')

Gives:
NotImplementedError: condition predicate of type 'ParameterExpression'

and this example: https://altair-viz.github.io/user_guide/interactions.html#expressions-inside-parameters
import altair as alt
import pandas as pd

source = pd.DataFrame({
    "a": ["A", "B", "C"],
    "b": [28, -5, 10]
})

bar = alt.Chart(source).mark_bar().encode(
    y="a:N",
    x=alt.X("b:Q").scale(domain=[-10, 35])
)

text_conditioned = bar.mark_text(
    align="left",
    baseline="middle",
    dx=alt.expr.if_(alt.datum.b >= 0, 10, -20))
    # dx=alt.expr(_alt._when(alt.datum.b >= 0).then(10).otherwise(-20))
).encode(text="b")

bar + text_conditioned

This:
alt.expr(_alt._when(alt.datum.b >= 0).then(10).otherwise(-20))

Gives:
SchemaValidationError: '{'condition': [{'test': '(datum.b >= 0)', 'value': 10}], 'value': -20}' is an invalid value for `expr`. Valid values are of type 'string'.

And I completely understand this is not expecting to work, but I was just trying.

Hmm, maybe we should add  alt.expr.when() for this?

Thanks for such a quick response @mattijn.
These are just my first thoughts after adding the two tests.
I'm going to read up on the vega-lite spec some more to see how this could be mapped over.
NotImplementedError: condition predicate of type 'ParameterExpression'
I rewrote this as an alt.condition to confirm:
# possible?:
# param_color_py_when = alt.param(
#    expr=_alt._when(param_width < 200).then("red").otherwise("black")
# )
param_color_py_condition = alt.param(
    expr=alt.condition(param_width < 200, alt.value("red"), alt.value("black"))
)

That error is part of the original alt.condition code, I left the message unchanged other than using f-strings.
I also added this comment, which I originally thought was the issue here. However, there's no relation between core.Expr and ParameterExpression.
Essentially, the predicate argument for alt.condition and alt._when are identical in what they allow - both using the same _PredicateType annotation - derived from the original signature.
I'm more than happy to extend what is allowed here, but I do not know why the original restriction was in place.
SchemaValidationError: '{'condition': [{'test': '(datum.b >= 0)', 'value': 10}], 'value': -20}' is an invalid value for expr. Valid values are of type 'string'.
I just arrived here as well after experimenting with the other one, after adding a new clause to _predicate_to_condition
def _predicate_to_condition(...):
	...
    elif _is_test_predicate(predicate):
        condition = {"test": predicate}
    elif isinstance(predicate, dict):
        condition = predicate
	# new clause that passes the rest of `alt.condition`, but triggers the same `SchemaValidationError`
    elif isinstance(predicate, _expr_core.OperatorMixin):
        condition = {"test": predicate._to_expr()}
    else:
        msg = f"condition predicate of type {type(predicate).__name__!r}"
        raise NotImplementedError(msg)
    return condition

Adding a summary I wrote in #3426 on the status of this PR, as I'd rather keep it updated here if I have any more thoughts.
I've left this on draft, not ready yet, but would be good to hear your thoughts on a couple of things:

alt.when signature

To preserve compatibility with alt.condition, the first predicate arg behaves identically - but *more_predicates is more restrictive in the types allowed - as they all must implement &.
I've left this to bake before writing docs, as I'm not sure whether the trade-off in added complexity (for the user) is worth preserving identical semantics as alt.condition for a single argument.

The new parts added for alt.expr comment which are "an" implementation, but not sure it would be the right way to go.

@binste was closing this intentional?
This branch is attached to a roadmap issue.

#2759

The link to #3458 was only addressing the comment I added in https://github.com/vega/altair/pull/3427#discussion_r1662542866

Nope, not intentional. Somehow GitHub closed it when I merged the PR :)

Nope, not intentional. Somehow GitHub closed it when I merged the PR :)

Thank you

I noticed you have marked this PR as review ready. Nice!
I tried the following examples:
import altair as alt
from vega_datasets import data

cars = data.cars.url

base = alt.Chart(cars).mark_tick().encode(x='Miles_per_Gallon:Q')

# condition with single predicate
base.encode(color=alt.when(alt.datum.Origin == 'Europe')
            .then(alt.value('green'))
            .otherwise(alt.value('red'))
)

# condition with multiple predicates
base.encode(color=alt.when(alt.datum.Origin == 'Europe')
            .then(alt.value('green'))
            .when(alt.datum.Origin == 'Japan')
            .then(alt.value('blue'))
            .otherwise(alt.value('red'))
)

and
import altair as alt
import polars as pl

df = pl.DataFrame([
      {"a": "A", "b": 28}, {"a": "B", "b": 55}, {"a": "C", "b": 43},
      {"a": "D", "b": 91}, {"a": "E", "b": 81}, {"a": "F", "b": 53},
      {"a": "G", "b": 19}, {"a": "H", "b": 87}, {"a": "I", "b": 52}
])

highlight = alt.selection_point(on='mouseover', empty=False)
select = alt.selection_point(on='click', empty=False)

# condition with multiple predicates using params
alt.Chart(df).mark_bar(fill="#4C78A8", stroke="black", cursor="pointer").encode(
    x="a:N",
    y="b:Q",
    fillOpacity=alt.when(highlight)
        .then(alt.value(1))
        .otherwise(alt.value(0.3)),
    strokeWidth=alt.when(select)
        .then(alt.value(2))
        .when(highlight)
        .then(alt.value(1))
        .otherwise(alt.value(0))
).configure_scale(
    bandPaddingInner=0.2
).add_params(highlight, select)

I noticed that
alt.when(alt.datum.Origin == 'Europe').then(alt.value('green')).otherwise(alt.value('red'))

returns
{'condition': [{'test': (datum.Origin === 'Europe'), 'value': 'green'}],
 'value': 'red'}

And that:
alt.when(alt.datum.Origin == 'Europe').then('green').otherwise('red')

Returns
{'condition': [{'test': (datum.Origin === 'Europe'), 'field': 'green'}],
 'field': 'red'}

Can you provide some description which option you choose from your options in this comment here: https://github.com/vega/altair/issues/2759#issuecomment-2137384675
Thanks again for this work, its really neat!

Thanks for getting to this so quickly @mattijn
Main

Can you provide some description which option you choose from your options in this comment here: #2759 (comment)
Thanks again for this work, its really neat!

Sure thing! Maybe I need to work on the docstrings, I added an example on alt.when but didn't for each method due to https://github.com/vega/altair/pull/3427#discussion_r1659965947
The three below are all equivalent (labelled a, b, c):
alt.when(alt.datum.Origin == 'Europe').then(alt.value('green')).otherwise(alt.value('red')) # a
alt.when(Origin="Europe").then(alt.value("green")).otherwise(alt.value("red"))				# b
alt.when(Origin="Europe").then("green", str_as_lit=True).otherwise("red", str_as_lit=True)	# c

The keyword str_as_lit's name comes from polars, which behaves in a very similar way - but they use pl.lit instead of alt.value.
I spent quite some time considering the name, the other candidates were value, shorthand, lit, field:

It should not obscure the **kwargs, inherited from alt.condition

All except lit have other meanings in altair & vega-lite

As it is only required for str, using either value=True/shorthand=False could lead to confusion

alt.when(Origin="Europe").then(1).otherwise(2) doesn't require the keyword
lit would be shorter but probably cause the same issue

You have probably noticed b is longer than c.
I initially thought this was a deal-breaker, but despite the additional length - this is clearly documented and autocomplete-able.
Compared to alt.condition, which does not indicate how an str is special-cased.
I'm quite interested in your opinion on my compromise
Example rewrites
The results will be the same, but just to utilise the new stuff:
# condition with multiple predicates
base.encode(
    color=alt.when(Origin="Europe")
    .then("green", str_as_lit=True)
    .when(Origin="Japan")
    .then("blue", str_as_lit=True)
    .otherwise("red", str_as_lit=True)
)

# condition with multiple predicates using params
alt.Chart(df).mark_bar(fill="#4C78A8", stroke="black", cursor="pointer").encode(
    x="a:N",
    y="b:Q",
    fillOpacity=alt.when(highlight).then(1).otherwise(0.3),
    strokeWidth=alt.when(select).then(2).when(highlight).then(1).otherwise(0),
).configure_scale(bandPaddingInner=0.2).add_params(highlight, select)

Thank you again for giving this a whirl.
I'm hopeful that there's enough to work with here, even if all of it doesn't make it in

Thanks for the explanation. Just documenting my experiences here. I'm intrigued by the str_as_lit, that is an interesting approach.  I think for altair it makes more sense if there was not str_as_lit, but the following items:

str_as_value
str_as_datum
str_as_field

See also https://vega.github.io/vega-lite/docs/condition.html. Maybe the list should be extended with:

str_as_aggregate
str_as_bin
str_as_timeunit
str_as_scale
str_as_legend
str_as_format

And I think it makes sense it returns the output with the behavior similar to str_as_value=True

When I do:
import altair as alt
import pandas as pd

df = pd.DataFrame({'local': ['2018-01-01T00:00:00'],
                   'utc': ['2018-01-01T00:00:00Z']})

alt.Chart(df).transform_calculate(
    compliant="hours(datum.local) != hours(datum.utc) ? true : false",
).mark_text(size=20, baseline='middle').encode(
    text=alt.when('datum.compliant').then('OK', str_as_lit=True).otherwise('not OK', str_as_lit=True),
    color=alt.when('datum.compliant').then('OK', str_as_lit=True).otherwise('not OK', str_as_lit=True)
).properties(width=80, height=50)

It returns an empty chart.

When comparing the output of
alt.when('datum.compliant').then('OK', str_as_lit=True).otherwise('not OK', str_as_lit=True)

{'condition': [{'test': 'datum.compliant', 'field': 'OK'}], 'field': 'not OK'}

with
alt.condition('datum.compliant', alt.value('OK'), alt.value('not OK'))

{'condition': {'test': 'datum.compliant', 'value': 'OK'}, 'value': 'not OK'}

I noticed that the condition is nested within [] for the alt.when(). That is different.

It would be great if the following example would work:
import altair as alt
from vega_datasets import data

cars = data.cars()
brush = alt.selection_interval()

alt.Chart(cars).mark_rect().encode(
    x='Cylinders:N',
    y='Origin:N',
    color=alt.when(brush).then('count()').otherwise('grey')
    #color=alt.condition(brush, if_true='count()', if_false=alt.value('grey'))
).add_params(brush)

This currently gives a SchemaValiditionError and the output of:
alt.when(brush).then('count()').otherwise('grey')

gives:

{'condition': [{'param': 'param_14',
   'aggregate': 'count',
   'type': 'quantitative'}],
 'field': 'grey'}

Almost good already! Its nice to see that count() is translated into a transformation function (aggregate).

This returns a condition with values
alt.when(Origin="Europe").then(1).otherwise(0.3)

{'condition': [{'test': (datum.Origin === 'Europe'), 'value': 1}],
 'value': 0.3}

And this with fields
alt.when(Origin='Europe').then('green').otherwise('red')

{'condition': [{'test': (datum.Origin === 'Europe'), 'field': 'green'}],
 'field': 'red'}

If I don't specify a .otherwise(), I get the following output
alt.when(brush).then('count()')#.otherwise('grey')

<altair.vegalite.v5.api.Then at 0x2c24399d960>

But at the above mentioned VL page on condition it is mentioned that:

Note that if the “else” case value is not specified, default mark color will be applied.

I noticed it work correctly within an alt.Chart() defintion, as in, it doesnt error when .otherwise() is not included.

Edit: maybe easier to have str_as and then a Literal with the allowed options ['value', 'datum', 'field', ...]

@mattijn I really like this! Absolutely wouldn't have thought of it myself.
I'll experiment with the idea and come back with any quirks I find.

And I think it makes sense if it returns the default output with the behavior similar to str_as_value=True

Syntactically, I agree this would be the cleanest.
Something that I've tried to do is maintain the existing semantics from alt.condition by default as seen in https://github.com/dangotbanned/altair/blob/8f66b7a8ec11b9be917d1374edcfaa20dc7de941/tests/vegalite/v5/test_api.py#L318.
So these should both result in the same spec (despite the list in the latter):
import altair as alt

alt.condition(select, "column_1", alt.value("blue"))
alt.when(select).then("column_1").otherwise(alt.value("blue"))

I noticed that the condition is nested within [] for the alt.when(). That is different.

Yeah that hasn't appeared to impact the usage in a chart for the tests I had so far. Also I thought this was expected after your proposal in https://github.com/vega/altair/issues/2759#issue-1501529331

This currently gives a SchemaValiditionError and the output of:
alt.when(brush).then('count()').otherwise('grey')

This again is trying to preserve semantics from alt.condition
So in your example:
import altair as alt
from vega_datasets import data

cars = data.cars()
brush = alt.selection_interval()

alt.Chart(cars).mark_rect().encode(
    x='Cylinders:N',
    y='Origin:N',
	# color=alt.when(brush).then('count()').otherwise('grey')
    color=alt.when(brush).then('count()').otherwise(alt.value('grey'))
    # color=alt.condition(brush, if_true='count()', if_false=alt.value('grey'))
).add_params(brush)

What I'm finding interesting here is the SchemaValidationError itself:
SchemaValidationError: `Color` has no parameter named 'aggregate'

Existing parameter names are:
shorthand      bin         legend   timeUnit
aggregate      condition   scale    title
bandPosition   field       sort     type

See the help for `Color` to read the full description of these parameters

This is strange to me as it was passed:
{'condition': [{'param': 'param_7',
   'aggregate': 'count',
   'type': 'quantitative'}],
 'value': 'grey'}

I'm going to add this one to the tests and try and debug what is going on here, because it clearly recognizes the nested aggregate but being within a list has produced a nonsensical error.

If I don't specify a .otherwise(), I get the following output
But at the above mentioned VL page on condition it is mentioned that:

Note that if the “else” case value is not specified, default mark color will be applied.

Thanks I'm glad this was noticed, see these for context:

https://github.com/dangotbanned/altair/blob/8f66b7a8ec11b9be917d1374edcfaa20dc7de941/altair/utils/core.py#L55
https://github.com/dangotbanned/altair/blob/8f66b7a8ec11b9be917d1374edcfaa20dc7de941/altair/utils/core.py#L837
https://github.com/dangotbanned/altair/blob/8f66b7a8ec11b9be917d1374edcfaa20dc7de941/altair/vegalite/v5/api.py#L779
https://github.com/dangotbanned/altair/blob/8f66b7a8ec11b9be917d1374edcfaa20dc7de941/altair/vegalite/v5/api.py#L862

I would prefer if we could work out a less special-cased integration.
The challenge is these classes aren't part of the schema, but Then needs to be maintained - so have access to its methods.

Also, altair is able to understand that count() is an aggregate transformation function and yearmonthdate() a timeunit transformation function. Does that conflict with the str_as_xx() approach?

I'm not sure I fully understand what you mean.
For reference, the default behaviour of .then(str), .otherwise(str) in https://github.com/dangotbanned/altair/blob/8f66b7a8ec11b9be917d1374edcfaa20dc7de941/altair/vegalite/v5/api.py#L672 simply defers to https://github.com/vega/altair/blob/c0f85cd1d1676f5fcdfda337d4990e24e93a9c39/altair/utils/core.py#L458-L650

@mattijn

Regarding:

Does that conflict with the str_as_xx() approach?

Maybe it is better to explain what I meant with an example:
alt.when(predicate).then('count()', str_as='value')

If the predicate satisfies, will this evaluate to a condition that contains an aggregate or will it evaluate to a condition containing a value?

So I'll follow on from your example with what the intention is with str_as.

class When:
	...
	def then(
        self,
        statement: _StatementOrLiteralType,
        *,
        str_as: Literal["shorthand", "value"] = "shorthand", # This is equivalent to `str_as_lit=False`
        **kwargs: Any,
    ) -> Then[Any]: ...

when = alt.when(predicate)

This is all that is happening when passing the keyword, https://github.com/vega/altair/pull/3427#discussion_r1667443802
when.then("count()", str_as="value") == when.then(alt.value("count()"))

when.then("count()", str_as="shorthand") == when.then(alt.utils.parse_shorthand("count()"))

Thanks for the changes and explanations!
When I try the following example:
import altair as alt
from vega_datasets import data

cars = data.cars()
brush = alt.selection_interval()

alt.Chart(cars).mark_rect().encode(
    x='Cylinders:N',
    y='Origin:N',
    color=alt.when(brush).then('count()').otherwise('grey')
).add_params(brush)

It returns an empty chart

That was a bit confusing for me. After inspecting
alt.when(brush).then('count()').otherwise('grey')

I notices it gives:
{'condition': [{'param': 'param_1', 'value': 'count()'}], 'value': 'grey'}

But after changing it to:
alt.when(brush).then('count()', str_as='shorthand').otherwise('grey')

It returns the correct condition:
{'condition': {'param': 'param_1',
  'aggregate': 'count',
  'type': 'quantitative'},
 'value': 'grey'}

But if the options for str_as are solely ['shorthand', 'value'], then it probably makes more sense to check if the str should very much likely resolve as a shorthand and otherwise treat it as a value? And if a user requires that the str resolves to a value, then the user can just force it using alt.value(). Then there is also no need for the str_as parameter.
I have been experimenting a lot to get an example working with an alt.datum() in the .then() or .otherwise(), but I could not get that to work, not even within the vega editor. Even though I think the docs on condition (link) states that that should be possible. Since this is not working within VL, it also is not necessary to anticipate for this here.
I cannot find an extensive list of examples utilizing a condition, so let me add some more examples here which I tried.
I tried this and it works great
import altair as alt
from vega_datasets import data

cars = data.cars.url

hover = alt.selection_point(on='pointerover', nearest=True, empty=False)

chart = alt.Chart(cars, title='Selection obscured by other points').mark_circle(opacity=1).encode(
    x='Horsepower:Q',
    y='Miles_per_Gallon:Q',
    color=alt.when(hover).then('coral').otherwise('lightgray'),
    size=alt.when(hover).then(300).otherwise(30)
).add_params(
    hover
)

chart | chart.encode(
    order=alt.when(hover).then(1).otherwise(0)
).properties(
    title='Selection brought to front'
)

I tried this and it doesn't work great:
alt.Chart(cars).mark_point().encode(
    x='Horsepower:Q',
    y='Miles_per_Gallon:Q',
    color=alt.when(brush).then('Origin:N').otherwise('lightgray')
).add_params(
    brush
)

From a user perspective, it is clear that 'Origin:N' is meant as a field definition and not as a value. Where in
alt.when(hover).then('coral').otherwise('lightgray'), it is clear that 'coral' is meant as a value definition.

Thanks for getting back to me on this @mattijn, really appreciate you taking the time to try out some examples.

From a user perspective, it is clear that 'Origin:N' is meant as a field definition and not as a value. Where in
alt.when(hover).then('coral').otherwise('lightgray'), it is clear that 'coral' is meant as a value definition.

I do have more to say on this point, and will follow up in another comment discussing potential issues to address.
If you are reading this, you've been to quick for me to finish typing up the next comment 😎

Prev examples using alt.condition
Re-writing the two problematic alt.whens as alt.conditions produces the following:
import altair as alt

brush = alt.selection_interval()
# alt.when(brush).then('count()').otherwise('grey')
>>> alt.condition(brush, "count()", "grey")
ValueError: A field cannot be used for both the `if_true` and `if_false` values of a condition. One of them has to specify a `value` or `datum` definition.

# alt.when(brush).then('Origin:N').otherwise('lightgray')
>>> alt.condition(brush, "Origin:N", "grey")
ValueError: A field cannot be used for both the `if_true` and `if_false` values of a condition. One of them has to specify a `value` or `datum` definition.

So from the user's perspective, alt.when fails silently. I don't see this as a positive UX.
However, I don't think the error or docstring for alt.condition clearly illustrates the issue either.
Nowhere was the term field specified until the error, and an identical error is presented when changing the definition to:
>>> alt.condition(brush, "coral", "lightgrey")
ValueError: A field cannot be used for both the `if_true` and `if_false` values of a condition. One of them has to specify a `value` or `datum` definition.

Related, but not the same issue, trying this example:
# alt.when(hover).then(300).otherwise(30)
>>> alt.condition(brush, 300, 30)
TypeError: 'int' object is not iterable

For all of these examples, alt.when can accept the inputs - albeit sometimes requiring the documented str_as="shorthand", whereas alt.condition will not and IMO is less intuitive in hinting towards how to resolve the error.

Its quite difficult to have auto inference of strings to either a field, aggregate, value or datum. Maybe we have been too ambitious on this aspect? A potential way out is to start with the explicit variant within the alt.when().then().otherwise() and continue from there to see if an implicit variant also can be included?

@mattijn

Here I use an alt.value('coral'), alt.datum('foo') and count() for the x or color encoding channel.
If we like to have a clever implicit variant, that knows what this is:
brush = alt.selection_interval()
alt.when(brush).then('count()').otherwise('coral')
alt.when(brush).then('count()').otherwise(300)

Will that also mean one should expect this to work?:
tick_value = alt.Chart(df).mark_bar().encode(color='coral', y=alt.Y('a:N'))
tick_datum = alt.Chart(df).mark_bar().encode(x='foo', y=alt.Y('a:N'))
tick_agg = alt.Chart(df).mark_bar().encode(x='count()', y=alt.Y('a:N'))
tick_value | tick_datum | tick_agg

Yeah this was the issue I was thinking of when writing

To me though, it seems this could be unreliable and be introducing deviating behaviour from what user's may expect from a shorthand string

I guess my main concern is introducing some new inference logic that applies only in certain places - unless this has a strong reason for doing so.
I still think the change in default mentioned in https://github.com/vega/altair/pull/3427#issuecomment-2212473301 qualifies as this, but I'm not happy about the silent passthrough you discovered in https://github.com/vega/altair/pull/3427#issuecomment-2227448475 that I didn't account for in testing

@binste @joelostblom @jonmmease
Do you guys have any thoughts/opinions on the discussions here?

I'm not sure if you can be certain that a non-str is a value and not a datum.
Example without using a condition
point = alt.Chart(df).mark_point(filled=True, size=150, cursor='pointer').encode(x='a', y='a')
rule = alt.Chart().mark_rule(strokeDash=[12, 6], size=4).encode(
    x=alt.datum(0.5)
)
point + rule

And now I like to add a condition that changes the location of the x-rule based on when I select a certain point. So I add an alt.condition(select, alt.datum(0.5), alt.datum(1.5)) as such:
select = alt.selection_point()

point = alt.Chart(df).mark_point(filled=True, size=150, cursor='pointer').encode(x='a', y='a')
rule = alt.Chart().mark_rule(strokeDash=[12, 6], size=4).encode(
    x=alt.condition(select, alt.datum(0.5), alt.datum(1.5))
    # x=alt.when(select).then(0.5).otherwise(1.5)
)
(point + rule).add_params(select)

It currently errors in Altair, probably due to errors in VL I think.
But if I simplify this example a bit more in Vega-Lite there is a warning in the editor and the predicate is always false, but the x-rule is present at "datum": 1.5: (Open the Chart in the Vega Editor)
{
  "$schema": "https://vega.github.io/schema/vega-lite/v5.17.0.json",
  "layer": [
    {
      "params": [
        {"name": "CHANGE_RULE_ON_SELECT", "select": {"type": "point"}}
      ],
      "data": {"values": [{"a": 1}, {"a": 1}, {"a": 2}]},
      "mark": {
        "type": "point",
        "filled": true,
        "cursor": "pointer",
        "size": 150
      },
      "encoding": {
        "x": {"field": "a", "type": "quantitative"},
        "y": {"field": "a", "type": "quantitative"}
      },
      "name": "LAYER_VIEW"
    },
    {
      "data": {"values": [{"a": 1}, {"a": 1}, {"a": 2}]},
      "mark": {"type": "rule", "size": 4, "strokeDash": [12, 6]},
      "encoding": {
        "x": {
          "condition": {"param": "CHANGE_RULE_ON_SELECT", "datum": 0.5},
          "datum": 1.5
        }
      }
    }
  ]
}

(I wish there was a predicate viewer in the editor, where I can test and evaluate predicates).
So in this case, when treating non-str as values would have been wrong within x=alt.when(select).then(0.5).otherwise(1.5).
Other thoughts are much welcome here!

Completely agree that that error is not helpful at all! Maybe that could be improved?
Your suggestion helped figuring out an example that doesn't error. Not sure if it actually makes sense, but it does something and has an alt.datum() in the if_true argument (would be alt.then()).
import altair as alt
import polars as pl

select = alt.selection_point(empty=False)

df = pl.DataFrame({'a': [1, 1, 2]})
point = alt.Chart(df).mark_point(filled=True, size=150, cursor='pointer').encode(x='a', y='a')
rule = alt.Chart(df).mark_rule(strokeDash=[12, 6], size=4).encode(
    x='a',
    color=alt.condition(select, alt.datum(2), alt.value("1.5"))
    #color=alt.when(select).then(2).otherwise("1.5")
)

(point + rule).add_params(select)

See https://altair-viz.github.io/gallery/line_chart_with_datum.html and https://altair-viz.github.io/gallery/line_chart_with_color_datum.html for usage of datum (examples are without conditions)

Do you guys have any thoughts/opinions on the discussions here?

Hi @dangotbanned, I haven't dug into this PR, but I do appreciate your work on it!  I'll defer to @mattijn on the API decisions here

I echo what John wrote above. My general thoughts on the API are still captured in https://github.com/vega/altair/issues/2759#issuecomment-2139018131, and I'm a bit short of time at the moment to dive into the specifics that you and Mattijn have uncovered. From my side, I'm ok if the first implementation is explicit with datum and value, if finding a solution to the string inference is deemed to time-consuming/ambiguous.

My suggestion would be to keep this PR to solely introducing the explicit input variants for alt.when().then().otherwise() methods, where this approach support chaining as such; alt.when().then().when().then().otherwise() or to use Altair defaults instead of the .otherwise(), by just leaving it out, like alt.when().then(). This is all great and awesome and deserves some more superlatives. Thanks for all the work here @dangotbanned!

or to use Altair defaults instead of the .otherwise(), by just leaving it out, like alt.when().then()

I didn't realize this was possible, how convenient!

My suggestion would be to keep this PR to solely introducing the explicit input variants for alt.when().then().otherwise() methods, where this approach support chaining as such; alt.when().then().when().then().otherwise() or to use Altair defaults instead of the .otherwise(), by just leaving it out, like alt.when().then(). This is all great and awesome and deserves some more superlatives. Thanks for all the work here @dangotbanned!

Thank you @mattijn and @joelostblom, @jonmmease for the feedback.
No qualms from me, having explicit input for .then(), .otherwise() is definitely the simplest option - and the changes I'd need to make should be easy enough to do tomorrow.

There have been some other points I raised (unrelated to most of what we've discussed) that may be good to resolve in the meantime.
Most of these relate to documentation, so they might be more approachable/easier to weigh in on:

https://github.com/vega/altair/pull/3427#discussion_r1668638763
https://github.com/vega/altair/pull/3427#discussion_r1623389174
https://github.com/vega/altair/pull/3427#discussion_r1659965947
https://github.com/vega/altair/pull/3427#discussion_r1662514935
https://github.com/vega/altair/pull/3427#discussion_r1642900469

@mattijn I've just finished scoping out what I anticipate are the requested changes.
I wanted to do this ahead of time to ensure I've understood correctly.
Also I think it will make the next review easier than studying the diff alone.
If this all sounds right to you, a simple 👍 is all I need, .otherwise() please follow this up with any corrections/alternatives/etc.

Core Changes
Removing str_as
Always assumed that str is shorthand, defering statement to https://github.com/vega/altair/blob/f8c9776a72afa433f3e6b311bdaf5133d38f127b/altair/utils/core.py#L492-L493
Drop support for these statement inputs to .then(), .otherwise()

NoLongerSupported: TypeAlias = bool | float | int | Sequence[str | bool | float | int]

For both

Removing related @overloads
Removing helper functions, that are now unused
Removing any TypeAlias definitions, that are now unused
Updating/removing tests
Updating docs
Updating error messages, which refer to these features

Impact on examples
Current (as of 0f862ad (#3427)) is commented out vs next
https://github.com/vega/altair/pull/3427#issuecomment-2227448475
import altair as alt
from vega_datasets import data

cars = data.cars()
brush = alt.selection_interval()
hover = alt.selection_point(on="pointerover", nearest=True, empty=False)

# color_1 = alt.when(brush).then('count()', str_as='shorthand').otherwise('grey')
color_1 = alt.when(brush).then("count()").otherwise(alt.value("grey"))

chart_1 = (
    alt.Chart(cars)
    .mark_rect()
    .encode(x="Cylinders:N", y="Origin:N", color=color_1)
    .add_params(brush)
)

# --------

# color_2 = alt.when(hover).then("coral").otherwise("lightgray")
color_2 = alt.when(hover).then(alt.value("coral")).otherwise(alt.value("lightgray"))

# size = alt.when(hover).then(300).otherwise(30)
size = alt.when(hover).then(alt.value(300)).otherwise(alt.value(30))

# order = alt.when(hover).then(1).otherwise(0)
order = alt.when(hover).then(alt.value(1)).otherwise(alt.value(0))

chart_2 = (
    alt.Chart(cars, title="Selection obscured by other points")
    .mark_circle(opacity=1)
    .encode(x="Horsepower:Q", y="Miles_per_Gallon:Q", color=color_2, size=size)
    .add_params(hover)
)

chart_2 | chart_2.encode(order=order).properties(title="Selection brought to front")

#3301
import altair as alt

select = alt.selection_point(name="select", on="click")
highlight = alt.selection_point(name="highlight", on="pointerover")

# fill_opacity = alt.when(select).then(1).otherwise(0.3)
fill_opacity = alt.when(select).then(alt.value(1)).otherwise(alt.value(0.3))

# stroke_width = (
#     alt.when(select)
#     .then(2, empty=False)
#     .when(highlight)
#     .then(1, empty=False)
#     .otherwise(0)
# )
stroke_width = (
	alt.when(select)
    .then(alt.value(2, empty=False))
    .when(highlight)
    .then(alt.value(1, empty=False))
	.otherwise(alt.value(0))
)
data = ...
chart = (
    alt.Chart(data)
    .mark_bar(fill="#4C78A8", stroke="black", cursor="pointer")
    .encode(x="a:O", y="b:Q", fillOpacity=fill_opacity, strokeWidth=actual_stroke)
    .configure_scale(bandPaddingInner=0.2)
    .add_params(select, highlight)
)

👍😊

👍😊

@mattijn All of https://github.com/vega/altair/pull/3427#issuecomment-2236376458 is finished and ready for review.
Did a little bit of tidying up as well.
If you'd like to defer the docs part to another PR, I'd be happy with merging as-is.

Thanks! Looks great! A few question for clarifications.
I was confused about these two new tests:
    when_constraint = alt.when(Origin="Europe")
    when_constraints = alt.when(
        Name="Name_1", Color="Green", Age=25, StartDate="2000-10-01"
    )
    expected_constraint = alt.datum.Origin == "Europe"
    expected_constraints = (
        (alt.datum.Name == "Name_1")
        & (alt.datum.Color == "Green")
        & (alt.datum.Age == 25)
        & (alt.datum.StartDate == "2000-10-01")
    )

This is syntax I have not seen before. I noticed this is mentioned in the polars docs, that mentions this:
    constraints
        Apply conditions as `col_name = value` keyword arguments that are treated as
        equality matches, such as `x = 123`. As with the predicates parameter, multiple
        conditions are implicitly combined using `&`.

And
    Pass conditions as keyword arguments:

    >>> df.with_columns(val=pl.when(foo=4, bar=0).then(99).otherwise(-1))
    shape: (3, 3)
    ┌─────┬─────┬─────┐
    │ foo ┆ bar ┆ val │
    │ --- ┆ --- ┆ --- │
    │ i64 ┆ i64 ┆ i32 │
    ╞═════╪═════╪═════╡
    │ 1   ┆ 3   ┆ -1  │
    │ 3   ┆ 4   ┆ -1  │
    │ 4   ┆ 0   ┆ 99  │
    └─────┴─────┴─────┘

Do you know where this type of syntax comes from? Is it unique for polars or also used elsewhere?
This only functions with a single = operator? Ie. a predicate like foo<4 is not supported? And what about alt.when('my column has spaces'=4)

Thanks! Looks great! A few question for clarifications.
I was confused about these two new tests:
    when_constraint = alt.when(Origin="Europe")
    when_constraints = alt.when(
        Name="Name_1", Color="Green", Age=25, StartDate="2000-10-01"
    )
    expected_constraint = alt.datum.Origin == "Europe"
    expected_constraints = (
        (alt.datum.Name == "Name_1")
        & (alt.datum.Color == "Green")
        & (alt.datum.Age == 25)
        & (alt.datum.StartDate == "2000-10-01")
    )

This is syntax I have not seen before. I noticed this is mentioned in the polars docs, that mentions this:
    constraints
        Apply conditions as `col_name = value` keyword arguments that are treated as
        equality matches, such as `x = 123`. As with the predicates parameter, multiple
        conditions are implicitly combined using `&`.

And
    Pass conditions as keyword arguments:

    >>> df.with_columns(val=pl.when(foo=4, bar=0).then(99).otherwise(-1))
    shape: (3, 3)
    ┌─────┬─────┬─────┐
    │ foo ┆ bar ┆ val │
    │ --- ┆ --- ┆ --- │
    │ i64 ┆ i64 ┆ i32 │
    ╞═════╪═════╪═════╡
    │ 1   ┆ 3   ┆ -1  │
    │ 3   ┆ 4   ┆ -1  │
    │ 4   ┆ 0   ┆ 99  │
    └─────┴─────┴─────┘

Do you know where this type of syntax comes from? Is it unique for polars or also used elsewhere?
This only functions with a single = operator? Ie. a predicate like foo<4 is not supported? And what about alt.when('my column has spaces'=4)

@mattijn I'm confused also but for a different reason.
This has been in here for a while and it is described with an example in the doc for alt.when https://github.com/vega/altair/blob/87cd9bd1d4d7c9de192f83ef68da8235cfb2cb95/altair/vegalite/v5/api.py#L1035
It utilises **kwargs, so you can technically do it for columns with spaces like this:
alt.when(**{'my column has spaces':4})

I would maybe note this in the User Guide as an option, but I'd probably lean on a different feature for those cases.
Apologies, I'm doing this from my phone - but I'm pretty sure one of the later tests has this syntax of unpacking.
I'll update this tomorrow with a more complete response, but appreciate you checking this out so quickly

Great, this docstring you refer to is very clear. Thanks for linking.
It would be great if we can extend the documentation as well in a follow up PR on this new feature's scope to manage user expectations.
Maybe without realizing, but there have been many new things in this PR! Thanks for all these efforts.
I'm approving, but please comment when you think this PR can be merged!

Great, this docstring you refer to is very clear. Thanks for linking.
It would be great if we can extend the documentation as well in a follow up PR on this new feature's scope to manage user expectations.
Maybe without realizing, but there have been many new things in this PR! Thanks for all these efforts.
I'm approving, but please comment when you think this PR can be merged!

@mattijn thank you, I'm ready for merging
Will absolutely be following up with another PR w/ more docs, especially examples on the methods (not just alt.when)

Thank you @dangotbanned!


Fix Swift parameters

Swift parameter markup has a colon (“:”) after the parameter name. If
the alignArgumentComments setting is true, then the colon will be
present, but if it is false it won’t. The fix is simply to append a
colon after the name for Swift comments.
Fixes issue #217

Good catch! Thanks for it!


Warning: constant ::Fixnum is deprecated (ruby 2.4.0)

I'm upgrading an app to ruby 2.4.0 and noticed this warning, so I thought I'd report it here (although it's not blocking at this point) :
/Users/thbar/.rvm/gems/ruby-2.4.0/gems/awesome_print-1.7.0/lib/awesome_print/formatters/base_formatter.rb:31: warning: constant ::Fixnum is deprecated

Related:

http://blog.bigbinary.com/2016/11/18/ruby-2-4-unifies-fixnum-and-bignum-into-integer.html
https://www.ruby-lang.org/en/news/2016/12/25/ruby-2-4-0-released/

@thbar Thanks for that :)

Merged that change, there are still some references to fixnum which should probably be updated though. Will update here when I've pushed a new release to Rubygems.

Workaround: http://stackoverflow.com/a/42336144/3391915
export RUBYOPT="-W0"

How long before a release is going to be cut? I'm also experiencing this deprecation warning on 2.4.0. I'm trying to figure out if I should just point to master in my gemfile or wait for a release. Thanks in advance for your time.

Same question here. Before getting into the workaround, is there a fix coming soon? Thanks for the help

Looks like this is fixed in master, maybe we can cut a new version soonish? :)

It's be nice to cut a release soon, though I don't know if you want to tackle any of the issues in the v2 milestone, or perhaps instead a 1.8 release?

Since this update has been ready for a while, I recommend a 1.x release.

It will be nice to have 1.8.0 or 1.7.1 sooner.

Since this update has been ready for a while, I recommend a 1.x release.

Here I have 1.7.0 and it is buggy also. The command gem install does not update.

Q: what's status on this?

so sorry -- life has been one project after another. Well, a year between releases can't be bad for a simple stable gem ;)
Here's to 1.8.0 ! :beers: 👍 💯

@imajes don't apologise, you owe use nothing :-) Thanks for the release!

I had the same error and I've just added the following in my gem file and it worked:
gem 'selenium-webdriver'
gem 'chromedriver-helper'
Hope that helps!


Callout for DKE Incompatibility with SCC DLP Policies

Can we confirm and note that DKE is incompatible with DLP Policies? It states some examples, but doesn't list DLP - which is common. If DKE is enabled for a Sensitivity Label, this does not allow you to configure DLP to trigger on the condition of Sensitivity Labels.

Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

ID: 484b1a6d-dfd0-1da6-5405-7826ed4c088f
Version Independent ID: 6e0ba9d2-aaa6-528a-daab-0e75c80f7135
Content: Double Key Encryption (DKE) - Microsoft 365 Compliance
Content Source: microsoft-365/compliance/double-key-encryption.md
Service: information-protection
GitHub Login: @KCCross
Microsoft Alias: krowley

@KCCross Please help us in resolving this issue. Thanks

@SeanTGeoghegan Thanks for your feedback! New issues and pull requests for this content are closed while we update this content to support upcoming feature improvements.


Unrealistic amounts of RAM required for training

Hello,
I'm trying to train on a dataset with thousands of .wav files that are about 4 minutes long, but I run out of RAM with anything larger than 75 files with 16GB of RAM:
Traceback (most recent call last):
  File "train.py", line 98, in <module>
    hop_length=args.hop_length)
  File "C:\vocal-remover\lib\dataset.py", line 33, in create_dataset
    (len_dataset, 2, hop_length, cropsize), dtype=np.float32)
MemoryError

So theorically I would still run out of RAM even if I had 128GB and tried to train on more than 600 files (128 / 16 = 8 , 8 * 75 = 600) , I'm trying to achieve similar results to http://krisp.ai , but that needs thousands of files, not just a few hundred.
Is it possible to increase the number of files or make the training scalable? (ie. split it on 75 files chunks and resume training on the next chunk automatically)

Yeah, it is possible to make the training scalable by dynamic data loading.
However, since I'm busy recently, I think it will take some time to implement it. Sorry for your inconvenience.
FYI, the pre-trained model on this repository was trained with 174 files with 32GB of RAM.


Create folders and sub folders

Could you add an option to create automatically folders and subfolders? I mean, download a course into a folder with its name and every video into a folder with the chapther's name.
Your tool it's amazing. It's the best.
Thanks in advice.

Great suggestion. I will work on it


cluster and endpoint liveness probe mechanism

What would you like to be added:
Pixiu sends request to endpoint in cluster regardless of endpoint actually status. Pixiu needs endpoint liveness probe mechanism to avoid sending request to unhealth endpoint
Why is this needed:

#437


compilation fails with 'error: "glXSwapIntervalEXT' was not declared in this scope"

Hey, guys
I am getting a compile error, it looks like a missing dependency.. I am running GLEW 1.13.0, glut <IP_ADDRESS> and glu 9.x.
Operating system or device - Godot version:
Linux 4.4.6-gentoo x86_64 Intel(R) Core(TM) i5-3230M CPU @ 2.60GHz GenuineIntel GNU/Linux
Issue description (what happened, and what was expected):
compilation fails
Steps to reproduce:
$ scons platform=x11
...
error
$ scons platform=x11
scons: Reading SConscript files ...
Enabling ALSA
Enabling PulseAudio
('translations: ', ['/home/madjestic/Projects/godot/tools/translations/ru.po', '/home/madjestic/Projects/godot/tools/translations/zh_HK.po', '/home/madjestic/Projects/godot/tools/translations/pt_BR.po', '/home/madjestic/Projects/godot/tools/translations/ko.po', '/home/madjestic/Projects/godot/tools/translations/it.po', '/home/madjestic/Projects/godot/tools/translations/de.po', '/home/madjestic/Projects/godot/tools/translations/fr.po', '/home/madjestic/Projects/godot/tools/translations/zh_CN.po'])
('fonts: ', ['/home/madjestic/Projects/godot/tools/editor_fonts/DroidSansThai.ttf', '/home/madjestic/Projects/godot/tools/editor_fonts/DroidSans.ttf', '/home/madjestic/Projects/godot/tools/editor_fonts/DroidSansArabic.ttf', '/home/madjestic/Projects/godot/tools/editor_fonts/DroidSansHebrew.ttf', '/home/madjestic/Projects/godot/tools/editor_fonts/DroidSansJapanese.ttf', '/home/madjestic/Projects/godot/tools/editor_fonts/DroidSansFallback.ttf', ['/home/madjestic/Projects/godot/tools/editor_fonts/source_code_pro.otf']])
scons: done reading SConscript files.
scons: Building targets ...
g++ -o platform/x11/context_gl_x11.x11.tools.64.o -c -g2 -Wall -DDEBUG_ENABLED -DDEBUG_MEMORY_ENABLED -DFREETYPE_ENABLED -DOC_X86_ASM -DDEBUG_MEMORY_ALLOC -DSCI_NAMESPACE -DOPENGL_ENABLED -DGLEW_ENABLED -DALSA_ENABLED -DJOYDEV_ENABLED -DPULSEAUDIO_ENABLED -DX11_ENABLED -DUNIX_ENABLED -DGLES2_ENABLED -DGLES_OVER_GL -DMUSEPACK_ENABLED -DSQUISH_ENABLED -DVORBIS_ENABLED -DOPUS_ENABLED -DTHEORA_ENABLED -DTHEORALIB_ENABLED -DPNG_ENABLED -DDDS_ENABLED -DPVR_ENABLED -DJPG_ENABLED -DWEBP_ENABLED -DSPEEX_ENABLED -DTOOLS_ENABLED -DGDSCRIPT_ENABLED -DMINIZIP_ENABLED -DXML_ENABLED -DETC1_ENABLED -D_REENTRANT -Icore -Icore/math -Itools -Idrivers -I. -Iplatform/x11 -I/usr/include/freetype2 platform/x11/context_gl_x11.cpp
platform/x11/context_gl_x11.cpp: In member function 'virtual void ContextGL_X11::set_use_vsync(bool)':
platform/x11/context_gl_x11.cpp:181:53: error: 'glXSwapIntervalEXT' was not declared in this scope
  glXSwapIntervalEXT(x11_display, drawable, p_use?1:0);
                                                     ^
scons: *** [platform/x11/context_gl_x11.x11.tools.64.o] Error 1
scons: building terminated because of errors.

According to commit 2420e46b449f4c8acdfe48c765ea52fc3e860de7 it was expected to not work. Travis failed too: https://travis-ci.org/godotengine/godot/jobs/135472746
It seems @punto- is looking to this right now though.

GLX instead of glX fixed this problem for me.

I get no difference with GLX, defining GLX_GLXEXT_PROTOTYPES provides the
prototype for the function, but it doesn't link, I think glew has to fetch
the extension, but I don't know how to request that
On 5 June 2016 at 21:25, suptoasty<EMAIL_ADDRESS>wrote:

GLX instead of glX fixed this problem for me.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/godotengine/godot/issues/5060#issuecomment-223847231,
or mute the thread
https://github.com/notifications/unsubscribe/AGVmPdWiGtkCfHo2w71BogCfjHy0LfQoks5qI2j_gaJpZM4Iueex
.

Fixed by #5067.


No train.py file

In order to run, just run: python train.py on your command line
Can you please add train.py file?

Pretrain with pretrain_IJEPA.py and finetune wiht finetune_IJEPA.py.


Multi-Headed Attention colab error link to Transformer

https://nn.labml.ai/transformers/mha.html
This link doesn't go to MHA code, but goes to Transformer code.

Sorry didn't understand what you mean't.


hi can someone help me i want to ask questions in github but iam lost

Thanks for looking to open an issue for this project.
If you are opening an issue to suggest adding a new entry, please consider opening a pull request instead!

?


helpp needed

i cant install super minions plugin
tells me it doesnt exist

SuperMinions (Case Sensitive)

@Yamanourani Go to console and type plugin istall super minions

@GhostShot3 it is SuperMinions not super-minions nor Super-Minions

@LegitSoulja thx .


Reversing Arrays in 2.4.1.

A failing spec:
require "spec_helper"

class Account
  include Mongoid::Document

  field :names, type: Array
  attr_accessible :names
end

describe Account do
  describe "an array field" do
    context "when there are two elements" do
      let(:names) { %w(Bob Sally) }
      let!(:account) { Account.create!(:names => names) }

      describe "reversing the elements" do
        before do
          account.names = names.reverse
          account.save!
          account.reload
        end

        it "should roundtrip the reversed elements" do
          account.names.should == names.reverse
        end
      end
    end
  end
end

The failure:
$ rspec spec/models/widget_spec.rb
F

Failures:

  1) Account an array field when there are two elements reversing the elements should roundtrip the reversed elements
     Failure/Error: account.names.should == names.reverse
       expected: ["Sally", "Bob"]
            got: ["Bob", "Sally"] (using ==)
       Diff:
       @@ -1,2 +1,2 @@
       -["Sally", "Bob"]
       +["Bob", "Sally"]
     # ./spec/models/widget_spec.rb:24:in `block (5 levels) in <top (required)>'

Finished in 1.36 seconds
1 example, 1 failure

Failed examples:

rspec ./spec/models/widget_spec.rb:23 # Account an array field when there are two elements reversing the elements should roundtrip the reversed elements

Gemfile:
source 'http://rubygems.org'

gem 'rails', '3.1.3'
gem 'mongoid', '2.4.1'
gem 'bson_ext'
gem 'rspec-rails'
gem 'database_cleaner'

With ruby-1.9.3-p0.

Ah yeah, this is probably the last one I think around these.

For the time being, is there a known workaround?

Can you get away with using Model#set instead of the assign and save? I'll have this fixed today on the 2.4.0-stable branch as well.


Style Sheets break Integrity "AssetCompiler.js"

Current behaviour
Setting integrity to true (or auto in production mode), causes the following error to occur if you reference .css or .scss files, whether it is from a .ejs or a .js file:
[webpack-cli] Error: TypeError: Cannot read properties of undefined (reading 'source')
    at Plugin.done (C:\Users\steff\Desktop\html-bundler-webpack-plugin-bug-examples\node_modules\html-bundler-webpack-plugin\src\Plugin\AssetCompiler.js:1224:13)
    at Hook.eval [as callAsync] (eval at create (C:\Users\steff\Desktop\html-bundler-webpack-plugin-bug-examples\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:9:1)
    at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (C:\Users\steff\Desktop\html-bundler-webpack-plugin-bug-examples\node_modules\tapable\lib\Hook.js:18:14)
    at C:\Users\steff\Desktop\html-bundler-webpack-plugin-bug-examples\node_modules\webpack\lib\Compiler.js:498:23
    at Compiler.emitRecords (C:\Users\steff\Desktop\html-bundler-webpack-plugin-bug-examples\node_modules\webpack\lib\Compiler.js:919:5)
    at C:\Users\steff\Desktop\html-bundler-webpack-plugin-bug-examples\node_modules\webpack\lib\Compiler.js:490:11
    at C:\Users\steff\Desktop\html-bundler-webpack-plugin-bug-examples\node_modules\webpack\lib\Compiler.js:885:14
    at Hook.eval [as callAsync] (eval at create (C:\Users\steff\Desktop\html-bundler-webpack-plugin-bug-examples\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:24:1)
    at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (C:\Users\steff\Desktop\html-bundler-webpack-plugin-bug-examples\node_modules\tapable\lib\Hook.js:18:14)
    at C:\Users\steff\Desktop\html-bundler-webpack-plugin-bug-examples\node_modules\webpack\lib\Compiler.js:882:27

Expected behaviour
Integrity should work for css/scss files.
Reproduction Example
https://github.com/SteffenBlake/html-bundler-webpack-plugin-bug-examples/blob/29131635a37f9be1bd0e9187734d609d3178da99/webpack.config.js#L24
If you enable integrity and execute npm run build the error is produced.
If you delete this line, the error no longer will be produced and output will occur:
https://github.com/SteffenBlake/html-bundler-webpack-plugin-bug-examples/blob/29131635a37f9be1bd0e9187734d609d3178da99/src/views/home.ejs#L3
Environment

OS: Windows
version of Node.js: v21.1.0
version of Webpack: 5.89.0
version of the Plugin: 2.15.0

Hello @SteffenBlake,
thanks for the issue report.
Yes, I can reproduce the bug.
Workaround
Try to remove the output.publicPath option or set as auto or as the empty string:

publicPath: 'auto'
publicPath: ''

This is a bug, I will fix it for the use case publicPath: '/'.

The bug is fixed with v2.15.1.
Please check it. Maybe it fixes the #43 too.

Confirmed resolved in 2.15.1, thanks for the fix!


[Security] fix tests that failed on ARM64

Description
For some reason, message returned in the security plugins tests
differ from architectures. On x64 it will return as valid JSON
but on ARM64 it will be an object. The closest attempt to keeping
the message check was by stringifying them but on ARM64 it would
add the double quote.
So it fails to parse we can just ensure the resp code is correct.
Also switch to visible to not exist seems like we define this across
the repo as well.
Signed-off-by: Kawika Avilla<EMAIL_ADDRESS>Issues Resolved
n/a
Check List

[x] Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Previous PR I closed due but I rebased so I have to re-open. Will copy the contents.

143 was x64 security tests without this change (and some tests skipped),
144 was arm64 security tests  without this change (and some tests skipped).
145 was x64 security tests with this change (and no tests skipped),
146 was arm64  security tests with this change (and no tests skipped).

Created a cleanup task for restoring this: https://github.com/opensearch-project/opensearch-dashboards-functional-test/issues/163

Created a cleanup task for restoring this: #163

We can tune it once https://github.com/opensearch-project/opensearch-dashboards-functional-test/pull/136 is merged.


RequirementMachine: Enable -requirement-machine-abstract-signatures=verify by default

If this needs to be reverted, it is sufficient to revert the final commit. The other commits should still pass tests with that one reverted.

@swift-ci Please test source compatibility

@AnthonyLatsis turning off getMinimalCanonicalType() for protocol compositions here is just temporary -- @CodaFi is working on the new representation for opened existential archetypes as we speak, which includes the outer generic signature and corrects the issue with compositions like P & C<T> that you encountered here.

@swift-ci Please test source compatibility

@swift-ci Please test source compatibility

@swift-ci Please smoke test

@swift-ci Please smoke test

@hamishknight Enabling this flag by default and removing it from the stdlib cmake configuration will also address rdar://problem/89805970.

@swift-ci Please smoke test

@swift-ci Please smoke test

@swift-ci Please test source compatibility


fix: fix-snyk-vul

Snyk.io was complaining about the use of  math.rand.Intn to generate the password and recommend we switch to crypto/rand.
Ref: https://app.snyk.io/org/application-services-red-hat-trusted-artifact-signer/project/7226cc76-b503-4925-b193-c8cc5459f3de

/override ci/prow/tas-operator-e2e


Fix macOS build by freeing up disk space on the runner

Unity version of this PR:
https://github.com/CesiumGS/cesium-unreal/pull/1510

Merging this to fix main.


Add travis-ci setting

Hi, would you add Travis-CI setting?
I have a question. I exec npm test, but this command does not show the test result. How to test tcomb-form?
$ npm test

><EMAIL_ADDRESS>test /Users/sane/work/js-study/tcomb-form
> echo "Compiling tests. Once finished open ./test/index.html in your browser..." && watchify -t [babelify --stage 0 --loose] test/index.js -o test/browser.js  -v -x react

Compiling tests. Once finished open ./test/index.html in your browser...
296858 bytes written to test/browser.js (5.32 seconds)

Hi!
thanks for the PR. Tests was pseudo-manuals.
I just added a karma config, now you should see the result in the console.
(it's first time I use karma+travis, hope everything's ok)

Great!


query ST_Intersects from 2 different tables

Hi, does anyone know how to execute a query like this??? is it possible??? Cheers
select a.entidad,a.seccion,array_to_string(array_agg(b.sett_name),',') as colonias from table_1 as a,table_2 as b WHERE a.seccion = 1600 AND a.entidad = 28 AND ST_Intersects(a.geom,b.geom) group by a.entidad,a.seccion

If probably try creating a view containing this logic.  Then you can query the view?
Ryan

On Jun 18, 2016, at 8:48 AM, DanielShinken<EMAIL_ADDRESS>wrote:
Hi, does anyone know how to execute a query like this??? is it possible??? Cheers
select a.entidad,a.seccion,array_to_string(array_agg(b.sett_name),',') as colonias from table_1 as a,table_2 as b WHERE a.seccion = 1600 AND a.entidad = 28 AND ST_Intersects(a.geom,b.geom) group by a.entidad,a.seccion
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.


PoS - validator set update, skip unchanged inactive validators

Depends on #438.
For validator set update, we need to iterate all the active validators (at least those, whose voting power has changed, but the active set size is bound by the max_validator_slots parameter), but for inactive ones, we only need to know the ones that were active in the previous epoch (i.e. validators that became inactive in this epoch). This issue has a TODO left in code.

fixed in #532 (merged manually in master)


[DNM] Explorer integration

removed Historical Transactions
added Transaction History button (takes you to user's tx history on explorer
removed Liquidity (explorer shows this now)
added Explorer button (kinda redundant)
Split the interface into two columns, one with Active Transactions, one with the sending interface

on mobile, they go vertical arrangement, and active txs is at the top

no longer using a table to display tx info, instead just use these card components. looks a bit basic, could be cleaned up, but imo is a bit more readable than that table

Left TODO:

[x] split up fees and impact
[ ] newly added buttons get scrunched up weird on mobile: should use a hamburger menu, possibly a second bar (footer)?
[ ] have ActiveTransactions be drawer that pops out
[ ] fix ActiveTransactions and Crosschain Swap placement

[x] former on right, latter on left on desktop
[ ] Use flexbox to have ActiveTransactions be at the top on mobile

[ ] handle receiving amount being incorrect; should come from the bid?

from Max:

It works later in the process as you see when "Sign to claim" is shown. I think tx.txData.receiving.amount  is not filled in the beginning. You need to parse the bid to add the information.

[ ] Add some horizontal space between the header buttons on mobile
[ ] on mobile there is some strange padding/margin on the right side
[ ] set a width limit on the form (again) and give more space for the active transactions

leaving the request for UI hamburger Menu on mobile interface to lifi team!


skin changer does not start in the game

the program repeats "injected succesfully"

This is because the cheat crashes the game without hooking it up.

Make sure you are not using the Chinese version of the Cheat on the Riot Games Servers.
Make sure to start the game in DX9 Mode on the Chinese Server.

If it constantly injects on the loading screen and stops when the game starts, there may be another reason.

i play on eune and i use normal version :/

Finally, install the latest C++ Run time libraries and try it.
Microsoft Visual C++ Redistributable
if it still doesn't work i can't fix the problem from here please debug.

now it works, thanks a lot

when i open the app it says on the r3znskin injector status
not injected even if i have pasted the rar on lol file


Scratch 2 doesn't include English as a language option

Reported by a user:

In Scratch, you can use the globe icon in the upper-left corner to set your desired interface language. But English isn't in the drop-down. So, if you set it to something else (being, naturally, a teen poking around and making trouble), there's no way to set it back to English short of clearing cookies.

Fixed in the code now. It'll get pushed into the live site with the next deployment - hopefully later today.


Empty result file

We have 15 EC2 instances in the same region i deplyoed the CF stack. The before336hour-with60min.csv file shows many entries but the results file is completly empty. i checked the cloudwatch logfiles, but i couldnt find any errors.

Hey. Did you solve the problem? I have the same

Hi @marcschroeter,
I've got the same problem did you found a solution since?

Is there a specific scenario that you share  to replicate the scenario as the retest in us-east-1 region had the results_rightsizingsozupxnb.csv with data.
Analysis: Unable to Replicate the reported scenario.
Retest Date: 07/03/2017
Retest Region: us-east-1
The Cloudformation template was deployed in us-east-1 region and a bucket with following list of files was generated with data.
a. results_rightsizingsozupxnb.csv
b. ec2pricelist.csv
c. 2018-07-03-before336hour-with60min.csv.gz

Same problem here, i think is something about the "Access CIDR Block" field, where can i see some examples of this input ? Because i´m not sure if i am filling it whit the correct data.

Cost Optimization parameters used for trying to replicate the scenario is attached.
Analysis: Unable to Replicate the reported scenario.
Retest Date: 07/03/2018
Retest Region: us-east-1
The Cloudformation template was deployed in us-east-1 region and a bucket with following list of files was generated with data.
a. results_rightsizingsozupxnb.csv
b. ec2pricelist.csv
c. 2018-07-03-before336hour-with60min.csv.gz

Guys, any update here. One of the issues we noticed that was causing similar behavior:
issue
Upon further investigation we found the issue to be with following lines in the sql query:
https://github.com/awslabs/cost-optimization-ec2-right-sizing/blob/1db8f6558e1e245108267321abcc40f438b31be4/run-rightsizing-redshift.py#L292
https://github.com/awslabs/cost-optimization-ec2-right-sizing/blob/1db8f6558e1e245108267321abcc40f438b31be4/run-rightsizing-redshift.py#L300
fix
change these lines to:
ls_gen_list_sql += " max(to_number(trim(both ' ' from diskreadops), '9999999999999D99999999')/60+to_number(trim(both ' ' from diskwriteops),'9999999999999D99999999')/60) as maxiops, "
reason
the reason for numeric overflow error was due to mismatch with the data-type.
next steps
would it be possible for you guys to make these changes and test it with your setup?
you can chose not to terminate resource at deployment. this will leave ec2 and redshift cluster after initial deployment. you can then ssh into the box and edit the /tmp/run-rightsizing-redshift.py with the recommended change and run it again

please try our updated v2.4 release which addresses this issue

@gsingh04 Same problem here, I am getting empty result. In my file above lines are commented.
ls_gen_list_sql += " from (select instanceid, instancetags, instanceType, az, max(to_number(trim(both ' ' from CPUUtilization),'9999999D99999999')) as maxcpu, "     #ls_gen_list_sql += " max(to_number(trim(both ' ' from diskreadops), '9999999999999D99999999')/60+to_number(trim(both ' ' from diskwriteops),'9999999999999D99999999')/60) as maxiops, "     ls_gen_list_sql += " max(CAST(trim(both ' ' from diskreadops) as decimal(38,10))/60+CAST(trim(both ' ' from diskwriteops) as decimal(38,10))/60) as maxiops, "     ls_gen_list_sql += " max((to_number(trim(both ' ' from networkin),'9999999999999D99999999')/60/1024/1024)*8+(to_number(trim(both ' ' from networkout),'9999999999999D99999999')/60/1024/1024)*8) as maxnetwork "     ls_gen_list_sql += " from " + cw_tablename     #ls_gen_list_sql += " where accountid like '%" + ACCOUNT_ID + "%' "     ls_gen_list_sql += " where accountid not like '%accountId%' "     ls_gen_list_sql += " group by instanceid, instancetags, instanceType, az) a, " + pricelist_table + " b "     ls_gen_list_sql += " where a.instanceid in (select instanceid from (select instanceid,max(maxcpu) as topcpu from "     ls_gen_list_sql += "(select instanceid, instancetags, instanceType, az, max(to_number(trim(both ' ' from CPUUtilization),'9999999D99999999')) as maxcpu, "     #ls_gen_list_sql += " max(to_number(trim(both ' ' from diskreadops), '9999999999999D99999999')/60+to_number(trim(both ' ' from diskwriteops),'9999999999999D99999999')/60) as maxiops, "     ls_gen_list_sql += " max(CAST(trim(both ' ' from diskreadops) as decimal(38,10))/60+CAST(trim(both ' ' from diskwriteops) as decimal(38,10))/60) as maxiops, "

In current version these two lines are in 292 and 301. I have uncommented to test but got below error:
Analyzing the instances need to be resized Traceback (most recent call last):   File "/tmp/run-rightsizing-redshift.py", line 449, in <module>     ls_temp_table = right_sizing(conn, ls_pricelist_tabname, ls_cw_tabname)   File "/tmp/run-rightsizing-redshift.py", line 313, in right_sizing     execute_dml_ddl(db_conn, ls_gen_list_sql)   File "/tmp/run-rightsizing-redshift.py", line 101, in execute_dml_ddl     cur_dml_ddl.execute(sql_stat) psycopg2.ProgrammingError: column reference "maxiops" is ambiguous


Disable feature CI builds by default.

This PR disables builds on feature/* branches by default. Teams that are doing long running builds can enable builds on their feature branch for just their service directories as required, but we found people doing merges from master into feature branches whilst this was the default for all the pipelines was causing build storms.

/azp run java - cosmos - ci

What out on this blowing up the agent usage on internal when this is merged.

@mitchdenny we really need to do something with spring and search CI builds, at least turn them off until there's something to build in those branches.

we really need to do something with spring and search CI builds, at least turn them off until there's something to build in those branches.

They were expected to run (and fail) here. Can you point to a PR where you don't think that they should run?

I will merge this later today after Redmond rolls of work hours so I don't eat the pool.


Static assets support

Dispatcher deployments often involve deploying static assets (images, etc) directly to docroot.
Sample static assets need to be included in aem-helloworld-publish-dispatcher and aem-helloworld-author-dispatcher. The deployer in aem-tools need to support copying static assets to docroot.

Sample asset image earth.jpg is sourced from Nasa Image Galleries https://www.nasa.gov/image-feature/rocky-mountains-from-orbit , adhering to their Media Usage Guidelines https://www.nasa.gov/multimedia/guidelines/index.html .


Spark packages

I've not managed to test the publishing process yet, so this might take some back and forth. But once this is merged, I'll tag 0.1.1 and try to publish.

+1


add black ci

Just pretty much copy paste from iree, except no ignoring third_party folder, and uses ubuntu-latest. I can move this to another file if you want to keep test.yml isolated


Double hyphens in comments being flagged as red, comments not closing

VSCode Version: 1.11.1
OS Version: Windows 10 Pro

Steps to Reproduce:

Enter comment tags like so <!--- "comment" --->
Double hyphen in the closing tag is highlighted in red, comment tag doesn't close

This issue was moved to textmate/html.tmbundle#58


[6.0] Fix CFTimeZone crashes on Windows

Explanation: Fixes a new crash in Swift 6 when calling to CFTimeZone APIs on Windows
Scope: Only impacts CFTimeZone on Windows
Original PR: https://github.com/apple/swift-corelibs-foundation/pull/5070
Risk: Low to moderate - introduces a nontrivial amount of new C code, however it has been tested locally and the scope is limited
Testing: Testing done via local testing via the SwiftPM build
Reviewer: @compnerd @itingliu

@swift-ci please test


Getting exception in viewing invoice.

Bug report
Title
Getting exception in viewing invoice.
Issue Description
Getting exception in viewing invoice.
Preconditions
1. framework Version.-master

Steps to reproduce
1. step1- Place an order and create invoice.
2. step2-view invoice

Expected result
invoice page should open
Actual result
Getting exception

Woking fine after running route:cache


Move all image lookups to XML tree and support directly specifying image file

We need to handle components that specify their images directly with file locations in the zip as opposed to id lookups.
I had wanted to condense all the image lookup (including the tree lookups) into the initialize, but ran into a snag. Because of the way we construct the tree, we cannot to the tree lookup as we are constructing the nodes. I guess I could add it as a second pass after the tree creation, similar to groupdefs, but that felt ugly, so I left it. Let me know what you think

decided to just apply the image lookups once during the initialize phase, I think it works well.  This will also let us use images to calculate node width/height in MAKI methods that seems required

Hey. I think I lost track of this, oops! I think this is probably fine for now. I think until we know how we want our final data model to work, it's not worth getting too into the weeds about how exactly we store state.

I'm going to go ahead and merge, we can refactor as we improve our data model thinking.

Oh yea, I honestly kinda forgot about it too :-X Once we started talking about mutable XML tree and other versions I figured I would just do this after that. Although agree we can always refactor it.
Thanks!


Add nullOrBoolean assert

Sooner or later we should just create an assert nullOr.

@Americas https://github.com/uphold/validator.js-asserts/pull/149 ?

Sooner or later we should just create an assert nullOr.

@Americas #149 ?

Damn that's an old PR, but even at that time things were not improved just because nobody had time to work on maintenance :laughing:
But yeah, that, I would probably make it more composable by allowing an array of asserts.


Fix warnings from legacy fortran file dopri5

Moved dopri5.f to fclaw_dopri5.f
Add continue statements to all labeled do loops
Move fclaw_dopri5.f to src/fortran_source2d for general use
Update examples that use this routine
This routine is the original code behind Matlab's ode45.   See [Dormand Prince Method].(https://en.wikipedia.org/wiki/Dormand–Prince_method)

Don't merge;  updated develop and then added new fixes;  see later PR.


chore: publish-ci fix

Pull Request Test Coverage Report for Build<PHONE_NUMBER>

0 of 0   changed or added relevant lines in 0 files are covered.
No unchanged relevant lines lost coverage.
Overall coverage remained the same at 81.85%

Totals

Change from base Build<PHONE_NUMBER>:
0.0%

Covered Lines:
5787

Relevant Lines:
6506

💛  - Coveralls


Created with should be added only the defined experiment number.

Currently we can see that different numbers are added to the created_with string, but acutally only 73 would be correct.

I think its already solved now; UI sets the correct OBM experiment number before the lib starts


Create Usage Documentation

What would you like to be updated?
Usage documentation should be added under docs/.

Will be maintained on GitHub Pages.


[A11y]At 150% page zoom images present of left side of screen are not visible.

Copied from https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1063665
Steps to Reproduce:

Hit the #URL:https://www.nuget.org/
Navigate to "Sign in" control and hit enter.
Navigate to "Sign in with Microsoft" control and hit enter.
Search for a key term (say “json”) from search box.
"Packages returned for json" screen gets opened.
Zoom the page to 150%.
Check if the images present on left side of the screen are visible.

Actual:
When the page is zoomed to 150% and above upto 200% the images that are present on left side of the screen are not visible.
Same issue is Observed in "Chrome" also.
Expected:
At 150% page zoom all the content and images that are visible in 100% zoom must also be visible at 150% and above upto 200%.
Notes:
This is actually an issue with the 150% zoom shrinking the horizontal width of the page to the point that the bootstrap stuff kicks in and hides the column with the icon. If I recall, this was by design as we decided that the icon eats up too much space at that width. We should revisit this decision and see if we still agree that this is the correct behaviour.

I believe this is by design, and we will not be fixing this.
We hide the icon explicitly since too much of the horizontal real estate is consumed by the icon


bug(compaction): streaming read will be terminated by remote if not polled timely

Describe the bug
We have encountered IO error raised by compactor in several tests, usually from a large compaction task with hundreds of input SST files.
2023-06-22T06:06:33.56173576Z  WARN risingwave_storage::hummock::compactor: Compaction task 22201 failed with error: ObjectStore failed with IO error Internal error: Internal error: read_bytes failed, error: Custom { kind: Other, error: Error { kind: StreamingError(hyper::Error(Body, Os { code: 104, kind: ConnectionReset, message: "Connection reset by peer" })) } }.
We have suspected it's caused by the streaming iterator (actually its underlying S3 connection) not polled timely.
I've created a demo that demonstrates there is indeed a timeout limit imposed by remote:
expect_connection_reset.rs.txt
What the demo does is

It first succeeds a S3 get_object, but doesn't consume its response body immediately. Thus it still holds the underlying connection.
After some sleep time, it tries to consumes the response body, but results in a "Connection reset by peer". I can almost be sure the remote timeout limit is 5 minutes: I can reproduce the error every time running with 310 seconds sleep time, while I can not reproduce the error at all running with 300 seconds sleep time.

Another demo shows that consuming the response body slowly but continuously (i.e. poll a bit data periodically) won't lead to such error, even the whole process holds the connection for very a long time ( >> 5 minutes ).
We still don't know where the timeout limit comes from, either the S3 service, or other components in between.
Error message/log
No response
To Reproduce
No response
Expected behavior
No response
How did you deploy RisingWave?
No response
The version of RisingWave
No response
Additional context
#11142

#11051


Building Hexa on M1

Building Hexa on Apple M1 fails with the following error.

Steps to build Hexa on M1

yarn install
import UIKit to iCloud.m #import <UIKit/UIKit.h>
update Podfile as per the troubleshooting guide

Closing this issue as discussed with dev.


Port fixes from CoreCLR

Skipping dotnet/coreclr#26792 and dotnet/coreclr#26793.

Hit https://github.com/dotnet/corert/issues/7603


Music inpainting?

I see this repository has code for extending an audio clip, conditioned on the input audio. Would it be possible to fill in a missing segment, conditioned on both the beginning and end input audio?

The same technique could be used to make audio loops.

I see this repository has code for extending an audio clip, conditioned on the input audio. Would it be possible to fill in a missing segment, conditioned on both the beginning and end input audio?

@jhurliman Did you find out a way to do this? I am trying to do this and would like to know if it has been done before I go digging into the model to try and implement it myself. Would the model have to be trained or at least fine-tuned for this specific task?

For those who want to use audiocraft library, I think you can also use the magnet model, which is the non-autoregressive variant of MusicGen.
But I will recommend ours as well.


backgroundColor not showing, and transition type not as expected

Hey, thanks for making this wonderful Presentr. :-)
With 0.1.8 I want to modally display my view controller upon a view controller that is vended by an UINavigationController that is itself modally presented on top of another UINaviagationController backed stack. I present my view controller like this:
        let presenter: Presentr = {
            let width = ModalSize.Full
            let height = ModalSize.Custom(size: 393)
            let center = ModalCenterPosition.Center
            let customType = PresentationType.Custom(width: width, height: height, center: center)

            let customPresenter = Presentr(presentationType: customType)
            customPresenter.transitionType = .CoverHorizontalFromRight
            customPresenter.roundCorners = false
            customPresenter.backgroundColor = UIColor.redColor()
            customPresenter.backgroundOpacity = 0.7
            return customPresenter
        }()

        customPresentViewController(presenter, viewController: vc, animated: true, completion: nil)

and it appears fine, but the backgroundColor is black with alpha 0 according to the view debugger. When I was running 0.1.6, with the default background color there, I had the same issue.
From poking around a bit, it seems that private func presentationController(presented: UIViewController, presenting: UIViewController) -> PresentrControlleris never called. private func presentViewController(presentingViewController presentingVC: UIViewController, presentedViewController presentedVC: UIViewController, animated: Bool, completion: (() -> Void)?) is called just fine, but none of the if clauses succeed, so I get neither systemPresentTransition nor systemDismissTransition, which I expect is fine since I had it set to CoverHorizontalFromRight. Except that it does not cover from right either. When it comes up, it comes up from the bottom
Do you have any hints or pointers to what's going on and how I should use Presentr differently to get it presented with a background color and the expected animation?
Cheers
Nik

I tried to add your configuration to our current PresentrExample project.
Where:

 let presenter: Presentr = {
    let width = ModalSize.Full
    let height = ModalSize.Custom(size: 393)
    let center = ModalCenterPosition.Center
    let customType = PresentationType.Custom(width: width, height: height, center: center)

    let customPresenter = Presentr(presentationType: customType)
    customPresenter.transitionType = .CoverHorizontalFromRight
    customPresenter.roundCorners = false
    customPresenter.backgroundColor = UIColor.redColor()
    customPresenter.backgroundOpacity = 0.7
    return customPresenter
 }()

// MARK: - IBAction's

@IBAction func alertDefault(sender: UIButton) {

    //presenter.presentationType = .Alert
    //presenter.transitionType = nil
    //customPresentViewController(presenter, viewController: alertController, animated: true, completion: nil)

    customPresentViewController(presenter, viewController: alertController, animated: true, completion: nil)
}

And I got the attached result:

As you can see, the background respects the defined color. Could you try to perform the same test using our current Master branch?

I have made a sample that recreates the problem from the master branch and will send it to you shortly

Have a look at https://www.dropbox.com/s/5peiklq9dhbsvqx/PresentrSample.zip?dl=0
See from Podfile that I use the latest commit on master
Open up PresentrSample.workspace, go to ViewController.swift and remove "/" and "/" that comment out the code around viewDidAppear. Launch the app in the simulator and see that a view controller with a yellow box with height 393 and red surroundings appears from right. Now go back to ViewController and comment it back in.
Relaunch the app, and hit the button "Tap me". See that the yellow view controller appears again, but is much more than 393 in height, appears from the bottom and has no red surroundings.
That last setting is what I see in my app too.

@niklassaers I noticed that if when you are performing the customPresentViewController in the viewDidAppear scope you trigger this issue. If you call if from a button action (just an example) it works perfectly.
I'll check it later, but seems to be connected to the fact that is not properly rendered in the moment when it is consumed.
Thanks for reporting this use case.

@niklassaers could you try changing your TheModalViewController class to the following code:
import UIKit
import Presentr

class TheModalViewController: UIViewController {

    var vc: SomeViewController? = nil

    let presenter: Presentr = {
        let width = ModalSize.Full
        let height = ModalSize.Custom(size: 393)
        let center = ModalCenterPosition.Center
        let customType = PresentationType.Custom(width: width, height: height, center: center)

        let customPresenter = Presentr(presentationType: customType)
        customPresenter.transitionType = .CoverHorizontalFromRight
        customPresenter.roundCorners = false
        customPresenter.backgroundColor = UIColor.redColor()
        customPresenter.backgroundOpacity = 0.7
        return customPresenter
    }()

    override func viewDidAppear(animated: Bool) {
        super.viewDidAppear(animated)

        if let vc = self.storyboard?.instantiateViewControllerWithIdentifier("SomeViewController") as? SomeViewController {
            self.vc = vc

            customPresentViewController(presenter, viewController: vc, animated: true, completion: nil)
        }
    }
}

In a nutshell I moved the Presentr outside the viewDidAppear scope to have time to be created in its plenitude.

Hi @gabrielPeart, thank for getting back to me so swiftly. :-) Your solution, as well as just delaying it with a dispatch_after in viewDidAppear both work great. :-) I must admit I do not understand why exactly, as at didAppear time I expect the view to be all right, but this solves the problem in my app and the example. :-) If you have the time to explain, I'd love to understand better why.

@niklassaers Glad to know that works. I believe that we could close this issue now :)
Of course, we can stay in touch and I can explain :)

Yupp, closed :-)

Thanks for looking into this @gabrielPeart !
It's good that the work-around is working but I think I would like to look into why exactly it was happening and look into a fix por it. Maybe I should re-open and take a look.
:)


GH-38057: [Python][CI] Fix flaky hypothesis tests

Rationale for this change
Some hypothesis tests are consistently flaky due to taking too long to generate examples. "Too long" is ~2 seconds so let's just suppress the warnings. It is suppressed only for a small number of tests.
What changes are included in this PR?

Suppress hypothesis warnings for test data generation being too slow (> 2 seconds).

Are these changes tested?
Will test the hypothesis CI job here.
Are there any user-facing changes?
No

Closes: #38057

@github-actions crossbow submit test-conda-python-3.11-hypothesis


tokio-console: 0.1.3 -> 0.1.7

Description of changes
https://github.com/tokio-rs/console/blob/main/tokio-console/CHANGELOG.md

Things done

Built on platform(s)

[x] x86_64-linux
[ ] aarch64-linux
[ ] x86_64-darwin
[ ] aarch64-darwin

[ ] For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
[ ] Tested, as applicable:

NixOS test(s) (look inside nixos/tests)
and/or package tests
or, for functions and "core" functionality, tests in lib/tests or pkgs/test
made sure NixOS tests are linked to the relevant packages

[x] Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
[ ] Tested basic functionality of all binary files (usually in ./result/bin/)
22.11 Release Notes (or backporting 22.05 Release notes)

[ ] (Package updates) Added a release notes entry if the change is major or breaking
[ ] (Module updates) Added a release notes entry if the change is significant
[ ] (Module addition) Added a release notes entry if adding a new NixOS module
[ ] (Release notes changes) Ran nixos/doc/manual/md-to-db.sh to update generated release notes

[ ] Fits CONTRIBUTING.md.

Result of nixpkgs-review pr 197202 run on x86_64-linux 1

1 package built:

tokio-console


Optional name mangling of private members

Search Terms
mangle private members
Suggestion
Introduce optional name mangling of private members of class, similarly how python does name mangling of private members (members which name starts with __).
In order not to make a breaking change I suggest using new keyword (lets say mangle) to mark property for mangling, example:
class MyClass {
  mangle private myProp: any;
}

Use Cases
First of all - this proposal purpose is not to make private variables inaccessible outside the class.
Primary purpose is to avoid naming collisions in derived class:
class MyClass {
  private myProp: any;
}
class DerivedClass extends MyClass {
  private myProp: any; // can't do this
}

Currently, we need to expose internals of class definition (private members) to avoid collisions.
Also, it could be possible to configure minifiers like uglifyjs to mangle the names again and produce smaller outputs.
Examples
With mangling enabled, this code:
class MyClass {
    mangle private myProp: any;
    constructor() {
        this.myProp = 1
    }
}

should be compiled to something like:
var MyClass = /** @class */ (function () {
    function MyClass() {
        this.myProp$MyClass= 1;
    }
    return MyClass;
}());

How the names should be mangled is up to debate. It could incorporate class name or some kind of hash in mangled names.
Checklist
My suggestion meets these guidelines:

[x] This wouldn't be a breaking change in existing TypeScript / JavaScript code
[x] This wouldn't change the runtime behavior of existing JavaScript code
[x] This could be implemented without emitting different JS based on the types of the expressions
[x] This isn't a runtime feature (e.g. new expression-level syntax)

Duplicate or related to #8.

@j-oliveras it's not releated. The mangling I proposed has nothing to do with minification. In fact, generated code will be probably bigger. It's to avoid name conflicts and as a bonus, it can make external tools that minifies code more efficient.

You may be interested in https://github.com/tc39/proposal-class-fields .

This looks like a duplicate of https://github.com/Microsoft/TypeScript/issues/9950. The private property proposal will be implemented as weak map, removing the chance that a derived classes can step on a base class private property.

@mhegazy It's a different approach. WeakMap requires polyfill when targeting ES5 and I don't think it's a good idea and there are obvious performance concerns (https://jsperf.com/weakmap-vs-property/1 - even with native WeakMap imprementation, on firefox it's more than 200 times slower). Also, this proposal is more general, as tc39 proposal doesn't mention private functions.

@dawidgarus I tested on IE, Firefox and Chrome and found the WeakMap implementation to be 2X slower, not 200X slower.

I my test (https://jsperf.com/weakmap-vs-property/1) in all the browsers except Chrome weakmaps are slower by 2 or 3 orders of magnitude:

browser
property ops/sec
weakmap ops/s

Chrome 67.0.3396 / Windows 8.1 0.0.0
10,652,072
520,222

IE 11.0.0 / Windows 8.1 0.0.0
5,120,056
71,054

Firefox 60.0.0 / Windows 8.1 0.0.0
14,287,836
63,247

Mobile Safari 11.0.0 / iOS 11.2.5
7,732,968
182,511

Historically we have not supported such levels of configurability for the emitted code. I do not think we will be supporting emitting private properties differently using mangling and also have private names supported using private maps.


go-mpulse.net

Unable to checkout and pay for groceries when domain go-mpulse.net is blocked when using the Woolworths (large Australian grocery chain) App on Android.
Whitelisting go-mpulse.net allowed me to pay, when it isn't whitelisted the text box to input CVV disappears.

ping jawz101 for assist 👍

What's the group opinion on this one?
https://github.com/akamai/boomerang
https://developer.akamai.com/tools/boomerang/

Any reason why having it blocked stopped the payment gateway from loading in the app?

Thought this would be relevant but this domain and response is generated before the app calls go-mpulse.net
Domain iframe.payments.woolworths.com.au Type A Protocol Plain DNS Response details DNS server tls://dns10.quad9.net:853 Elapsed 35 ms Response CNAME: api.payments.woolworths.com.au.edgekey.net. (ttl=3096) CNAME: e3032.a.akamaiedge.net. (ttl=8258) A: <IP_ADDRESS> (ttl=20)

Usually is because of poorly implemented error handling(if any at all),so i'd assume that this is the case here.

This one is redy for closing Steve @StevenBlack 👍

Thanks everybody!
Closing.

This one is ready for closing Steve @StevenBlack 👍

Just wanted to check if it will be removed from StevenBlack's List as well?
As it was removed from AdAway List.
Thank you!

@gyCfjSnO the domain is completely removed, yes.


Create Individual Contr. Report - M2

Create Individual Report that summaries what I have done for the project.

Report page


Save and load of the trained TRPO and PPO agents

Hi,
How save, load and visualization of the trained agents with TRPO or PPO algorithms can be done?

Hello,
I think I've figured out how to do it, so I thought I would describe the process and possibly submit a pull request so other people can get started experimenting.
The run_atari.py and run_mujoco.py files will go through the training/learning process and display some running statistics, but it does not save the network's model or parameters when the script completes. Luckily, you can use the tf.train.Saver class to do just that. It's as easy as instantiating the saver and then calling the save method with a session and file prefix.
Then, in another file, you'll want to instantiate the same policy (the default is a MlpPolicy) with the same parameters (hidden size, hidden layers, etc.). Then, use the saver class to restore the model, and voilá, you can call the act function and get back actions.
This solution is a little janky and could probably be improved using the ActWrapper class that the DQN method uses.

Thanks for the explanation, Viktor. I also use the tf.train.Saver, however, it's not in the released code because I figured that people would probably want to roll their own solutions.

Can we do this in pposgd_learn.py? I want to save the model after every 100 iterations, say. Would simply calling U.save_state(fname) work there?

I am also facing tensor shape mismatch issue, anyone got a workaround?

@BlazingFire -The error for me was arising because i had missed one of the wrappers. It think it was the Frame Stack wrapper which stacks the 4 images. Hence the mismatch in dimensions.

In ashwinreddy's fork, there is an example, but it has been removed from openai baselines