successfully added captcha in login and register pages with refresh button

#45

successfully added recaptcha by creating the api for it in userRoutes
[Shravan Das contributer for girls script summer of code]

Awesome thank you!!
On Fri, May 26, 2023 at 3:58 PM shravan-das @.***>
wrote:

#45 https://github.com/tusharzalte/tusharesume/issues/45
[image: Screenshot (95)]
https://user-images.githubusercontent.com/100745475/241193399-2e0c5ff5-4743-45ba-bc19-d29d4e21c610.png
[image: Screenshot (96)]
https://user-images.githubusercontent.com/100745475/241193413-2de21384-db1a-42d4-ba0f-56f3d9d90c76.png
successfully added recaptcha by creating the api for it in userRoutes
[Shravan Das contributer for girls script summer of code]
You can view, comment on, or merge this pull request online at:
https://github.com/tusharzalte/tusharesume/pull/57
Commit Summary

984c5b2
https://github.com/tusharzalte/tusharesume/pull/57/commits/984c5b2550c5bda0d113879fdcfdb131b90056e1
first change
1f6ed7c
https://github.com/tusharzalte/tusharesume/pull/57/commits/1f6ed7c7a4910415f2a2be3863d403f06c88e2ba
captcha added succesfully

File Changes
(7 files https://github.com/tusharzalte/tusharesume/pull/57/files)

A client1/.gitignore
https://github.com/tusharzalte/tusharesume/pull/57/files#diff-6847472bff2d5cd686cc2c43528efb8f4c354f42587a25dfcd04733ed8338746
(2)
M client1/package-lock.json
https://github.com/tusharzalte/tusharesume/pull/57/files#diff-6f900db4c96e755b6dc00202751d029115f32758f83a6c5a089de0efde96e104
(106)
M client1/src/Pages/Login.js
https://github.com/tusharzalte/tusharesume/pull/57/files#diff-537d9e87591c319d2077d143627ecf628cc8b1ae5fb3c350176cefa1c65898fd
(63)
M client1/src/Pages/Register.js
https://github.com/tusharzalte/tusharesume/pull/57/files#diff-32f0a470ccf023e8751b503dc55f149177920a78bc3dda44274b8b2ae6e8aa55
(61)
M package-lock.json
https://github.com/tusharzalte/tusharesume/pull/57/files#diff-053150b640a7ce75eff69d1a22cae7f0f94ad64ce9a855db544dda0929316519
(179)
M package.json
https://github.com/tusharzalte/tusharesume/pull/57/files#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519
(5)
M routes/userRoute.js
https://github.com/tusharzalte/tusharesume/pull/57/files#diff-2d3853355a0f394d222f03d85c0553dc153a969e05b125205b1ab61ad36e0390
(99)

Patch Links:

https://github.com/tusharzalte/tusharesume/pull/57.patch
https://github.com/tusharzalte/tusharesume/pull/57.diff

—
Reply to this email directly, view it on GitHub
https://github.com/tusharzalte/tusharesume/pull/57, or unsubscribe
https://github.com/notifications/unsubscribe-auth/AVTK64LE3JSWKHB63YE3S7DXICATBANCNFSM6AAAAAAYQBHMGI
.
You are receiving this because you are subscribed to this thread.Message
ID: @.***>

can you deploy it?
On Fri, May 26, 2023 at 4:02 PM Tushar Zalte @.***>
wrote:

Awesome thank you!!
On Fri, May 26, 2023 at 3:58 PM shravan-das @.***>
wrote:

#45 https://github.com/tusharzalte/tusharesume/issues/45
[image: Screenshot (95)]
https://user-images.githubusercontent.com/100745475/241193399-2e0c5ff5-4743-45ba-bc19-d29d4e21c610.png
[image: Screenshot (96)]
https://user-images.githubusercontent.com/100745475/241193413-2de21384-db1a-42d4-ba0f-56f3d9d90c76.png
successfully added recaptcha by creating the api for it in userRoutes
[Shravan Das contributer for girls script summer of code]
You can view, comment on, or merge this pull request online at:
https://github.com/tusharzalte/tusharesume/pull/57
Commit Summary

984c5b2
https://github.com/tusharzalte/tusharesume/pull/57/commits/984c5b2550c5bda0d113879fdcfdb131b90056e1
first change
1f6ed7c
https://github.com/tusharzalte/tusharesume/pull/57/commits/1f6ed7c7a4910415f2a2be3863d403f06c88e2ba
captcha added succesfully

File Changes
(7 files https://github.com/tusharzalte/tusharesume/pull/57/files)

A client1/.gitignore
https://github.com/tusharzalte/tusharesume/pull/57/files#diff-6847472bff2d5cd686cc2c43528efb8f4c354f42587a25dfcd04733ed8338746
(2)
M client1/package-lock.json
https://github.com/tusharzalte/tusharesume/pull/57/files#diff-6f900db4c96e755b6dc00202751d029115f32758f83a6c5a089de0efde96e104
(106)
M client1/src/Pages/Login.js
https://github.com/tusharzalte/tusharesume/pull/57/files#diff-537d9e87591c319d2077d143627ecf628cc8b1ae5fb3c350176cefa1c65898fd
(63)
M client1/src/Pages/Register.js
https://github.com/tusharzalte/tusharesume/pull/57/files#diff-32f0a470ccf023e8751b503dc55f149177920a78bc3dda44274b8b2ae6e8aa55
(61)
M package-lock.json
https://github.com/tusharzalte/tusharesume/pull/57/files#diff-053150b640a7ce75eff69d1a22cae7f0f94ad64ce9a855db544dda0929316519
(179)
M package.json
https://github.com/tusharzalte/tusharesume/pull/57/files#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519
(5)
M routes/userRoute.js
https://github.com/tusharzalte/tusharesume/pull/57/files#diff-2d3853355a0f394d222f03d85c0553dc153a969e05b125205b1ab61ad36e0390
(99)

Patch Links:

https://github.com/tusharzalte/tusharesume/pull/57.patch
https://github.com/tusharzalte/tusharesume/pull/57.diff

—
Reply to this email directly, view it on GitHub
https://github.com/tusharzalte/tusharesume/pull/57, or unsubscribe
https://github.com/notifications/unsubscribe-auth/AVTK64LE3JSWKHB63YE3S7DXICATBANCNFSM6AAAAAAYQBHMGI
.
You are receiving this because you are subscribed to this thread.Message
ID: @.***>

actualy i havent got any experience in deployment of nodejs application :(

I havent got any experience in deploying nodejs applications!
On Fri, 26 May, 2023, 4:02 pm tusharzalte, @.***> wrote:

can you deploy it?
On Fri, May 26, 2023 at 4:02 PM Tushar Zalte @.***>
wrote:

Awesome thank you!!
On Fri, May 26, 2023 at 3:58 PM shravan-das @.***>
wrote:

#45 https://github.com/tusharzalte/tusharesume/issues/45
[image: Screenshot (95)]
<
https://user-images.githubusercontent.com/100745475/241193399-2e0c5ff5-4743-45ba-bc19-d29d4e21c610.png

[image: Screenshot (96)]
<
https://user-images.githubusercontent.com/100745475/241193413-2de21384-db1a-42d4-ba0f-56f3d9d90c76.png

successfully added recaptcha by creating the api for it in userRoutes
[Shravan Das contributer for girls script summer of code]
You can view, comment on, or merge this pull request online at:
https://github.com/tusharzalte/tusharesume/pull/57
Commit Summary

984c5b2
<
https://github.com/tusharzalte/tusharesume/pull/57/commits/984c5b2550c5bda0d113879fdcfdb131b90056e1

first change

1f6ed7c
<
https://github.com/tusharzalte/tusharesume/pull/57/commits/1f6ed7c7a4910415f2a2be3863d403f06c88e2ba

captcha added succesfully
File Changes
(7 files https://github.com/tusharzalte/tusharesume/pull/57/files)

A client1/.gitignore
<
https://github.com/tusharzalte/tusharesume/pull/57/files#diff-6847472bff2d5cd686cc2c43528efb8f4c354f42587a25dfcd04733ed8338746

(2)

M client1/package-lock.json
<
https://github.com/tusharzalte/tusharesume/pull/57/files#diff-6f900db4c96e755b6dc00202751d029115f32758f83a6c5a089de0efde96e104

(106)

M client1/src/Pages/Login.js
<
https://github.com/tusharzalte/tusharesume/pull/57/files#diff-537d9e87591c319d2077d143627ecf628cc8b1ae5fb3c350176cefa1c65898fd

(63)

M client1/src/Pages/Register.js
<
https://github.com/tusharzalte/tusharesume/pull/57/files#diff-32f0a470ccf023e8751b503dc55f149177920a78bc3dda44274b8b2ae6e8aa55

(61)

M package-lock.json
<
https://github.com/tusharzalte/tusharesume/pull/57/files#diff-053150b640a7ce75eff69d1a22cae7f0f94ad64ce9a855db544dda0929316519

(179)

M package.json
<
https://github.com/tusharzalte/tusharesume/pull/57/files#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519

(5)

M routes/userRoute.js
<
https://github.com/tusharzalte/tusharesume/pull/57/files#diff-2d3853355a0f394d222f03d85c0553dc153a969e05b125205b1ab61ad36e0390

(99)
Patch Links:

https://github.com/tusharzalte/tusharesume/pull/57.patch
https://github.com/tusharzalte/tusharesume/pull/57.diff

—
Reply to this email directly, view it on GitHub
https://github.com/tusharzalte/tusharesume/pull/57, or unsubscribe
<
https://github.com/notifications/unsubscribe-auth/AVTK64LE3JSWKHB63YE3S7DXICATBANCNFSM6AAAAAAYQBHMGI

.
You are receiving this because you are subscribed to this thread.Message
ID: @.***>

—
Reply to this email directly, view it on GitHub
https://github.com/tusharzalte/tusharesume/pull/57#issuecomment-1564181685,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AYAUCA57RG3P34QOLORTERLXICBFJANCNFSM6AAAAAAYQBHMGI
.
You are receiving this because you authored the thread.Message ID:
@.***>

Okay
On Fri, May 26, 2023, 16:09 shravan-das @.***> wrote:

I havent got any experience in deploying nodejs applications!
On Fri, 26 May, 2023, 4:02 pm tusharzalte, @.***> wrote:

can you deploy it?
On Fri, May 26, 2023 at 4:02 PM Tushar Zalte @.***>
wrote:

Awesome thank you!!
On Fri, May 26, 2023 at 3:58 PM shravan-das @.***>
wrote:

#45 https://github.com/tusharzalte/tusharesume/issues/45
[image: Screenshot (95)]
<

https://user-images.githubusercontent.com/100745475/241193399-2e0c5ff5-4743-45ba-bc19-d29d4e21c610.png

[image: Screenshot (96)]
<

https://user-images.githubusercontent.com/100745475/241193413-2de21384-db1a-42d4-ba0f-56f3d9d90c76.png

successfully added recaptcha by creating the api for it in userRoutes
[Shravan Das contributer for girls script summer of code]
You can view, comment on, or merge this pull request online at:
https://github.com/tusharzalte/tusharesume/pull/57
Commit Summary

984c5b2
<

https://github.com/tusharzalte/tusharesume/pull/57/commits/984c5b2550c5bda0d113879fdcfdb131b90056e1

first change

1f6ed7c
<

https://github.com/tusharzalte/tusharesume/pull/57/commits/1f6ed7c7a4910415f2a2be3863d403f06c88e2ba

captcha added succesfully
File Changes
(7 files https://github.com/tusharzalte/tusharesume/pull/57/files)

A client1/.gitignore
<

https://github.com/tusharzalte/tusharesume/pull/57/files#diff-6847472bff2d5cd686cc2c43528efb8f4c354f42587a25dfcd04733ed8338746

(2)

M client1/package-lock.json
<

https://github.com/tusharzalte/tusharesume/pull/57/files#diff-6f900db4c96e755b6dc00202751d029115f32758f83a6c5a089de0efde96e104

(106)

M client1/src/Pages/Login.js
<

https://github.com/tusharzalte/tusharesume/pull/57/files#diff-537d9e87591c319d2077d143627ecf628cc8b1ae5fb3c350176cefa1c65898fd

(63)

M client1/src/Pages/Register.js
<

https://github.com/tusharzalte/tusharesume/pull/57/files#diff-32f0a470ccf023e8751b503dc55f149177920a78bc3dda44274b8b2ae6e8aa55

(61)

M package-lock.json
<

https://github.com/tusharzalte/tusharesume/pull/57/files#diff-053150b640a7ce75eff69d1a22cae7f0f94ad64ce9a855db544dda0929316519

(179)

M package.json
<

https://github.com/tusharzalte/tusharesume/pull/57/files#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519

(5)

M routes/userRoute.js
<

https://github.com/tusharzalte/tusharesume/pull/57/files#diff-2d3853355a0f394d222f03d85c0553dc153a969e05b125205b1ab61ad36e0390

(99)
Patch Links:

https://github.com/tusharzalte/tusharesume/pull/57.patch
https://github.com/tusharzalte/tusharesume/pull/57.diff

—
Reply to this email directly, view it on GitHub
https://github.com/tusharzalte/tusharesume/pull/57, or unsubscribe
<

https://github.com/notifications/unsubscribe-auth/AVTK64LE3JSWKHB63YE3S7DXICATBANCNFSM6AAAAAAYQBHMGI

.
You are receiving this because you are subscribed to this
thread.Message
ID: @.***>

—
Reply to this email directly, view it on GitHub
<
https://github.com/tusharzalte/tusharesume/pull/57#issuecomment-1564181685
,
or unsubscribe
<
https://github.com/notifications/unsubscribe-auth/AYAUCA57RG3P34QOLORTERLXICBFJANCNFSM6AAAAAAYQBHMGI
.
You are receiving this because you authored the thread.Message ID:
@.***>

—
Reply to this email directly, view it on GitHub
https://github.com/tusharzalte/tusharesume/pull/57#issuecomment-1564188789,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AVTK64LNAS5NMDDWV6ET6ALXICB4XANCNFSM6AAAAAAYQBHMGI
.
You are receiving this because you modified the open/close state.Message
ID: @.***>

hey @tusharzalte @ZapeeoSheikh  please add label gssoc in the pull requests i made including this pull request
because you didnt added label to it my name is not shown in the leaderboard of gssoc (because pr is not counted as you have not  added the label)


Are you open to a private chat

I have an idea for company/product. I think it's winner take all situation but it requires a first mover advantage. Btw I live in Canada

I'm glad to hear that you have an idea for a company/product that could potentially benefit from the technology used in my app. If there are any specific ways we can collaborate or share knowledge, I would be open to discussing them further. However, I am busy with a lot of school projects and preparing for graduation, so I may not be able to respond quickly to issues at times.
Still I am open to any opinion. My email is<EMAIL_ADDRESS>

I sent you an email. You can edit out your email from your last comment. thanks


21 add localeselector functionality in navbar

test

@a-wong-8 refactored and removed Spanish. Lmk your thoughts.
Otherwise, looks good. Only thing pending is design approval as there is no Figma design for it.

Update from design team:
"remove the circle to match web, and add a black background/box to fully cover the button when its dropped down"

The design is also in Figma as well.


User should be able to post a crypto listing

Tracked by #876

[ ] Express unique type of metadata.contractType to represent crypto listings. (replace AUCTION type)
[ ] Express unique type of metadata.format to represent that the price should reflect Market Value. (referred to as listing "Market Value" format)
[ ] Express new metadata field which indicates the type of coin for sale in the listing. (referred to as the listing coin type)
[ ] When metadata.contractType reflects a new crypt listing, the server should not persist values for the following fields:

pricingCurrency
price
condition
options
shippingOptions
coupons

[ ] When metadata.contractType reflects a crypto listing, the server should return an error if any of the following objects are sent with a value:

pricingCurrency
condition
options
shippingOptions
coupons

[ ] When metadata.contractType reflects a crypto listing, the server should return an error if the coinType is empty
[ ] When metadata.format is set to "market value", the server should return an error if item.price is not zero.
[ ] When metadata.contractType reflects a crypto listing, the server should set format to MARKET_PRICE

{
   "termsAndConditions":"test",
   "refundPolicy":"test",
   "item":{
      "title":"ZEC for Sale",
      "description":"I am selling 1.5 ZEC.",
      "tags":[
         "ZEC",
         "Zcash"
      ],
      "categories":[
         "crypto"
      ],
      "nsfw":false,
      "condition":"", // should be blank
      "images":[
         {
            "filename":"cryptoImage.jpg",
            "original":"zb2rhkeGuSRJe9eKdiPAoNXRtc2APEqR8YcKwLaer75bJZrkF",
            "large":"zb2rhkfkVTD1opwgSz3i6oMKm1Uwesqzxn4SHBhb5aFsyxjcY",
            "medium":"zb2rhkJXrP7Vp5oP4EMVDEhVPweZDw8GmBvQjkcw7pKPx1uCL",
            "small":"zb2rhf5SNn6MdZL8BXeg6WcTn8tBrN6PyZS3d2YdaYrPEXo1d",
            "tiny":"zb2rhdZ7MLdpQne12gigyowCzCRBZLtgUJz4zSfnzLkSHES1s"
         }
      ],
      "options":[], // should be empty
      "skus":[
         {
            "quantity": 150000000  // this represents 1.5 ZEC
         }
      ],
      "price":0 // should be zero
   },
   "metadata":{
      "contractType":"CRYPTO_CURRENCY",
      "format":"FIXED_PRICE",
      "expiry":"2037-12-31T05:00:00.000Z",
      "pricingCurrency":"", // should be blank
      "coinType":"ZEC"
   },
   "shippingOptions":[], // should be empty
   "coupons":[]  // should be empty
}

When metadata.contractType reflects a crypto listing, the server should return an error if the coinType is not empty

Should that be "is empty"?

Thanks @jjeffryes, corrected.


R2DBC driver

R2DBC (Reactive Relational Database Connectivity) is a reactive API specification for SQL databases. It provides a non-blocking and reactive way to interact with relational databases.
https://r2dbc.io
Roadmap below:

[ ] 1. Research and understand the database dialect

SQL syntax
YDB Data types map to Java Types, implement io.r2dbc.spi.Type
other language-specific features YQL

[ ] 2. Study R2DBC specification. Existing dialect implementations.

PostgreSQL R2DBC - https://github.com/pgjdbc/r2dbc-postgresql. The perfect solution from the founders of R2DBC.
Clickhouse R2DBC - https://github.com/ClickHouse/clickhouse-java/tree/main/clickhouse-r2dbc. Community implementation. Don't support transactions, and more features.

[ ] 3. Design the architecture

The driver implementation will be built using the YDB Java SDK v2.
Connection != YDB Session. Because the connection is active until the close method is called.
Connection have next state - InTransaction, OutTransaction, Close.

[ ] 4. Implement the core API - R2DBC SPI

io.r2dbc.spi.ConnectionFactory
io.r2dbc.spi.ConnectionFactoryMetadata
io.r2dbc.spi.ConnectionFactoryProvider
io.r2dbc.spi.Result
io.r2dbc.spi.Row
io.r2dbc.spi.RowMetadata
io.r2dbc.spi.Batch
io.r2dbc.spi.Connection
io.r2dbc.spi.Statement

[ ] 5. Testing

[ ] 6. Documentation.

[ ] 7. Release candidate.

Document the usage, configuration options, and any database-specific features of YDB R2DBC driver to help users and developers understand how to use it effectively.

Student: @Kuleshovegor

Kuleshov Egor from ITMO University

https://github.com/ydb-platform/ydb-r2dbc-driver/issues/1


Cloud Run Service Deployment Breaking

Does this issue occur when all extensions are disabled?: Yes/No

VS Code Version: 1.92
OS Version:  window 10

Steps to Reproduce:

Install Gemini Code Assist + Google Cloud Code extension
Create an dummy project from cloud run and try to deploy in google cloud run
The service deployment failed suddenly with the issue (Failed to build the app. Error: Failed to create skaffold configuration. Error: processing cli artifacts: malformed artifact provided: {image:gcr.io/flaskgcp-424601/scoro-optimo,builder:Docker,payload:{path:Dockerfile}}
From the logs, we can see (Running skaffold command: "C:\Users\user\AppData\Local\Google\Cloud SDK\google-cloud-sdk\bin\skaffold.exe" init --artifact {"image":"gcr.io/flaskgcp-424601/scoro-optimo","builder":"Docker","payload":{"path":"Dockerfile"}} --skip-deploy --filename C:\Users\user\AppData\Local\Temp\cloud-code-cloud-run-PTBBBp\skaffold.yaml --force
processing cli artifacts: malformed artifact provided: {image:gcr.io/flaskgcp-424601/scoro-optimo,builder:Docker,payload:{path:Dockerfile}}
Failed to build the app. Error: Failed to create skaffold configuration. Error: processing cli artifacts: malformed artifact provided: {image:gcr.io/flaskgcp-424601/scoro-optimo,builder:Docker,payload:{path:Dockerfile}}
)

I have updated to 1.92.1 but the problem still exists.

/causedByExtension

I have the same issue with you. But when I try to run my project in Mac OS it works well.
I see in the window the Gemini Code Assits extension shows an error like the one below:

However, with the same account in the Mac OS it now shows any error
I want to uninstall it, just to keep Cloud Code but can not. It combines together.
I think this information can help you investigate this issue.

@AnNguyenPTN investigation is the job of the extension authors. Please raise the issue with them,


Deserialization returns empty object insted of zero

When using PrimitiveSerializer to deserialize 0, empty object is received instead. It happens because 0 || {} === {} in setFieldMetadataToModel in deserialize.ts.

#5 Pull request created - this will be in next patch of library

@AndriiKobzar Do you want that exception was thrown if the field was not present but it was required?

Yes, that would be nice

#6 Optional support issue


feat: 🎸 added radio-btn validation

👋 Thanks for creating a pull request! 🚀 Checkout the storybook we've created for it: react


Good first issue

Refactor pay.html to display countdown (10 minutes max to pay) and 'Done' mark when paymen is received at Bitfinance.

There is no file named pay.html in the repo

Hello Coder-Manan, yes, I have tried to solve this via res.write and res.end, instead of res.render. See post('/pay') section in the server.mjs . I append "PAYMENT RECEIVED" or "PAYMENT FAILED" phrase to the end of the payment page. It works on desktop browsers, but not on mobiles. I realized that moustache makes all my html files a template, so I cannot use


[ADD ME TO THE ORGANIZATION]

Name: Austin Axtell
Location: New York, US
**Interest:Javascript
**Discord username(optional):-uchiha.clan5555
Hello everyone, I am Austin 👋
I hope to join this GitHub Org of writers and developers! My goal is to share my experiences and learn from others, so we can all grow together. Here's a bit more about me:
👨💻 I work as a Frontend Developer, which I love because it allows me to solve real-world problems with technology.
📚 I'm passionate about learning new things. Whether it's a new programming language or a cooking recipe, I enjoy the challenge of picking up new skills.
🤝 I believe in collaboration and teamwork. I think the best ideas come from diverse perspectives, so I'm eager to hear what everyone has to say.
Thanks for reading, and please don't hesitate to reach out if you want to chat or collaborate on a project!

@uchiha123456 Thanks for your interest. Invitations have been sent to you. Kindly accept it and make your membership public.


[AST] Remove DefaultValueExpr type

The last instantiation of this type was removed in 68bcb0d2af75e66a3666fae3a23d29d74647e983
I believe this is NFC.

@swift-ci Please smoke test

Huh, we're not using this because TupleShuffleExpr (weirdly) encodes caller-provided default arguments in its array. If at some point we fix that, we might bring DefaultValueExpr back... but it's better to delete it for now. Thanks!

@swift-ci Please smoke test

@DougGregor Thank you for the comment!
merging.


[oracle] Fix TestLargeUint64Binding test for RDS (DBMON-4339)

What does this PR do?

Motivation

Additional Notes

Possible Drawbacks / Trade-offs

Describe how to test/QA your changes

/merge


Add Self bounds from methods and ?Sized relaxation (if possible) to impl header

These are two fairly independent features, so I'm not quite sure why I'm trying to merge both in one PR :thinking: At least there are two commits!
Commit 1 solves #52 as it adds a ?Sized relaxation to the proxy type on the impl header whenever it's possible.
Commit 2 solves #11 in that it searches for all Self bounds on methods and adds them to the proxy parameter. This is unfortunate, but the only sane way to handle that.
@KodrAus If you don't have the time, just tell me, then we'll merge this unreviewed. I would probably publish this as 0.4.0 after merging, if you are fine with that?

This looks good to me! It might be worth adding a compile test that has an explicit Self: Sized bound on the trait itself, even though the trait would otherwise be object-safe.

@KodrAus Good point! I forgot about that. Luckily the current implementation seems to work fine with these traits.


sha: convert SHA one shot macros back to being functions

Fixes #15655

[ ] documentation is added or updated
[ ] tests are added or updated

Merged, thanks for the approvals.


Multi-GPU training error

❓ Questions and Help

The code  got stuck?why?

Seems to be an issue with apex. Did you install within a container or bare metal? Either way, this could be due to a previous install on your system.

Seems to be an issue with apex. Did you install within a container or bare metal? Either way, this could be due to a previous install on your system.

I installed like this:

I still do not know the error.Could you help me?

hello，when i use :
CUDA_VISIBLE_DEVICES="3,4" python -m torch.distributed.launch --nproc_per_node 2 train_net.py
i meet some trouble, like this:
RuntimeError: CUDA error: an illegal memory access was encountered
terminate called without an active exception
How can I solve it，thanks a lot!

hello，when i use :
CUDA_VISIBLE_DEVICES="3,4" python -m torch.distributed.launch --nproc_per_node 2 train_net.py
i meet some trouble, like this:
RuntimeError: CUDA error: an illegal memory access was encountered
terminate called without an active exception
How can I solve it，thanks a lot!

permission problem？ maybe

export NGPUS=4
CUDA_VISIBLE_DEVICES=“0,1,2,3” python -m torch.distributed.launch --nproc_per_node=$NGPUS /path_to_maskrcnn_benchmark/tools/train_net.py --config-file "path/to/config/file.yaml" MODEL.RPN.FPN_POST_NMS_TOP_N_TRAIN images_per_gpu x 1000


Added new protocol for UIViewController to instantiate it from storyboard

Checklist

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

Here I thought about making extension to UIViewController directly, but then every time you instantiated a custom UIViewController, you would have to cast it to your type as the return type for the function would be 'UIViewController'. In this way that casting won't be necessary.

Okay, I'll try. Thanks 😊

@guykogus I updated the code the way you suggested.

@VatoKo There are a couple of swiftlint issues which needs to be addressed

          3 Errors

:no_entry_sign:
SwifterSwift_iOSTests.UIViewControllerExtensionsTests: testInstantiate, failed: caught “NSInvalidArgumentException”, “Could not find a storyboard named ‘TestStoryboard’ in bundle NSBundle </Applications/Xcode_11.4.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Xcode/Agents> (loaded)”   Tests/UIKitTests/UIViewControllerExtensionsTests.swift#L64

:no_entry_sign:
SwifterSwift_iOSTests.WKWebViewExtensionsTests: testLoadURL, Asynchronous wait failed: Exceeded timeout of 3 seconds, with unfulfilled expectations: “Correct URL”.   Tests/WebKitTests/WKWebViewExtensionsTests.swift#L31

:no_entry_sign:
SwifterSwift_tvOSTests.UIViewControllerExtensionsTests: testInstantiate, failed: caught “NSInvalidArgumentException”, “Could not find a storyboard named ‘TestStoryboard’ in bundle NSBundle </Applications/Xcode_11.4.app/Contents/Developer/Platforms/AppleTVSimulator.platform/Developer/Library/Xcode/Agents> (loaded)”   Tests/UIKitTests/UIViewControllerExtensionsTests.swift#L64

          1 Warning

:warning:
Tests/UIKitTests/UIViewControllerExtensionsTests.swift#L65: ‘is’ test is always true
        XCTAssert(vc is MyViewController)

          4 Messages

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

:book:
iOS: Executed 680 tests, with 2 failures (1 unexpected) in 27.179 (28.913) seconds

:book:
tvOS: Executed 645 tests, with 1 failure (1 unexpected) in 8.004 (8.507) seconds

:book:
macOS: Executed 511 tests, with 0 failures (0 unexpected) in 4.563 (4.803) seconds

SwiftLint found issues
Warnings

File
Line
Reason

UIViewControllerExtensions.swift
25
Lines should not have trailing whitespace. (trailing_whitespace)

UIViewControllerExtensions.swift
26
Lines should not have trailing whitespace. (trailing_whitespace)

UIViewControllerExtensions.swift
26
Limit vertical whitespace to a single empty line. Currently 2. (vertical_whitespace)

UIViewControllerExtensionsTests.swift
64
Variable name should be between 3 and 40 characters long: 'vc' (identifier_name)

UIViewControllerExtensionsTests.swift
24
Lines should not have trailing whitespace. (trailing_whitespace)

UIViewControllerExtensionsTests.swift
61
Lines should not have trailing whitespace. (trailing_whitespace)

  Generated by :no_entry_sign: Danger

Closing due inactivity, @VatoKo feel free to reopen if you still want to move this forward :)

@LucianoPAlmeida I was waiting for the final decision from you actually 😄I'll make changes according to the way you suggested.

By the way, notice that the tests are failing...

@guykogus I get "Could not find a storyboard named 'TestStoryboard' in bundle..." error on unit test. I checked already existing unit test where this storyboard is used and those tests are failing too. Any idea what could be causing this?

@guykogus I get "Could not find a storyboard named 'TestStoryboard' in bundle..." error on unit test. I checked already existing unit test where this storyboard is used and those tests are failing too. Any idea what could be causing this?

I'm not really sure. It may be to do with catalyst. You may need to add #if !targetEnvironment(macCatalyst). Give it a try.
Also, make sure that you're open the project in Xcode via the SwifterSwift.xcworkspace file in Finder. If you try to open the project directly from Xcode it will open it as a Swift package, which doesn't support resources (until Xcode 12).

@guykogus I've always opened the project via SwifterSwift.xcworkspace, no problem with that. Tried #if !targetEnvironment(macCatalyst) check and it's still failing as you can see. 😕

We have a problem with the build
Tests/UIKitTests/UIViewControllerExtensionsTests.swift#L59: use of unresolved identifier ‘MyViewController’
let myViewController = MyViewController.instantiate(from: "TestStoryboard", bundle: Bundle(for: UIViewControllerExtensionsTests.self))

We have a problem with the build
Tests/UIKitTests/UIViewControllerExtensionsTests.swift#L59: use of unresolved identifier ‘MyViewController’
let myViewController = MyViewController.instantiate(from: "TestStoryboard", bundle: Bundle(for: UIViewControllerExtensionsTests.self))

Do you have any more context for this error?

Nope, I just copied what danger is saying :)

I don't have such problem. The code compiles and even passes the test successfully.

Ok I'll take a look ASAP :)

          1 Error

:no_entry_sign:
Tests/UIKitTests/UIViewControllerExtensionsTests.swift#L59: use of unresolved identifier ‘MyViewController’
        let myViewController = MyViewController.instantiate(from: "TestStoryboard", bundle: Bundle(for: UIViewControllerExtensionsTests.self))

          1 Warning

:warning:
Could not read serialized diagnostics file: Invalid File: Invalid diagnostics signature (in target ‘SwifterSwift-tvOSTests’ from project ‘SwifterSwift’)

          3 Messages

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

:book:
iOS: Executed 680 tests, with 0 failures (0 unexpected) in 18.024 (19.654) seconds

:book:
macOS: Executed 511 tests, with 0 failures (0 unexpected) in 5.313 (5.592) seconds

  Generated by :no_entry_sign: Danger

@VatoKo I went ahead and fixed it for you. I was actually curious to see if I could push to your fork. I guess I can cos I have superpowers? 😅
The main issue was for the tvOS tests. We needed a separate storyboard for tvOS, since storyboards aren't cross-platform.

@guykogus I guess I have to say thank you 😄


How to automatic save "swagger.json" to folder when debug on web API ?

Hi All,
Now i started to used Swagger and Docfx for generate on REST API document.
To related on this issue :

dotnet/docfx#5012
https://docs.microsoft.com/en-us/aspnet/core/tutorials/getting-started-with-swashbuckle?view=aspnetcore-2.2&tabs=visual-studio#feedback

Docfx : https://dotnet.github.io/docfx/
How to automatic save swagger.json file to folder for support with Docfx, when i run debug on web APIs project ?
My project to used .NET Core 2.2 on vs 2019
Thanks you

Any update?


dm_control.mujoco.wrapper.core.Error:Could not register license

First I set the Environment Variables with the following command
export MUJOCO_GL="glfw"
export MJLIB_PATH=$HOME/.mujoco/mujoco200/bin/libmujoco200.dylib
export MJKEY_PATH=$HOME/.mujoco/mujoco200/mjkey.txt
export LD_LIBRARY_PATH=$HOME/.mujoco/mujoco200/bin:$LD_LIBRARY_PATH
export MUJOCO_PY_MJPRO_PATH=$HOME/.mujoco/mujoco200/
export MUJOCO_PY_MJKEY_PATH=$HOME/.mujoco/mujoco200/mjkey.txt

then I clone the dm_control suite from the Site. then I move to folder and then i install the package with command with pip3 install . to check whether it works for me or not
After installing with pip3 install .  i check the all available package in terminals
Now When I try to run the code examples given with control suites then following error happen which is also title of ISSUE

There are a few possible reasons why registration might fail:

The path might be incorrect
The contents of mjkey.txt might be invalid
The license might be expired or otherwise invalid

You should see an error message logged by MuJoCo that should give more information about why the registration failed, e.g.
~$ MJKEY_PATH=/some/nonexistent/path/mjkey.txt \
  python -c "from dm_control import suite; suite.load('cartpole', 'swingup')"
CRITICAL:absl:Could not open activation key file /some/nonexistent/path/mjkey.txt
Traceback (most recent call last):
  ...

~$ MJKEY_PATH=~/.bashrc \
  python -c "from dm_control import suite; suite.load('cartpole', 'swingup')"
CRITICAL:absl:Invalid text in activation key
Traceback (most recent call last):
  ...

alimuldal thanks.
After finding the missing component like mujoco python file which is missing in system, it now install and works.

alimuldal thanks.
After finding the missing component like mujoco python file which is missing in system, it now install and works.

Hey how did you fixed it exactly? I am trying to find a solution but it seems difficult to find

@FoRg1veness What do your logs show? In particular the CRITICAL:absl: part I mentioned above should tell you the reason why MuJoCo could not register the license.

@FoRg1veness What do your logs show? In particular the CRITICAL:absl: part I mentioned above should tell you the reason why MuJoCo could not register the license.

Hi Alimuldal,
Could u please have a look at my problem #158,  it shows "CRITICAL:absl:Invalid activation key"
I follow your suggestions in this issue, but I still didn't find the correct solution. I was obsessed with this problem for a few days ~~
Thanks very much!


[Refactor] Update analysis tools and documentations.

Motivation
Some analysis tools are not available and documentations are outdated.
Modification
Update these analysis tools and documentation.
BC-breaking
The interface of the tools/analysis_tools/eval_metric.py is changed.
In the new eval_metric.py, you don't need to specify the config file, and accordingly, you need to use
--metric argument to specify the metrics to calculate. For example:
# Eval the top-1 and top-5 accuracy
python tools/analysis_tools/eval_metric.py results.pkl --metric type=Accuracy topk=1,5

# Eval accuracy, precision, recall and f1-score
python tools/analysis_tools/eval_metric.py results.pkl --metric type=Accuracy \
    --metric type=SingleLabelMetric items=precision,recall,f1-score

And the output of mmcls.utils.load_json_log changed to the below format to fit the new log format.
{
    'train': [
        {"lr": 0.1, "time": 0.02, "epoch": 1, "step": 100},
        {"lr": 0.1, "time": 0.02, "epoch": 1, "step": 200},
        {"lr": 0.1, "time": 0.02, "epoch": 1, "step": 300},
        ...
    ]
    'val': [
        {"accuracy/top1": 32.1, "step": 1},
        {"accuracy/top1": 50.2, "step": 2},
        {"accuracy/top1": 60.3, "step": 2},
        ...
    ]
}

Checklist
Before PR:

[x] Pre-commit or other linting tools are used to fix the potential lint issues.
[x] Bug fixes are fully covered by unit tests, the case that causes the bug should be added in the unit tests.
[x] The modification is covered by complete unit tests. If not, please add more unit test to ensure the correctness.
[x] The documentation has been modified accordingly, like docstring or example tutorials.

After PR:

[x] If the modification has potential influence on downstream or other related projects, this PR should be tested with those projects, like MMDet or MMSeg.
[x] CLA has been signed and all committers have signed the CLA in this PR.

hi, I got this three numbers by running the code. My datasets has 15 classes , what's this 3 numbers meaning?


Computing the gold standard

I found this work really fascinating and I was wondering if you could provide code for computing the gold standard? I tried computing it using pysaliency but I must be doing something wrong because it takes a really long time to compute the gold standard for just 1000 frames.
How did you compute the gold standard for the Ledov dataset?

Thank you for your interest in our work! I copied my gold standard implementation to the following gist:
https://gist.github.com/mtangemann/231f26d9066ce1b63c724abe3fef935e
Computing the gold standard however may take a while: Due to the leave-one-out cross validation a prediction has to be computed for every gaze position, which for 1000 frames are probably 10k-100k predictions. When using the relatively high resolution of LEDOV and computing on the CPU this easily takes hours. The implementation above is optimized for computing leave-one-out predictions and can be run on the GPU, so it should be faster. Let me know if you have further questions!

Wow! Thank you for uploading your implementation of the Gold Standard.... I am very grateful for it.

Had a chance to look at the code:
`        # create single map for each gaze position
maps_single = torch.zeros(gaze.size(0), *self.size_tuple).to(gaze.device)
maps_single[gaze_[:,0], gaze_[:,1], gaze_[:,2]] = 1
    # create loo maps
    map_all = maps_single.sum(dim=0)
    maps = map_all.repeat(gaze.size(0), 1, 1) - maps_single

`
Concise and straight to the point! Doesn't this assume that every subject has 1 fixation per image? Due to the resolution mismatch between the eye tracker and the movie, I end up with more than 1 fixation per subject on each frame.... I was thinking of having multiple fixations per subject, and have each maps_single represent a single subject....

Great that the code helps! And yes you're right, it is assumed that there is at most one fixation per subject and frame. I preprocessed the gaze data so that there is at most one fixation per frame: I rounded the fixation start and end times to the frame times. So a fixation for a frame is only present if the respective event overlaps with the frame by >50% of the frame duration, which is the case for one fixation at most.

Awesome, thank you for the very swift responses. Last, and hopefully final, question: I have 30 subjects and would like to compare my model (trained in leave-one-movie out fashion) with the gold standard.
Say my left-out movie holds X amount of frames.
If I understand correctly, I should (for every frame)

compute the gold standard for all 30 subjects (maps_repeat - maps_single)
then take my 30 maps, compute the average
compute the CC (or any other metric) between the average of the 30 gold standards, and the ground truth
relate my leave-one-movie out model with the computed CC for the averaged gold standards?

Yes the gold standard is evaluated for every frame, but the predictions are not averaged: Instead, for every subject, the prediction given all other subjects is evaluated individually. So you get one performance value for any of the N maps. Afterwards, these performances are averaged for that frame and compared to the model prediction.
This requires a metric that allows to evaluate predictions for individual fixations, which however is not the case for CC. In our paper, we evaluated the gold standard using information gain, AUC and NSS. In general, I'd recommend using information gain as primary metric and computing the other metrics only for comparing with previous works (Kümmerer et al. 2018 analyzes this in detail).

Great! Thank you for all your help Matthias!
Part 1:
To use the Information Gain as primary metric:

Option a): Get model's output, continue as normal with my non-probabilistic metrics (CC, NSS, etc...) and for the probabilistic metrics:

range normalize (out - out.min()) / (out.max() - out.min()),
divide by the sum to convert the output into a probability distribution,
3.i) Compute the image-based KLD using probability distribution.
3.ii) Apply the log, and then compute the Log Likelihood and Information Gain,

Option b): Add a Finalizer (gaussian blur, center bias, log-softmax) and get log-probability outputs.

