Ask question

Dear professor, It's generous of you to share this project . But  I have a question that  what is the specific value of input(u) in README.md, such as command lsim(G, u, t). I'm a beginner, it's a little diffcult for me to guess the value of u. Can you upload a more detailed version of  'Typical use'  at your convenience or just tell me  the value of u?

Hello! Sorry for the late reply.
u is the input signal from your mesurements and y is the output signal.
lsim(G, u, t) is linear simulation of transfer function G or statespace model sys, u = input and t = time vector.
Yes. I will create a tutorial how to use. Questions:
<EMAIL_ADDRESS>

Dear Professor,
is it possible to use OKID for MISO systems? i tried to use it but i get the following error:
error: toeplitz: C must be a vector
error: called from
toeplitz at line 70 column 7
okid at line 49 column 5
Regards

Sorry. I haven't implement it yet.
But I have an idea if you want to do a pullrequest.
OKID computes the impulse response, but only for siso-case. If you want to have MIMO-case, you should have a for-loop around the OKID algorithm part only.
Then it should work. ERA algorithm can do MIMO, but I think i need to tell the correct sizes first. Right now it assumes that the impulse response is only SISO.
I don't know why I made OKID SISO. Perhaps because I use the C++ bult in routines.
OKID is my favorite algorithm. Works every time. But N4SID and MOESP can do MIMO. They requries more tuning and more data.

thanks again for your generosity and sharing your codes with everyone. I am a Mechanical Engineer in Germany, writing my Master Thesis about different mehtods of System Identification. One of the Methods I'm researching is OKID. I have a system with 6 inputs (Speed, Acceleration, Yawrate and some other signals from a vehicle) and one output (Force on Cross tie). Unfortunately I don't get a proper solution using OKID-Algo (i used the codes of Steve Brunton) , so I thought it might be a  weakness of OKID. Is there any specific limitation for using this algorithm? I read lots of papers but i couldn't find anything helpful, so it would be really nice if you could help me as an expert in this field.
Thanks again and I would really appreciate your answer.

thanks again for your generosity and sharing your codes with everyone. I am a Mechanical Engineer in Germany, writing my Master Thesis about different mehtods of System Identification. One of the Methods I'm researching is OKID. I have a system with 6 inputs (Speed, Acceleration, Yawrate and some other signals from a vehicle) and one output (Force on Cross tie). Unfortunately I don't get a proper solution using OKID-Algo (i used the codes of Steve Brunton) , so I thought it might be a weakness of OKID. Is there any specific limitation for using this algorithm? I read lots of papers but i couldn't find anything helpful, so it would be really nice if you could help me as an expert in this field.
Thanks again and I would really appreciate your answer.

The OKID algorithm computes first the impulse response of your inputs. It uses the singular value decomposition, e.g least squares in practice.
Then when you got the impulse response, you use the Eigensystem Realization Algorithm(ERA) to compute the dynamical state space model.
Here is how you find the MIMO impulse response for OKID.
# Se till att du har mataveID and MataveControl installerad

# Skapa en modell
sys = ss(0, [0 1 0 0; -2 -1 0 0; 0 0 0 1; 0 0 -1.4 -0.5], [0 0; 1 0; 0 0; 0 1], [1 0 0 0; 0 0 1 0])

# Simulera modellen
u1 = linspace(4,4, 100);
u2 = linspace(2,2, 100);
t = linspace(0, 20, 100); % 20 sekunder
y = lsim(sys, [u1; u2], t);

# Identifiera med OKID - Toeplitz matrix
g1 = y(1,:)*pinv(triu(toeplitz(u1)));
g2 = y(2,:)*pinv(triu(toeplitz(u2)));
plot(t, g1, t, g2);

But then you need to implement this impulse response into the ERA algorithm.
The ERA algorhtm is also singular value decomposition. E.g least square.
Step 1:
Run the code above.
Step 2:
Change those lines in okid.m or era.m files
% Create hankel matrecies
  H0 = hank(g, 1);
  H1 = hank(g, 2);

So they will contain the MIMO impulse response. Notice that they need to be square e.g. equal amount of inputs as outputs.

thanks again for your generosity and sharing your codes with everyone. I am a Mechanical Engineer in Germany, writing my Master Thesis about different mehtods of System Identification. One of the Methods I'm researching is OKID. I have a system with 6 inputs (Speed, Acceleration, Yawrate and some other signals from a vehicle) and one output (Force on Cross tie). Unfortunately I don't get a proper solution using OKID-Algo (i used the codes of Steve Brunton) , so I thought it might be a weakness of OKID. Is there any specific limitation for using this algorithm? I read lots of papers but i couldn't find anything helpful, so it would be really nice if you could help me as an expert in this field.
Thanks again and I would really appreciate your answer.

Hi!
Updated now. Look at okid.m
:)
Bästa hälsningar
Daniel

Dear Professor,
is it possible to use OKID for MISO systems? i tried to use it but i get the following error:
error: toeplitz: C must be a vector
error: called from
toeplitz at line 70 column 7
okid at line 49 column 5
Regards

OKID updated now. Try it.


Option to hide the digital timer

Cleans up the interface, for users who don't like the digital timer or find it useful.
Depends on #125.

Thanks for all the PRs. I'm excited to see another dev adding to the project! 🎉
Could you make each PR self-containing without the requirement of another PR. That way we can review the PR on the changes (what it fixes or what new features it implements) without having to merge another PR. I understand there will be repeat code.

Hey @karbassi, thanks for the warm welcome. Glad I can contribute to this project!
Screenshots
Screenshots below for hiding the digital timer. Note that the pause symbol is unaffected so users can still see if the timer is paused or not.
Current look

This PR

Its an optional setting, and defaults to the current behaviour, so shouldn't affect other people if they don't like it.
PR dependency

Could you make each PR self-containing without the requirement of another PR. That way we can review the PR on the changes (what it fixes or what new features it implements) without having to merge another PR. I understand there will be repeat code.

The first 2 commits of all the PRs I've submitted are actually all the same (adds the View menu option and saves/loads preferences from UserDefaults) – in other words, the PRs are already self-contained and can be merged without needing #125. I only split it up like that to make it easier for code review. But happy to close that PR if you prefer.
Let me know if this is ok. I'll then fix up the lint issues that have been flagged.


Optional CheckpointSaver instantiation inside the Trainer

🚀 Feature Request
The Trainer instantiates a CheckpointSaver when the save_folder is specified (see this line). The creation of this object should be optional in case there is already a CheckpointSaver provided as part of the callbacks.
Motivation
I implemented a custom checkpointing strategy which is injected to the trainer by appending it to the list of callbacks. I am now looking into enabling the automatic resumption with this stategy. However, the autoresume requires the save_folder to be provided. If the save_folder is not None then a CheckpointSaver in created regardless of what is provided for callbacks. I would like to have more flexibility for checkpointing without penalizing the resumption.
Implementation
Before creating the CheckpointSaver the Trainer should check if such callback already exists:
if not any(isinstance(callback, CheckpointSaver) for callback in callbacks):
    checkpoint_saver = CheckpointSaver(...)

Certain fields like the save_folder and latest_remote_file_name can then be extracted from the provided object.
Some questions remains regarding the handling of certain edge cases given that certain fields are optional or might be conflicting:

if the CheckpointSaver is provided as a callback and the save_folder is also provided, should we ensure they are equal and raise an exception if they aren't?
if the CheckpointSaver is provided as a callback and the save_folder is also provided with a matching value (checkpoint_saver.folder == save_folder), should other fields match too if they are provided? for example checkpoint_saver.latest_filename == save_latest_filename

I would love to get your perspective on this @mvpatel2000. I am happy to make this contribution myself once we agree on how to handle the edge cases.

Seems reasonable to me. I would emit a log.info that it's being skipped for auto-creation if the requisite args are passed but an existing callback is present. We'd love a community PR for this!
Also tagging @eracah in case you have any objections

Cool! I can start working on it tomorrow.
Out of curiosity, when is the next release expected? Maybe I get this merged before it's out.

We are planning in 1-2 weeks. We try to aim for every month minimum and optionally a mid-month if there is enough PRs accumulated. We can try to make this release process and cadence more public if helpful.

@antoinebrl, this is a good idea! One other thing to keep in mind is that we may have a use case where someone wants two checkpoint savers. e.g. they are saving some checkpoints locally at a different frequency that they are saving some remotely.

Another thing to note is that in the next few months we will be moving to a config-based set up for checkpointing where you specify 1 or more configs (usually 1) for checkpoint saving and each config is used to create a CheckpointSaver. This obviates the need for a user ever creating their own CheckpointSaver, so I fear this PR may only be useful for a short time.

