Replace use of argparse.Namespace with named args and kwargs where possible.

🚀 Feature Request
Remove argparse.Namespace parameter passing where possible.
Motivation
Using args makes code unclear to read because it couples implementations with argparse tightly. Functions and classes should rely on what they need to function and no more.
Pitch
With the exception of classmethods, arguments to functions and methods should be named and explicitly passed in. This makes the code:

More readable -- no more cluttering the code with args.X in implementations that only care about X
More testable -- argparse is a runtime concern and won't/shouldn't be needed in tests
More portable -- if I want to use a class from fairseq in some other code, I don't need to "mock" argument parsing logic.
Less tightly coupled -- instead of guessing why some call-site passed in args, I know exactly what the minimal information required to compute some function will be.

Alternatives
Leave the code as is. 😄
Additional context
As I begin looking at the refactor for #1648, I see args buried deep in the code. This refactor would be much easier if this were implemented first.

Yes, @alexeib and I have been discussing this. I agree that the first step is removing Namespaces where possible and moving to explicit named arguments/kwargs.
We've also been discussing adopting something like hydra as an additional interface to the current command line arguments. What do you think?

I'm not so familiar with hydra outside of its motivation. I think configuration files as opposed to strictly using command-line args is super desirable, though! In favor of this change. 👍

Oh wow, hydra seems very nice. I really like the idea of this now because it answers another question I've been having: how can I (easily) do hyperparameter tuning with fairseq? With --multirun, I could provide a hyperparam grid. Nice!

Have you considered switching to ConfigArgParse? It seems to be compatible with normal argparse library but offers handling configuration files and/or env vars.
I am using fairseq for a couple of weeks and I miss this functionality.

The fact that the namespaces are being pushed so far down into implementation is a bigger problem. Once that's addressed, swapping out the configuration mechanism should be a breeze.

This should probably be re-opened, but I'm curious: @myleott what do you think about having typed configs for models and tasks? The is how huggingface approaches it and is a middle-ground between having some per-component encapsulation and allowing for a flexible library experience.