Question(s):

What happens if I don't use Option b and go with Option a?
How is Option b equivalent to the section "Phrasing Saliency Maps Probabilistically" in Kümmerer et al. 2015?

Part 2:
Also, in Kümmerer et al. 2015, they say: "to evaluate metrics described above on the probabilistic models, we used the log-probability maps as saliency maps."...
Question(s):

Does that mean I should compute the CC, NSS, and any other non-probabilistic metric using the log-probability?
I found this reference online which Uses DeepGaze to get log_probability outputs. From there, they obtain the saliency maps (to be used on all other metrics) by exponentiating and dividing by the max.

I'm computing the CC, Image-Based KLD, NLL and NSS as sanity checks during training on the training set and validation set (but I'm only using the NLL as loss function when using option b).
Question(s):

When using option a), all my plots seem right. Except that I wouldn't be properly using the Information Gain, right?
When using option b) with log-probability maps as saliency maps, I get a very zig-zaggy CC plot on the validation set, but not the training set, and a different scale NSS plot...


ci: support package publish

Pull Request
The issue or feature being addressed

Support publishing NuGet package automatically.

Details on the issue fix or feature implementation

Create workflow to publish NuGet package when a git tag is created

Confirm the following

[x]  I started this PR by branching from the head of the default branch
[x]  I have targeted the PR to merge into the default branch
[x]  I have included unit tests for the issue/feature
[x]  I have successfully run a local build