@mvpatel2000, Depending on the criticality of the feature we contribute we either wait or develop a quick hack. Having an ETA for the next release would help us plan better, but I also understand that committing to specific release cycle might increase the maintenance burden on your side. For previous key contributions, asking you this information was good enough for us.
@eracah, I will definitely take into account the case where there are multiple CheckpointSavers and thanks for sharing the roadmap around this. Are the roadmaps and the design docs available publicly? I would be happy to share ideas and feedback or to consider implementing some of them.
What will be the flexibility once the config object is introduced? For example, I created a custom CheckpointSaver to save after an evaluation. This synchronization ensures each intermediate evaluation is reproducible and that the intermediate checkpoints can be compared. This can be extended to only create checkpoints when a certain metric is improving. As you can see, using different checkpointing strategies is not only about having different configurations but also about implementing custom rules.
From the user perspective, given the simplicity of the API for the CheckpointSaver I don't think there is much difference between passing all the values to the Trainer, assembling them inside a config structure or directly instantiating the corresponding object. My preference is on the last option: letting the user instance the callback(s) themselves. Introducing the config object has the downside of extending the API surface without much benefit (and even sometime reducing the flexibility). Once the instantiation of the CheckpoinSaver is optional inside the Trainer, one can wonder if the Trainer should still accept values related to checkpointing. Potentially 9 pass-through arguments of the Trainer (save_filename, save_weights_only, etc) can be removed which would increase separation of responsibility and simplify its API. wdyt?

PR is ready for review: https://github.com/mosaicml/composer/pull/3334

Today I observed that some arguments of the CheckpointSaver are not exposed through the Trainer (remote_file_name and latest_remote_file_name). This might be another argument towards decorrelating these two entities by forcing the user to instantiate the callback.

Today I observed that some arguments of the CheckpointSaver are not exposed through the Trainer (remote_file_name and latest_remote_file_name). This might be another argument towards decorrelating these two entities by forcing the user to instantiate the callback.

It's a good point, but I don't think we should force users to make a callback for a very basic, non-custom thing.
remote_file_name is indirectly passed in by parsing the save_folder if it includes an object store prefix and we don't allow users to customize latest_remote_file_name because that was a mistake to expose that fine-grained of a knob to them to begin with


Merged argument parsing into a single file.

This gets rid of the subtle nuances between the streaming and non-streaming compiles, so requires a major version bump for breaking backwards incompatibility.  This will lead to eventual sub-command execution, which will include breaking changes to get to that point.
The v3 to-do list is also added.

This fixes issue #8 .


[BUG] Backups to Backblaze B2 sporadically fail with SignatureDoesNotMatch; can cause backup to get stuck indefinitely

Describe the bug
We have a pretty bog-standard backup configuration targeting Backblaze B2's S3-compatible endpoint. Fairly consistently, backups will fail with a SignatureDoesNotMatch error coming back from B2. The error doesn't always occur at the same point. For example, I've seen it occur at 2%, 48%, and other random percentages.
More troubling, often when the error occurs we'll see the error in the instance manager logs, but the backup resource in Kubernetes will not transition to an Error state, but be stuck in InProgress. This is a rather serious problem because if this happens during a recurring backup then Longhorn effectively suspends all recurring backup jobs until a cluster operator notices the problem and manually deletes the stuck backup resource. (This is likely a separate issue than the SignatureDoesNotMatch error, but thought it was worth noting.)
[rocket-r-b738e4e1] time="2024-09-01T06:49:32Z" level=error msg="Failed to back up volume rocket snapshot 3145537f-d983-4cfb-9a99-8826ca00c1ac block at offset<PHONE_NUMBER> size 2097152" func=backupstore.backupMapping file="deltablock.go:438" error="failed to put object: longhorn-backups/backupstore/volumes/31/b1/rocket/blocks/71/75/71756799a7b82366685937cdec6bb5c795858d9edd62393e3459d72cbf86642f.blk response: {\n\n} error: AWS Error:  SignatureDoesNotMatch Signature validation failed <nil>\n403 87ca83f9ba55dd88\n"
[rocket-r-b738e4e1] time="2024-09-01T06:49:32Z" level=error msg="Failed to backup volume rocket snapshot 3145537f-d983-4cfb-9a99-8826ca00c1ac" func=backupstore.performBackup file="deltablock.go:548" error="failed to put object: longhorn-backups/backupstore/volumes/31/b1/rocket/blocks/71/75/71756799a7b82366685937cdec6bb5c795858d9edd62393e3459d72cbf86642f.blk response: {\n\n} error: AWS Error:  SignatureDoesNotMatch Signature validation failed <nil>\n403 87ca83f9ba55dd88\n"
time="2024-09-01T06:49:32Z" level=error msg="Failed to perform backup for volume rocket snapshot 3145537f-d983-4cfb-9a99-8826ca00c1ac" func=backupstore.CreateDeltaBlockBackup.func3 file="deltablock.go:295" error="failed to put object: longhorn-backups/backupstore/volumes/31/b1/rocket/blocks/71/75/71756799a7b82366685937cdec6bb5c795858d9edd62393e3459d72cbf86642f.blk response: {\n\n} error: AWS Error:  SignatureDoesNotMatch Signature validation failed <nil>\n403 87ca83f9ba55dd88\n"