we are currently working on integrating hydra (https://hydra.cc/) into fairseq. The latest version has typed configs etc. Stay tuned.

That's why I was asking. 😄 I have been working with hydra and would be happy to start making commits - I just want to make sure it's not going to die on the vine.

yeah that is a problem. I believe @omry is thinking about how to address it, or we can hack around it meanwhile. happy to work with you on this as well! (@kevinmtian is working on this with me on our side)

Ah, presumably you're working on it in a FB-side repo and not in the OSS? I'm not sure if there's a substantive way for me to help until a branch hits the OSS fairseq. Not sure if you have ideas about that, though. Hopefully I'll be gaining access to the PyTorch slack soon and we can have a lengthier discussion there if necessary.

we are just getting started. the plan is to try to push pieces to OSS as we build them as opposed to landing one giant commit. we should have first changes out in the next couple of weeks.

Awesome! I'll keep an eye out for new branches and will try to help out as I can.

Source of truth for Hydra is the open source repo. There are some internal Facebook-only plugins but almost everything is in the repo.
I am well aware of the current limitations with user specified config file / dir and will address them in a future version.
there are workarounds we can discuss until it's is ready.

Coreference is hard. 😆 "it" in my comment above was the fairseq branch for integration with hydra. Very excited about this!

Coreference is hard.  "it" in my comment above was the fairseq branch for integration with hydra. Very excited about this!

Me too!


Avoid the Skeleton3DGizmoPlugin crash when clicking in the editor.

Avoids a crash.

I would like to know the reproduction steps. I assume this crash does not occur under normal use, but does it occur when any editor extensions are implemented?

Thanks!


Misleading/improperly documented priority options

Expected Behavior

Begin the scraping process
Results should contain JA results from JavLibraryJa, JavBusJa, etc.

Current Behavior

Begin the scraping process
Results does not contain JA results from JavLibraryJa, JavBusJa, etc.

Possible Solution

It seems that many alternative variables within Get-AggregatedDataObject are currently ignored, as detected by the PowerShell Script Analyzer in VSC (e.g. $javbusJaData, $javlibraryJaData)
Edit: Upon further investigation, it seems that we are expected to put javLibraryJa in the priority list instead of javLibrary (see $var = Get-Variable -Name "$($priority)Data"). Perhaps this could be made clearer in the configuration file?

Hey, thanks for raising the issue. Seems like you solved it yourself, and yeah I haven't gotten around to updating all documentation for the latest version.
I'm currently doing a pretty large rewrite to move into v2.0.0, so I will have documentation updated following that release.

I see, thanks! Looking forward to it. This PowerShell module has been of great help ever since JavMovieScraper's demise. Hope to see this project getting more love!

Version 2.0.0 released with updated documentation in the README. Hopefully that is sufficient!


migrate to the namespace value in the build file.

Thank you very much for your contribution. It has been adapted in v1.2.1 ：https://pub.dev/packages/app_installer


No locations sent when app is closed

Describe the bug
I'm developing an app that requires to push locations to BE even if the app has been closed, not simply put in background. I did several tests but I was not able to do this, the app it stops to send location when I close it. Is this the normal behavior, is it a bug or am I doing something wrong?
To Reproduce
Steps to reproduce the behavior:

close the app

Expected behavior
The BE continue to receive locations even if the app has been closed, not in background
Smartphone (please complete the following information):

Device: iPhone 12 Pro in iPhone Simultator
OS: iOS 14.4

Hi @lucaoliano . I'm afraid that closing the app will indeed stop location updates. There may be a way to implement this for Android using services, but I am fairly certain this would never be possible on iOS.

@diachedelic thank you for the quick response. In the past I used this Cordova plugin and locations were sent with closed app both for iOS and Android

That's interesting, I did not know iOS supported that kind of background work. Communicating to a server is out of scope for this plugin. I actually wrote this plugin because I felt mauron85's plugin (which I used for two years) was too big and complex. Does mauron85's plugin no longer work for you?

I have an old app based on the 2.x version of mauron85's plugin and it works fine. Currently I'm rewriting the app, so I tried the 3.x version and I'm not able to send location with closed app, so I tried your plugin and it is the same.
Next tests are:

try cordova-background-geolocation-lt that is the original plugin that mauron85 forked to start his plugin . Unfortunately this plugin is free only for iOS and requires a license for Android
try mauron85 2.x on the new app

I will let you know if any of this test have success.

@diachedelic finally I found the mistake with mauron85's plugin v3.x, it started to send location with closed app after that I checked the Background processing capability in Xcode. I hope that this can help with development of your plugin, I I'd rather use your plugin since it hasn't unneeded complexity and is a native capacitor plugin.

I'm glad you got it working. My vision for this plugin is to provide a simple, lightweight alternative to the more feature rich plugins such as mauron85 and cordova-background-geolocation-lt. If those plugins cease to function with Capacitor I will consider incorporating such features.

@lucaoliano Hey, what was the issue with the mauron85's plugin v3.x, and how di d you solve it. And was it working with to?

does anyone have a example code with ionic angular? didnt work for me

Got same issue on android 14. background location not sending after app is closed. Notification also removed.

@satheshsat the plugin doesnt work when the app is closed. What we ended up using is: transistorsoft background geolocation. Its payed plugin for android. But its the best documented plugin i have ever seen, if its of any value.


How does a key become "Revoked"

"Created, active, and expired keys may all be used to unprotect incoming payloads. Revoked keys by default may not be used to unprotect payloads"  Can you explain the difference between "expired" and "revoked" keys?  what can happen to an "expired" key to tranform it's status to "revoked"?

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

ID: 275ff6a6-a3f2-fb2b-6fda-4981abf46a7d
Version Independent ID: e7547577-5c8a-ce9f-d990-b8a4cbaa5a50
Content: Key management in ASP.NET Core
Content Source: aspnetcore/security/data-protection/implementation/key-management.md
Product: aspnet-core
GitHub Login: @Rick-Anderson
Microsoft Alias: riande

Hello @kalimist123 ...

Can you explain the difference between "expired" and "revoked" keys?

They're explained at the top of the topic:

Expired - the key has run its natural lifetime and should no longer be used for new Protect operations.
Revoked - the key is compromised and must not be used for new Protect operations.

what can happen to an "expired" key to tranform it's status to "revoked"?

You manually revoke it (AFAIK the framework doesn't revoke keys all by itself), either via IKeyManager.RevokeAllKeys or IKeyManager.RevokeKey. You would do this if you knew that that the key (or the entire key ring) had become compromised (e.g., a data breach occurs).

Thank you. I wanted to check if the framework revokes keys by itself as I am considering using keys for long-term data encryption. I know that is not the intended usage.


hasOne relationship return empty model object or null

https://codesandbox.io/s/4x0qnn088w
version 0.20.0

version 0.21.0

Which one is correct?

HasOne should return null if the relation can't be found. so the 0.21.0 was wrong I guess.


When editing a migrated collection, valid email address not accepted

I'm not sure if this is specific to the migration, but I got this on https://sul-h2-stage.stanford.edu/collections/241/edit#

After a little more testing:
<EMAIL_ADDRESS>did not work
<EMAIL_ADDRESS>did work
The second period seems to be the issue?


g2p: add IsGlide method

This PR adds an IsGlide method to IG2p that tells whether a phoneme is a semivowel or liquid sound, like y, w, l, r in English.
In "Consonant - Glide - Vowel" syllables such as "grass", glide phoneme should be put after the start position of the note.
I've tested some external dll phonemizers released before this change. They work successfully as before.

TODO in this PR:

Add glide support for MonophonePhonemizer and LatinDiphonePhonemizer
TODO in the future:
Add glide support for Machine Learning phonemizers
Refactor G2pPack to make it fully portable. (Currently grapheme and phoneme definitions are hard coded in C# which makes it impossible to load external G2pPacks)


Admin Page - Assigning Role Access

As an Instance Admin
I want to be able to grant and remove EPIC.system Access
so that only those who should see EAO data can see EAO data
Acceptance Criteria
Scenario 1:
GIVEN ... (you or your condition)
WHEN ... (what you do)
THEN ... (what you see)
Scenario 2:
xxxxxx
Validation Rules?
(If yes, list here)
Screenshot
(Link above will always be the most up-to-date version.)

EPIC.Auth

need to be able to remove access entirely


Update Nuki adapter 1.2.0 to 1.2.3

RE-CHECK!

Automated adapter checker
ioBroker.nuki

:thumbsup: No errors found
Add comment "RE-CHECK!" to start check anew


[Experiment] brisk-reconciler component PPX

I have seen PPX for hooks example in https://github.com/briskml/brisk-reconciler/pull/42#issuecomment-544195151. can that also be used here?
let%component make = (~prop) => {
  let%hook (state, setState) = Hooks.state("");
  <Text value=state />;
};

Closing as #576 handles this, and much more


ok

Describe the bug
A clear and concise description of what the bug is.
To Reproduce
Steps to reproduce the behavior:

Go to '...'
Click on '....'
Scroll down to '....'
See error

Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.

This is a meaningless issue, please don't post useless things @fdsaqwer22. Have a nice day.


Using Cross-Env In Npm Scripts

Hi there,
I have the following package.json script...sample below
"name": "System_Test_Project",
"config": { "StandaloneVersion": "3.4.0" , "ChromeDriverVersion": "2.30" ,"GeckoDriverVersion": "v0.17.0", "IeDriverVersion": "3.4.0" , "Proxy": "http://<IP_ADDRESS>:18717"},
"version": "1.0.0",
"author": "Bhréin Brannick",
"description": "E2E Testing Against The Website",
"license": "MIT",
"main": "index.js",
"scripts": {

"//": "Install Scripts...",
"postinstall-update-selenium": "node node_modules/protractor/bin/webdriver-manager update --versions.chrome=$npm_package_config_ChromeDriverVersion --ie32 --versions.ie=$npm_package_config_IeDriverVersion --gecko --versions.gecko=$npm_package_config_GeckoDriverVersion --versions.standalone $npm_package_config_StandaloneVersion --proxy $npm_package_config_Proxy",

}

The flexibility this gives me is that it allows me to update the proxy etc via command
npm config set Aca_System_Test_Project:Proxy http://<IP_ADDRESS>:18717
as we have multiple proxies however this solution in its current form will only work on posix os types. Specifically this will fail on windows. I'm use your module to run scripts across multiple environments & os types (see below) which works very well
"auto_regression-dev-chrome":               "cross-env TEST_BROWSER_NAME=chrome                   TEST_INSTANCE_UNDER_TEST=DEV       TEST_SUBSET_TO_EXECUTE=@auto_regression  node node_modules/protractor/built/cli.js Conf_Aca_Functional.js --suite",
"auto_regression-qa-chrome":                "cross-env TEST_BROWSER_NAME=chrome                   TEST_INSTANCE_UNDER_TEST=QA        TEST_SUBSET_TO_EXECUTE=@auto_regression  node node_modules/protractor/built/cli.js Conf_Aca_Functional.js --suite",
"auto_regression-preprod-chrome":           "cross-env TEST_BROWSER_NAME=chrome                   TEST_INSTANCE_UNDER_TEST=PRE_PROD  TEST_SUBSET_TO_EXECUTE=@auto_regression  node node_modules/protractor/built/cli.js Conf_Aca_Functional.js --suite",

I'm wondering can the module cross-env be capable of solving the problem referenced above in that to source those environment variables on unix I have to use $ and windows it would be %%. Thanks in advance as to any help on the above.

Have a try with cross-env-shell node node_modules/.... cross-env-shell is a bin that comes with cross-env.


Improve performer/studio image handling

Send a mime-type
Set a long expire time for caching.  This is to improve the speed
related to using the image in the scene form performer selection field.

The values I picked for cache-control headers may be a little long, but I was leaning towards cacheability over freshness. (Generally I think most users of Stash would know if they had updated an image and could clear browser cache if they had stale data)

Ignore this PR for now.  I just realized I have another commit that fixes some issues with it that I need to detangle from my local branch.  I'll update when I have that all unwound.


Computing abstractiveness

In your paper you mentioned an interesting statistic, the abstractiveness of the model. You compute an abstractiveness score (See et al.,2017) as the ratio of novel n-grams in the generated summary that are not present in the input document.
Can you share the code that is used to re-produce this experiment?
Thanks in advance,
Nick

Thanks for your interest. Unfortunately I can't find the old code as of now. I believe it is very straightforward to implement. The n-gram follows the same tokenization w/o any extra text normalization. So you can compute all the n-grams (n=1~4) for the document and summary and then compute the overlap divided by total summary n-gram. Please let me know if you need extra clarification.


long awaited -> long-awaited

https://www.merriam-webster.com/dictionary/awaited

too many false positives


feat(core): add TEMPEST_START constant

This pull request adds a TEMPEST_START constant which holds the system's high-resolution time for performance measuring purposes.
echo (hrtime(true) - TEMPEST_START) * 1e-6; // 244.245834

Nice! Not sure on the answer, b he  would it make sense to store a stopwatch instance?

Not sure honestly. I think a scalar value makes more sense here, but I guess a stopwatch instance is just as lightweight. Would you just do new GenericClock? Because the container is not yet initialized at this point

I think an int is good for now

@aidan-casey I think only the hrtime() function is built in PHP, but the HRTime namespace is in an extension that's not installed by default


protos: Add definitions to telemetry.vehicle_data Field enums

Description
Adds commented definitions for the vehicle data proto Field enums
Fixes #106
Type of change
Please select all options that apply to this change:

[ ] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
[ ] Bug fix (non-breaking change which fixes an issue)
[x] Documentation update

Checklist:
Confirm you have completed the following steps:

[x] My code follows the style of this project.
[x] I have performed a self-review of my code.
[x] I have made corresponding updates to the documentation.
[ ] I have added/updated unit tests to cover my changes.
[ ] I have added/updated integration tests to cover my changes.

@vmallet I agree with you and will close this. My main goal was to get some clarity on the descriptions and the pr was more or less a way to get feedback if my "guesses" were correct.

@vmallet I agree with you and will close this. My main goal was to get some clarity on the descriptions and the pr was more or less a way to get feedback if my "guesses" were correct.


remove field that is no longer returned

charging status is no longer reported in the endpoint which causes the rest of the property setting to fail - removing this field from the parsing allows it to work, but recommend also error handling that allows properties that can't be determined/parsed to be set in an "unknown" state rather than not working at all to protect from breaking changes

Hi @estiens,
Can you share a sample output of the API call for your account? I have the following sample for my dog and there is an "isCharging" state. What output do you have when you call this API? Also is your collar a Version 2 or 1?
"data": {     "pet": {       "__typename": "Pet",       "chip": null,       "device": {         "__typename": "Device",         "id": "FC198",         "moduleId": "FC198",         "info": {           "buildId": "1.4.0-898-g03404c60d-module-fw-6",           "batteryPercent": 94,           "hasPowerSupply": false,           "**isCharging": false**,           "batteryVoltage": 4196,           "batteryHealth": 92,           "batteryHealthStatus": 3,           "batteryNominalAvailableCapacity": 481,           "batteryFullAvailableCapacity": 518,           "temperature": 307.5,           "uptime": 681188,

this appears to be fixed now...


fix: update pom to fix distributionManagement

Fix: https://github.com/jcasbin/shiro-casbin/issues/30
I have try it in my repo, and it's success.
401 error in shiro-casbin, that's because there is no permission, two errors cause 401.
One is that the account of ossrh does not have permission.
And the other is that the id of <distributionManagement> is not set correctly, and I found it's in profile release, the release environment doesn't seem to be used by default. So I try use multiple profiles and putting distributionManagement under the release profile in my repo as same as shiro-casbin, the same error as shiro-casbin appeared (https://github.com/imp2002/maven-release-example/commit/54f9c09fdd63e577a0ef30a7948ce2ba206b2b8b).
And move it out to default environment solve it(https://github.com/imp2002/maven-release-example/commit/f35c9412c67a016a86c6214eed87b5e575bed56e).

:tada: This PR is included in version 1.0.2 :tada:
The release is available on:

GitHub release
v1.0.2

Your semantic-release bot :package::rocket:


Accelerate mutli-add for intel64 backend

ideep backend has the ability to fuse several add operation into one sum primitive. This PR is to accelerate the mutli_add on intel64 backend.

Jenkins, test this please.

Could you please add test code?
(i.e., fix TestMultipleAdd in chainer_tests/functions_tests/math_tests/test_basic_math.py to use backend.inject_backend_tests)
You can see the usage of inject_backend_tests in iDeep PRs like #4277.

Thanks for the instruction. The unit test is for backend is added.

@kmaehashi
Could you help to review?

Thanks for the fix!
Please check coding style violations: https://travis-ci.org/chainer/chainer/jobs/352192823#L1118
LGTM otherwise.

Jenkins, test this please.

Are you finished working on this PR? Can I proceed to merge?

Jenkins, test this please.

I think I'm finished on this PR, but I encounter some problem on pooling test case. I think it is precision issue, so I have to re-trigger test for several times. If you can ignore this problem, please merge the code. Thanks.

Thanks. The failure seems unrelated to your change.
(you don't have to modify code just to retrigger CI; we'll do that if we think we need.)

Jenkins, test this please.


Auto Commenting when a PR is merged

This feature aims to solve the problem of inconsistent and delayed communication following the merging of PRs. By automating the commenting process, it ensures that contributors receive timely feedback and acknowledgments. It also reduces the administrative burden on maintainers, allowing them to focus more on code reviews and other critical tasks.
Could you please assign me this issue under GSSOC'24.

@suhanipaliwal can you provide any example or documentation about this ?

A comment like this will be made as soon as a pull request is merged

@suhanipaliwal it's not needed


Some more tests related to subtyping

this adds some tests to account for the new behaviour of
https://github.com/dfinity/candid/pull/110f
Just a first stab, untested, and kinda running out of stream.

I am getting
Checking 61 opt: parsing null : null...thread 'decode_test_test_construct_test_did' panicked at 'called `Result::unwrap()` on an `Err` value: Custom("type mismatch: null cannot be of type opt empty")', rust/candid/tests/test_suite.rs:11:16

which sounds like a lie (sure null can be of type opt t).
Also, it might be helpful to not number the tests squentially, but use the line number to identify them, makes it easier to to jump to them. This is what the test driver in Motoko is doing.

I could fix this with
--- a/rust/candid/src/parser/value.rs
+++ b/rust/candid/src/parser/value.rs
@@ -154,7 +154,7 @@ impl IDLValue {
                 let ty = crate::types::internal::find_type(id).unwrap();
                 self.annotate_type(from_parser, env, &ty)?
             }
-            (IDLValue::Null, Type::Opt(_)) if from_parser => IDLValue::None,
+            (IDLValue::Null, Type::Opt(_)) => IDLValue::None,
             (IDLValue::Float64(n), Type::Float32) if from_parser => IDLValue::Float32(*n as f32),
             (IDLValue::Number(str), t) if from_parser => match t {
                 Type::Int => IDLValue::Int(str.parse::<Int>()?),

but then it seems the distinction between IDLValue::Null and IDLValue::None may not be needed. It is not clear to me why we’d need that – in the algebra of untyped values, they are the same, aren’t they?
Now at
Checking 67 opt: parsing opt true : opt bool...thread 'decode_test_test_construct_test_did' panicked at 'called `Result::unwrap()` on an `Err` value: Custom("type mismatch: false cannot be of type opt bool")', rust/candid/tests/test_suite.rs:11:16

which means that the rule
not (null <: <datatype>)
<datatype> <: <datatype'>
-----------------------------
<datatype> <: opt <datatype'>

(which I find dubious, non-compositional, and wouldn’t be surprised if it breaks stuff) is not implemented. Will leave this to @chenyan-dfinity at this point.

it seems the distinction between IDLValue::Null and IDLValue::None may not be needed.

In the untype setting, we need IDLValue::Null to represent null of type null and IDLValue::None to represent null of type opt T. The parser always parses null to be IDLValue::Null, and we need the if from_parser guard to ensure we don't change between null and none after the first type annotation.
The whole set of opt subtyping rules are not implemented. I will take a look to see the right place to add these.

it seems the distinction between IDLValue::Null and IDLValue::None may not be needed.

In the untype setting, we need IDLValue::Null to represent null of type null and IDLValue::None to represent null of type opt T. The parser always parses null to be IDLValue::Null, and we need the if from_parser guard to ensure we don't change between null and none after the first type annotation.

Right, but why do you even have to distinguish the two? It’s not that IDLValue::None tells you the type of it (you still don’t know T). What breaks if you only use IDLValue::Null everywhere?

Right, but why do you even have to distinguish the two? It’s not that IDLValue::None tells you the type of it (you still don’t know T). What breaks if you only use IDLValue::Null everywhere?

Ah right. It was a workaround when we don't have type annotations. Yes, this is not necessary now.

Ah right. It was a workaround when we don't have type annotations. Yes, this is not necessary now.

Gave it a shot, but still needed internally in the current code structure, because idl_serialize only takes an IDLValue, but not the type, so when serializing null it is unclear which form it should take. The Spec solves this by making the M function indexed by the type to encode at, but I don’t feel like refactoring the rust code now :-)

Just added a few nat <: int subtyping tests, and tried to add the subtyping.
It’s a bit hard that the test suite will panc (rather than report an error and continue) upon bad subtyping. The unwrap in HostTest.from_assert is causing problems.

The rust code chanes might need some cleanup, feel free to push to this branch.

Thanks for looking at the code. Feel free to take over and change the rust code in whatever way you see fit.


Add sub-matrix pm2.5 to matrix aerosol particle phase

Added to dev vocabulary server!

Part of next release