Codecov Report

Merging #17 (8b640a4) into main (bae9488) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main      #17   +/-   ##
=======================================
  Coverage   72.49%   72.49%
=======================================
  Files          14       14
  Lines         429      429
  Branches       33       33
=======================================
  Hits          311      311
  Misses        112      112
  Partials        6        6

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more


Validation runs #2

We will now calculate if the orbiting/stationary bayes factors decrease with nside.

[x]  Run orbiting and stationary analysis with nside =4 and seeds= 10, 20, 30, 40,50, 60

[x] Run orbiting and stationary analysis with nside =8 and seeds= 10, 20, 30, 40,50, 60

[x] Make bayesfactor plots for them both.

[x] Try to generate posterior corner plots which plot Omega_0 rather than log(Omega_0)

Unless we are changing them we will use standard settings of fmin = 1e-4, fmax = 2e-2, duration = 2e6, seglen = 5e4, nside = 6, alpha=2/3, omega0 = 4.5e-9, seed=10, fs=0.25, FixSeed=1, mldc=0

[x] Repeat everything with fmax = 2e-2 with all the other parameters being the same.

Hey @sharanbngr
I think by adding this code below

post = np.loadtxt(params['out_dir'] + "/post_samples.txt")

in plotmaker.py will generate a corner plot for Omega0 instead of log10Omega0. Let me know if it's right!
Change Omega0 from "log10 Omega" back to normal
for x in range(len(post)):
    post[x][1] = np.power(10,post[x][1])