To Reproduce
I have not found a consistent way to reproduce other than to configure backups targeting Backblaze B2 and try backing up a volume. It does seem to happen more frequently the larger a volume is, but the problem by its nature seems to occur somewhat unpredictably.
Expected behavior
The backup should not cause a SignatureDoesNotMatch error, and if an error does occur, the backup should properly transition to the Error state.
Support bundle for troubleshooting
I can provide a bundle if absolutely necessary. I'm not sure that it will actually be terribly useful (except possibly for Longhorn's own pod logs) given that the issue seems specific to the S3 backup client when used with B2, so I would think any cluster configured to backup to B2 should be capable of observing these issues. (I find the scope of the bundle to be somewhat invasive as well, capturing seemingly everything but secrets, and I don't exactly want to publish the entire state of a private cluster.)
Environment

Longhorn version: 1.6.2
Impacted volume (PV): Any volume, though we see it most often with the "rocket" PV due to its size.
Installation method (e.g. Rancher Catalog App/Helm/Kubectl): kubectl
Kubernetes distro (e.g. RKE/K3s/EKS/OpenShift) and version: Vanilla Kubernetes (kubeadm) v1.30.4

Number of control plane nodes in the cluster: 3
Number of worker nodes in the cluster: 5

Node config

OS type and version: Debian Bookworm
Kernel version: 6.1.0
CPU per node: 4
Memory per node: 8GB
Disk type (e.g. SSD/NVMe/HDD): SSD
Network bandwidth between the nodes (Gbps): 1Gbps theoretical, tested at ~730Mbps, average typical inter-node traffic actually observed ~1Mbps

Underlying Infrastructure (e.g. on AWS/GCE, EKS/GKE, VMWare/KVM, Baremetal): Linode VMs, "bare metal" install (not using LKE)
Number of Longhorn volumes in the cluster: 20

Thanks for the reply and the suggestions.

Check if the time on the client/server is synchronized. Clock drift affects S3 signature.

The servers are all in sync using NTP and I just verified that the specific server that the most recent failure originates from is in sync with sub-second drift.

Could you use another tool like aws-cli to check if the s3 operation works to the bucket?

I tasted the credentials with rclone before initially configuring Longhorn, though I did so using the B2 backend and not the S3 backend. I can verify that it works with an S3 client. However, do note that many block uploads do succeed; the failures are intermittent and occur at different points in the backup when it is retried.

Create new credentials to check if the backup works.

I'll give this a shot. I also want to test using S3 proper and see if the issues go away.
I haven't ruled out an issue on Backblaze's side, though we are storing quite a lot of data in other B2 buckets and have never seen this problem with any other S3 client before -- it only seems to happen with Longhorn, so I'm very suspicious that there's a subtle bug in whatever S3 client library Longhorn uses that may only manifest when it is used with B2.

Could you provide the support bundle?
And could you show the backup target URL you set in the LH Settings here first?

@mantissahz
Just wanted to follow up because I am seeing this issue as well. Stuff I've tested:

Time is synced on the system, this doesn't appear to be the issue.
Tested that the S3 bucket is accessible with the token. I am able to log in using the AWS-CLI tool and see data on the bucket with the token. Not an issue AFAIK.

What is strange is this doesn't appear to be consistent, around 1/3 of the backups fail.
The interesting part is that they don't fail right away. They get ~20-80% of the way
through the backup, then they fail. So I'm thinking it's 2 possible scenarios:

The authentication works for a while, then it runs into an issue suddenly fails then gives up on the backup.
The authentication never works, it runs into an issue once it tries the first upload.

There is no size issue as some small volumes and large volumes fail, I think we notice that
the large volumes are failing more often because they have more chunks that are being
uploaded.
This was working a couple months ago, but I checked and suddenly the backups silently
started failing which caused a ripple effect --> nothing is getting backed up.

I’ve seen this in the past too and sadly had to swap to AWS S3 (at the expense of my wallet!)

Thanks everyone for chiming in.
I think I should probably split this into two issues. I observed both of them together, but they should be separate, I think:

B2 backups sometimes fail with SignatureDoesNotMatch even though credentials are valid and time is in sync.
A failure during backup sometimes does not cause the k8s Backup record to transition to the Error state.

Just chiming in to say that I also encountered this SignatureDoesNotMatch error on Backblaze B2. Today, I switched over to iDrive e2 and ran into the same thing! I managed to successfully back up a ~70GB volume, which is more than I can say for Backblaze, but another backup attempt on a 3 TB volume failed 58 GBs in.

cc @mantissahz

Jumping on this bandwagon to say that I am seeing the exact same issue with B2 on 1.7.2.

@mantissahz Let's address the B2 compatibility issue in v1.9.0.
cc @innobead


feat(buf): new lsp for protobuf

As may know, bufbuild team is working on the new lsp for protobufs which is included in the cli itself. Compared to buf-language-server, this lsp supports more features. Take a look at this PR for more info. This config sets up the new buf lsp.

finally fixed the linter problems :D

@sprsquish yeah, i got occasional crash, i thought because the lsp is still in beta phase. But good suggestions!

the old bufls can mark as deprecated ? and  current server file name is a bit confusing. I think it is better to use xx_ls.lua as the file name if there is no special server command name.

https://github.com/bufbuild/buf-language-server this repo is archived so could you also add a deprecate of bufls in lua/lspconfig.lua aliases table ?

@glepnir done


Contract compiled with Rust 1.70.0 not working

Problem
After creating a new Rust contract with create-near-app with latest Rust version 1.70.0, and following the steps to deploy contract, developer failed to view function with near view <dev-account> get_greeting.
This issue is reported by developers in community who are learning how to build on NEAR today.
How to Reproduce
(1) Install the latest Rust version 1.70.0. For example,
stable-x86_64-unknown-linux-gnu (default)
rustc 1.70.0 (90c541806 2023-05-31)

(2) Create a new project with create-near-app command
npx create-near-app my-project --contract rust --frontend none --tests rust

(3) Deploy contract to testnet
cd ./my-project
npm i
npm run deploy

(4) View call function get_greeting
near view <dev-account> get_greeting

View call failed and you'll encounter the error as below.
$ near view dev-1685967486834-62115280035912 get_greeting
View call: dev-1685967486834-62115280035912.get_greeting()
An error occured
Error: Querying [object Object] failed: wasm execution failed with error: CompilationError(PrepareError(Deserialization)).
{
  "block_hash": "5cdGPvRvN8JGKs7AfEPjVJaoVZjhhS35H1WgxrvxmNXR",
  "block_height": 128323323,
  "error": "wasm execution failed with error: CompilationError(PrepareError(Deserialization))",
  "logs": []
}
    at JsonRpcProvider.query (/usr/local/share/nvm/versions/node/v19.9.0/lib/node_modules/near-cli/node_modules/near-api-js/lib/providers/json-rpc-provider.js:123:19)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Account.viewFunction (/usr/local/share/nvm/versions/node/v19.9.0/lib/node_modules/near-cli/node_modules/near-api-js/lib/account.js:366:24)
    at async exports.callViewFunction (/usr/local/share/nvm/versions/node/v19.9.0/lib/node_modules/near-cli/index.js:103:48)
    at async Object.handler (/usr/local/share/nvm/versions/node/v19.9.0/lib/node_modules/near-cli/utils/exit-on-error.js:52:9)
TypedError: Querying [object Object] failed: wasm execution failed with error: CompilationError(PrepareError(Deserialization)).
{
  "block_hash": "5cdGPvRvN8JGKs7AfEPjVJaoVZjhhS35H1WgxrvxmNXR",
  "block_height": 128323323,
  "error": "wasm execution failed with error: CompilationError(PrepareError(Deserialization))",
  "logs": []
}
    at JsonRpcProvider.query (/usr/local/share/nvm/versions/node/v19.9.0/lib/node_modules/near-cli/node_modules/near-api-js/lib/providers/json-rpc-provider.js:123:19)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Account.viewFunction (/usr/local/share/nvm/versions/node/v19.9.0/lib/node_modules/near-cli/node_modules/near-api-js/lib/account.js:366:24)
    at async exports.callViewFunction (/usr/local/share/nvm/versions/node/v19.9.0/lib/node_modules/near-cli/index.js:103:48)
    at async Object.handler (/usr/local/share/nvm/versions/node/v19.9.0/lib/node_modules/near-cli/utils/exit-on-error.js:52:9) {
  type: 'UntypedError',
  context: undefined
}

Notes
This is probably a compatibility issue of Rust SDK 4.0.0 with Rust 1.70.0.

CompilationError(PrepareError

This usually indicates that the contract defined that it requires host functions that are not going to be provided or has illegal/unsupported operation. We will need to involve nearcore team to help to diagnose it.

It has been already investigated: https://github.com/near/nearcore/pull/9140#issuecomment-1576655073
Here is where solution is being discussed: https://near.zulipchat.com/#narrow/stream/295306-pagoda.2Fcontract-runtime/topic/sign-ext.20support.20and.20rust.201.2E70.2B

Unfortunately, without a protocol upgrade, the best workaround is to use rustc <1.69.

Hey, I've just ran into this.
I'm wondering if we should add a rust-toolchain.toml with the following content to the template to force using Rust 1.69:
[toolchain]
channel = "1.69"

Happy to provide a PR.

@agostbiro let’s do what you suggested as a quick temporary fix


New configuration proposal: hide buttons

Hi, thanks for this amazing project!
TL;DR:
My proposal is to add none/hidden value as an option to the buttons_position configuration, so you can do something like:

Proposal configuration with three covers without buttons
type: horizontal-stack
cards:
  - type: custom:shutter-card
    title: ''
    entities:
      - entity: cover.bedroom_blind
        name: Dormi
        buttons_position: hidden
        title_position: up
        shutter_width_px: 90
  - type: custom:shutter-card
    title: ''
    entities:
      - entity: cover.mari_blind
        name: Mari
        buttons_position: hidden
        title_position: up
        shutter_width_px: 90
  - type: custom:shutter-card
    title: ''
    entities:
      - entity: cover.alexis_blind
        name: Estudio
        buttons_position: hidden
        title_position: up
        shutter_width_px: 90

So you can get something like this:

Full story:
I don't know if anyone will have the same problem as me, but my covers/shutter does not work with the close and open services, they only work by setting a specific number from 0 to 100.
Right now the picture works as expected, but the buttons does not work, and if you try to stop, open or close the blind by using them, an error message is presented to the user like this one:
Failed to call service cover/close_cover. Entity cover.bedroom_blind does not support this service.

There are people in my house that are not as technical as me, and they do not want to have to think were they can press or not, so I'd like to completely remove the buttons and left only the picture with the nice slider.
Right now, I'm doing that using card styles (I leave my config below), but that is a rather convoluted way if you were not using card styles before

Working configuration with three covers without buttons using [card styles](https://github.com/thomasloven/lovelace-card-mod)
type: horizontal-stack
cards:
  - type: custom:shutter-card
    title: ''
    entities:
      - entity: cover.bedroom_blind
        name: Dormi
        buttons_position: right
        title_position: up
        shutter_width_px: 90
        disable_end_buttons: true
  - type: custom:shutter-card
    title: ''
    entities:
      - entity: cover.mari_blind
        name: Mari
        buttons_position: right
        title_position: up
        shutter_width_px: 90
        disable_end_buttons: true
  - type: custom:shutter-card
    title: ''
    entities:
      - entity: cover.alexis_blind
        name: Estudio
        buttons_position: right
        title_position: up
        shutter_width_px: 90
        disable_end_buttons: true
    style: |
      ha-card {
        font-size: 11px !IMPORTANT;
      }
      .sc-shutter-label {
        font-size: 15px !IMPORTANT;
      }
      .sc-shutter-buttons {
        display: none !IMPORTANT;
        visibility: hidden !IMPORTANT;
      }

I just discovered that there is already a PR for this. I will mention this issue in the PR https://github.com/Deejayfool/hass-shutter-card/pull/42


Remove A/L 22 page & banner

Purpose

The purpose of this PR is to fix #141
Goals

Remove the banner on the home page (Grade 1 admission)
Remove A/l 2022 Application page from the home page.

Preview Link
https://kumuditha-udayanga.github.io/sack-site/
Checklist

[x] This PR doesn't commit any keys, passwords, tokens, usernames, or other secrets.
[x] I have read and understood the development best practices guidelines
[x] My code follows the style guidelines of this project
[x] I have performed a self-review of my own code
[x] I have commented my code, particularly in hard-to-understand areas
[ ] I have made corresponding changes to the documentation

According to google analytics data some are still using that assignment page. Shall we leave it?
Since Grade 1 admissions expired yesterday shall we leave it a little bit days? WDYT @Piumal1999  @jayasanka-sack

Yes @Gimhan-minion. I think we can remove a/level  application link. Let's keep other files

Good job @kumuditha-udayanga


cant run " az aks get-credentials --resource-group"

This is autogenerated. Please review and update as needed.
Describe the bug
Command Name
az aks get-credentials
Errors:
The command failed with an unexpected error. Here is the traceback:
[Errno 30] Read-only file system: '/path'
Traceback (most recent call last):
  File "/usr/local/Cellar/azure-cli/2.44.1/libexec/lib/python3.10/site-packages/knack/cli.py", line 233, in invoke
    cmd_result = self.invocation.execute(args)
  File "/usr/local/Cellar/azure-cli/2.44.1/libexec/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 663, in execute
    raise ex
  File "/usr/local/Cellar/azure-cli/2.44.1/libexec/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 726, in _run_jobs_serially
    results.append(self._run_job(expanded_arg, cmd_copy))
  File "/usr/local/Cellar/azure-cli/2.44.1/libexec/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 697, in _run_job
    result = cmd_copy(params)
  File "/usr/local/Cellar/azure-cli/2.44.1/libexec/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 333, in __call__
    return self.handler(*args, **kwargs)
  File "/usr/local/Cellar/azure-cli/2.44.1/libexec/lib/python3.10/site-packages/azure/cli/core/commands/command_operation.py", line 121, in handler
    return op(**command_args)
  File "/usr/local/Cellar/azure-cli/2.44.1/libexec/lib/python3.10/site-packages/azure/cli/command_modules/acs/custom.py", line 1118, in aks_get_credentials
    _print_or_merge_credentials(
  File "/usr/local/Cellar/azure-cli/2.44.1/libexec/lib/python3.10/site-packages/azure/cli/command_modules/acs/custom.py", line 1236, in _print_or_merge_credentials
    os.makedirs(directory)
  File<EMAIL_ADDRESS>line 215, in makedirs
    makedirs(head, exist_ok=exist_ok)
  File<EMAIL_ADDRESS>line 225, in makedirs
    mkdir(name, mode)
OSError: [Errno 30] Read-only file system: '/path'

To Reproduce:
Steps to reproduce the behavior. Note that argument values have been redacted, as they may contain sensitive information.

Put any pre-requisite steps here...
az aks get-credentials --resource-group {} --name {} --subscription {}

Expected Behavior
Environment Summary
macOS-12.6-x86_64-i386-64bit, Darwin 21.6.0
Python 3.10.9
Installer: HOMEBREW

azure-cli 2.44.1

Additional Context

route to CXP team

@eilanponycell Thanks for reaching out to us and reporting this issue. We are looking into this issue and we will provide an update.

@eilanponycell Could you please confirm if you are running this command from the Azure Cloud Shell ? Awaiting your reply.

@eilanponycell I wanted to do quick follow-up to check if you had a chance to look at my above comment. Please let us know if you are running this command from the Azure Cloud Shell ? . Awaiting your reply.

@eilanponycell The action is currently pending on you to share the details with us regarding how / where the CLI command is being run. Please feel free to reopen this thread, once you are ready to resume troubleshooting on this. We would be happy to help.


Call to undefined method SquareConnect\ApiException::getCategory()

Related to https://github.com/NikolaGavric94/nikolag-square/issues/10
I change line 131 to: ApiException $exception
And I get
Call to undefined method SquareConnect\ApiException::getCategory()

You are not using the latest version which fixed #10 and #11

After updating dont forget to rerun migrations and to check if your published config file looks similar to this config

@zhsolutions awaiting your feedback

My Composer Config is:     "nikolag/square": "^1.1",

Seems like your composer didn't fetch the newest version, remove your composer.lock file and remove vendor folder and run composer update, tell me which version does composer install?

This is the installation output of the CL running :
composer require nikolag/square --dev

Installing nikolag/core (v1.0.0): Downloading (100%)
Installing square/connect (2.4.0): Downloading (100%)
Installing nikolag/square (v1.1.0): Downloading (100%)

After that the Issue #10 still present.

@zhsolutions can you check does the file SquareConfig.php from v1.1.0 match the same file in your vendor folder?

It Does not Match

Hmm that is strange, if you are truly installing v1.1.0 then both your local copy in vendor and external one here should match..

I do not disagree...BUT i can tell you the composer file, the locked file both confirm its 1.1.0
I also uninstalled & deleted any record of the old installation before  running the new ccommand..
Seems likes its downloading some sort of old cache of the files rather then the actual files.
IDK, i manually overwrote the files with the downloaded ones from the .zip.
Seems as though that worked

@zhsolutions try running composer clearcache nikolag/square nikolag/core and then remove vendor, composer.lock and do composer install

@zhsolutions if the above solution worked, please close the issues

@zhsolutions closing the issues since u are not responding I take it that you've resolved the issue, feel free to reopen it if it appears again


Version 0.4.2

I am going to prepare a new release of picozero - 0.4.2 - it will include a couple of small bug fixes but I am doing it mainly to run through the release process using a fork of the main repo.
I'll keep track of where we are in the process in this issue and assign tasks which I cant do myself.

@MarcScott I cant assign you to an issue, hopefully if I tag you, you will see it.

Create PR #107 for version 0.4.2
@MarcScott could you review please.

I have released version 0.4.2 to PyPI - https://pypi.org/project/picozero/0.4.2/
@MarcScott can you:

create a PR and merge the dev branch into main
create a release with the tag 0.4.2 and upload the release tar.gz file to it - https://files.pythonhosted.org/packages/f5/b5/8a241bbd029b5116d36070ebc0f13caa6efa3a77cfe174e889418e60b8f4/picozero-0.4.2.tar.gz
close a couple of issues which have been resolved by the release

#101 and #103 have been resolved with this release. @MarcScott can you close them please.

I wonder is this project dead?


Fix append_slash_redirect when PATH_INFO has internal slashes

(This seems to have been a contentious issue — please don't hate me.)
This addresses an issue — reported before in #1972 — namely that werkzeug.utils.append_slash_redirect does not work correctly if PATH_INFO contains internal slashes.
Suppose a request comes in for http://example.com/app/foo/bar.  Assume this makes it to the WSGI app with environ["SCRIPT_NAME"] = "/app" and environ["PATH_INFO"] = "/foo/bar".  The app, in order to append a slash to the URL returns append_slash_redirect(environ).  As things stand, this issues a redirect to the relative path "foo/bar/".  That path gets interpreted relative to the base URL implied by the original request ("http://example.com/app/foo/bar") resulting in a final location of "http://example.com/app/foo/foo/bar/".  This is not quite what is wanted — one foo is enough for us.
The solution is to redirect to a relative path (as is currently done), but redirect to a relative path that contains only the trailing component PATH_INFO.
This PR fixes that and includes new tests that exercise the problem.
Relation to Prior Work
Note that this issue is subtly different than that purportedly "fixed" by PR #1538.  PR #1538, as demonstrated by the tests included in that PR wants to redirect to an absolute path based on PATH_INFO. This results in (incorrectly) discarding any leading path components that may be in SCRIPT_NAME.
There is also #1842.  Due to its brevity, it is unclear precisely what issue is being described therein, but the proposed fix is the same as the (incorrect) solution proposed in #1538.

Issues Fixed

fixes #1972

Checklist

[x] Add tests that demonstrate the correct behavior of the change. Tests should fail without the change.
[n/a] Add or update relevant docs, in the docs folder and in code.
[x] Add an entry in CHANGES.rst summarizing the change and linking to the issue.
[n/a] Add .. versionchanged:: entries in any relevant code docs.
[x] Run pre-commit hooks and fix any issues.
[x] Run pytest and tox, no tests failed.

Thank you, this finally makes sense. The issue is that Request.autocorrect_location_header uses the urljoin behavior to join the relative redirect URL to the full request path. The full path includes both SCRIPT_NAME and PATH_INFO, but the redirect was using the entire PATH_INFO. Relative URL join behavior is to replace only the last segment of the path with the new relative path, so append_slash_redirect needs to only return that last segment.


Glow jumps around with inner "layers"

First of all, love this package!
I ran into an issue with it, however. The glow is jumping around with certain inner elements. I noticed this is because of the use of layerX where srcElement on the pointermove might become one of the inner elements of the Glow container.
Here's a video that will explain what I mean:
https://github.com/codaworks/react-glow/assets/697707/243cbb45-74e7-4061-b867-9c9767ec04df
Repro at: https://stackblitz.com/edit/react-ts-jfk4fd?file=src%2FApp.tsx
I'll follow up with a PR to fix this.

Note that the repro also doubles the HOVER ME text for some reason. I haven't looked into that.

Thanks for your contribution. Using layer x/y instead of offset is precisely done to avoid this effect. I'll look into your reproduction why this still happens.
Btw the doubling do the text is because you apply a padding to [glow]. I'll add an explainer to the readme to make this clearer.

There's a quirk though. Per documentation of layerX/Y:

A positioned element is an element whose position property is set to relative, absolute or fixed. For more information about element positioning, see About Element Positioning. Note This property is provided for cross-browser compatibility. Use x instead.

https://webplatform.github.io/docs/dom/MouseEvent/layerX/
Any inner element with position absolute or relative will take over. I have verified that my PR at #4 fixes it with no performance problems - unless you have a different solution in mind. 🙂


Fixed sidebar menu

Fixed the problem of clicking the menu that has been opened repeatedly and the submenu is not closed.

Hello @owwo,
I am not sure I understand the issue. I viewed your code but the changes are not obvious. Could you please explain the issue further?
Thanks and sorry for the extra late reply!

May be repeated to expand the menu items, the submenu items are not collapsed normally.
Time is too long, I have forgotten..., so this closed!


Unable to parse HTTP header

Same as:  https://github.com/Azure/azure-sdk-for-ruby/issues/400
Traceback (most recent call last):
  File "/home/barrett/Installers/pycharm-4.5.4/helpers/pydev/pydevd.py", line 2358, in <module>
    globals = debugger.run(setup['file'], None, None, is_module)
  File "/home/barrett/Installers/pycharm-4.5.4/helpers/pydev/pydevd.py", line 1778, in run
    pydev_imports.execfile(file, globals, locals)  # execute the script
  File "/home/barrett/Git/bnr_robot_software/src/bnr_analytics/bnr_distributed_common/test/scratch.py", line 28, in <module>
    timeout=5)
  File "/usr/local/lib/python2.7/dist-packages/azure/servicebus/servicebusservice.py", line 972, in receive_subscription_message
    timeout)
  File "/usr/local/lib/python2.7/dist-packages/azure/servicebus/servicebusservice.py", line 700, in peek_lock_subscription_message
    return _create_message(response, self)
  File "/usr/local/lib/python2.7/dist-packages/azure/servicebus/_serialization.py", line 100, in _create_message
    elif str(int(float(value))) == value:
ValueError: could not convert string to float: max-age=31536000

✗ pip freeze | grep azure
azure==1.0.3
azure-common==1.1.4
azure-mgmt==0.20.2
azure-mgmt-common==0.20.0
azure-mgmt-compute==0.20.1
azure-mgmt-network==0.20.1
azure-mgmt-nspkg==1.0.0
azure-mgmt-resource==0.20.1
azure-mgmt-storage==0.20.0
azure-nspkg==1.0.0
azure-servicebus==0.20.2
azure-servicemanagement-legacy==0.20.2
azure-storage==0.31.0
 ✗ python ../bnr_distributed_common/test/scratch.py
1
PT1M
PT2M
Traceback (most recent call last):
  File "../bnr_distributed_common/test/scratch.py", line 28, in <module>
    timeout=5)
  File "/usr/local/lib/python2.7/dist-packages/azure/servicebus/servicebusservice.py", line 972, in receive_subscription_message
    timeout)
  File "/usr/local/lib/python2.7/dist-packages/azure/servicebus/servicebusservice.py", line 700, in peek_lock_subscription_message
    return _create_message(response, self)
  File "/usr/local/lib/python2.7/dist-packages/azure/servicebus/_serialization.py", line 100, in _create_message
    elif str(int(float(value))) == value:
ValueError: could not convert string to float: max-age=31536000

Hi @bearrito
This was supposed to be fixed in 0.20.2 of servicebus (https://github.com/Azure/azure-sdk-for-python/pull/657)
I take a look right now.

I was running in a virtualenv, maybe I had site packages enabled. I'll double check on my end.

Based on the "line 100", you are using the 0.20.2 version (the fix in 0.20.2 was added line 87, then the previous exception came from line 99). I wasn't able to reproduce it yet, but seems a real problem.

I executed exactly the same code (it seems):
self.sbs.receive_subscription_message(self.topic_name, 'MySubscription', True, 5)

But was not able to reproduce it. Could you confirm the state of your double check?

Looks fine. I confirmed I had an issue with my virtualenv.
I think this ticket can be closed.

Ok, no problem! Feel free to re-open the issue if necessary :)


Bundle error logging

https://loom.com/share/2a2039a17af04e23838561a08b0c6aaf
What is this PR doing?

Adding a submit error column to the DB
Updating the bundle receipt API call to return a 202 if the bundle exists in the DB
New response object for bundle receipt API call (note: this will break demos.  It's a simple fix but I want to make sure it is okay with everyone)

Additional work

We would need to update examples and the extension because right now, they expect the /bundleReceipt API call to return a 404 when a bundle is pending.

Future improvements

Add a status column to the bundles table so that we don't delete bundles when the are successful or fail (we are currently storing the successful bundles in memory)

How can these changes be manually tested?
You can run the zeroAddressError script to trigger a bundle error and log out a message
Does this PR resolve or contribute to any issues?
Resolves https://github.com/web3well/bls-wallet/issues/301
Checklist

[x] I have manually tested these changes
[x] Post a link to the PR in the group chat

Guidelines

If your PR is not ready, mark it as a draft
The resolve conversation button is for reviewers, not authors

(But add a 'done' comment or similar)

Would be good to have an integration test case(s) for the HTTP 202 path that ensures the bundle lifecycle & error decoding works as expected.

Yeah good call, I'll write some tests for this 👍

Idk how I'm missing these lint errors

How's your IDE set-up? Are the linting errors showing? Is autofix-on-save working?


Follow newer spec (replacement coding & CAPITAL letter labels)

'labels.py' is outdated.

the new coding 'replacement' is introduced (in 2013!).
label names now uses uppercases (utf-8 -> UTF-8).

1 is heavier, so I dealt with 2 first,
artificially removing the new coding from 'labels.py'.

https://travis-ci.org/gsnedders/python-webencodings/jobs/564491375
from contextlib import suppress
ImportError: cannot import name suppress
contextlib.suppress: New in version 3.4.
pytest >= Python3.5
pluggy >= Python3.4
importlib_metadata >= Python3.4

I have implemented 'replacement' encoding in an different place (Python3 only).
I would be happy if someone take a look at it (and correct if something is wrong).
https://github.com/openandclose/html5prescan/blob/master/src/html5prescan/replacement.py


Zoomed in extent is unlimited

It's possible to zoom in too far using the mousewheel causing a failed render:
Invalid value for <path> attribute d="M-Infinity,-466.1657812499783L-Infinity ...
Zooming in on the primary or nav chart beyond the error causes the chart's zoom level to 'wrap around' and render using the full nav domain.

Implement maximum zoom on sc.util.zoomControl?

It's a bit tricky because scale on the zoom behavior refers only to the new scale level for the current event - the best approach imo would be to only zoom in if the viewDomain is still going to show at least the size of one period of data (we can put this on the dataModel), else size the viewDomain to be exactly one period of data

Can throttle zoom, ask Rob what he thinks?

Confirmed

We want to restrict zoom-in to more than 5 of the selected data period, see #273 for implementation on zoom.

Working with Nav brush is much more tricky. Expected behaviour is as follows:

Attempting to decrease brush extent to less than minimum results in no movement of brush even when the mouse passes the point where the brush changes its orientation. Increasing back in the previous direction results in expected behaviour. (There is no 'flip' of the brush)

When selecting a new domain, we can select as small a domain as possible (which is rendered) until we select over the minimum. After this, we revert to the behaviour in 1.

My work on this
https://github.com/djmiley/d3fc-showcase/tree/bug/zoominextent

Question- should the nav bar update continuously in on('brush'), or should it be restricted to only update in on('brushend')? Restricting to 'on('brushend') would make solving this far easier,

Duplicated by #499 (reopen if you disagree :))


Fix Select/Multiselect relationship BelongsToThrough

In the next days i'll investigate on entire package ( all component and table )
Now this PR is to fix Select/Multiselect component from Form using BelongsToThrough relationship.

Thanks


Fix publish twice

https://sentry.io/govuk/app-content-publisher/issues/682788212/

Strangely your comment isn't appearing, so this reply might look a bit strange! I noticed we weren't exactly checking the 'self_declared_review_state' param before either; perhaps we shouldn't be defaulting it either. My thought is that it'll be handled implicitly by the model validation, but we can do an explicit check instead if you prefer?
Perhaps now is also a good time to remove the inconsistent default and show an array if the user doesn't select something, unless it's intentional - but then we should preselect the radio button like we do with the change note.

I'd suggest the ternary option is the best for the scope of what you're trying to achieve here, as the latter feels a substantial increase in scope. Can you write a card for the latter so we can check it with product too and have a ponder if there are other parts of the app that are similar?

Got a card for the defaulting https://trello.com/c/LhoqJDhC/623-revisit-the-radio-buttons-for-the-publish-confirmation-screen.

Should be OK now - can you take another look?


Combine all plotting functions into one function

Three plotting functions

Simulation data
Test plots
Comparison of data between multiple simulations

Plots
Simulation data

Animated

Fire history
Priority history

FIS parameters
Objective function hist
Objective function sum hist
FIS param hist
Agent location hist
cell scan time hist

Test plots

FIS sensitivity
Obj sensitivity
Solver comparison

Comparison of data between multiple simulations

Objective function hist
Objective function sum hist
FIS param hist
Agent location hist / cell scan time hist?

Two functions - one for plotting individual simulation results, another for plotting results from multiple simulations. Additional work to be detailed in individual issues.


try-catch-swallow in array resolution too general?

If I understand #71 correctly, we need to account for the case when creating a generic type fails because of generic constraints not being satisfied. The only way to do it, is an attempt to make the generic type and catch the exception. However, in the fix for #71: https://github.com/unitycontainer/container/commit/254c4fb5bca3cfc055defcef2835194ef4ad77f0 all exceptions are being swallowed for all cases (not only generics) on a higher level than the actual attempt of creating the generic type. What is the rationale for that?
The problem is that the following test, which looks like a reasonable expectation will fail:
[Test]
public void FailedResolveAllTest()
{
    var container = new UnityContainer();

    container.RegisterType<ITestService>(
            string.Empty,
            new SingletonLifetimeManager(),
            new InjectionFactory(
                c => { throw new InvalidOperationException(); }));

    Assert.Throws<ResolutionFailedException>(() => container.ResolveAll<ITestService>());
}

Duplicate #87

Fixed in https://github.com/unitycontainer/container/commit/941cdd6d7e41e976431763c511c466f0b26d309b


[Bug Report] YouTube links stopped

hi
The bot stopped running YouTube links

Please take a look at existing issues, and use the bug report template if you have an issue not already known.


Specs got stuck in the end

I'm using superagent-mock to mock my requests and, even returning the correct result and the tests are passing, after all specs are done, the suite got stuck and release after 60s (probably a timeout).
Disabling superagent-mock makes all the specs to pass (hitting the real server), and the suite finishes instantly.
Below is my spec:
  describe('search triggers', () => {
    const mockObj = superagentMock(request, rules)

    describe('city search', () => {
      beforeEach(() => triggerSearchByCity())

      it('should update the state', () => {
        expect(subject.state.loaded).toEqual(true)
        expect(subject.state.data).toEqual(apiMocks.cityResponse)
      })
    })

And my mock setup rules:
 rules= [{
    pattern: 'http://api.openweathermap.org/data/2.5/weather(.*)',

    fixtures: function (match, params, headers, context) {
      // City search mock
      if (match[1] === '?q=Berlin%2CDE&units=metric&APPID=[MY APP ID]') {
        return cityResponse
      }

    get: function (match, data) {
      return {
        body: data
      };
    }
  }
];

And my superagent call:
  return new Promise((resolve, reject) => {
    request
      .get('http://api.openweathermap.org/data/2.5/weather')
      .query({
        q: `Berlin,DE`,
        units: 'metric',
        APPID: '[My APP ID]'
      })
      .end((err, res) => {
        if (err) { reject (err)      }
        else     { resolve(res.body) }
      })
  })

The promise above is resolved in the triggerSearchByCity() method.
UPDATE:
Here's another simpler setup that causes the same problem:
https://gist.github.com/mauricioklein/b0dd5768bce0075232729596dc71a83f
Thanks!

Hi,
You may have a case sensitive problem here ?
In your setup:
if (match[1] === '?q=Berlin%2CDE&units=metric&APPID=[MY APP ID]') {
In your call:
APPID: '[My APP ID]'

Hello, thanks for your response.
Actually, this is just placeholder, to not share my personal key.
I've checked and the APP key is right on both sides 👍

Also, the mock is matching and I'm getting the valid mocked response, and all the specs are passing.
The problem is that, after all the specs run, the terminal is not released.
Only after 60s, I get the Jest message of success, and the terminal is released.
This causes my specs, that normally takes 3s, to finish in more than 1 minute.
Thanks!

Here's another (and simpler) setup that causes the same problem.
https://gist.github.com/mauricioklein/badb31ada9487f16f2376107a774deaf

Maybe because you don't return the promise in your test ?
it('should process failure result', () =>
  getWeatherForCity('Foo', 'Bar').then(() => {},
    err => expect(err).toEqual(Error(500))
  )
)

Thanks for your comment, but it didn't solved the problem:
import { getWeatherForGeoloc, getWeatherForCity } from 'api'

import request from 'superagent';
import * as apiMocks from 'mocks'

describe('API', () => {
  var mock = null
  beforeEach(() => mock = require('superagent-mock')(request, apiMocks.rules))
  afterEach(() => mock.unset())

  describe('#getWeatherForCity', () => {
    it('should process success result', () =>
      getWeatherForCity('Berlin', 'DE').then(body =>
        expect(body).toEqual(apiMocks.cityResponse)
      )
    )

    it('should process failure result', () =>
      getWeatherForCity('Foo', 'Bar').then(() => {},
        err => expect(err).toEqual(Error(500))
      )
    )
  })

Any further suggestions about how to fix that?
I really have no clue why this is happening and, since I disable the mock library, the tests finishes instantly, I suppose could be something related to the library itself.
Thanks!

I am experiencing the exact same thing after upgrading..

superagent 3.5.2 => 3.8.1
superagent-mock 2.0.1 => 3.6.0

With no other changes, I experience the same thing with all the tests completing instantly followed by everything hanging for 60 seconds.

Downgrading to 2.0.1 seems to fix this.

I can't reproduce on<EMAIL_ADDRESS>and<EMAIL_ADDRESS>:unamused:
superagent-mock is designed for functional testing environment.
I should encourage you to mock superagent with Jest
jest.mock('superagent', () =>  ({
  get: jest.fn().mockReturnThis(),
  query: jest.fn().mockReturnThis(),
  timeout: jest.fn().mockReturnThis(),
  post: jest.fn().mockReturnThis(),
  del: jest.fn().mockReturnThis(),
  set: jest.fn().mockReturnThis(),
  end: jest.fn(),
})

I just started experiencing this issue, but after a bunch of digging, haven't really found the cause.
What's strange is that my current setup was lifted from a Node (w/Babel because Jest does not currently support mocking modules with ESM, which was what I wrote it with) which works as a charm. The difference here is that I'm now using TypeScript and I don't really see how that can cause an issue. Even has the same docker environment and dependency versions, so it's not anything related to the runtime.
I noticed that this only happens when there's a match for a defined pattern, and removing any matching pattern will make tests go through, so the issue definitely lies within this library somewhere.
I'll update this thread if I find something just in case anyone else stumbles across this one.

@fdubost not sure why issue is closed. it's still happening.
i've pinpointed to this particular moment https://github.com/M6Web/superagent-mock/blob/master/src/superagent-mock.js#L237-L242 where the setTimeout is never called ; but not sure why. It'd be great to fix it.


Fixes cases when the "Home" directory has spaces in it.

Thank Bradley T. Landis for this patch. He submitted this patch via a comment on my blog. I tried it out and it seems to work great.

See #24 :)

Ha! Doh!

Sorry Phil, I should have mentioned on your blog that I was submitting it. :)

No worries! As long as it gets there! :)


Allow stories to seed their own data using the factories defined within the makeServer function.

This PR allows a story to seed its own data based on factories in the server.
To do so it would look like this:
Story.parameters = {
  mirage: {
    logging: true,
    handlers: {...},
    factorySeeds: {
        // create 2 addresses with the same traits.
        address: [{ traits: ['withRecipient', 'withCompleteAddress'], count: 2 }],
        // create a single cart item with no specific traits
        cart: [{}],
        // create 2 users with different traits
        user: [
          { traits: ['withAddress', 'withSubscription'] },
          { traits: ['withAddress'] },
        ],
        // create 2 items that contain override values
        items: [
          {
            traits: [
              'withSomeTrait',
              'withOtherTrait',
              // override certain values
              {
                name: 'R2D2',
                gender: 'Male',
              },
            ],
          },
          {
            traits: [
              'withSomeTrait',
              'withOtherTrait',
              {
                name: 'BB8',
                gender: 'Male',
              },
            ],
          },
        ],
    },
  },
};

Where the name of the property corresponds to one of the factories, and value is an array of items with 1. traits as an array of trait names (defined within that factory in makeServer) or an object of data to pass in specific override values and 2. a count property to indicate how many of that type of item should be created, defaulting to 1.

Another choice may be to create a seeds property which has both fixtures and factories nested under it rather than have them both be top level properties.

@HipsterBrown Added an example. Let me know if you'd like me to change anything. I was pretty light on the styling but I can add more if you prefer. Thanks for taking a look!

Added more styling to make it look like your Page story :). Thanks for approving


Add Faiss Search

Codecov Report

Merging #1210 (145a76b) into main (68a9f1a) will increase coverage by 1.08%.
The diff coverage is 98.76%.

:exclamation: Current head 145a76b differs from pull request most recent head fb3abdf. Consider uploading reports for the commit fb3abdf to get more accurate results

@@            Coverage Diff             @@
##             main    #1210      +/-   ##
==========================================
+ Coverage   67.53%   68.61%   +1.08%
==========================================
  Files         242      247       +5
  Lines       11104    11892     +788
  Branches     1844     1960     +116
==========================================
+ Hits         7499     8160     +661
- Misses       3124     3225     +101
- Partials      481      507      +26

Impacted Files
Coverage Δ

towhee/connectors/ann_index/faiss.py
98.63% <98.63%> (ø)

towhee/connectors/__init__.py
90.90% <100.00%> (+10.90%)
:arrow_up:

towhee/connectors/ann_index/__init__.py
100.00% <100.00%> (ø)

towhee/models/vit/vit.py
47.79% <0.00%> (-33.09%)
:arrow_down:

...s/video_swin_transformer/video_swin_transformer.py
44.54% <0.00%> (-4.18%)
:arrow_down:

towhee/models/layers/patch_embed2d.py
88.57% <0.00%> (-4.03%)
:arrow_down:

towhee/models/timesformer/timesformer.py
80.18% <0.00%> (-2.84%)
:arrow_down:

towhee/dataframe/dataframe.py
73.10% <0.00%> (-1.05%)
:arrow_down:

towhee/models/layers/mlp.py
100.00% <0.00%> (ø)

towhee/models/vit/vit_block.py
100.00% <0.00%> (ø)

... and 9 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 68a9f1a...fb3abdf. Read the comment docs.

This assumes that the user has already installed faiss. Wouldn't it be better to package all of our ANN engines as hub operators?

This assumes that the user has already installed faiss. Wouldn't it be better to package all of our ANN engines as hub operators?

The anns.insert is a reduce operator, but our engine can not support reduce. We decide impl the faiss op after framework supporting reduce op. I will close this pr.


Run test on device by serial works incorrect.

(It is duplicate of closed issue #311 and #314.)
Good day!
I use selendroid 0.10 but I have the same issue when I try run my test on the specific ID.
I use two " Nexus 5", one of them 4.4.2 version second 4.4.3 version. (For both the same Android 19 API)
PS: It seems that test runs on the device that first in the devices list in command shell.

Hi,
I am still getting this issue with standalone server 0.12.I am using devices Galaxy S4 and Nexus5 and even after I use setSerial("xxx") method ,it is defaulting to top device in adb devices list

Hi I am still seeing this issue on 1.12.0.appears that standalone server 0.12 defaults to the top device in adb devices list.


Adding multiple font attributes causes email client to not import fonts

Describe the bug
This could potentially be a user error based on misunderstanding the docs. Using multiple  tags in the head is causing just the default font to be used in the received email, client-side. The preview HTML shows up correctly though in iContact as well as the MJML editor: https://mjml.io/try-it-live/ACMGLQPDcho
To Reproduce
Steps to reproduce the behavior:

Create a JSON obj with multiple <mj-font> attributes in the <mj-head>. In markup that translates to:

<mjml>
  <mj-head>
     <mj-font name="Raleway"
       href="https://fonts.googleapis.com/css?family=Raleway" />
     <mj-font name="Lobster"
       href="https://fonts.googleapis.com/css?family=Lobster" />
     <mj-font name="Balsamiq Sans"
       href="https://fonts.googleapis.com/css?family=Balsamiq%20Sans" />
  </mj-head>
  <mj-body>
    <mj-section>
      <mj-column>
        <mj-text font-size="20px" color="#F45E43" font-family="Raleway">Hello World</mj-text>
        <mj-text font-size="20px" color="#F45E43" font-family="Lobster">Hello World</mj-text>
        <mj-text font-size="20px" color="#F45E43" font-family="Balsamiq Sans">Hello World</mj-text>
      </mj-column>
    </mj-section>
  </mj-body>
</mjml>

Render it to HTML by doing mjml2html (I'm doing JSON in MJML but testing it in the editor with raw MJML gives the same issue)
Send the HTML to either Outlook or Gmail accounts
See error

Expected behavior
All fonts should display in the email client
MJML environment (please complete the following information):

OS: MacOS
MJML Version: 4.9.0
MJML tool used: mjml2html (mjml-browser)

Email sending environment(for rendering issues):

Platform used to send the email iContact]

Affected email clients (for rendering issues):

Email Client: Gmail, Outlook
OS: Windows, iOS, Mac
Browser: Chrome mobile/desktop, & in-app

Screenshots
Email Preview:

Outlook web client received:

Gmail web client received:

Same as the above two for mobile clients + desktop outlook client.

Both clients doesn’t support external font so that’s normal

On 19 Mar 2021, at 19:13, Tony @.***> wrote:

Describe the bug
This could potentially be a user error based on misunderstanding the docs. Using multiple tags in the head is causing just the default font to be used in the received email, client-side. The preview HTML shows up correctly though in iContact as well as the MJML editor: https://mjml.io/try-it-live/ACMGLQPDcho
To Reproduce
Steps to reproduce the behavior:
Create a JSON obj with multiple  attributes in the . In markup that translates to:

Hello World
Hello World
Hello World

Render it to HTML by doing mjml2html (I'm doing JSON in MJML but testing it in the editor with raw MJML gives the same issue)
Send the HTML to either Outlook or Gmail accounts
See error
Expected behavior
All fonts should display in the email client
MJML environment (please complete the following information):
OS: MacOS
MJML Version: 4.9.0
MJML tool used: mjml2html (mjml-browser)
Email sending environment(for rendering issues):
Platform used to send the email iContact]
Affected email clients (for rendering issues):
Email Client: Gmail, Outlook
OS: Windows, iOS, Mac
Browser: Chrome mobile/desktop, & in-app
Screenshots
Email Preview:
Outlook web client received:
Gmail web client received:
Same as the above two for mobile clients + desktop outlook client.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.

Ohh okay thanks for lettin me know. I think adding a notice to the mj-font docs about that, similar to the notices on mj-hero would be really helpful!

Well we might add some notice to check https://www.caniemail.com/ for those stuff because it provides way more info than we could provide into our doc without bloating it.


fix "board" option being missing in snake game code

source: https://github.com/GizmolabAI/djs-games/issues/15


        Given two array_like objects, check that the shape is equal and all
        elements of these objects are equal. An exception is raised at
        shape mismatch or conflicting values. In contrast to the standard usage
        in numpy, NaNs are compared like numbers, no assertion is raised if
        both objects have NaNs in the same positions.

        The usual caution for verifying equality with floating point numbers is
        advised.

        Parameters
        ----------
        x : array_like
            The actual object to check.
        y : array_like
            The desired, expected object.
        err_msg : str, optional
            The error message to be printed in case of failure.
        verbose : bool, optional
            If True, the conflicting values are appended to the error message.

        Raises
        ------
        AssertionError
            If actual and desired objects are not equal.

        See Also
        --------
        assert_allclose: Compare two array_like objects for equality with desired
                         relative and/or absolute precision.
        assert_array_almost_equal_nulp, assert_array_max_ulp, assert_equal

        Examples
        --------
        The first assert does not raise an exception:

        >>> np.testing.assert_array_equal([1.0,2.33333,np.nan],
        ...                               [np.exp(0),2.33333, np.nan])

        Assert fails with numerical inprecision with floats:

        >>> np.testing.assert_array_equal([1.0,np.pi,np.nan],
        ...                               [1, np.sqrt(np.pi)**2, np.nan])
        ...
        <type 'exceptions.ValueError'>:
        AssertionError:
        Arrays are not equal
        <BLANKLINE>
        (mismatch 50.0%)
         x: array([ 1.        ,  3.14159265,         NaN])
         y: array([ 1.        ,  3.14159265,         NaN])

        Use `assert_allclose` or one of the nulp (number of floating point values)
        functions for these cases instead:

        >>> np.testing.assert_allclose([1.0,np.pi,np.nan],
        ...                            [1, np.sqrt(np.pi)**2, np.nan],
        ...                            rtol=1e-10, atol=0)

        """
        assert_array_compare(operator.__eq__, x, y, err_msg=err_msg,
>                            verbose=verbose, header='Arrays are not equal')
E       AssertionError:
E       Arrays are not equal
E
E       (mismatch 50.0%)
E        x: array([[ 1.,  0.]])
E        y: array([[0, 0]])

those of you with Macs, please try to reproduce

I couldn't reproduce it on my Mac. It looks like an stable bug that results from precision lost during floating number calculation.

Closed since we can not reproduce the error. Its probably fixed due to some changes we did lately. Please reopen if the error shows up again.


add 1fps lower limit to delta time multiplier.

I am not 100% sure how to fix this. But what happens is. Every frame, I take 1/current fps * 60 to get the "delta time multiplier" I then use this in my physics and multiply is against speed.
for example, if you are playing the game with 30 fps. You will go 2x as fast to accommodate.
The issue arises after pausing the game for a while. You will zoom around the map.

Resolved in d4ebd36610d3b43770a94e5e80bac604adccfc90


Bump charlock_holmes to 0.7.5

Recently I installed Carto on a new brand laptop, and when I went to bundle install I had some issues with charlock_holmes gem:
Building native extensions.  This could take a while...
ERROR:  Error installing charlock_holmes:
    ERROR: Failed to build gem native extension.
    current directory: /Users/buti/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/charlock_holmes-0.7.2/ext/charlock_holmes
/Users/buti/.rbenv/versions/2.2.3/bin/ruby -r ./siteconf20170825-25745-g0t4kc.rb extconf.rb
checking for main() in -licui18n... no
checking for main() in -licui18n... yes
checking for unicode/ucnv.h... yes
checking for main() in -lz... yes
checking for main() in -licuuc... yes
checking for main() in -licudata... yes
creating Makefile
current directory: /Users/buti/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/charlock_holmes-0.7.2/ext/charlock_holmes
make "DESTDIR=" clean
current directory: /Users/buti/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/charlock_holmes-0.7.2/ext/charlock_holmes
make "DESTDIR="
compiling converter.c
In file included from converter.c:2:
./common.h:23:14: warning: unused function 'charlock_new_str' [-Wunused-function]
static VALUE charlock_new_str(const char *str, size_t len)
             ^
./common.h:32:14: warning: unused function 'charlock_new_str2' [-Wunused-function]
static VALUE charlock_new_str2(const char *str)
             ^
2 warnings generated.
compiling encoding_detector.c
In file included from encoding_detector.c:2:
./common.h:14:14: warning: unused function 'charlock_new_enc_str' [-Wunused-function]
static VALUE charlock_new_enc_str(const char *str, size_t len, void *encoding)
             ^
1 warning generated.
compiling ext.c
In file included from ext.c:1:
./common.h:14:14: warning: unused function 'charlock_new_enc_str' [-Wunused-function]
static VALUE charlock_new_enc_str(const char *str, size_t len, void *encoding)
             ^
./common.h:23:14: warning: unused function 'charlock_new_str' [-Wunused-function]
static VALUE charlock_new_str(const char *str, size_t len)
             ^
./common.h:32:14: warning: unused function 'charlock_new_str2' [-Wunused-function]
static VALUE charlock_new_str2(const char *str)
             ^
3 warnings generated.
compiling transliterator.cpp
In file included from transliterator.cpp:5:
In file included from /usr/local/Cellar/icu4c/59.1/include/unicode/translit.h:25:
In file included from /usr/local/Cellar/icu4c/59.1/include/unicode/unistr.h:33:
/usr/local/Cellar/icu4c/59.1/include/unicode/char16ptr.h:90:19: warning: deleted function definitions are a C++11 extension [-Wc++11-extensions]
    Char16Ptr() = delete;
                  ^
/usr/local/Cellar/icu4c/59.1/include/unicode/char16ptr.h:198:24: warning: deleted function definitions are a C++11 extension [-Wc++11-extensions]
    ConstChar16Ptr() = delete;
                       ^
In file included from transliterator.cpp:5:
In file included from /usr/local/Cellar/icu4c/59.1/include/unicode/translit.h:25:
/usr/local/Cellar/icu4c/59.1/include/unicode/unistr.h:3025:7: error: delegating constructors are permitted only in C++11
      UnicodeString(ConstChar16Ptr(text)) {}
      ^~~~~~~~~~~~~
/usr/local/Cellar/icu4c/59.1/include/unicode/unistr.h:3087:7: error: delegating constructors are permitted only in C++11
      UnicodeString(ConstChar16Ptr(text), length) {}
      ^~~~~~~~~~~~~
/usr/local/Cellar/icu4c/59.1/include/unicode/unistr.h:3180:7: error: delegating constructors are permitted only in C++11
      UnicodeString(Char16Ptr(buffer), buffLength, buffCapacity) {}
      ^~~~~~~~~~~~~
2 warnings and 3 errors generated.
make: *** [transliterator.o] Error 1
make failed, exit code 2
Gem files will remain installed in /Users/buti/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/charlock_holmes-0.7.2 for inspection.
Results logged to /Users/buti/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/extensions/x86_64-darwin-16/2.2.0-static/charlock_holmes-0.7.2/gem_make.out

For some reason, C++11 was not available to gcc when compiling icu. But the thing is, version 0.7.5 already does it as part the gem itself: https://github.com/brianmario/charlock_holmes/pull/116.
It's a minor bump, so I'm confident it will not break anything. Tested locally and it works without any issue. Time to test it more deeply.

I have also found that bug, previously reported to https://github.com/gfiorav/carto_loves_mac/issues/12

It's in ded04, I did some tests and I could not see any issue.

Not in ded04 anymore.

So? could we merge it?

I couldn't see any issue but I'd sleep better if someone else could take a look.

Necrobumping this one. I'll do some quick acceptance and merge if everything is OK.


Third Party Cookie Deprecation - What Google Chrome Version Will Release These Changes?

Hey Google Chrome Labs team,
I am curious if there is a Google Chrome Version which will have the Third Party Cookie Deprecation
GA of Google Chrome I currently have is 119.0.6045.106
Canary of Google Chrome I currently have is 121.0.6113.0
If I could be informed on what version the Third Party Cookie Deprecation will being for Google Chrome, I could perform my testing on our product
Thank you

Hi there - for now, you can test with the --test-third-party-cookie-phaseout commandline switch, or enabled the chrome://flags/#test-third-party-cookie-phaseout flag. These are in Chrome 118 and above, but testing with Canary is typically a good idea as it may have recent bug fixes or feature updates.
See https://developer.chrome.com/en/docs/privacy-sandbox/third-party-cookie-phase-out/#test for more info.

@miketaylr  Thank you for your quick feedback!

Hi @miketaylr, I'm curious, when Chrome ramps up the third-party cookie restrictions to 100% of users in Q3 2024, what versions of users will be affected? Will it only affect users with versions greater than 119, or will it affect users of all versions?
If so, what solution should we provide for users below version 114 since neither CHIPS nor Storage Access API is supported in these versions.

I don't think we have identified an exact version for further rollout, but it should not affect older versions prior to M120.


Unify C# and TS SignalR client auto-reconnect APIs

Fixes #10128.
This changes the older TS IReconnectPolicy to be more like the newer C# IRetryPolicy which takes a context instead of individual arguments. This will break custom IReconnectPolicy's that might have been written using an earlier preview.
One thing that's unchanged is the "InMilliseconds" suffix on nextRetryDelayInMilliseconds since TS/JS don't have a standard specialized TimeSpan type. Everyone just uses milliseconds.

Let's get this in before noon.

Let's get this in before noon.

It will need to target branch release/3.0-preview6

Also NOTE we have branched so this needs to be retargetted to release/3.0-preview6 to get in to that milestone.

Do we feel this is essential for preview6? We need QB approval if so.

It's a breaking change so it would have been nice for preview6 but I don't think we need to force it.

FYI @halter73, whenever making SignalR TS client changes we now also need to build the blazor project to update the "ref assembly" for "blazor.server.js".

Do we feel this is essential for preview6? We need QB approval if so.

Not particularly, but as @mikaelm12 it breaks people writing custom nextRetryDelayInMilliseconds callbacks. I don't know if (m)any other than me has done so though.

I get it, but I think we need to limit the churn we take now that the coherency process is starting up.


Error for this code

What is the error for this code?
When I used the Middlebury evaluation SDK, I got a very high error of 85% if I set the bad threshold to 10. The AD-Census algorithm is run with the default disparity values. The final image generated is compared with the ground truth image present in the repo.
Upon increasing the threshold, the error decreases. However, this does not seem to be right. Because increasing the threshold means we are allowing a larger margin for error in the pixel values of the generated disparity and the ground truth disparity.
Is there some bug in the code or the method of evaluation needs to be changed? Can anyone help in this regard?

the real disparity values are saved in array "disparity", which was defined as float32 type.
the final saved image who's format is "png" is for displaying, can't be used to evaluate.
you should save array "disparity" in PFM format, which can be done by Middlebury evaluation SDK, then evaluating with PFM file.
Besides, all valid values in array "disparity" should be multiply by a factor, because the ground-truth did the same thing when generating. Please visit the dataset site to get the factor value : https://vision.middlebury.edu/stereo/data/scenes2003/. For instance, the facor is 4 for 2003 datasets.

I'm sorry I didn't write this part of the code, considering that this will introduce other third-party libraries.

Thanks a lot for the reply.
However, this is specific to Middlebury. I want to evaluate it for KITTI 2015 training dataset: http://www.cvlibs.net/datasets/kitti/eval_scene_flow.php?benchmark=stereo
For evaluating for KITTI, I used the disparity array and calculated the 3-pixel error with respect to the ground truth image that is in png format that is read using cv::imread. Also, there is no factor for the KITTI dataset.
The error comes out to be 67.6% for adcensus algorithm with min disparity 0 and max disparity 64.
Can you help me with this dataset?

Strange. Did you skip those invalid disparities which are equal to Invalid_Float? or did you only evaluate those pixels who have truth-value?

Yes. I used only valid values and those pixels that have positive value in the ground truth.
I used this code snippet:
double sum = 0;
int count = 0;
float ans = 0;
cv::Mat myMap = cv::imread(gt_path);
    for (sint32 i = 0; i < height; i ++)
    {
            for (sint32 j = 0; j < width; j ++)
            {
                    if(myMap.at<uchar>(i,j) > 0 && abs(disparity[i * width + j]) != Invalid_Float ){
                            sum++;
                            ans = abs(disparity[i * width + j] - myMap.at<uchar>(i,j));
                            if ( (ans > 3.0) &&  (ans / myMap.at<uchar>(i,j)  > 0.05))
                                    count ++;
                    }
            }
    }
    double result = (count + 0.0)/sum;
    cout << "disp path is: " << gt_path << endl;
    cout << "error is: " << result * 100 << endl;

Try to use cv::imread(gt_path,0)？ cv::imread load image in 3 channels by default.

Thanks a lot. That reduced the error to 18% for adcensus (min disparity 0 and max disparity 64).

OK. Try to set “ad_option.do_filling = false” and then computing error again.

It reduced further to 10.99%

OK. That's all I can think of for now.

thanks a lot.

With the above two changes, I am getting an error of 2.5% for semiglobal matching. The filling line was already false in semiglobal code.
sgm_option.is_fill_holes = false;

Sounds good

For PatchMatch, it is 14-15%. Can the error for PatchMatch and AD-Census be reduced further? Or are they inherently inferior to semi-global matching?