And I think because of these lines:
   # Adjust axis labels
    for ii in range(npar):
        ax = axes[ii, ii]

        # get the right summary for the parameter ii
        sum_ax = sum_data[parameters[ii]]
        err =  [sum_ax[2] - sum_ax[1], sum_ax[1]- sum_ax[0]]

        if np.abs(sum_ax[1]) <= 1e-3:
            mean_def = '{0:.3e}'.format(sum_ax[1])
            eidx = mean_def.find('e')
            base = float(mean_def[0:eidx])
            exponent = int(mean_def[eidx+1:])
            mean_form = str(base) + ' \\times ' + '10^{' + str(exponent) + '} '
        else:
            mean_form = '{0:.3f}'.format(sum_ax[1])

        if np.abs(err[0]) <= 1e-2:
            err[0] = '{0:.4f}'.format(err[0])
        else:
            err[0] = '{0:.2f}'.format(err[0])

        if np.abs(err[1]) <= 1e-2:
            err[1] = '{0:.4f}'.format(err[1])
        else:
            err[1] = '{0:.2f}'.format(err[1])

        label =  parameters[ii][:-1] + ' = ' + mean_form + '^{+' + err[0] + '}_{-' + err[1] + '}$'

        ax.set_title(label, {'fontsize':23}, loc='left')

It gave me this latex error that prevented me from plotting corner plots:
python3 run_blip.py params.ini
Simulating instrumental noise ...
 Adding sgwb signal ...
Calculating fourier spectra...
Diagnostic spectra plot made in ./o_aet_1e_10_noLog2/diag_psd.png
Doing an isotropic stochastic analysis...
npar = 4
iter: 7542 | +500 | bound: 80 | nc: 1 | ncall: 160920 | eff(%):  4.998 | loglstar:   -inf < 7010623.206 <    inf | logz: 7010608.900 +/-  0.225 | dlogz:  0.001 >  0.500
 Making posterior Plots ...
Traceback (most recent call last):
  File "/home/tommy/lisaenv/lib/python3.6/site-packages/matplotlib/texmanager.py", line 304, in _run_checked_subprocess
    stderr=subprocess.STDOUT)
  File "/usr/lib/python3.6/subprocess.py", line 356, in check_output
    **kwargs).stdout
  File "/usr/lib/python3.6/subprocess.py", line 438, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['latex', '-interaction=nonstopmode', '--halt-on-error', '/home/tommy/.cache/matplotlib/tex.cache/0dfca64bb48e87b7cdbc55a9f95e977e.tex']' returned non-zero exit status 1.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "run_blip.py", line 471, in <module>
    blip(sys.argv[1])
  File "run_blip.py", line 464, in blip
    plotmaker(params, parameters, npar)
  File "/home/tommy/lisaenv/blip/tools/plotmaker.py", line 94, in plotmaker
    plt.savefig(params['out_dir'] + 'corners.png', dpi=150)
  File "/home/tommy/lisaenv/lib/python3.6/site-packages/matplotlib/pyplot.py", line 722, in savefig
    res = fig.savefig(*args, **kwargs)
  File "/home/tommy/lisaenv/lib/python3.6/site-packages/matplotlib/figure.py", line 2180, in savefig
    self.canvas.print_figure(fname, **kwargs)
  File "/home/tommy/lisaenv/lib/python3.6/site-packages/matplotlib/backend_bases.py", line 2089, in print_figure
    **kwargs)
  File "/home/tommy/lisaenv/lib/python3.6/site-packages/matplotlib/backends/backend_agg.py", line 527, in print_png
    FigureCanvasAgg.draw(self)
  File "/home/tommy/lisaenv/lib/python3.6/site-packages/matplotlib/backends/backend_agg.py", line 388, in draw
    self.figure.draw(self.renderer)
  File "/home/tommy/lisaenv/lib/python3.6/site-packages/matplotlib/artist.py", line 38, in draw_wrapper
    return draw(artist, renderer, *args, **kwargs)
  File "/home/tommy/lisaenv/lib/python3.6/site-packages/matplotlib/figure.py", line 1709, in draw
    renderer, self, artists, self.suppressComposite)
  File "/home/tommy/lisaenv/lib/python3.6/site-packages/matplotlib/image.py", line 135, in _draw_list_compositing_images
    a.draw(renderer)
  File "/home/tommy/lisaenv/lib/python3.6/site-packages/matplotlib/artist.py", line 38, in draw_wrapper
    return draw(artist, renderer, *args, **kwargs)
  File "/home/tommy/lisaenv/lib/python3.6/site-packages/matplotlib/axes/_base.py", line 2607, in draw
    self._update_title_position(renderer)
  File "/home/tommy/lisaenv/lib/python3.6/site-packages/matplotlib/axes/_base.py", line 2556, in _update_title_position
    if title.get_window_extent(renderer).ymin < top:
  File "/home/tommy/lisaenv/lib/python3.6/site-packages/matplotlib/text.py", line 890, in get_window_extent
    bbox, info, descent = self._get_layout(self._renderer)
  File "/home/tommy/lisaenv/lib/python3.6/site-packages/matplotlib/text.py", line 298, in _get_layout
    clean_line, self._fontproperties, ismath=ismath)
  File "/home/tommy/lisaenv/lib/python3.6/site-packages/matplotlib/backends/backend_agg.py", line 201, in get_text_width_height_descent
    s, fontsize, renderer=self)
  File "/home/tommy/lisaenv/lib/python3.6/site-packages/matplotlib/texmanager.py", line 448, in get_text_width_height_descent
    dvifile = self.make_dvi(tex, fontsize)
  File "/home/tommy/lisaenv/lib/python3.6/site-packages/matplotlib/texmanager.py", line 338, in make_dvi
    texfile], tex)
  File "/home/tommy/lisaenv/lib/python3.6/site-packages/matplotlib/texmanager.py", line 317, in _run_checked_subprocess
    exc=exc.output.decode('utf-8'))) from exc
RuntimeError: latex was not able to process the following string:
b'$\\\\log_{10} (\\\\Omega_0) = 1.24 \\\\times 10^{-6} ^{+0.0001}_{--0.0000}$'

Here is the full report generated by latex:
This is pdfTeX, Version 3.14159265-2.6-1.40.18 (TeX Live 2017/Debian) (preloaded format=latex)
 restricted \write18 enabled.
entering extended mode
(/home/tommy/.cache/matplotlib/tex.cache/0dfca64bb48e87b7cdbc55a9f95e977e.tex
LaTeX2e <2017-04-15>
Babel <3.18> and hyphenation patterns for 84 language(s) loaded.
(/usr/share/texlive/texmf-dist/tex/latex/base/article.cls
Document Class: article 2014/09/29 v1.4h Standard LaTeX document class
(/usr/share/texlive/texmf-dist/tex/latex/base/size10.clo))
(/usr/share/texlive/texmf-dist/tex/latex/type1cm/type1cm.sty)
(/usr/share/texlive/texmf-dist/tex/latex/base/textcomp.sty
(/usr/share/texlive/texmf-dist/tex/latex/base/ts1enc.def))
(/usr/share/texlive/texmf-dist/tex/latex/base/inputenc.sty
(/usr/share/texlive/texmf-dist/tex/latex/base/utf8.def
(/usr/share/texlive/texmf-dist/tex/latex/base/t1enc.dfu)
(/usr/share/texlive/texmf-dist/tex/latex/base/ot1enc.dfu)
(/usr/share/texlive/texmf-dist/tex/latex/base/omsenc.dfu)
(/usr/share/texlive/texmf-dist/tex/latex/base/ts1enc.dfu)))
(/usr/share/texlive/texmf-dist/tex/latex/geometry/geometry.sty
(/usr/share/texlive/texmf-dist/tex/latex/graphics/keyval.sty)
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/ifpdf.sty)
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/ifvtex.sty)
(/usr/share/texlive/texmf-dist/tex/generic/ifxetex/ifxetex.sty)

Package geometry Warning: Over-specification in `h'-direction.
    `width' (5058.9pt) is ignored.

Package geometry Warning: Over-specification in `v'-direction.
    `height' (5058.9pt) is ignored.

)
No file 0dfca64bb48e87b7cdbc55a9f95e977e.aux.
(/usr/share/texlive/texmf-dist/tex/latex/base/ts1cmr.fd)
*geometry* driver: auto-detecting
*geometry* detected driver: dvips
! Double superscript.
l.14 ...og_{10} (\Omega_0) = 1.24 \times 10^{-6} ^
                                                  {+0.0001}_{--0.0000}$}
No pages of output.
Transcript written on 0dfca64bb48e87b7cdbc55a9f95e977e.log.
'''

Also, for the Bayes' factor plot, can you send me Alexander's plot for reference? Thanks.

Hey @sharanbngr
I think by adding this code below

post = np.loadtxt(params['out_dir'] + "/post_samples.txt")

in plotmaker.py will generate a corner plot for Omega0 instead of log10Omega0. Let me know if it's right!
Change Omega0 from "log10 Omega" back to normal
for x in range(len(post)):
    post[x][1] = np.power(10,post[x][1])

I think that is correct. However you can get much better performance by vectorizing, which in principle is always better than for loops. You can vectorize this by doing
post[:, 1] = 10**(post[:, 1])

label =  parameters[ii][:-1] + ' = ' + mean_form + '^{+' + err[0] + '}_{-' + err[1] + '}$'

I think for now if you comment out the following line it should work. We can figure out a better workaround latter.
label =  parameters[ii][:-1] + ' = ' + mean_form + '^{+' + err[0] + '}_{-' + err[1] + '}$'

Also, for the Bayes' factor plot:

Do I plot logZ(orbiting)/logZ(stationary) or Z(orbiting)/Z(stationary)?
For the error bar, is it logZ or Z, and is it also the ratio of Zerr(orbiting)/Zerr(stationary)?
Can you send me Alexander's plot for reference? Thanks.

Its  Z(orbiting)/Z(stationary) or equivalently log(Zorbiting - Zstationary)
I think you should propagate the errors in both into the bayesfactor.
Emailed you

For the bayesfactor plot, is the x axis the random seed number?

For the bayesfactor plot, is the x axis the random seed number?

Thats correct

Hey @sharanbngr
I tried to compute Baye's factor using this equation
bayes_factor = 10**(logz_o - logz_s)

but logz_o - logz_s is in the range of a 10^2, this results to an extremely large number that python calls it inf, is there any trick to go around this? Or I should change the equation to another form? I can't seem to go around this.

I fixed the inf problem by adding:
logz_o = np.array(logz_o, dtype=np.float128)
Thanks.

Hey @sharanbngr ,
From Alexander's plot, I can see that his bayes' factor is in the range of 10^2, but the bayes' factor I get is extremely huge.
This is the formula I used to compute it, did I make a mistake?

Hey @sharanbngr, is it logical to have logz(orbiting) < than logz(stationary)? Even with Alexander's params I still get a very large number, I've decided to plot log(z_orbiting/z_stationary, which is equivalent to log(z_orbiting) - log(z_stationary). Though, logz_o - logz_s will give a negative number because of logz_o < logz_s, do I have to worry about that? Or that's a result I can expect as well.
I will post the params I use in another comment below.

[params]
fmin=1e-4
fmax=1e-2
## duration in seconds, should be compatiable with fmin
duration=5e6
## segment length for fft in seconds, should be compatiable with fmin
## Note by SB: Looks like this needs to be atleast a factor of 10 larger than 1/fmin
## to give consistant recoveries.
seglen=5e4
## sample rate in Hz, should be compatible with fmax
## Note by SB: Looks like this needs to be atleast a factor of 4
## higher than fmax (as opposed to the usual factor of 2) to give
## consistent recoveries.
fs=0.25
Shfile=LISA_2017_PSD_M.npy
nside=4

## LISA configuration. Can be stationary or orbiting
lisa_config=orbiting

## Level of the tdi. Can be michelson, xyz or aet
tdi_lev=aet

# If the mldc flag is set to 1, then the time series data is read in from a file.
mldc=0
datafile=SGWB_withnoise_full.txt

## Current options: SGWB_withnoise_full.txt mldc_tdi_withnoise.txt

## If loadResponse is true, then a previously generated set of detector responses is read in from a file. Only use when running repeated analyses on the same data set. Only used for orbiting LISA configuration due to the increased computation time of that case.
## File loaded depends on tdi_lev.
loadResponse=0

## If loadCustom is also true, the detector response arrays will be loaded from files specified by the user (responsefile1,2,3). Specified detector responses should be compatible with tdi_lev.
## IMPORTANT - only load responses when analyzing the dataset originally used to generate them. The code will throw an error if the duration/segment length (dur/seglen) don't match. However, mismatched combinations of data and responses can still function in some cases and will produce erroneous results.
loadCustom=0
responsefile1=R1arrayAETMLDC.txt
responsefile2=R2arrayAETMLDC.txt
responsefile3=R3arrayAETMLDC.txt

## fref parameter useful for powerlaw stochastic backgrounds
fref = 25
## recovery model type, can be isgwb, sph_sgwb, isgwb_only or noise_only for now
modeltype=isgwb
lmax=0
## Truevals for whatever parameters are being used.
## This should be a comma seperate list WITHOUT spaces
## For sph, the list is alpha, {log_omega_lm}, Np, Na
truevals=0.667,-8.455,-41.045,-48.443

[inj]
# Power Law Injection
# Omege0 is defined as the power at 1e-3 Hz
doInj=1
omega0=4.5e-9
alpha=0.667
Np=9e-42
Na=3.6e-49
injtype=isgwb

[run_params] # Parameters related to the run or to the sampler
out_dir=./o_n4_s50
verbose=1
# Set doPreProc to 1 to force generation of fake data again rather than used
# precalculated data in the data_spectrum file
doPreProc=0
nlive=500
Nthreads=1
## If FixSeed is true, the sampler will use random states generated by the seed given in the 'seed' parameter below. This allows for reproduction of sampling results; for a given seed value, repeated analyses of the same dataset will produce precisely identical results. The seed can be any unsigned 32-bit integer.
FixSeed=1
seed=50
# Must be .npz file
input_spectrum=data_spectrum.npz

Hey @sharanbngr, is it logical to have logz(orbiting) < than logz(stationary)? Even with Alexander's params I still get a very large number, I've decided to plot log(z_orbiting/z_stationary, which is equivalent to log(z_orbiting) - log(z_stationary). Though, logz_o - logz_s will give a negative number because of logz_o < logz_s, do I have to worry about that? Or that's a result I can expect as well.
I will post the params I use in another comment below.

I thought yesterday we were seeing runs with logz_o >logz_s. Is this with a higher nside?

Hey @sharanbngr, is it logical to have logz(orbiting) < than logz(stationary)? Even with Alexander's params I still get a very large number, I've decided to plot log(z_orbiting/z_stationary, which is equivalent to log(z_orbiting) - log(z_stationary). Though, logz_o - logz_s will give a negative number because of logz_o < logz_s, do I have to worry about that? Or that's a result I can expect as well.
I will post the params I use in another comment below.

I thought yesterday we were seeing runs with logz_o >logz_s. Is this with a higher nside?

Yes, yesterday's result is logz_o > logz_s. After changing params to Alexander's, the logz switched. This is with nside=4, which is the same as before.

Hey @sharanbngr, is it logical to have logz(orbiting) < than logz(stationary)? Even with Alexander's params I still get a very large number, I've decided to plot log(z_orbiting/z_stationary, which is equivalent to log(z_orbiting) - log(z_stationary). Though, logz_o - logz_s will give a negative number because of logz_o < logz_s, do I have to worry about that? Or that's a result I can expect as well.
I will post the params I use in another comment below.

I thought yesterday we were seeing runs with logz_o >logz_s. Is this with a higher nside?

Yes, yesterday's result is logz_o > logz_s. After changing params to Alexander's, the logz switched. This is with nside=4, which is the same as before.

In that case, it's fine. Go ahead and make the bayesfactor plots and we will think about how to interpret them when we meet on Friday.

Ok, I will do the bayesfactor plots in log_10, if so, I cannot think of a way to compute the uncertainty in log_10(Zo/Zs) because the error propagation formula requires the actual Zo and Zs values to compute. Should I just approximate the uncertainties? Or I just plot the bayesfactor plots without it for now, then we discuss more on Friday? I am almost done with running the orbiting/stationary analysis for both nside=4 & 8.

Hey @sharanbngr , just a quick clarification, do you run run_blip.py in python or python3 ? I'm thinking that might be the cause of the problem I'm facing.

@kuan0020 Sorry about the late reply. I run with python3 but afaik it shouldn't change based on what you have used. Are you sourcing the virtualenv? If you are both python and python3 should be the same thing.

https://docs.google.com/presentation/d/1uuhY1vxJdz5bgdTFGf_aNqXFacbAgLIkde1D5BlHfA4/edit?usp=sharing

https://docs.google.com/presentation/d/1uuhY1vxJdz5bgdTFGf_aNqXFacbAgLIkde1D5BlHfA4/edit?usp=sharing

https://docs.google.com/presentation/d/1uuhY1vxJdz5bgdTFGf_aNqXFacbAgLIkde1D5BlHfA4/edit?usp=sharing

There's an update to the graph, I missed out something in the code that made the data weird. Now it is ready.

[ ] Reproduce MLDC based bayesfactor plots for different seeds

[ ] Fix our own simulated data-set to understand the source of the statistical fluctuations.

[ ] repeat runs with our own fixed data set for different seeds


Update setup.py

Sonarqube was complaining and creating a security hotspot because URL is http not https

Fixed in version 0.6.22 circa Aug 20, 2023.
Thanks for reporting this @joshibeast :)


Prooph Event Sourcing Revival

Two years ago I created this issue about a possible Blueprint instead of a event-sourcing library.
I'd like discuss this option again. In the last two years @sandrokeil and me focused on developing a modeling tool: InspectIO. It ships with a customizable code generator. The PHP version works with PHP AST and @sandrokeil put a lot of effort into making it as flexible as possible while still being easy to use.
With this toolbox in place we could think about a new prooph/event-sourcing and also a lightweight prooph/service-bus. Both based on code generation instead of library code that you have to extend from.
A set of defaults could guide people in the right direction but should offer enough freedom to change things they want to do different.
What do you think?
/cc @prolic

While I am not totally against having an event-sourcing lib available, this would be different for v7 and v8 of event-store and again different within prooph/micro f.e.
What is the purpose of having it as library available? Rely on it during code generation?
About: prooph/service-bus
What we have is already solid and reliable. What else do you want to remove or add? Any featureset in mind?

I'd like to turn prooph/event-sourcing into a library that is preconfigured for the code generator.
See this event-engine package as an example: https://github.com/event-engine/php-code-generator-cody
It's prepared to generate Event Engine code.
We could prepare different styles for prooph/micro, v7, v8.
Some logic like command, event and value object generation can be shared across the styles and others like organizing aggregates, command handlers, etc. is different. some details: https://github.com/event-engine/php-code-generator-cody/blob/master/src/Aggregate.php#L58
Regarding service-bus: we deprecated the package because maintenance was too much effort and other feature-complete solutions exist as alternatives.
So I'm thinking about a very simple, basic implementation: map command to handler, event to listeners, without all the plugin logic etc. Just enough to have something that works out-of-the-box when exploring prooph and its capabilities.
If people need more they should follow the suggestion and use symfony/messenger or whatever they prefer.

I would +1 on this (excluding the code generation part).
I have been trying to revive a project that was stale for the last 5 years and the stack was with Prooph Eventstore on Mysql, projections on service bus 4.x (onEventHappened methods), Zend expressive for API communication with REST, HAL, ApiProblem...
The goal was to touch as little code as possible, but I managed to upgrade almost everything (k8s, Prooph, Mezzio...) to the latest versions and as data wasn't a concern (and other reasons), swapped the Prooph event store with Greg's Eventstore. I wanted to run everything in a single process, but as the async Eventstore client does work with AMP, I opted by splitting the projection code in its own application. The writes are happening with the HTTP library.
Almost everything is working fine but I'm a little bit stuck for days in the projection part (it works but slow and unreliable). I made a "compatibility trait" with call_user_func on _invoke to make my old projection classes written for 4.x work on 6.x. In general, I would favor small callables instead of code all merged together, but in the case of projections, I still prefer the old approach of 4.x since its much more similar to the code written by the query/projection system of Greg's Eventstore (you receive state + event and make changes to state).
Since MySQL is still used for read-model projection, the challenge is to batch event handling to avoid doing a database commit on every event. On the projection code, I obtain the event from the event store client with a persistent subscription and pass it on the event-bus from service-bus. Since the event bus is fire-and-forget, it is hard to know when the event was successfully processed so the manual acknowledges can be sent to the Eventstore. I know the library is not made for that, but message brokers often work with acknowledging patterns, so having a retry-system in the query bus could also make sense.
In my humble opinion when you talk about code generation you talk about an opinionated code that provides no guarantee of being easier to modify/customize than a properly contract-based design. Your mind is less shaped with the positive limitations that come from knowing you are providing something in a library.
I know you guys went in a completely new and opposite direction with a new framework, and RAD is probably much faster, but not everyone is a fan of code generation or can just switch the approach on an old app as I have.

Having thought about this a few more days...
event-sourcing lib
Actually I am quite happy this thing is gone, most devs I know didn't use our implementation anyway. If you want to work on this, I have nothing against. I can do some code reviews and provide input, but most likely I personally won't invest too much time into this.
service-bus
This is actually quite interesting. Last stable release is 6.2.2 from Feb 7, 2018. 3 years without a single bug-report. Also this thing has more downloads then event-store v7 and v8 combined, so people really seem to have an interest in this project. In my current project for client I use simple anonymous functions for this job, instead of composing and wiring many objects together (like the prooph/service-bus does). I am curious what plans you had in mind and how code-generation can be used to help build a service-bus component.

FYI @gquemener and @OskarStark were recently discussing the symfony/messenger as  standalone-version:

https://twitter.com/psren/status/1362870629570142209

Haven't got much experience using symfony/messenger as a standalone component. All I know is that it is designed for such purpose (and is integratable within a symfony app through the symfony/framework-bundle package).

Nonetheless, I was able to achieve the following feature without too much hastle with symfony/messenger and the framework-bundle:

register a command bus and an event bus
wrap command handlers within a doctrine transaction
dispatch domain events after command handling and transaction commit (through a middleware, so this behavior is configured within the command bus, and generalized to all command handling)
route some events to a message queue (through the use of a marker interface)

and as a bonus I had : log and good DX through the web debug toolbar (where I see all the command/events that have been dispatched/handled during an http request handling).

@fabiocarneiro thanks for your insights!
I'd like to answer a few things:

In my humble opinion when you talk about code generation you talk about an opinionated code that provides no guarantee of being easier to modify/customize than a properly contract-based design.

It's the opposite: I'm talking about a blueprint powered by code generation that serves as a default implementation. Of cause the blueprint is opinionated, but compared to a library you can tweak it to your liking.

For the purposes that fulfill the other framework, why don't you guys write new packages in that repo instead of trying to transform Prooph into something else?

That's already done. I don't want to turn prooph into a RAD framework. Therefor we have Event Engine and it is already powered by the Code Generator. What I suggest here is to integrate the benefits of visual modeling + code generation into prooph, which calls itself enterprise-ready. getprooph.org still lists all components, but everything except event-store is not officially supported at the moment. I would like to change that again, but still respect the reasons why we deprecated the stuff two years ago.

I should also point out that symfony/messenger seems to lack a way to enforce a single handler per command strategy : https://github.com/symfony/symfony/issues/36958

I was asked on twitter to leave a comment here regarding standalone usage of symfony/messenger:

I should also point out that symfony/messenger seems to lack a way to enforce a single handler per command strategy : symfony/symfony#36958

Since handling the messages is done by a Middleware, it should be easy to build an own SingleHandlerMiddleware implements MiddlewareInterface and use it instead of the default HandleMessageMiddleware

I did look into symfony/messenger, but I had the feeling it is a bit coupled to the framework [...]

It's not coupled at all. It's possible to use it standalone and it is very feature-rich and has lots of transports, including:

https://packagist.org/packages/sroze/messenger-enqueue-transport
https://github.com/symfony/doctrine-messenger
https://github.com/symfony/redis-messenger

However, I guess you'd have to do quite a bunch of source digging to properly configure the bus manually.

This is true. The docs for standalone usage is quite more than minimal (also see this docs-discussion on twitter), but the sourcecode is well understandable.

I also experimented a bit with the standalone usage and can say:

it's easy to extend, and every corner is replaceable
eco system / integrations are good

I will continue to invest some time in this and really like symfony/messenger. The symfony-bundle is very easy to use,
but everything seems doable as standalone, too.
But if you want async-command-processing I'd recommend using symfony/console, since the Console-Commands provided by the messenger-Component are huge time savers.

*It is important to know that messages routed to async transport will never be handled synchronously. If you want your message to be both routed to a message queue and your local event handlers to be called, you must explicitly route your event to both sync and async transport.

If you don't want a message to be routed to multiple transports an own HandleMessageMiddleware could do both, too.

I know the library is not made for that, but message brokers often work with acknowledging patterns, so having a retry-system in the service-bus could also make sense.

retry-patterns it built in in symfony/messenger.

In my humble opinion when you talk about code generation you talk about an opinionated code that provides no guarantee of being easier to modify/customize than a properly contract-based design. Your mind is less shaped with the positive limitations that come from knowing you are providing something in a library.

Serialize/Deserialize is completely configurable with symfony/messenger so using generated code should be no problem at all. (I'm a fan of generated code).
Maybe one could provide a simple factory that builds a "opinionated" messenger instance.

I was asking if the guys from Eventstore had an example of how they handle the persistent subscription in other languages and they unfortunately also don't have examples but have been planning to work on it.
The interesting part is that Greg also answered and said that there were multiple requests for a client-side projection library and they have been planning to work on it for a while. I quote:

I have discussed with a few others in the past sitting and writing an external projection library. The first would be in C# then ported to Java.
This is a 4-8 week project depending on scope likely involving 1-2 people aside from me personally. I would love to get some companies involved so its not just "free work".
There is no shortage of time in COVID days

It's not coupled at all. It's possible to use it standalone and it is very feature-rich...

@HellPat, I might not have expressed myself properly. I didn't mean you must use or download the other components, but it works in a very standard Symfony way. The way the configurations work... Bundle...

thanks for all the input guys!
I think we have two topics here:

Event Sourcing

@prolic yeah, I get your point. I think it is best to provide a prototype of what I have in mind and collect some feedback. I'm also happy that it's gone because everybody has a different opinion about it. But what I also learned during last 2 or 3 years is, that companies are really looking for proper Event Sourcing solutions that they can integrate into their existing stack. And prooph components are a perfect match for them because our components are really individual packages, but still work quite nice together. No matter what part you develop yourself and what part you integrate directly: prooph/common is the glue.
I'd like to provide an easy way for them to start with a blueprint and then learn and adopt. I could do that outside of prooph under the Event Engine umbrella, but IMHO prooph OS is the better place for it, because that is what people know and where they are looking first for solutions.
I don't think you need to develop anything, but feedback and some code review would be awesome, yes!

Service Bus
I remember the day when we made the decision to deprecate prooph/service-bus. It was a hard one. The package is of extrem high quality. And this ongoing usage after 3 years of inactivate still demonstrates it. Symfony/Messenger has a slightly different scope but is also of high quality and can be tweaked to provide similar capabilities like prooph/service-bus.
Personally I also think that a very simple message routing solution is enough for many cases, especially these days where more and more infrastructure stuff is directly pushed into the cloud and application logic split into micro services or even single functions.
I'm really not sure about how to proceed here. I'd like to have something in the prooph ecosystem that gives you message routing. Again because people are looking at prooph for a solution and they don't really get what packages are still maintained and which one are not. Here my suggestion is also to start with a new prototype and collect feedback. Or we just reactivate prooph/service-bus and see if we can put a light version next to it. Not sure ...

Update from my side:
@dgafka asked me to take a look at his EcotoneFramework before reactivating prooph/service-bus. Ecotone is a service bus implementation which enables message driven architecture and CQRS/ES.
We had a longer chat last week and decided to collaborate on some ideas like InspectIO Code Generation for Ecotone, proper prooph/event-store intgration and maybe integrating some ideas from Event Engine.
Ecotone is definitely as powerful as prooph/service-bus but easier to understand thanks to PHP 8 attributes. prooph/service-bus had this plugin system based on an internal event dispatcher. Ecotone on the other hand uses the concept of interceptors which can hook into message routing and provide cross-cutting functionality. Compared to symfony/messenger Ecotone has first-class support for CQRS which was another selling point of prooph/service-bus before.
Long story, short: With Ecotone being actively maintained and making use of latest PHP 8 features, it makes no sense to me to reactivate prooph/service-bus. Ecotone also provides an Event Sourcing module, so I think that's also a very good option for people looking for a library that provides ES basics.
I'm closing the issue here. Thank you again for all the input!


After xu.concat(): selection and depth conversion issues

Hey,
I've found an issue when using concatenated datasets, following xu.concat().
Firstly, my ds.ugrid.sel() function gives me an index error with the concatenated data.
Secondly, my depth conversion from sigma to meters (dfmt.get_Dataset_atdepths()) only works before the data is concatenated - and also does not work on the point-selected output from the first issue.
An example: P:\11208479-sequestration-seaweed\Oosterschelde_DFM_hydro_waq\dflowfm3d-oosterschelde-wq\scripts\issue_minimal_working_example.ipynb
Or:
import os
from pathlib import Path
import geopandas
import pandas as pd
import xugrid as xu
import dfm_tools as dfmt
from shapely.geometry import Point

## Reading output from 2 years, for 3 partitions

basedir = r"p:\archivedprojects\11206044-002ospareutrophication\final_results_Snellius_latestversion_20220210"
f1 = [os.path.join(basedir, r'A16b_Numtopsiguniform1_2015_pH\DFM_OUTPUT_DCSM-FM_0_5nm_waq',f'DCSM-FM_0_5nm_waq_{i:04d}_map.nc') for i in [146,147,148]]
f2 = [os.path.join(basedir, r'A16b_Numtopsiguniform1_2016_pH\DFM_OUTPUT_DCSM-FM_0_5nm_waq',f'DCSM-FM_0_5nm_waq_{i:04d}_map.nc') for i in [146,147,148]]

waq_xr1 = dfmt.open_partitioned_dataset(f1)       # opens every .map file in this folder
waq_xr2 = dfmt.open_partitioned_dataset(f2)

waq_xr1 = dfmt.rename_waqvars(waq_xr1)             # renames the water quality variables
waq_xr2 = dfmt.rename_waqvars(waq_xr2)

waq_xr = xu.concat([waq_xr1, waq_xr2], dim='time') # concatenate the two years

list_plifiles = [Path(r'p:\11208479-sequestration-seaweed\Oosterschelde_DFM_hydro_waq\dflowfm3d-oosterschelde-wq\boundary_conditions\zee-zuid.pli')]

## Loop over each boundary

for i,file in list(enumerate(list_plifiles)):
    print(str(file).split('\\')[-1].split('.')[0])

    # Read points within this offshore boundary:
    pli_file = pd.read_csv(list_plifiles[i], skiprows=1, sep=' ')   # read pli file
    pli_file = pli_file.dropna(axis=1)                              # drop empty columns
    # Convert dutch crs to decimal degrees (for DCSM)
    points = []
    for i in range(0,len(pli_file)):
        points.append(Point(pli_file[pli_file.columns[0]].to_list()[i], pli_file[pli_file.columns[1]].to_list()[i]))
    d = {'location': pli_file[pli_file.columns[2]].to_list(), 'geometry': points}
    gdf = geopandas.GeoDataFrame(d, crs='epsg:28992')   # set Dutch crs
    gdf = gdf.to_crs(4326)                              # convert to decimal degrees

point = 0

## Issue when using .sel from concatenated ds:
waq_xr.ugrid.sel(x=gdf.geometry[point].x, y=gdf.geometry[point].y)

## Note: no issue with pre-concatenated data
ds_point = waq_xr1.ugrid.sel(x=gdf.geometry[point].x, y=gdf.geometry[point].y)

## Issue with depth conversion from sigma to meters:
dfmt.get_Dataset_atdepths(data_xr=ds_point, depths = waq_xr.mesh2d_layer_z[0,:].values)  ## using point selected from above

dfmt.get_Dataset_atdepths(data_xr=waq_xr, depths = waq_xr.mesh2d_layer_z[0,:].values)  # Also issue when using concat data

## But no issue when using 1 year (pre-concat and pre-point-selection):
dfmt.get_Dataset_atdepths(data_xr=waq_xr1, depths=waq_xr.mesh2d_layer_z[0,:].values.tolist(), reference='waterlevel')

I ran the code in the issue description again. Most of the lines work without errors. However, there is still one issue left. When interpolating the merged dataset (waq_xr) to depths, it raises "ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()". This is because the mesh2d_interface_z variable (and possibly others), has an additional time dimension. Reproducible code:
import os
import xugrid as xu
import dfm_tools as dfmt

## Reading output from 2 years, for 3 partitions
basedir = r"p:\archivedprojects\11206044-002ospareutrophication\final_results_Snellius_latestversion_20220210"
f1 = [os.path.join(basedir, r'A16b_Numtopsiguniform1_2015_pH\DFM_OUTPUT_DCSM-FM_0_5nm_waq',f'DCSM-FM_0_5nm_waq_{i:04d}_map.nc') for i in [146,147,148]]
f2 = [os.path.join(basedir, r'A16b_Numtopsiguniform1_2016_pH\DFM_OUTPUT_DCSM-FM_0_5nm_waq',f'DCSM-FM_0_5nm_waq_{i:04d}_map.nc') for i in [146,147,148]]

waq_xr1 = dfmt.open_partitioned_dataset(f1)       # opens every .map file in this folder
waq_xr2 = dfmt.open_partitioned_dataset(f2)

waq_xr1 = dfmt.rename_waqvars(waq_xr1)             # renames the water quality variables
waq_xr2 = dfmt.rename_waqvars(waq_xr2)

waq_xr = xu.concat([waq_xr1, waq_xr2], dim='time') # concatenate the two years

# this raises "ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()"
# dfmt.get_Dataset_atdepths(data_xr=waq_xr, depths = waq_xr.mesh2d_layer_z[0,:].values)

print(waq_xr2['mesh2d_interface_z'].dims) # ('mesh2d_nInterfaces',)
print(waq_xr['mesh2d_interface_z'].dims) # ('time', 'mesh2d_nInterfaces')

Prints:
('mesh2d_nInterfaces',)
('time', 'mesh2d_nInterfaces')

Is this a bug or should one use a different approach to concatenate the datasets?

I think it needs a different option for one of the keywords:
https://docs.xarray.dev/en/stable/generated/[xarray.concat](https://docs.xarray.dev/en/stable/generated/xarray.concat.html).html

Thanks, you are right, I missed data_vars='minimal'. This avoids the time dimension being broadcasted on variables without it.
This code should do all the intented things and gives no errors:
import os
import geopandas
import pandas as pd
import xugrid as xu
import dfm_tools as dfmt
from shapely.geometry import Point

## Reading output from 2 years, for 3 partitions
basedir = r"p:\archivedprojects\11206044-002ospareutrophication\final_results_Snellius_latestversion_20220210"
f1 = [os.path.join(basedir, r'A16b_Numtopsiguniform1_2015_pH\DFM_OUTPUT_DCSM-FM_0_5nm_waq',f'DCSM-FM_0_5nm_waq_{i:04d}_map.nc') for i in [146,147,148]]
f2 = [os.path.join(basedir, r'A16b_Numtopsiguniform1_2016_pH\DFM_OUTPUT_DCSM-FM_0_5nm_waq',f'DCSM-FM_0_5nm_waq_{i:04d}_map.nc') for i in [146,147,148]]

# opens every .map file in this folder
waq_xr1 = dfmt.open_partitioned_dataset(f1)
waq_xr2 = dfmt.open_partitioned_dataset(f2)

# rename the water quality variables
waq_xr1 = dfmt.rename_waqvars(waq_xr1)
waq_xr2 = dfmt.rename_waqvars(waq_xr2)

# concatenate the two years
waq_xr = xu.concat([waq_xr1, waq_xr2],
                   dim='time', # dimension along which to concatenate
                   data_vars='minimal' # to avoid expanding of non-time variables with time dimension
                   )

file_pli = r'p:\11208479-sequestration-seaweed\Oosterschelde_DFM_hydro_waq\dflowfm3d-oosterschelde-wq\boundary_conditions\zee-zuid.pli'

# Read points within this offshore boundary:
pli_file = pd.read_csv(file_pli, skiprows=1, sep=' ')  # read pli file
pli_file = pli_file.dropna(axis=1)  # drop empty columns
# Convert dutch crs to decimal degrees (for DCSM)
points = []
for i in range(0,len(pli_file)):
    points.append(Point(pli_file[pli_file.columns[0]].to_list()[i], pli_file[pli_file.columns[1]].to_list()[i]))
d = {'location': pli_file[pli_file.columns[2]].to_list(), 'geometry': points}
gdf = geopandas.GeoDataFrame(d, crs='epsg:28992')  # set Dutch crs
gdf = gdf.to_crs(4326)  # convert to decimal degrees

point = 0

ds_point = waq_xr.ugrid.sel(x=gdf.geometry[point].x, y=gdf.geometry[point].y)

ds_point_atdepths = dfmt.get_Dataset_atdepths(data_xr=ds_point, depths=waq_xr.mesh2d_layer_z[0].values)

waq_xr_atdepths = dfmt.get_Dataset_atdepths(data_xr=waq_xr, depths=waq_xr.mesh2d_layer_z[0].values)


Color for support activity doesn't change even after specifying a custom color

Hi, i am looking into this
How did you specify the color?
Can i please see the code? Thanks

it is working for me...
if i can check your code, maybe the documentation about how using it was not so clear?

I checked the new update, both issues have been fixed thanks :)
You definitely did something for the color thing as well, I was using getColor(R.color.myColor) to get the color int.
I have noticed a new more bugs:

If I specify the email of the user before starting the support activity, it doesn't take that email and shows a random name like RoyalBlue Ocelot even though I do set the email. I have tried logging out and re logging like the sdk says but it doesn't help. However if I don't specify an email through code then the support activity asks for the email and registers that email correctly.

If I open the chat window for the admin (on the website dashboard) and reply the customer, the admin message doesn't get delivered to the customer unless he goes back and open the chat window again. But its working correctly now for the admin app on android.

Another thing I noticed was that if the customer goes back to a previous chat and the admin messages him first, that very first message doesn't get delivered to the customer. If the admin messages again for the second time, it gets delivered fine. (this was on the customerly admin android app).

Lastly even if I login as a new user or with a new name it shows the previous chats of the previous user. I mean if I login with the email address<EMAIL_ADDRESS>and I logout and relogin using a different email (bca@gmail.com), shouldn't it remove the previous chats that were added for abc?

Thanks again for the quick response.

@giannign1 did you get a chance to look at these mate?

not yet i'll keep you posted about it

@hamzabinamin can i see your code? Because is working for me
Any chances you are doing something like this? (without wait some time between the first and the second?

Customerly.logoutUser()
Customerly.registerUser(email)

I only succeded to replicate your first issue by writing
Customerly.logoutUser()
Customerly.registerUser(email)

That's because the logoutUser was not intended as a blocking task but it it executed asynchronously and will conflict with the registerUser task
If you need to perform something like this, i just added a callback to the logoutUser() function so, since next version of SDK you'll be able to write:
Customerly.logoutUser {
    Customerly.registerUser(email)
}

@giannign1
No I am not calling them both together one after the other. The call layout is as following:

User logs out of their account.
We call Customerly.logoutUser
The user logs in to their account (Its a network call to our own server now)
if the login is successful, we register the user in Customerly as well using Customerly.registerUser(email)

As you can see there's quite a difference in call time so it shouldn't be happening. Plus logout feature works fine. If I log out and initiate the chat, the support activity prompts me to enter a email.

Strange is not happening to me
I have just uploaded a new version of sdk,  3.0.3
Let me know if some of the reported bugs persist

@giannign1 Rest of the bugs seem to be fixed but the register function is still not working correctly. I still get random names for customers.
Also I posted an issue for the ios version as well. I think  you're active there as well. Could you take a look on that as well?

I am sorry i need to see your code of logout, registerUser and openSupport as well because is working in my test app, maybe i can see a way to replicate the issue. Thank you
For the other task no i don't handle ios but i pushed the ios developer, he will answer asap

Logout function
public void showLogOutDialog() {
     AlertDialog.Builder builder;
     if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
         builder = new AlertDialog.Builder(context, R.style.DialogStyle);
     } else {
         builder = new AlertDialog.Builder(context);
     }
     builder.setTitle(context.getString(R.string.logout2))
             .setMessage(context.getString(R.string.areYouSureYouWantToLogout))
             .setPositiveButton(R.string.logout, new DialogInterface.OnClickListener() {
                 public void onClick(DialogInterface dialog, int which) {
                     if(Shared_Preferences.getCurrentCustomer(context) != null) {
                         Customer customer = Shared_Preferences.getCurrentCustomer(context);

                         if(customer.facebookUser) {
                             System.out.println("Facebook User is logging out");
                             LoginManager.getInstance().logOut();
                         }
                         else {
                             System.out.println("Non Facebook User is logging out");
                         }
                     }
                     Shared_Preferences.saveCurrentCustomer(context, null);
                     **Customerly.logoutUser();**
                     TastyToast.makeText(context, context.getString(R.string.logoutConfirmation), TastyToast.LENGTH_SHORT, TastyToast.SUCCESS);
                      ((AccountActivity)context).getFragmentManager().popBackStack(null, FragmentManager.POP_BACK_STACK_INCLUSIVE);
                      ((AccountActivity)context).startActivity(new Intent(context, MainActivity.class));
                 }
             })
             .setNegativeButton(android.R.string.no, new DialogInterface.OnClickListener() {
                 public void onClick(DialogInterface dialog, int which) {
                     dialog.cancel();
                 }
             })
             .show();
 }

Login Function
public static void getCustomerUsingEmailAndPassword(final Context context, String email, String password, final KProgressHUD hud) {

      Gson gson = new GsonBuilder()
              .setLenient()
              .create();

      Retrofit.Builder builder = new Retrofit.Builder()
              .baseUrl("http://xxx/App Scripts/")
              .addConverterFactory(GsonConverterFactory.create(gson));

      Retrofit retrofit = builder.build();

      CustomerInterface customerInterface = retrofit.create(CustomerInterface.class);
      Call<JsonObject> call = customerInterface.getCustomerUsingEmailAndPassword(email, password);
      call.enqueue(new Callback<JsonObject>() {
          @Override
          public void onResponse(Call<JsonObject> call, Response<JsonObject> response) {
              Utilities.hideHUD(hud);
              System.out.println("Response: " + response.body().toString());
              String status = response.body().getAsJsonPrimitive("status").getAsString();

              if(status.equals("success")) {
                  JsonArray userArray = response.body().getAsJsonArray("user");
                  System.out.println(userArray.get(0).getAsJsonObject().get("ID").getAsString());
                  Customer customer = new Customer(userArray.get(0).getAsJsonObject().get("ID").getAsString(), userArray.get(0).getAsJsonObject().get("Email").getAsString(), userArray.get(0).getAsJsonObject().get("Password").getAsString());
                  customer.firstname = userArray.get(0).getAsJsonObject().get("First_Name").getAsString();
                  customer.lastname = userArray.get(0).getAsJsonObject().get("Last_Name").getAsString();
                  customer.number = userArray.get(0).getAsJsonObject().get("Contact_Number").getAsString();
                  customer.postal = userArray.get(0).getAsJsonObject().get("Postal_Code").getAsString();
                  customer.street = userArray.get(0).getAsJsonObject().get("Street_Address").getAsString();
                  customer.omiseID = userArray.get(0).getAsJsonObject().get("Omise_ID").getAsString();

                  Shared_Preferences.saveCurrentCustomer(context, customer);
                  Utilities.sendMessage(context, true);
                  **Customerly.registerUser(email);**
                  ((AccountActivity)context).getSupportFragmentManager().popBackStackImmediate();
                  ((AccountActivity)context).hideTabLayout();
                  ((AccountActivity)context).showFragment(new SettingsFragment());
              }
              else if(status.equals("wrong password")) {
                  TastyToast.makeText(context, context.getString(R.string.wrongPassword), TastyToast.LENGTH_SHORT, TastyToast.ERROR);
              }
              else if(status.equals("failure")) {
                  TastyToast.makeText(context, context.getString(R.string.wrongEmailPassword), TastyToast.LENGTH_SHORT, TastyToast.CONFUSING);
              }
          }

          @Override
          public void onFailure(Call<JsonObject> call, Throwable t) {
              Utilities.hideHUD(hud);
              System.out.println("Failed: " + t.getMessage());
              TastyToast.makeText(context, context.getString(R.string.somethingWentWrong), TastyToast.LENGTH_SHORT, TastyToast.CONFUSING);
          }
      });

  }

Open Support Function
      switch (view.getId()) {
            case R.id.emailNowButton:
                sendEmail();
                break;

            case R.id.chatButton:
                Customerly.openSupport(getActivity());
                break;
        }

Your code seems okay for me 👍
So can you tell me the steps you are following?
i did the following:
Customerly.logoutUser(); //Just to make sure we start with zero authentication
wait 1s
Customerly.openSupport(getActivity());
write a message (received with random names)
Customerly.logoutUser();
wait 1s
Customerly.registerUser(email);
write a message (received with email user)
Customerly.logoutUser();
write a message (received with random name 'XXX YYY')
Customerly.registerUser(email); (the old lead 'XXX YYY' get upgraded to user email)
previous message from 'XXX YYY' is now from 'email user'
write a message (received with email user)
which is the step not working well for you?

@giannign1  I cleared cache and reinstalled the app, the logout feature is working as intended now. I'll keep an eye in case the issue comes again.
Can you please ask the iOS developer to look into my other request. Its been 7 days and he didn't comment there. Would appreciate a lot. Thanks


Update cats-effect to 3.3.0

Updates org.typelevel:cats-effect from 3.2.9 to 3.3.0.
GitHub Release Notes - Version Diff
I'll automatically update this PR to resolve conflicts as long as you don't change it yourself.
If you'd like to skip this version, you can just close this PR. If you have any feedback, just mention me in the comments below.
Configure Scala Steward for your repository with a .scala-steward.conf file.
Have a fantastic day writing Scala!

Applied Scalafix Migrations

org.typelevel:{cats-effect,cats-effect-laws}:3.3.0 (created no change)

github:typelevel/cats-effect/v3_3_0?sha=series/3.x

Ignore future updates
Add this to your .scala-steward.conf file to ignore future updates of this dependency:
updates.ignore = [ { groupId = "org.typelevel", artifactId = "cats-effect" } ]

labels: library-update, early-semver-minor, semver-spec-minor, scalafix-migrations

Codecov Report

Merging #352 (ab074ad) into main (df19298) will increase coverage by 0.38%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##             main     #352      +/-   ##
==========================================
+ Coverage   59.87%   60.26%   +0.38%
==========================================
  Files          30       30
  Lines         987      969      -18
  Branches       64       73       +9
==========================================
- Hits          591      584       -7
+ Misses        396      385      -11

Impacted Files
Coverage Δ

...la/org/dhallj/imports/ReferentialSanityCheck.scala
90.00% <0.00%> (-1.67%)
:arrow_down:

...scala/org/dhallj/imports/CorsComplianceCheck.scala
92.30% <0.00%> (-1.03%)
:arrow_down:

...avagen/src/main/java/org/dhallj/javagen/Code.scala
0.00% <0.00%> (ø)

...ce/src/main/scala/org/dhallj/circe/Converter.scala
100.00% <0.00%> (ø)

...c/main/java/org/dhallj/javagen/ToCodeVisitor.scala
0.00% <0.00%> (ø)

...hallj/tests/acceptance/ImportResolutionSuite.scala
100.00% <0.00%> (ø)

...allj/tests/acceptance/AcceptanceFailureSuite.scala
100.00% <0.00%> (ø)

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 df19298...ab074ad. Read the comment docs.

Superseded by #360.


Featurerequest: Password for mobile users

Hi,
I would like to add for my mobile users also a password. Is this already possible with this script?
Regards

Not possible by default.
If you insist, take a look at #529.


Improve article 2112.01199

Problem details
Title has malformed Unicode: SchrÃ¶dinger.

Fixed upon regenerating.


⚠ ClamAV has degraded performance

In bcf03f9, ClamAV (https://spamassassin.apache.org/) experienced degraded performance:

HTTP code: 200
Response time: 193 ms

Resolved: ClamAV performance has improved in c253349.


devbox: 0.11.0 -> 0.12.0

Automatic update generated by nixpkgs-update tools. This update was made based on information from https://repology.org/project/devbox/versions.
meta.description for devbox is: Instant, easy, predictable shells and containers
meta.homepage for devbox is: https://www.jetpack.io/devbox
Updates performed

Golang update

To inspect upstream changes

Release on GitHub

Compare changes on GitHub

Impact
Checks done

built on NixOS
The tests defined in passthru.tests, if any, passed
found 0.12.0 with grep in /nix/store/9xdvsvfa5rxj8gds2qw1iygdxk2n3ijn-devbox-0.12.0
found 0.12.0 in filename of file in /nix/store/9xdvsvfa5rxj8gds2qw1iygdxk2n3ijn-devbox-0.12.0

Rebuild report (if merged into master) (click to expand)

2 total rebuild path(s)

2 package rebuild(s)

First fifty rebuilds by attrpath

devbox

Instructions to test this update (click to expand)

Either download from Cachix:
nix-store -r /nix/store/9xdvsvfa5rxj8gds2qw1iygdxk2n3ijn-devbox-0.12.0 \
  --option binary-caches 'https://cache.nixos.org/ https://nix-community.cachix.org/' \
  --option trusted-public-keys '
  nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=
  cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=
  '

(The Cachix cache is only trusted for this store-path realization.)
For the Cachix download to work, your user must be in the trusted-users list or you can use sudo since root is effectively trusted.
Or, build yourself:
nix-build -A devbox https://github.com/r-ryantm/nixpkgs/archive/a0f413fd819fb8a1cf5f97477569383d1ed46a54.tar.gz

Or:
nix build github:r-ryantm/nixpkgs/a0f413fd819fb8a1cf5f97477569383d1ed46a54#devbox

After you've downloaded or built it, look at the files and if there are any, run the binaries:
ls -la /nix/store/9xdvsvfa5rxj8gds2qw1iygdxk2n3ijn-devbox-0.12.0
ls -la /nix/store/9xdvsvfa5rxj8gds2qw1iygdxk2n3ijn-devbox-0.12.0/bin

Pre-merge build results
We have automatically built all packages that will get rebuilt due to
this change.
This gives evidence on whether the upgrade will break dependent packages.
Note sometimes packages show up as failed to build independent of the
change, simply because they are already broken on the target branch.
Result of nixpkgs-review run on x86_64-linux 1

1 package built:

devbox

Maintainer pings
cc @urandom2 @Lagoja for testing.


Build system portability issues

I've made use of echo -e in the build system to make the output a bit friendler but this is not posix compliant usage of echo. Some shells may (and do) break with this usage, including shell used for github CI. This results in stray characters being emitted everywhere.
This brings up an important question of what other assumptions are made within the build system when it comes to being portable.

The usage of the echo seemed to be the only posix compliance issue. Build was fixed in https://github.com/DeanoBurrito/northport/commit/793a7d5f77553bfae8a6be0a0f681779a3901ea3