add image builder icon for Cockpit nav

Adds the patternfly icon pficon-build to display as the icon in the Cockpit navigation.
An example of the icon can be seen on the PatternFly icon page

Codecov Report

Merging #226 into master will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master     #226   +/-   ##
=======================================
  Coverage   50.64%   50.64%
=======================================
  Files          71       71
  Lines        2391     2391
  Branches      322      322
=======================================
  Hits         1211     1211
  Misses        989      989
  Partials      191      191

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 4b0eabb...f0590c1. Read the comment docs.


perf(layout): const functions

The layout can often contain things that are already known at compile time which speeds up things on runtime. Especially as render is called a lot.
With 0.26.0 the Rect::contains method is now accepting a Position. While contains is const, Position::new is not which triggered the creation of this PR. I switched to Position { x, y }, but the compiler should be able to do the same in const with ::new().
I added the lint to the layout module, but I don't really know what other plans of this project are in regard to configuring lints. I could also just remove the lint there, but mistakes like the current one will happen again as the code uses a lot of const already. Do you have other thoughts on how to configure the lints best?
I observed the missing_const_for_fn clippy lint in other areas of the library too, but it's mostly pointless there. Some Widgets and WidgetStates could get ::new() implementations which are const which would also allow for optimizations there.
Personally I also think that more clippy::pedantic and clippy::nursery lints could keep the code quality of ratatui consistent. Like in the current case many things are already const, but they are forgotten in other places as no lints are ensuring that.

Personally I also think that more clippy::pedantic and clippy::nursery lints could keep the code quality of ratatui consistent. Like in the current case many things are already const, but they are forgotten in other places as no lints are ensuring that.

+1 on these - the issue is that turning them on makes a lot of noise initially, so it's a bunch of work drilling down on the lint errors. Once it's in though things are really nice.


Error while multithreaded GET_HISTORICAL_KLINES

I'm getting error while executing this code:
def handle_queue_get_klines(q, all_klines, stored_klines):
	while not q.empty():
		work = q.get()
		klines = client.get_historical_klines(work, Client.KLINE_INTERVAL_1MINUTE, '15 days ago UTC')
		all_klines[work] = klines
		stored_klines[work] = utils.fromKlinesToOHLC(klines[-params.klines_store_length:])
		q.task_done()

for symbol in symbols:
	#put workers in queue.
	q_klines.put((symbol))

for i in range(num_theads_klines):
	 worker = Thread(target=handle_queue_get_klines, args=[q_klines, all_klines, stored_klines])
	 worker.setDaemon(True)
	 worker.start()

q_klines.join()

Traceback (most recent call last):
  File "/Users/georgezagraid/.vscode/extensions/ms-python.python-2019.2.5558/pythonFiles/ptvsd_launcher.py", line 45, in <module>
    main(ptvsdArgs)
  File "/Users/georgezagraid/.vscode/extensions/ms-python.python-2019.2.5558/pythonFiles/lib/python/ptvsd/__main__.py", line 357, in main
    run()
  File "/Users/georgezagraid/.vscode/extensions/ms-python.python-2019.2.5558/pythonFiles/lib/python/ptvsd/__main__.py", line 257, in run_file
    runpy.run_path(target, run_name='__main__')
  File "/Users/georgezagraid/.pyenv/versions/2.7.15/lib/python2.7/runpy.py", line 252, in run_path
    return _run_module_code(code, init_globals, run_name, path_name)
  File "/Users/georgezagraid/.pyenv/versions/2.7.15/lib/python2.7/runpy.py", line 82, in _run_module_code
    mod_name, mod_fname, mod_loader, pkg_name)
  File "/Users/georgezagraid/.pyenv/versions/2.7.15/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/Users/georgezagraid/Projects/AI/Projects/Binance_Anomaly/main.py", line 171, in <module>
    start_detection()
  File "/Users/georgezagraid/Projects/AI/Projects/Binance_Anomaly/main.py", line 122, in start_detection
    klines = client.get_historical_klines(symbol, Client.KLINE_INTERVAL_1MINUTE, '{0} ago UTC'.format(params.klines_interval_str))
  File "/Users/georgezagraid/.pyenv/versions/2.7.15/envs/htm-env/lib/python2.7/site-packages/binance/client.py", line 762, in get_historical_klines
    start_ts = date_to_milliseconds(start_str)
  File "/Users/georgezagraid/.pyenv/versions/2.7.15/envs/htm-env/lib/python2.7/site-packages/binance/helpers.py", line 22, in date_to_milliseconds
    d = dateparser.parse(date_str)
  File "/Users/georgezagraid/.pyenv/versions/2.7.15/envs/htm-env/lib/python2.7/site-packages/dateparser/conf.py", line 81, in wrapper
    return f(*args, **kwargs)
  File "/Users/georgezagraid/.pyenv/versions/2.7.15/envs/htm-env/lib/python2.7/site-packages/dateparser/__init__.py", line 53, in parse
    data = parser.get_date_data(date_string, date_formats)
  File "/Users/georgezagraid/.pyenv/versions/2.7.15/envs/htm-env/lib/python2.7/site-packages/dateparser/date.py", line 404, in get_date_data
    locale, date_string, date_formats, settings=self._settings)
  File "/Users/georgezagraid/.pyenv/versions/2.7.15/envs/htm-env/lib/python2.7/site-packages/dateparser/date.py", line 177, in parse
    return instance._parse()
  File "/Users/georgezagraid/.pyenv/versions/2.7.15/envs/htm-env/lib/python2.7/site-packages/dateparser/date.py", line 187, in _parse
    date_obj = parser()
  File "/Users/georgezagraid/.pyenv/versions/2.7.15/envs/htm-env/lib/python2.7/site-packages/dateparser/date.py", line 200, in _try_freshness_parser
    return freshness_date_parser.get_date_data(self._get_translated_date(), self._settings)
  File "/Users/georgezagraid/.pyenv/versions/2.7.15/envs/htm-env/lib/python2.7/site-packages/dateparser/freshness_date_parser.py", line 148, in get_date_data
    date, period = self.parse(date_string, settings)
  File "/Users/georgezagraid/.pyenv/versions/2.7.15/envs/htm-env/lib/python2.7/site-packages/dateparser/freshness_date_parser.py", line 97, in parse
    date, period = self._parse_date(date_string)
  File "/Users/georgezagraid/.pyenv/versions/2.7.15/envs/htm-env/lib/python2.7/site-packages/dateparser/freshness_date_parser.py", line 133, in _parse_date
    date = self.now - td
TypeError: unsupported operand type(s) for -: 'NoneType' and 'relativedelta'

So if I changing '15 days ago UTC' to<PHONE_NUMBER> to not force dateparser to execute - threads started but seems to never end getting klines. How can I get more klines at the same time?

I'm also interested in this as I get the same type of error when trying to get multiple historical klines at the same time by using QRunnable and QThreadPool.
In my application I have 6 intervals for which I want to get the klines, so I'm trying to run each interval on a separate Thread.
Thanks in advance for the help.

I'm also interested in this as I get the same type of error when trying to get multiple historical klines at the same time by using QRunnable and QThreadPool.
In my application I have 6 intervals for which I want to get the klines, so I'm trying to run each interval on a separate Thread.
Thanks in advance for the help.

I found that when I'm using
from threading import Timer
Timer(seconds, restart_detection).start()

Inside restart_detection I'm getting klines while websockets opened and It's kinda working (but I'm using Timer for different purpose)


Add support for requirements traceability

We created a Sphinx-based example for documenting requirements. However, it does not support requirements traceability (very well) or checking for uniqueness of requirement ids.
What is required
Extend the Sphinx-based requirement generation to include assistance for linking requirements.
Subtasks:

[x] Install sphinxcontrib-traceability module
[x] Generate example requirements traceability
[x] Document linking process

How do you know it has to be done
Requirements traceability is a key part of IEC 62304 compliance
Starting points
https://pypi.org/project/sphinxcontrib-traceability/
Don't forget

[x] Put the issue in a milestone
[x] Assign it to one of the projects
[x] Add appropriate labels
[x] Mention dependent/blocked issues if any

Related issue: #1022
Blocks: #803

Done


[load]: add new loadTestService MR

Description of your changes
Add new loadTestService

I have:

[x] Run make reviewable test to ensure this PR is ready for review.

How has this code been tested
Local e2e
Will extend with uptest run below

 Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.Jan Mikołajczak seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.You have signed the CLA already but the status is still pending? Let us recheck it.

/test-examples="examples/loadtestservice/loadtest.yaml"

/test-examples="examples/loadtestservice/loadtest.yaml"

/test-examples="examples/loadtestservice/loadtest.yaml"

/test-examples="examples/loadtestservice/loadtest.yaml"

@jankaacc, if you are considering taking this PR forward, could you please sign the CLA and resolve the conflicts?

Covered in https://github.com/upbound/provider-azure/pull/564


Update DIAGNOSTICLEVEL for openjdk from noDetails to default failure

Signed-off-by: Sophia Guo<EMAIL_ADDRESS>

Grinder with PR https://github.com/adoptium/TKG/pull/367
https://github.com/adoptium/TKG/pull/367#issuecomment-1312007425


[web] Fetch more than just first 100 asset (Icons)

Description
original implementation quickly used the .all method which will only return the first 100 rows in an air-table, now page thru to actually get all possible rows.
Other changes
created a byMethod middleware to avoid having to write the error handling code on each route handler
Related issues

Fixes #3042

Backwards compatibility
no as routes  changed

note my first thought here was to be able to pass an page number from clientside. but airtable doesnt do explicit pages, just in memory paging.


Cleanup wim package for use on non Windows platforms

Cleans up the wim package (removing unnecessary build tag guards), and
cleans up the wim/validate command to be slightly more "Go idiomatic".

Submitted this as a separate PR in hopes if the package renaming is not accepted, that this would be. Both PRs should be rebase-able against the master branch.


crashes

my game crashes even tho the mod it's be itself

crash report?

отчет о катастрофе?

crash-2020-08-15_09.50.06-client.txt
mod crashes, here's the log

Update forge to last version
http://files.minecraftforge.net/maven/net/minecraftforge/forge/index_1.8.9.html


User deleted from gui is not reimported

Hi, I have the realm config below.
Steps to reproduce:

Import config
users imported in keycloak
keycloak gui delete user or users
reimport config
users are not reimported into keycloak
but when change a name of the user in yaml, run reimport, users imported.

Tried with --import.force=true and without but same effect.
---
realm: test
users:
- username<EMAIL_ADDRESS>  enabled: true
  totp: false
  emailVerified: true
  firstName: user1
  lastName: user1
  email<EMAIL_ADDRESS>  credentials:
    - type: password
      value: "myuser123"
  disableableCredentialTypes: []
  requiredActions: []
  realmRoles:
    - offline_access
    - uma_authorization
  notBefore: 0
  groups: []
- username<EMAIL_ADDRESS>  enabled: true
  totp: false
  emailVerified: true
  firstName: user2
  lastName: user2
  email<EMAIL_ADDRESS>  credentials:
    - type: password
      value: "myuser123"
  disableableCredentialTypes: []
  requiredActions: []
  realmRoles:
    - offline_access
    - uma_authorization
  notBefore: 0

which version of config-cli you are using?

First run:
2021-02-08 00:00:33.243 DEBUG 300 --- [           main] d.a.k.config.service.RealmImportService  : Creating realm 'test' ...
2021-02-08 00:00:37.157 DEBUG 300 --- [           main] d.a.k.config.service.UserImportService   : Create user<EMAIL_ADDRESS>in realm 'test'
2021-02-08 00:00:38.308 DEBUG 300 --- [           main] d.a.k.config.service.UserImportService   : Create user<EMAIL_ADDRESS>in realm 'test'
2021-02-08 00:00:39.632 DEBUG 300 --- [           main] d.a.k.config.service.state.StateService  : Updated states of realm 'test'
2021-02-08 00:00:40.178 DEBUG 300 --- [           main] d.a.k.c.s.checksum.ChecksumService       : Updated import checksum of realm 'test' to 'c61e934c35f8de188ef2f211e88b186b768bef47e43faa01182cb

After deleting user and rerun:
2021-02-08 00:01:51.820 DEBUG 342 --- [           main] d.a.k.config.service.RealmImportService  : No need to update realm 'test', import checksum same: 'c61e934c35f8de188ef2f211e88b186b768bef47e43faa01182cb0c667b07403'

Versions:
Keycloak-config-cli: 10.0.2
keycloak : 10.0.2

No need to update realm 'test', import checksum same

In this case --import.force=true helps here. You mention that you already try it. But this line does not come up, if the force flag is set to true.

Seems that it is working with the force. So most pobably I did something wrong wih force before.


Added my details

Added my details as mentioned in the README.md file to data.json file. Kindly review and merge this pull request.

Added my details as mentioned in the README.md file to data.json file. Kindly review and merge this pull request.

Just try to change the DATA.json file .


Added SocketIO for Android mobile app support

Updated notification settings and added Firebase support
Added option to enable and disable notification types
Added qrcode support to admin page and ili9341 display
Changed from RPi GPIO to gpiozero for ili buttons to support long press
gpiozero also improved button responsiveness
Added PelletDB log clear option to Admin Page
Added settings and pelletdb update timestamp for future options
Moved Pellet Level sensor settigns to settings.json from pelletdb.json
Merge in Redis support updates
Merge distance sensor update
Bugfix Smoke Plus toggle in settings
Reformat settings html
Changed history time format to HH:mm:ss

Thank you for the pull request!  This is going to be a wonderful addition to the project.


Processing a single graph in batch mode

Hi @tkipf, thanks for your awesome work and providing this code!
I have a bit of a novice question: I'm trying to process my graph's features through a GCN in mini-batches. I.e. let's say I have a 1000-node graph and I want to process it through the GCN in mini-batches of size 50.
It doesn't seem like the code currently supports this because we have to multiply by the full adjacency matrix in the GCN layer's forward pass - do you have any sense of how I can support these "batch" operations? Better yet, do you have example code that does this?
My code looks something like:
z0 = F.tanh(self.gcn1(x, self.fancy_adj))
where x is a sampled batch of size 50 x F (not the full batch of 1000 x F) and self.fancy_adj is the adjacency matrix transformed as suggested in your paper ( adjacency + identity + row normalized). The problem, of course, is that self.fancy_adj is a 1000 x 1000 matrix. Even if I take just the rows of self.fancy_adj corresponding to the 50 points in the batch, then the adjacency matrix becomes a 50 x 1000 matrix which can't be multiplied by the 50 x F sampled batch.

Great question! This has come up in my other repository on GCNs and I’ve
outlined a solution here:
https://github.com/tkipf/gcn/issues/4
On Sun 14. Oct 2018 at 20:50 motiwari<EMAIL_ADDRESS>wrote:

Hi @tkipf https://github.com/tkipf, thanks for your awesome work and
providing this code!
I have a bit of a novice question: I'm trying to process my graph's
features through a GCN in mini-batches. I.e. let's say I have a 1000-node
graph and I want to process it through the GCN in mini-batches of size 50.
It doesn't seem like the code currently supports this because we have to
multiply by the full adjacency matrix in the GCN layer's forward pass -
do you have any sense of how I can support these "batch" operations? Better
yet, do you have example code that does this?
My code looks something like:
z0 = F.tanh(self.gcn1(x, self.fancy_adj))
where x is a sampled batch of size 50 x F (not the full batch of 1000 x
F) and self.fancy_adj is the adjacency matrix transformed as suggested in
your paper ( adjacency + identity + row normalized)
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/tkipf/pygcn/issues/23, or mute the thread
https://github.com/notifications/unsubscribe-auth/AHAcYI2Fcr3J4q1m0pIk-x2exyksbkHbks5uk5VpgaJpZM4XbTEj
.

Thanks @tkipf ! I saw that thread but it looks like it only discusses processing multiple graphs as a block-diagonal matrix, but I'm asking about a single large graph whose adjacency matrix is too large to fit on a single device. Am I missing something?

In this case, have a look at FastGCN: https://arxiv.org/abs/1801.10247


[BUG] Value.GetString() returns an error on valid empty string

Describe the bug
Value.GetString() interprets a NULL from C.g_value_get_string as an "unexpected nil pointer from cgo" whereas it is seemingly returned on a valid, empty string, contrary to the function's description:
// GetString is a wrapper around g_value_get_string().  GetString()
// returns a non-nil error if g_value_get_string() returned a NULL
// pointer to distinguish between returning a NULL pointer and returning
// an empty string.

To Reproduce
I'm working with a ListStore instance putting strings into it. Empty strings do cause a nil to be returned when using the following code:
v, err := model.GetValue(iter, id)
if err != nil {
	// Handle error
}

s, err := v.GetString()
// err is non-nil here where the value was in fact an empty string

Expected behavior
Not quite sure, but maybe NULL does denote a valid empty string when returned by g_value_get_string()?
Its description does not mention neither of the two possible causes explicitly.
Environment:
gtk3 version: 3.24
go version: 1.14.2
os: Ubuntu 19.10
GLib version: 2.62
Additional context
The code in question is here
Interestingly enough. the only usage of GetString() I discovered in gotk3 is in gtk_export.go, and it also ignores the returned error.

Hm... I doubt that its a gotk3 bug. gotk3 generally returns this error, if the pointer returned from the C func is nil.
As you stated, the gtk docs say nothing that the returned value may be NULL. While extensive, their docs are not flawless. Sometimes their docs are outdated/incomplete. It's also possible that cgo did something at this point. The comment in gotk3 may be wrong (or outdated, if cgo's behaviour changed), as well.
Personally, I don't see any improvements that can be made to GetString()...
I wrote a unittest checking this case (see #586). At least GetString() is not at fault. The return value is the expected empty string.
If you are interested, you can write some unittests for TreeModel.GetValue()

Yep, you're seemingly right. I have created a few tests that check both ListStore and glib.Value. It is indeed the case an empty string is properly handled, whereas a missing value results in an error from GetString(). Will file a PR shortly.


[Bug] Error about Seesaw Loss when using single-stage instance segmentation algorithm

Prerequisite

[X] I have searched Issues and Discussions but cannot get the expected help.
[X] I have read the FAQ documentation but cannot get the expected help.
[X] The bug has not been fixed in the latest version (master) or latest version (3.x).

Task
I have modified the scripts/configs, or I'm working on my own tasks/models/datasets.
Branch
master branch https://github.com/open-mmlab/mmdetection
Environment
sys.platform: linux
Python: 3.8.10 (default, Jun  4 2021, 15:09:15) [GCC 7.5.0]
CUDA available: True
GPU 0,1,2,3: NVIDIA RTX A5000
CUDA_HOME: /usr/local/cuda
NVCC: Cuda compilation tools, release 11.3, V11.3.109
GCC: gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0
PyTorch: 1.10.0+cu113
PyTorch compiling details: PyTorch built with:

GCC 7.3
C++ Version: 201402
Intel(R) Math Kernel Library Version 2020.0.0 Product Build 20191122 for Intel(R) 64 architecture applications
Intel(R) MKL-DNN v2.2.3 (Git Hash 7336ca9f055cf1bfa13efb658fe15dc9b41f0740)
OpenMP 201511 (a.k.a. OpenMP 4.5)
LAPACK is enabled (usually provided by MKL)
NNPACK is enabled
CPU capability usage: AVX2
CUDA Runtime 11.3
NVCC architecture flags: -gencode;arch=compute_37,code=sm_37;-gencode;arch=compute_50,code=sm_50;-gencode;arch=compute_60,code=sm_60;-gencode;arch=compute_70,code=sm_70;-gencode;arch=compute_75,code=sm_75;-gencode;arch=compute_80,code=sm_80;-gencode;arch=compute_86,code=sm_86
CuDNN 8.2
Magma 2.5.2
Build settings: BLAS_INFO=mkl, BUILD_TYPE=Release, CUDA_VERSION=11.3, CUDNN_VERSION=8.2.0, CXX_COMPILER=/opt/rh/devtoolset-7/root/usr/bin/c++, CXX_FLAGS= -Wno-deprecated -fvisibility-inlines-hidden -DUSE_PTHREADPOOL -fopenmp -DNDEBUG -DUSE_KINETO -DUSE_FBGEMM -DUSE_QNNPACK -DUSE_PYTORCH_QNNPACK -DUSE_XNNPACK -DSYMBOLICATE_MOBILE_DEBUG_HANDLE -DEDGE_PROFILER_USE_KINETO -O2 -fPIC -Wno-narrowing -Wall -Wextra -Werror=return-type -Wno-missing-field-initializers -Wno-type-limits -Wno-array-bounds -Wno-unknown-pragmas -Wno-sign-compare -Wno-unused-parameter -Wno-unused-variable -Wno-unused-function -Wno-unused-result -Wno-unused-local-typedefs -Wno-strict-overflow -Wno-strict-aliasing -Wno-error=deprecated-declarations -Wno-stringop-overflow -Wno-psabi -Wno-error=pedantic -Wno-error=redundant-decls -Wno-error=old-style-cast -fdiagnostics-color=always -faligned-new -Wno-unused-but-set-variable -Wno-maybe-uninitialized -fno-math-errno -fno-trapping-math -Werror=format -Wno-stringop-overflow, LAPACK_INFO=mkl, PERF_WITH_AVX=1, PERF_WITH_AVX2=1, PERF_WITH_AVX512=1, TORCH_VERSION=1.10.0, USE_CUDA=ON, USE_CUDNN=ON, USE_EXCEPTION_PTR=1, USE_GFLAGS=OFF, USE_GLOG=OFF, USE_MKL=ON, USE_MKLDNN=ON, USE_MPI=OFF, USE_NCCL=ON, USE_NNPACK=ON, USE_OPENMP=ON,

TorchVision: 0.11.1+cu113
OpenCV: 4.6.0
MMCV: 1.7.0
MMCV Compiler: GCC 9.3
MMCV CUDA Compiler: 11.3
MMDetection: 2.25.3+e71b499
Reproduces the problem - code sample
@LOSSES.register_module()
class SeesawLoss(nn.Module):
"""
Seesaw Loss for Long-Tailed Instance Segmentation (CVPR 2021)
arXiv: https://arxiv.org/abs/2008.10032
Args:
use_sigmoid (bool, optional): Whether the prediction uses sigmoid
of softmax. Only False is supported.
p (float, optional): The p in the mitigation factor.
Defaults to 0.8.
q (float, optional): The q in the compenstation factor.
Defaults to 2.0.
num_classes (int, optional): The number of classes.
Default to 1203 for LVIS v1 dataset.
eps (float, optional): The minimal value of divisor to smooth
the computation of compensation factor
reduction (str, optional): The method that reduces the loss to a
scalar. Options are "none", "mean" and "sum".
loss_weight (float, optional): The weight of the loss. Defaults to 1.0
return_dict (bool, optional): Whether return the losses as a dict.
Default to True.
"""
def __init__(self,
             use_sigmoid=False,
             p=0.8,
             q=2.0,
             num_classes=1203,
             eps=1e-2,
             reduction='mean',
             loss_weight=1.0,
             return_dict=True):
    super(SeesawLoss, self).__init__()
    assert not use_sigmoid
    self.use_sigmoid = False
    self.p = p
    self.q = q
    self.num_classes = num_classes
    self.eps = eps
    self.reduction = reduction
    self.loss_weight = loss_weight
    self.return_dict = return_dict
    # 0 for pos, 1 for neg
    self.cls_criterion = seesaw_ce_loss
    # cumulative samples for each category
    self.register_buffer(
        'cum_samples',
        torch.zeros(self.num_classes + 1, dtype=torch.float))
    # custom output channels of the classifier
    self.custom_cls_channels = True
    # custom activation of cls_score
    self.custom_activation = True
    # custom accuracy of the classsifier
    self.custom_accuracy = True
def _split_cls_score(self, cls_score):
    # split cls_score to cls_score_classes and cls_score_objectness
    assert cls_score.size(-1) == self.num_classes + 2
    cls_score_classes = cls_score[..., :-2]
    cls_score_objectness = cls_score[..., -2:]
    return cls_score_classes, cls_score_objectness
def get_cls_channels(self, num_classes):
    """Get custom classification channels.
    Args:
        num_classes (int): The number of classes.
    Returns:
        int: The custom classification channels.
    """
    assert num_classes == self.num_classes
    return num_classes + 2
def get_activation(self, cls_score):
    """Get custom activation of cls_score.
    Args:
        cls_score (torch.Tensor): The prediction with shape (N, C + 2).
    Returns:
        torch.Tensor: The custom activation of cls_score with shape
             (N, C + 1).
    """
    cls_score_classes, cls_score_objectness = self._split_cls_score(
        cls_score)
    score_classes = F.softmax(cls_score_classes, dim=-1)
    score_objectness = F.softmax(cls_score_objectness, dim=-1)
    score_pos = score_objectness[..., [0]]
    score_neg = score_objectness[..., [1]]
    score_classes = score_classes * score_pos
    scores = torch.cat([score_classes, score_neg], dim=-1)
    return scores
def get_accuracy(self, cls_score, labels):
    """Get custom accuracy w.r.t. cls_score and labels.
    Args:
        cls_score (torch.Tensor): The prediction with shape (N, C + 2).
        labels (torch.Tensor): The learning label of the prediction.
    Returns:
        Dict [str, torch.Tensor]: The accuracy for objectness and classes,
             respectively.
    """
    pos_inds = labels < self.num_classes
    obj_labels = (labels == self.num_classes).long()
    cls_score_classes, cls_score_objectness = self._split_cls_score(
        cls_score)
    acc_objectness = accuracy(cls_score_objectness, obj_labels)
    acc_classes = accuracy(cls_score_classes[pos_inds], labels[pos_inds])
    acc = dict()
    acc['acc_objectness'] = acc_objectness
    acc['acc_classes'] = acc_classes
    return acc
def forward(self,
            cls_score,
            labels,
            label_weights=None,
            avg_factor=None,
            reduction_override=None):
    """Forward function.
    Args:
        cls_score (torch.Tensor): The prediction with shape (N, C + 2).
        labels (torch.Tensor): The learning label of the prediction.
        label_weights (torch.Tensor, optional): Sample-wise loss weight.
        avg_factor (int, optional): Average factor that is used to average
             the loss. Defaults to None.
        reduction (str, optional): The method used to reduce the loss.
             Options are "none", "mean" and "sum".
    Returns:
        torch.Tensor | Dict [str, torch.Tensor]:
             if return_dict == False: The calculated loss |
             if return_dict == True: The dict of calculated losses
             for objectness and classes, respectively.
    """
    assert reduction_override in (None, 'none', 'mean', 'sum')
    reduction = (
        reduction_override if reduction_override else self.reduction)
    assert cls_score.size(-1) == self.num_classes + 2

Reproduces the problem - command or script
official train script
Reproduces the problem - error message
Traceback (most recent call last):
File "tools/train.py", line 244, in
main()
File "tools/train.py", line 233, in main
train_detector(
File "/root/autodl-tmp/mmdetection/mmdet/apis/train.py", line 244, in train_detector
runner.run(data_loaders, cfg.workflow)
File "/root/miniconda3/lib/python3.8/site-packages/mmcv/runner/epoch_based_runner.py", line 136, in run
epoch_runner(data_loaders[i], **kwargs)
File "/root/miniconda3/lib/python3.8/site-packages/mmcv/runner/epoch_based_runner.py", line 53, in train
self.run_iter(data_batch, train_mode=True, **kwargs)
File "/root/miniconda3/lib/python3.8/site-packages/mmcv/runner/epoch_based_runner.py", line 31, in run_iter
outputs = self.model.train_step(data_batch, self.optimizer,
File "/root/miniconda3/lib/python3.8/site-packages/mmcv/parallel/data_parallel.py", line 77, in train_step
return self.module.train_step(*inputs[0], **kwargs[0])
File "/root/autodl-tmp/mmdetection/mmdet/models/detectors/base.py", line 248, in train_step
losses = self(**data)
File "/root/miniconda3/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl
return forward_call(*input, **kwargs)
File "/root/miniconda3/lib/python3.8/site-packages/mmcv/runner/fp16_utils.py", line 119, in new_func
return old_func(*args, **kwargs)
File "/root/autodl-tmp/mmdetection/mmdet/models/detectors/base.py", line 172, in forward
return self.forward_train(img, img_metas, **kwargs)
File "/root/autodl-tmp/mmdetection/mmdet/models/detectors/yolact.py", line 76, in forward_train
losses, sampling_results = self.bbox_head.loss(
File "/root/miniconda3/lib/python3.8/site-packages/mmcv/runner/fp16_utils.py", line 208, in new_func
return old_func(*args, **kwargs)
File "/root/autodl-tmp/mmdetection/mmdet/models/dense_heads/yolact_head.py", line 224, in loss
losses_cls, losses_bbox = multi_apply(
File "/root/autodl-tmp/mmdetection/mmdet/core/utils/misc.py", line 30, in multi_apply
return tuple(map(list, zip(*map_results)))
File "/root/autodl-tmp/mmdetection/mmdet/models/dense_heads/yolact_head.py", line 265, in loss_single_OHEM
loss_cls_all = self.loss_cls(cls_score, labels, label_weights)
File "/root/miniconda3/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl
return forward_call(*input, **kwargs)
File "/root/autodl-tmp/mmdetection/mmdet/models/losses/seesaw_loss.py", line 224, in forward
assert cls_score.size(-1) == self.num_classes + 2
Additional information
Our dataset has 22 classes, following the COCO format.
Seesaw Loss was used as the "loss_cls" in the bbox_head.
We used YOLACT as the instance segmentation algorithm.
This bug has been asked by other developers  (issue: #6424), but no one has been slow to provide a solution. Can you give some help?
I tried to print "cls_score.size(-1)" and the result is "23"
Our config information :
base = '../base/default_runtime.py'
img_size = 550
model = dict(
type='YOLACT',
backbone=dict(
type='ResNet',
depth=50,
num_stages=4,
out_indices=(0, 1, 2, 3),
frozen_stages=-1,
norm_cfg=dict(type='BN', requires_grad=True),
norm_eval=False,  # update the statistics of bn
zero_init_residual=False,
style='pytorch',
init_cfg=dict(type='Pretrained', checkpoint='torchvision://resnet50')),
neck=dict(
type='FPN',
in_channels=[256, 512, 1024, 2048],
out_channels=256,
start_level=1,
add_extra_convs='on_input',
num_outs=5,
upsample_cfg=dict(mode='bilinear')),
bbox_head=dict(
type='YOLACTHead',
num_classes=22,
in_channels=256,
feat_channels=256,
anchor_generator=dict(
type='AnchorGenerator',
octave_base_scale=3,
scales_per_octave=1,
base_sizes=[8, 16, 32, 64, 128],
ratios=[0.5, 1.0, 2.0],
strides=[550.0 / x for x in [69, 35, 18, 9, 5]],
centers=[(550 * 0.5 / x, 550 * 0.5 / x)
for x in [69, 35, 18, 9, 5]]),
bbox_coder=dict(
type='DeltaXYWHBBoxCoder',
target_means=[.0, .0, .0, .0],
target_stds=[0.1, 0.1, 0.2, 0.2]),
loss_cls=dict(
type='SeesawLoss',
p=0.8,
q=2.0,
num_classes=22,
loss_weight=1.0),
loss_bbox=dict(type='SmoothL1Loss', beta=1.0, loss_weight=1.5),
num_head_convs=1,
num_protos=32,
use_ohem=True),
mask_head=dict(
type='YOLACTProtonet',
in_channels=256,
num_protos=32,
num_classes=22,
max_masks_to_train=100,
loss_mask_weight=6.125),
segm_head=dict(
type='YOLACTSegmHead',
num_classes=22,
in_channels=256,
loss_segm=dict(
type='CrossEntropyLoss', use_sigmoid=True, loss_weight=1.0)),
train_cfg=dict(
assigner=dict(
type='MaxIoUAssigner',
pos_iou_thr=0.5,
neg_iou_thr=0.4,
min_pos_iou=0.,
ignore_iof_thr=-1,
gt_max_assign_all=False),
# smoothl1_beta=1.,
allowed_border=-1,
pos_weight=-1,
neg_pos_ratio=3,
debug=False),
test_cfg=dict(
nms_pre=1000,
min_bbox_size=0,
score_thr=0.05,
iou_thr=0.5,
top_k=200,
max_per_img=100))
dataset_type = 'CocoDataset'
data_root = 'data/coco/'
img_norm_cfg = dict(
mean=[123.68, 116.78, 103.94], std=[58.40, 57.12, 57.38], to_rgb=True)
train_pipeline = [
dict(type='LoadImageFromFile'),
dict(type='LoadAnnotations', with_bbox=True, with_mask=True),
dict(type='FilterAnnotations', min_gt_bbox_wh=(4.0, 4.0)),
dict(
type='Expand',
mean=img_norm_cfg['mean'],
to_rgb=img_norm_cfg['to_rgb'],
ratio_range=(1, 4)),
dict(
type='MinIoURandomCrop',
min_ious=(0.1, 0.3, 0.5, 0.7, 0.9),
min_crop_size=0.3),
dict(type='Resize', img_scale=(img_size, img_size), keep_ratio=False),
dict(type='RandomFlip', flip_ratio=0.5),
dict(
type='PhotoMetricDistortion',
brightness_delta=32,
contrast_range=(0.5, 1.5),
saturation_range=(0.5, 1.5),
hue_delta=18),
dict(type='Normalize', **img_norm_cfg),
dict(type='DefaultFormatBundle'),
dict(type='Collect', keys=['img', 'gt_bboxes', 'gt_labels', 'gt_masks']),
]
test_pipeline = [
dict(type='LoadImageFromFile'),
dict(
type='MultiScaleFlipAug',
img_scale=(img_size, img_size),
flip=False,
transforms=[
dict(type='Resize', keep_ratio=False),
dict(type='Normalize', **img_norm_cfg),
dict(type='ImageToTensor', keys=['img']),
dict(type='Collect', keys=['img']),
])
]
data = dict(
samples_per_gpu=8,
workers_per_gpu=4,
train=dict(
type=dataset_type,
ann_file=data_root + 'annotations/instances_train2017.json',
img_prefix=data_root + 'train2017/',
pipeline=train_pipeline),
val=dict(
type=dataset_type,
ann_file=data_root + 'annotations/instances_val2017.json',
img_prefix=data_root + 'val2017/',
pipeline=test_pipeline),
test=dict(
type=dataset_type,
ann_file=data_root + 'annotations/instances_val2017.json',
img_prefix=data_root + 'val2017/',
pipeline=test_pipeline))
optimizer = dict(type='SGD', lr=1e-3, momentum=0.9, weight_decay=5e-4)
optimizer_config = dict()
lr_config = dict(
policy='step',
warmup='linear',
warmup_iters=500,
warmup_ratio=0.1,
step=[20, 42, 49, 52])
runner = dict(type='EpochBasedRunner', max_epochs=55)
cudnn_benchmark = True
evaluation = dict(metric=['bbox', 'segm'])
auto_scale_lr = dict(enable=True, base_batch_size=32)

seesaw loss does not support single stage training.

seesaw loss does not support single stage detectors.

May I ask how seesaw loss is used on faster rcnn


eos_token config in PPOTrainer

Feature request
It appears that the  generation config in PPOTrainer does not set an eos_token, resulting in each generation process continuing until it reaches the maximum length before stopping, which is quite time-consuming.
Motivation
If the eos_token is set, it will significantly reduce the time spent during the generation phase.
Your contribution
i'm sorry

Thanks for reporting it. Would you like to open a PR to fix it?

Seems that current code is inspired by https://iclr-blogposts.github.io/2024/blog/the-n-implementation-details-of-rlhf-with-ppo/, section General implementation details, 4.2. Authors tried to recreate results from early OpenAI work, but they say:

Note that in a more recent codebase https://github.com/openai/summarize-from-feedback, OpenAI does stop sampling when encountering EOS token (summarize_from_feedback/utils/experiment_helpers.py#L19). However in this work we aim to do a 1:1 replication, so we align the setting that could keep sampling even eos_token is encountered

Reading PPOTrainer implementation, it seems that stop_token/stop_token_id arguments should control when to stop generation:

When stop_token is set to eos value, everything that is after EOS is padded and therefore ignored in calculations (using masks). In that case, keeping generating after all sequences have EOS seems just wasting of time and resources. I've checked that between stopping on EOS and generating until max length, loss values are almost exact and minimal differences of the order of 1e-8 are caused by masked calculations.
When stop_token_id is set, sequences get padded after this token, so generation should stop there, not model's EOS.
The case when stop_token != None and stop_token != 'eos' are not supported, so they should probably raise an exception.


Failure due to protective stop on the UR

The robot stops during the execution of motions programmed via MoveIt.
Also read:
https://github.com/ros-industrial/universal_robot/issues/241#issuecomment-223309926
https://groups.google.com/forum/#!topic/swri-ros-pkg-dev/LwcFK44vmKI

General information :

ROS Indigo, Ubuntu 14.04 64 bits.
The end effector mass is 0.5 kg and it is declared in the UR10 controller.
I'm using universal_robot indigo-branch.

These are my test pacakges:
https://github.com/InstitutMaupertuis/institut_maupertuis_robots_descriptions/tree/ur10_tests
https://github.com/InstitutMaupertuis/universal_robot_motion
https://github.com/InstitutMaupertuis/ensenso_extrinsic_calibration/tree/ur10_test
kinematics.yaml file
joint_limits.yaml file
universal_robot_motion
This program moves the robot using the tool0 TCP (manipulator move group).
The robot does not go into protective stop with this trajectory/setup however the robot motion is very jerky at high speeds on the teach pendant.

Video 1, speed = 24%
Video 1, speed = 100%

$ rostopic echo -n1 /joint_states
header:
  seq: 30115
  stamp:
    secs:<PHONE_NUMBER>
    nsecs: 757682323
  frame_id: ''
name: ['shoulder_pan_joint', 'shoulder_lift_joint', 'elbow_joint', 'wrist_1_joint', 'wrist_2_joint', 'wrist_3_joint']
position: [0.10749213397502899, -1.6914003531085413, -2.255641285573141, -0.7656462828265589, 1.570691466331482, -1.4633196035968226]
velocity: [0.003847735235467553, 0.0005752427969127893, -0.0010865697404369712, -0.017736652866005898, 0.0, 0.00046019424917176366]
effort: [0.3799438774585724, 3.437805414199829, 2.176798105239868, 1.029556393623352, -0.1547699123620987, 0.1682281643152237]
---

$ rostopic echo /joint_trajectory_action/goal
header:
  seq: 27
  stamp:
    secs:<PHONE_NUMBER>
    nsecs: 547241536
  frame_id: ''
goal_id:
  stamp:
    secs:<PHONE_NUMBER>
    nsecs: 547242262
  id: /move_group-28-1465464915.547242262
goal:
  trajectory:
    header:
      seq: 0
      stamp:
        secs: 0
        nsecs:         0
      frame_id: /base_link
    joint_names: ['elbow_joint', 'shoulder_lift_joint', 'shoulder_pan_joint', 'wrist_1_joint', 'wrist_2_joint', 'wrist_3_joint']
    points:
      -
        positions: [-2.2549708525287073, -1.6918318907367151, 0.10376204550266266, -0.7655866781817835, 1.5708353519439697, -1.467086140309469]
        velocities: [0.01, 0.01, 0.01, 0.01, 0.01, 0.01]
        accelerations: []
        effort: []
        time_from_start:
          secs: 0
          nsecs: 200000000
      -
        positions: [-2.2551142205139545, -1.6917144345912636, 0.104558172139388, -0.7655606542365021, 1.5708275466449029, -1.4662796425854197]
        velocities: [0.01, 0.01, 0.01, 0.01, 0.01, 0.01]
        accelerations: []
        effort: []
        time_from_start:
          secs: 0
          nsecs: 400000000
      -
        positions: [-2.2552569478965943, -1.6915974960830145, 0.10535434386167308, -0.7655347639600301, 1.570819741379175, -1.4654730997769168]
        velocities: [0.01, 0.01, 0.01, 0.01, 0.01, 0.01]
        accelerations: []
        effort: []
        time_from_start:
          secs: 0
          nsecs: 600000000
      -
        positions: [-2.2553990349626503, -1.6914810774315878, 0.10615055970794862, -0.7655090066525032, 1.5708119359759958, -1.4646665128453131]
        velocities: [0.01, 0.01, 0.01, 0.01, 0.01, 0.01]
        accelerations: []
        effort: []
        time_from_start:
          secs: 0
          nsecs: 800000000
      -
        positions: [-2.255540481556798, -1.6913651789939417, 0.10694681868675793, -0.7654833821134783, 1.5708041304503921, -1.4638598827819198]
        velocities: [0.01, 0.01, 0.01, 0.01, 0.01, 0.01]
        accelerations: []
        effort: []
        time_from_start:
          secs: 1
          nsecs:         0
      -
        positions: [-2.255681287524319, -1.6912498011257657, 0.10774311980599016, -0.7654578901431304, 1.5707963248173944, -1.4630532105786997]
        velocities: [0.01, 0.01, 0.01, 0.01, 0.01, 0.01]
        accelerations: []
        effort: []
        time_from_start:
          secs: 1
          nsecs: 199999999
      -
        positions: [-2.215952529663621, -1.7240881091266331, 0.10381395634153678, -0.7723483415992316, 1.5707963246457914, -1.4669823740431536]
        velocities: [0.01, 0.01, 0.01, 0.01, 0.01, 0.01]
        accelerations: []
        effort: []
        time_from_start:
          secs: 1
          nsecs: 399999999
      -
        positions: [-2.175648416604411, -1.756148217646671, 0.1001639584823173, -0.7805923459301383, 1.570796324668755, -1.4706323719023722]
        velocities: [0.01, 0.01, 0.01, 0.01, 0.01, 0.01]
        accelerations: []
        effort: []
        time_from_start:
          secs: 1
          nsecs: 599999999
      -
        positions: [-2.1347557605286305, -1.7875552383501638, 0.0967641379870352, -0.790077981094857, 1.5707963246931047, -1.4740321923976545]
        velocities: [0.01, 0.01, 0.01, 0.01, 0.01, 0.01]
        accelerations: []
        effort: []
        time_from_start:
          secs: 1
          nsecs: 799999999
      -
        positions: [-2.093255950999202, -1.8184201988902498, 0.09358941771175111, -0.8007128298772637, 1.5707963247187018, -1.4772069126729388]
        velocities: [0.01, 0.01, 0.01, 0.01, 0.01, 0.01]
        accelerations: []
        effort: []
        time_from_start:
          secs: 1
          nsecs: 999999999
      -
        positions: [-2.051125098085622, -1.848842748212645, 0.09061798874414384, -0.8124211332620881, 1.5707963247454262, -1.4801783416405456]
        velocities: [0.01, 0.01, 0.01, 0.01, 0.01, 0.01]
        accelerations: []
        effort: []
        time_from_start:
          secs: 2
          nsecs: 199999999
      -
        positions: [-2.008334014041594, -1.8789134180971407, 0.08783079112480352, -0.8251415472157895, 1.5707963247731669, -1.4829655392598866]
        velocities: [0.01, 0.01, 0.01, 0.01, 0.01, 0.01]
        accelerations: []
        effort: []
        time_from_start:
          secs: 2
          nsecs: 399999999
      -
        positions: [-1.964848042211523, -1.9087155458047365, 0.08521109114890124, -0.8388253911329162, 1.5707963248018326, -1.485585239235789]
        velocities: [0.01, 0.01, 0.01, 0.01, 0.01, 0.01]
        accelerations: []
        effort: []
        time_from_start:
          secs: 2
          nsecs: 600000000
      -
        positions: [-1.9206267324000184, -1.9383269416090192, 0.08274413480153386, -0.8534353049352355, 1.5707963248313395, -1.4880521955831556]
        velocities: [0.01, 0.01, 0.01, 0.01, 0.01, 0.01]
        accelerations: []
        effort: []
        time_from_start:
          secs: 2
          nsecs: 800000000
      -
        positions: [-1.8756233530382707, -1.9678213711605546, 0.08041686170767126, -0.8689442545409527, 1.570796324861616, -1.490379468677018]
        velocities: [0.01, 0.01, 0.01, 0.01, 0.01, 0.01]
        accelerations: []
        effort: []
        time_from_start:
          secs: 3
          nsecs:         0
      -
        positions: [-1.8806717496154661, -1.9645426952691754, 0.1084882967527665, -0.8671745355136329, 1.5707963247330217, -1.4623080336319223]
        velocities: [0.01, 0.01, 0.01, 0.01, 0.01, 0.01]
        accelerations: []
        effort: []
        time_from_start:
          secs: 3
          nsecs: 200000000
      -
        positions: [-1.8844615777459488, -1.9620765677794738, 0.13655222712642257, -0.8658508347300424, 1.5707963247389853, -1.4342441032582665]
        velocities: [0.01, 0.01, 0.01, 0.01, 0.01, 0.01]
        accelerations: []
        effort: []
        time_from_start:
          secs: 3
          nsecs: 400000000
      -
        positions: [-1.886989841433481, -1.9604290459116687, 0.1645642775918419, -0.8649700927672335, 1.5707963247353183, -1.4062320527928476]
        velocities: [0.01, 0.01, 0.01, 0.01, 0.01, 0.01]
        accelerations: []
        effort: []
        time_from_start:
          secs: 3
          nsecs: 600000000
      -
        positions: [-1.8882544927960172, -1.9596042443807482, 0.19248017460061795, -0.8645302427925969, 1.5707963247220658, -1.3783161557840717]
        velocities: [0.01, 0.01, 0.01, 0.01, 0.01, 0.01]
        accelerations: []
        effort: []
        time_from_start:
          secs: 3
          nsecs: 800000000
      -
        positions: [-1.8882544927314484, -1.9596042441771413, 0.22025616646523583, -0.8645302429181427, 1.5707963246993075, -1.3505401639194536]
        velocities: [0.01, 0.01, 0.01, 0.01, 0.01, 0.01]
        accelerations: []
        effort: []
        time_from_start:
          secs: 4
          nsecs:         0
      -
        positions: [-1.8869898412398456, -1.9604290453013693, 0.247849435797048, -0.8649700931435982, 1.570796324667165, -1.3229468945876413]
        velocities: [0.01, 0.01, 0.01, 0.01, 0.01, 0.01]
        accelerations: []
        effort: []
        time_from_start:
          secs: 4
          nsecs: 200000000
      -
        positions: [-1.8844615774234592, -1.9620765667640425, 0.2752184945161491, -0.8658508353564054, 1.5707963246257965, -1.2955778358685404]
        velocities: [0.01, 0.01, 0.01, 0.01, 0.01, 0.01]
        accelerations: []
        effort: []
        time_from_start:
          secs: 4
          nsecs: 400000000
      -
        positions: [-1.880671749164474, -1.9645426938511932, 0.3023235523599732, -0.8671745363886387, 1.5707963245754006, -1.2684727780247167]
        velocities: [0.01, 0.01, 0.01, 0.01, 0.01, 0.01]
        accelerations: []
        effort: []
        time_from_start:
          secs: 4
          nsecs: 600000000
      -
        positions: [-1.8756233529181898, -1.9678213711480321, 0.3291268508415388, -0.868944255200053, 1.5707963245162, -1.2416694795431509]
        velocities: [0.01, 0.01, 0.01, 0.01, 0.01, 0.01]
        accelerations: []
        effort: []
        time_from_start:
          secs: 4
          nsecs: 800000000
      -
        positions: [-1.9261961437469743, -1.9346333967296294, 0.33969106793075854, -0.8515594404739089, 1.570796324014399, -1.231105262453931]
        velocities: [0.01, 0.01, 0.01, 0.01, 0.01, 0.01]
        accelerations: []
        effort: []
        time_from_start:
          secs: 5
          nsecs:         0
      -
        positions: [-1.9757867901999777, -1.9012858555142236, 0.35095421573560315, -0.8353163350296606, 1.5707963240882885, -1.2198421146490865]
        velocities: [0.01, 0.01, 0.01, 0.01, 0.01, 0.01]
        accelerations: []
        effort: []
        time_from_start:
          secs: 5
          nsecs: 200000000
      -
        positions: [-2.0244601190168634, -1.867672726537858, 0.3629878580013266, -0.8202561349829605, 1.5707963241572798, -1.2078084723833626]
        velocities: [0.01, 0.01, 0.01, 0.01, 0.01, 0.01]
        accelerations: []
        effort: []
        time_from_start:
          secs: 5
          nsecs: 400000000
      -
        positions: [-2.0722711037381725, -1.8336809272015673, 0.37587365139730333, -0.8064369493923804, 1.5707963242208614, -1.1949226789873864]
        velocities: [0.01, 0.01, 0.01, 0.01, 0.01, 0.01]
        accelerations: []
        effort: []
        time_from_start:
          secs: 5
          nsecs: 600000000
      -
        positions: [-2.119265651068785, -1.7991875456370856, 0.3897051866010086, -0.793935783421496, 1.5707963242784522, -1.1810911437836813]
        velocities: [0.01, 0.01, 0.01, 0.01, 0.01, 0.01]
        accelerations: []
        effort: []
        time_from_start:
          secs: 5
          nsecs: 800000000
      -
        positions: [-2.1654810642101854, -1.7640566439245724, 0.4045902470470062, -0.7828512717888927, 1.5707963243293899, -1.1662060833376833]
        velocities: [0.01, 0.01, 0.01, 0.01, 0.01, 0.01]
        accelerations: []
        effort: []
        time_from_start:
          secs: 6
          nsecs:         0
      -
        positions: [-2.210946196751216, -1.728135461136758, 0.42065360031356636, -0.773307321833296, 1.5707963243729095, -1.1501427300711233]
        velocities: [0.01, 0.01, 0.01, 0.01, 0.01, 0.01]
        accelerations: []
        effort: []
        time_from_start:
          secs: 6
          nsecs: 200000000
      -
        positions: [-2.255681287365939, -1.6912498010803345, 0.4380404746996618, -0.7654578910743188, 1.5707963244081327, -1.1327558556850281]
        velocities: [0.01, 0.01, 0.01, 0.01, 0.01, 0.01]
        accelerations: []
        effort: []
        time_from_start:
          secs: 6
          nsecs: 400000000
      -
        positions: [-2.262164681179893, -1.6857616655376804, 0.3989166630136951, -0.7644626344017702, 1.5707963237108702, -1.1718796673709946]
        velocities: [0.01, 0.01, 0.01, 0.01, 0.01, 0.01]
        accelerations: []
        effort: []
        time_from_start:
          secs: 6
          nsecs: 600000000
      -
        positions: [-2.26681065743996, -1.681805138254016, 0.3589146203024165, -0.7637731850641911, 1.5707963237982354, -1.2118817100822739]
        velocities: [0.01, 0.01, 0.01, 0.01, 0.01, 0.01]
        accelerations: []
        effort: []
        time_from_start:
          secs: 6
          nsecs: 800000000
      -
        positions: [-2.2696043177795495, -1.6794163322183309, 0.318150749863805, -0.7633683304054539, 1.5707963239093554, -1.252645580520885]
        velocities: [0.01, 0.01, 0.01, 0.01, 0.01, 0.01]
        accelerations: []
        effort: []
        time_from_start:
          secs: 7
          nsecs:         0
      -
        positions: [-2.270536557495281, -1.6786175501868632, 0.2767544032059195, -0.7632348723746816, 1.5707963490170427, -1.2940419271787702]
        velocities: [0.01, 0.01, 0.01, 0.01, 0.01, 0.01]
        accelerations: []
        effort: []
        time_from_start:
          secs: 7
          nsecs: 200000000
      -
        positions: [-2.2696043177116074, -1.679416331766185, 0.23486559161974263, -0.763368330242848, 1.5707963242033187, -1.3359307387649473]
        velocities: [0.01, 0.01, 0.01, 0.01, 0.01, 0.01]
        accelerations: []
        effort: []
        time_from_start:
          secs: 7
          nsecs: 400000000
      -
        positions: [-2.266810657304209, -1.6818051373518337, 0.19263215643209675, -0.763773184740705, 1.5707963243856378, -1.3781641739525927]
        velocities: [0.01, 0.01, 0.01, 0.01, 0.01, 0.01]
        accelerations: []
        effort: []
        time_from_start:
          secs: 7
          nsecs: 600000000
      -
        positions: [-2.2621646809765874, -1.6857616641896316, 0.15020667378084207, -0.7644626339208056, 1.5707963245906627, -1.4205896566038474]
        velocities: [0.01, 0.01, 0.01, 0.01, 0.01, 0.01]
        accelerations: []
        effort: []
        time_from_start:
          secs: 7
          nsecs: 800000000
      -
        positions: [-2.255681287524319, -1.6912498011257657, 0.10774311980599016, -0.7654578901431304, 1.5707963248173944, -1.4630532105786997]
        velocities: [0.01, 0.01, 0.01, 0.01, 0.01, 0.01]
        accelerations: []
        effort: []
        time_from_start:
          secs: 8
          nsecs:         0
  path_tolerance: []
  goal_tolerance: []
  goal_time_tolerance:
    secs: 0
    nsecs:         0
---

ensenso_extrinsic_calibration
This program moves the robot using the ensenso_tcp TCP (ensenso_n10 move group), I also tried with manipulator, same results.
The robot goes into protective stop. At low speeds (~ 20%) the robot either goes into protective stop or does not finish it's trajectory.
roslaunch ur10_ensenso_extrinsic_calibration calibration.launch robot_ip:=<IP_ADDRESS> sim:=false

$ rostopic echo -n1 /joint_states
header:
  seq: 278
  stamp:
    secs:<PHONE_NUMBER>
    nsecs: 148979714
  frame_id: ''
name: ['shoulder_pan_joint', 'shoulder_lift_joint', 'elbow_joint', 'wrist_1_joint', 'wrist_2_joint', 'wrist_3_joint']
position: [0.07957300543785095, -1.9691742102252405, -1.880716625844137, -0.8625786940204065, 1.5707874298095703, -1.4912903944598597]
velocity: [0.0, 0.008897088468074799, -0.0, 0.019481556490063667, 0.023815052583813667, 0.01781335286796093]
effort: [-0.0274658240377903, 4.591370105743408, 3.295461416244507, -0.0695343092083931, -0.1211242824792862, -0.1256103664636612]
---

$ rostopic echo /joint_trajectory_action/goal
dell@M6700:~/catkin_src/ensenso_extrinsic_calibration$ rostopic echo /joint_trajectory_action/goal
header:
  seq: 0
  stamp:
    secs:<PHONE_NUMBER>
    nsecs: 729480224
  frame_id: ''
goal_id:
  stamp:
    secs:<PHONE_NUMBER>
    nsecs: 729483202
  id: /move_group-1-1465465684.729483202
goal:
  trajectory:
    header:
      seq: 0
      stamp:
        secs: 0
        nsecs:         0
      frame_id: /base_link
    joint_names: ['elbow_joint', 'shoulder_lift_joint', 'shoulder_pan_joint', 'wrist_1_joint', 'wrist_2_joint', 'wrist_3_joint']
    points:
      -
        positions: [-1.880716625844137, -1.969210449849264, 0.0795610249042511, -0.8626983801471155, 1.5707154273986816, -1.491206471120016]
        velocities: [0.05, 0.05, 0.05, 0.05, 0.05, 0.05]
        accelerations: []
        effort: []
        time_from_start:
          secs: 0
          nsecs: 200000000
      -
        positions: [-1.7018506974226018, -2.0803188339097662, -0.01981388490404612, -0.9063977531316931, 1.528335916287313, -2.969048055500995]
        velocities: [0.05, 0.05, 0.05, 0.05, 0.05, 0.05]
        accelerations: []
        effort: []
        time_from_start:
          secs: 0
          nsecs: 400000000
  path_tolerance: []
  goal_tolerance: []
  goal_time_tolerance:
    secs: 0
    nsecs:         0
---
header:
  seq: 1
  stamp:
    secs:<PHONE_NUMBER>
    nsecs: 247310453
  frame_id: ''
goal_id:
  stamp:
    secs:<PHONE_NUMBER>
    nsecs: 247311127
  id: /move_group-2-1465465687.247311127
goal:
  trajectory:
    header:
      seq: 0
      stamp:
        secs: 0
        nsecs:         0
      frame_id: /base_link
    joint_names: ['elbow_joint', 'shoulder_lift_joint', 'shoulder_pan_joint', 'wrist_1_joint', 'wrist_2_joint', 'wrist_3_joint']
    points:
      -
        positions: [-1.8746102491961878, -1.9737761656390589, 0.07535193860530853, -0.8645313421832483, 1.5689294338226318, -1.54619008699526]
        velocities: [0.05, 0.05, 0.05, 0.05, 0.05, 0.05]
        accelerations: []
        effort: []
        time_from_start:
          secs: 0
          nsecs: 200000000
      -
        positions: [-1.8807166263011048, -1.9692104516566022, 0.07956102492095352, -0.8626983796833887, 1.5707154272559791, -1.4912064711034585]
        velocities: [0.05, 0.05, 0.05, 0.05, 0.05, 0.05]
        accelerations: []
        effort: []
        time_from_start:
          secs: 0
          nsecs: 400000000
  path_tolerance: []
  goal_tolerance: []
  goal_time_tolerance:
    secs: 0
    nsecs:         0
---
header:
  seq: 2
  stamp:
    secs:<PHONE_NUMBER>
    nsecs: 171089184
  frame_id: ''
goal_id:
  stamp:
    secs:<PHONE_NUMBER>
    nsecs: 171090400
  id: /move_group-3-1465465698.171090400
goal:
  trajectory:
    header:
      seq: 0
      stamp:
        secs: 0
        nsecs:         0
      frame_id: /base_link
    joint_names: ['elbow_joint', 'shoulder_lift_joint', 'shoulder_pan_joint', 'wrist_1_joint', 'wrist_2_joint', 'wrist_3_joint']
    points:
      -
        positions: [-1.874622646962301, -1.9738004843341272, 0.07539987564086914, -0.8645313421832483, 1.5689294338226318, -1.5461538473712366]
        velocities: [0.05, 0.05, 0.05, 0.05, 0.05, 0.05]
        accelerations: []
        effort: []
        time_from_start:
          secs: 0
          nsecs: 200000000
      -
        positions: [-1.7832820861832914, -2.0082614073819967, 0.0781178191017029, -1.0115700827663803, 1.4446979420760742, -2.1014648702613377]
        velocities: [0.05, 0.05, 0.05, 0.05, 0.05, 0.05]
        accelerations: []
        effort: []
        time_from_start:
          secs: 0
          nsecs: 400000000
      -
        positions: [-1.6651512276537161, -2.073190960918998, 0.10424251270339324, -1.082737436077796, 1.294429050315901, -2.6361261810050793]
        velocities: [0.05, 0.05, 0.05, 0.05, 0.05, 0.05]
        accelerations: []
        effort: []
        time_from_start:
          secs: 0
          nsecs: 600000000
  path_tolerance: []
  goal_tolerance: []
  goal_time_tolerance:
    secs: 0
    nsecs:         0
---
header:
  seq: 3
  stamp:
    secs:<PHONE_NUMBER>
    nsecs: 856730864
  frame_id: ''
goal_id:
  stamp:
    secs:<PHONE_NUMBER>
    nsecs: 856731847
  id: /move_group-4-1465465700.856731847
goal:
  trajectory:
    header:
      seq: 0
      stamp:
        secs: 0
        nsecs:         0
      frame_id: /base_link
    joint_names: ['elbow_joint', 'shoulder_lift_joint', 'shoulder_pan_joint', 'wrist_1_joint', 'wrist_2_joint', 'wrist_3_joint']
    points:
      -
        positions: [-1.8433497587787073, -1.9871748129474085, 0.07688666880130768, -0.9108617941485804, 1.5257060527801514, -1.7314875761615198]
        velocities: [0.05, 0.05, 0.05, 0.05, 0.05, 0.05]
        accelerations: []
        effort: []
        time_from_start:
          secs: 0
          nsecs: 200000000
      -
        positions: [-1.8746345683462238, -1.9737642465191048, 0.07541186363020014, -0.8645194207857712, 1.568929433778452, -1.5461781660645038]
        velocities: [0.05, 0.05, 0.05, 0.05, 0.05, 0.05]
        accelerations: []
        effort: []
        time_from_start:
          secs: 0
          nsecs: 400000000
  path_tolerance: []
  goal_tolerance: []
  goal_time_tolerance:
    secs: 0
    nsecs:         0
---
header:
  seq: 4
  stamp:
    secs:<PHONE_NUMBER>
    nsecs: 216729253
  frame_id: ''
goal_id:
  stamp:
    secs:<PHONE_NUMBER>
    nsecs: 216729984
  id: /move_group-5-1465465705.216729984
goal:
  trajectory:
    header:
      seq: 0
      stamp:
        secs: 0
        nsecs:         0
      frame_id: /base_link
    joint_names: ['elbow_joint', 'shoulder_lift_joint', 'shoulder_pan_joint', 'wrist_1_joint', 'wrist_2_joint', 'wrist_3_joint']
    points:
      -
        positions: [-1.8507488409625452, -1.9846580664264124, 0.07609570771455765, -0.9010370413409632, 1.5348515510559082, -1.6904967466937464]
        velocities: [0.05, 0.05, 0.05, 0.05, 0.05, 0.05]
        accelerations: []
        effort: []
        time_from_start:
          secs: 0
          nsecs: 200000000
      -
        positions: [-1.4816874711486596, -2.1910048161415308, 0.008885546546005152, -1.1846888096274952, 1.4944890624148757, -3.107264129418932]
        velocities: [0.05, 0.05, 0.05, 0.05, 0.05, 0.05]
        accelerations: []
        effort: []
        time_from_start:
          secs: 0
          nsecs: 400000000
  path_tolerance: []
  goal_tolerance: []
  goal_time_tolerance:
    secs: 0
    nsecs:         0
---
header:
  seq: 5
  stamp:
    secs:<PHONE_NUMBER>
    nsecs: 734270208
  frame_id: ''
goal_id:
  stamp:
    secs:<PHONE_NUMBER>
    nsecs: 734271261
  id: /move_group-6-1465465707.734271261
goal:
  trajectory:
    header:
      seq: 0
      stamp:
        secs: 0
        nsecs:         0
      frame_id: /base_link
    joint_names: ['elbow_joint', 'shoulder_lift_joint', 'shoulder_pan_joint', 'wrist_1_joint', 'wrist_2_joint', 'wrist_3_joint']
    points:
      -
        positions: [-1.8480427900897425, -1.9862878958331507, 0.0754837691783905, -0.9033015410052698, 1.5345759391784668, -1.7015331427203577]
        velocities: [0.05, 0.05, 0.05, 0.05, 0.05, 0.05]
        accelerations: []
        effort: []
        time_from_start:
          secs: 0
          nsecs: 200000000
      -
        positions: [-1.8507369204866926, -1.9846223054378545, 0.0760957076899158, -0.9010131990373642, 1.5349473955385382, -1.6905444304981287]
        velocities: [0.05, 0.05, 0.05, 0.05, 0.05, 0.05]
        accelerations: []
        effort: []
        time_from_start:
          secs: 0
          nsecs: 400000000
  path_tolerance: []
  goal_tolerance: []
  goal_time_tolerance:
    secs: 0
    nsecs:         0
---

Here is a video of the robot going in protective stop.

From the looks of it, my initial guess would be that your problem is due to the velocity values in your goal.
In the first example, each goal pose has a velocity of 0.01, spaced 0.2 sec apart. Obviously, this will result in jerky movement, as the robot first accelerates to be able to move sufficiently fast, and then slows down to get the velocity down to 0.01 rad/sec. The result is the jerky motion you see.
The same goes with the other example; here the velocity is a bit higher, but the travel distance is also much higher.
To visualize the problem, try to plot the velocity and acceleration curve required to execute your trajectory, interpolating with a timestep of 8 ms. You can find the code used by the driver for interpolation at https://github.com/ThomasTimm/ur_modern_driver/blob/master/src/ur_driver.cpp#L61

@VictorLamoine: what did you use to calculate velocities and accelerations?

Argh, I didn't notice that the trajectory already had timing information!
I never played with timed/velocity constrained trajectory before.
Some things are not clear to me:

How does it work when we specify both the goal time and velocity, these information are contradictory?!
What should I put in velocities?
Per-axis maximum/goal velocities?
TCP maximum/goal velocity?
If I want a specific TCP speed, what should I do?
Can I put all time_from_start to zero If I want to ignore this information?

Where is that documented? I can't find the right wiki link.

The velocity is related to the point at the trajectory, so you should use the desired joint velocity at the point (i.e. all zeros at the first and last point).
The driver then interpolates and calculate the required velocity to reach the trajectory points at the desired time.
So goal time and velocity is not contradictory; goal time is when the robot should be at that pose, velocity is how fast the robot should move at that point.
If you want a specific TCP speed in cartesian space, you should find and calculate the inverse Jacobian.
No, if you put all time_from_start to zero, you are essentially telling the driver at should be at all those poses at the same time (now).

Thanks, I'll try that Thursday and give you feedback!

I think understood how it works but this feels completely un-usable to me.
All I want is a smooth motion at a given constant speed. I don't care about accelerations as long as it's not too slow. And I don't want to calculate anything, ROS should do that for me.
There are many parameters interacting with each other:

Compute Cartesian path eef_step
time_from_start (can we change how much it increases between each point? I don't want to manually tweak those values!)
Velocities

If we change one of those without adjusting the others, it breaks everything.
It's hard to believe people are doing it this way.. this is way over-complicated for what I'm trying to achieve, am I using the right tool? Is there a package or anything I'm missing?
I'm frustrated because I'm trying to achieve something that should be very simple to achieve (10 secs of programming with the UR teach pendant) and it feels like a pain to do it with ROS-I.
I'm getting a lot less preventing stops because I understood how to tweak the parameters but it still happens sometimes. The robot is finishing the trajectory very brutally despite the fact that I set all the velocities of the last pose to zero, it seems like it stops before reaching the goal.

Seeing your issue is with ROS and calculating stuff, I'll close the topic. Let me know if you have any issues with the driver not working when using it as intended.


Must add a measure of the test coverage

Now that tests are fully automated, we need a measure of test coverage at each build.

Test coverage at 100% on branch "renaming"
Need to merge and add a measure badge.

Installed coveralls and linked to this repo.

Coverage badge appears in the readme
Coverage at 100%
Done and closing


[Wise Old Man] - Plugin - Competitions

Notifications
Competition Notifications notifications are inconsistent with Login info notifications.

"Test has started!" should be "Competition Test has started!"
Also, perhaps Competition: {comp name} or WOM Competition {comp name} would be better than Competition {comp name} for these notifications.
Competition Timers
When a competition starts during a login session, the Upcoming Competition timer disappears, and the Ongoing timer does not appear until you relog or toggle this feature off and on. See gif here: https://cdn.discordapp.com/attachments/696219254076342312/889268378664071168/YyoueTSq6Z.gif
Upcoming/Ongoing colour coding
There's also no difference between the icon for 21:17 until a competition starts, and 21:17 until a competition ends. Perhaps they should be colour coded? Red numbers for upcoming or something?
The white text is also quite difficult to read without Outline infobox text turned on within the rl settings, particularly for a Slayer competition. This should be considered when choosing potential text colours for colour coding.
Cluttered Infoboxes
The infoboxes should be off by default, some members can be in multiple groups, and some clans run multiple competitions at the same time (for bingos, or dks competitions for example) This will get very messy/cluttered for users. After a quick check, I found this one user with 5 ongoing competitions, and 3 upcoming. That's 5-8 potential infoboxes which would be very crowded.

I know eventually we'd like to add a ui for competitions within the plugin, it would be great to be able to individually toggle which competitions have an infobox if/when this becomes an option.

Implemented by b8593276497ce24420725f10b8ffb9ca24b75be2


QCFractal Intro Docs

Several users have mentioned that one of the issues starting Fractal is trying to understand where everything should live. Should the server be on a laptop or on the supercomputer, or should the manager be on a worker node. This kind of overview information is critical to provide before the Setup Compute/ Setup Server data.
Other minor issues:

Current manager examples also require dtd3 which is not currently in the installs.
Discussing what pieces need to be installed where (e.g. does Psi4 need to be installed on the server).

@mattwelborn the issue related to the intro docs.

Closed by PR #362.


Deployment is a bit long

As of now, the Heroku deployments are a bit long (~10 minutes).
This can be a bit annoying as Heroku Review Apps are used to preview PRs, meaning that one can only preview and test their changes after waiting for ~10 minutes.
@kraynel as you already slimmed down the Docker build, you might want to have a look at what can be optimized even more :)

I used https://stackoverflow.com/a/52192327 to time the execution of each step of the docker build. Total build duration: 396s (local, no cache), i.e. 6 min 40 sec.
Here are the timings:

Slow steps:

Fetch front dependencies (yarn install) -> 166s
Build front -> 103s
Install back dependencies (pip) -> 105s

Possibilities to reduce these steps:

Add cache to avoid fetching the front & back dependencies for every build (impossible with heroku build?)
Fetch fewer librairies (front dev dependencies are required to build the prod)
Improve front build time

Closed for now by #60, thanks @kraynel!


fix a bug in pureidelight and clean store entitlement pure code

What type of PR is this?

Bug Fix
What does this PR do / why is it needed ?

Which issue(s) this PR fixes:

Fixes #
Other notes for reviewers:
Does this PR introduce a user-facing change?

Closes #1699


Android Basics: Get data from the Internet: inconsistent use of capital I in word 'internet'

URL of codelab
Get data from the internet
In which task and step of the codelab can this issue be found?
Task 6: Connectiong to the Internet
Describe the problem
Unit title and task title uses 'internet' capitalization inconsistently.
Additional information

@bivanbi
Thank you for reaching out to us. The issue is closed due to intentional behavior.


Refactor RNNs

I refactored RNNs. All NStepRNNs have similar codes. I extracted common codes from these implementation.
This fix is required before fixing interface of RNNs because we need to fix all interfaces of RNNs.

fixed

jenkins, test this please.

jenkins, test this please.

LGTM!


Dynamic role support

I have a project where I customized Rbac. The thing was that I needed dynamic roles; a person can be an Owner/Admin for one resource instance and for another resource instance of the same type (so a different resource identifier) he has for example no role at all (Guest role). To be able to implement that I introduced a RoleResolver.
In my config I tie resource classes to certain role resolvers to be able to resolve the roles for the provided $resource instance for the current AuthenticatedIdentity at run time (or optional another identity passed to the resolver).
something like:
'role_resolvers' => [
    'Application\Resource\Object'    => 'Application\Role\Resolver\ObjectRoleResolver'
    //... more role resolver configs
)

My RoleResolverInterface looks like this:
<?php

namespace Rbac\Role;

use Rbac\Identity\IdentityInterface;

/**
 * A role resolver is a class that collects role names (strings)
 */
interface RoleResolverInterface
{
    /**
     * Get the roles for the resource
     *
     * @param IdentityInterface $identity
     * @param object $resource
     * @return array
     */
    public function getRoles(IdentityInterface $identity, $resource);
}

I created a RoleResolverPluginManager where I load the config. This allows easy access to the correct role resolver.
In my authorization event I get the correct resource (or a resource reference) and resolve the roles for the current user for the resource so that the isAuthorized method in my AuthorizationService can be executed with the correct roles for that particular resource.
Would it be interesting to add such dynamic role support to this RBAC module? Or would it be interesting to make another module called DynamicRBAC? Or do you see other ways of achieving the same results with the current module?

@Wilt thanks for your showing that up. We are planning the next major release of ZfcRbac that would bring middlewares concept, do you know it? As I said in #316, I'd like to allow developers to register their own "role provider" middleware, so that they could apply some custom logic for resolving the user roles:
namespace UserLand\Middleware;

class MyCustomRoleProviderMiddleware
{
    public function __invoke(ServerRequestInterface $request, ResponseInterface $response, callable $next)
    {
    	$roles = /* Custom logic to fetch identity roles */;

    	return $next($request->withAttribute('roles', $roles), $response);
    }
}

While I feel that this resource x role x identity stuff sounds more like ACL, I think you could implement that logic with custom role provider middlewares. What do you think?

@danizord I am not familiar with the Middleware concept yet, but I see how that would work. It seems it would for sure help me but how do those custom attributes find their way into the AuthorizationService. It would still mean writing my own service that handles these roles? Is having dynamic roles not something you would like to implement more structurally?
Rbac seems to me a module that should allow users more out-of-the-box with common features like dynamic roles? Otherwise the module becomes much less usable in practice.
In our application each resource has a known set of roles (Admin, Guest, Owner), we just need to collect the list roles for the current Identity to be able to do the isAuthorized check. I still don't see how this could work in the current Rbac module? Or can you provide a full example?

Should we invent a new authorisation system that is neither called Acl not Rbac and that does all this? So that we stop saying "this does not sound like Acl/Rbac" ?
Ideally I'd love this library to be able to provide an authorisation as granular as what AWS provide for its IAM service.

@bakura10  First I thought you were being sarcastic, but I sincerely hope you are serious. And yes, we should do that, I am in. And if necessary I would also not mind contributing to this.
RARA - Roles, Assertions and Resources Authorization :)

I'm not sarcastic at all :). In my previous project I had this mechanism of "team" where one user could actually have different roles based on the sub-project he had created, so the same user could be potentially an admin, a super-user and a user at the same time, depending on the project.
Therefore this is where AWS mechanism shines, where you can create permissions using simple logic, so you could have a permission for a given resource (so it looks a bit like a mix of RBAC and ACL) - this could actually be removed completely and only use "Condition" as shown after):
{
   "Effect": "allow",
   "Permission": "read_article",
   "Resource": "343" // An article ID
}

Or going more deeper and creating conditions, based on context (and this context info would be exposed by the app, depending on the resource):
{
   "Effect": "allow",
   "Permission": "read_article",
   "Condition": {
      "StringLike": {
         "article.team.name": "team-bar-*"
      }
   }
}

This user would have the permission to read the article only if the current context (the article) belongs to a team of writer whoes name starts by "team-bar-".
You could also combine things and set a wildcard for "Permission": "*_article".
@danizord what do you tihnk?

Only my humble 5 cents about assertions etc. here, but...
I think the proposed conditions above are really interesting idea. Similarly to Assertions.
I certainly love the assertions and would not like to see it going away.
In fact I would love to see ability to add multiple assertions to one permission. I have extended this module for my own project purposes and it works excellently.
As for it not belonging to the Rbac... well you might be right but this module (despite it's name) is to most people more than an Rbac. It's a module to solve most authorization needs.
But if new repository is required (ZfrAuthorization?), why not.
Background info (if interested):
I work with a large scale system, social network type of application that has hundreds of item types. Each item has specified visibility (so permission) to whom it can be shown :
friends / sameNetwork / registeredUsers / everyone
For regular things Acl is ok, but it became nightmare when it came to feed posts (similar to facebook) with hundreds of thousands (potentially millions) of feed items/posts.
The displaying it itself is done via so called stream table so that's fine, but it still has to have access permissions in place in case someone access it differently.
Sadly this system was using simple Acl (item_type/item_id/user_id permission type records in db table) so say on creation of each feed post that is accessible to friends only it needs to find all friends of the creator and add new permission row for each friend to DB .
That seemed as a good idea at first but with tens of thousands of feed posts and users it grew like crazy. So that was one big expensive table of data.
Each time the feed post was accessed it needed to check the permission row in DB.
I have solved the issue by using (customized) zfcrbac and it’s assertion plugins (in some cases multiple ones).
Having an assertion say visibilityAssertion that reads column ‘visibility’ of the context (feed post) and doing the check between the creator and viewer makes more sense.
So for post with visibility ‘friends’ it would also run one simple query (one trip to DB) to see if creator and viewer are friends,
but the result will be cached for next posts with same visibility and creator/viewer and it is now much more performant. Plus there is no huge extra table of data.

Thanks for the comprehensive answer. It makes sense.
For now (v2) I will submit PR for multiple assertions in couple of days, and you see if you like it.


Android/IOS app does not focus on date of birth field when 'fix the errors' link is clicked

Details
Native apps does not fire focus on field with editable={false} prop.
To make it working we need to use custom ref with showPicker function fired on focus, function will be executed - and default picker will be shown.
Also there are some improvements:

We don't really need e.preventDefault() for native apps - it's doing nothing in particular case
We need to close calendar picker before firing onInputChange (when date selected) - it will fix issue with shacked calendar (which looks a bit weird).

Fixed Issues
$ https://github.com/Expensify/App/issues/15290
$ https://github.com/Expensify/App/issues/15290#issuecomment-1439785640
Tests

Open the app in android
Open settings
Open Profile
Open Personal details
Open date of birth
Write or select any wrong date eg: 02/02/2024
Click on save
Click on fix the errors

[ ] Verify that no errors appear in the JS console

Offline tests
This feature doesn't change or is impacted by offline mode.
QA Steps
Same as above.

[ ] Verify that no errors appear in the JS console

PR Author Checklist

[x] I linked the correct issue in the ### Fixed Issues section above
[x] I wrote clear testing steps that cover the changes made in this PR

[x] I added steps for local testing in the Tests section
[x] I added steps for the expected offline behavior in the Offline steps section
[x] I added steps for Staging and/or Production testing in the QA steps section
[x] I added steps to cover failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
[x] I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
[x] I tested this PR with a High Traffic account against the staging or production API to ensure there are no regressions (e.g. long loading states that impact usability).

[x] I included screenshots or videos for tests on all platforms
[x] I ran the tests on all platforms & verified they passed on:

[x] Android / native
[x] Android / Chrome
[x] iOS / native
[x] iOS / Safari
[x] MacOS / Chrome / Safari
[x] MacOS / Desktop

[x] I verified there are no console errors (if there's a console error not related to the PR, report it or open an issue for it to be fixed)
[x] I followed proper code patterns (see Reviewing the code)

[x] I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick)
[x] I verified that comments were added to code that is not self explanatory
[x] I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
[x] I verified any copy / text shown in the product is localized by adding it to src/languages/* files and using the translation method

[x] If any non-english text was added/modified, I verified the translation was requested/reviewed in #expensify-open-source and it was approved by an internal Expensify engineer. Link to Slack message:

[x] I verified all numbers, amounts, dates and phone numbers shown in the product are using the localization methods
[x] I verified any copy / text that was added to the app is correct English and approved by marketing by adding the Waiting for Copy label for a copy review on the original GH to get the correct copy.
[x] I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
[x] I verified the JSDocs style guidelines (in STYLE.md) were followed

[x] If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
[x] I followed the guidelines as stated in the Review Guidelines
[x] I tested other components that can be impacted by my changes (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar are working as expected)
[x] I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
[x] I verified any variables that can be defined as constants (ie. in CONST.js or at the top of the file that uses the constant) are defined as such
[x] I verified that if a function's arguments changed that all usages have also been updated correctly
[x] If a new component is created I verified that:

[x] A similar component doesn't exist in the codebase
[x] All props are defined accurately and each prop has a /** comment above it */
[x] The file is named correctly
[x] The component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
[x] The only data being stored in the state is data necessary for rendering and nothing else
[x] For Class Components, any internal methods passed to components event handlers are bound to this properly so there are no scoping issues (i.e. for onClick={this.submit} the method this.submit should be bound to this in the constructor)
[x] Any internal methods bound to this are necessary to be bound (i.e. avoid this.submit = this.submit.bind(this); if this.submit is never passed to a component event handler like onClick)
[x] All JSX used for rendering exists in the render method
[x] The component has the minimum amount of code necessary for its purpose, and it is broken down into smaller components in order to separate concerns and functions

[x] If any new file was added I verified that:

[x] The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory

[x] If a new CSS style is added I verified that:

[x] A similar style doesn't already exist
[x] The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)

[x] If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
[x] If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
[x] If a new page is added, I verified it's using the ScrollView component to make it scrollable when more elements are added to the page.
[x] If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.
[x] I have checked off every checkbox in the PR author checklist, including those that don't apply to this PR.

Screenshots/Videos

Web
https://user-images.githubusercontent.com/28352309/221192524-1d9cd257-e23f-430d-817a-d93fb85b73e4.mov

Mobile Web - Chrome
https://user-images.githubusercontent.com/28352309/221192587-a66bbd73-ec9c-4af3-a3fc-822c51f3a715.mov

Mobile Web - Safari
https://user-images.githubusercontent.com/28352309/221192637-adb58b55-9b38-451a-8741-e292d521af68.mov

Desktop
https://user-images.githubusercontent.com/28352309/221192665-e90b14c8-db3b-4ce5-b9be-2f90b33424e0.mov

iOS
https://user-images.githubusercontent.com/28352309/221192686-736b7d30-5607-4950-aad6-470522e4a0c4.mov

Android
https://user-images.githubusercontent.com/28352309/221193065-a6b5e0ac-35a1-4a73-9883-69f2d74242c8.mp4

Hey! I see that you made changes to our Form component. Make sure to update the docs in FORMS.md accordingly. Cheers!

@alex-mechler @Santhosh-Sellavel One of you needs to copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button]

Reviewer Checklist

[ ] I have verified the author checklist is complete (all boxes are checked off).
[ ] I verified the correct issue is linked in the ### Fixed Issues section above
[ ] I verified testing steps are clear and they cover the changes made in this PR

[ ] I verified the steps for local testing are in the Tests section
[ ] I verified the steps for Staging and/or Production testing are in the QA steps section
[ ] I verified the steps cover any possible failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
[ ] I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)

[ ] I checked that screenshots or videos are included for tests on all platforms
[ ] I included screenshots or videos for tests on all platforms
[ ] I verified tests pass on all platforms & I tested again on:

[ ] Android / native
[ ] Android / Chrome
[ ] iOS / native
[ ] iOS / Safari
[ ] MacOS / Chrome / Safari
[ ] MacOS / Desktop

[ ] If there are any errors in the console that are unrelated to this PR, I either fixed them (preferred) or linked to where I reported them in Slack
[ ] I verified proper code patterns were followed (see Reviewing the code)

[ ] I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick).
[ ] I verified that comments were added to code that is not self explanatory
[ ] I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
[ ] I verified any copy / text shown in the product is localized by adding it to src/languages/* files and using the translation method
[ ] I verified all numbers, amounts, dates and phone numbers shown in the product are using the localization methods
[ ] I verified any copy / text that was added to the app is correct English and approved by marketing by adding the Waiting for Copy label for a copy review on the original GH to get the correct copy.
[ ] I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
[ ] I verified the JSDocs style guidelines (in STYLE.md) were followed

[ ] If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
[ ] I verified that this PR follows the guidelines as stated in the Review Guidelines
[ ] I verified other components that can be impacted by these changes have been tested, and I retested again (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar have been tested & I retested again)
[ ] I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
[ ] I verified any variables that can be defined as constants (ie. in CONST.js or at the top of the file that uses the constant) are defined as such
[ ] If a new component is created I verified that:

[ ] A similar component doesn't exist in the codebase
[ ] All props are defined accurately and each prop has a /** comment above it */
[ ] The file is named correctly
[ ] The component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
[ ] The only data being stored in the state is data necessary for rendering and nothing else
[ ] For Class Components, any internal methods passed to components event handlers are bound to this properly so there are no scoping issues (i.e. for onClick={this.submit} the method this.submit should be bound to this in the constructor)
[ ] Any internal methods bound to this are necessary to be bound (i.e. avoid this.submit = this.submit.bind(this); if this.submit is never passed to a component event handler like onClick)
[ ] All JSX used for rendering exists in the render method
[ ] The component has the minimum amount of code necessary for its purpose, and it is broken down into smaller components in order to separate concerns and functions

[ ] If any new file was added I verified that:

[ ] The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory

[ ] If a new CSS style is added I verified that:

[ ] A similar style doesn't already exist
[ ] The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)

[ ] If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
[ ] If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
[ ] If a new page is added, I verified it's using the ScrollView component to make it scrollable when more elements are added to the page.
[ ] If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.
[ ] I have checked off every checkbox in the PR reviewer checklist, including those that don't apply to this PR.

Screenshots/Videos

Web

Mobile Web - Chrome

Mobile Web - Safari

Desktop

iOS

Android

Just waiting for job3 to pass, it had errored out so I restarted it

Job3 didn't time out this time 🎉
Merging

Congrats, that’s your 5th PR merged! :tada: Do you know about the ContributorPlus role? It’s an opportunity to earn more in the Expensify Open Source community. Keep up the great work - thanks!

:hand: This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.

I believe this PR fixes the performance issue.

🚀 Deployed to staging by https://github.com/alex-mechler in version: 1.2.77-0 🚀

platform
result

🤖 android 🤖
success ✅

🖥 desktop 🖥
failure ❌

🍎 iOS 🍎
success ✅

🕸 web 🕸
success ✅

🚀 Deployed to staging by https://github.com/alex-mechler in version: 1.2.77-0 🚀

platform
result

🤖 android 🤖
success ✅

🖥 desktop 🖥
success ✅

🍎 iOS 🍎
success ✅

🕸 web 🕸
success ✅

🚀 Deployed to production by https://github.com/yuwenmemon in version: 1.2.77-4 🚀

platform
result

🤖 android 🤖
success ✅

🖥 desktop 🖥
success ✅

🍎 iOS 🍎
success ✅

🕸 web 🕸
success ✅


Purpose of ingress-shaping-is-avail and egress-shaping-is-avail not clear

The MacInterfaceCapability class contains the ingress-shaping-is-avail and egress-shaping-is-avail attributes which do not seem to be related to some configuration. The MacInterfaceConfiguration class does contain neither shaping parameters nor references to shaping profiles.
Are the attributes mentioned above at the right place?

MacInterfaceCapability::ingressShapingIsAvail
MacInterfaceCapability::egressShapingIsAvail
are obsolete and shall be removed from the modeling.

Corrected in UML and YANG (e.g. MacInterface_1.0.0-tsp.200123.1415+yang.4).

Corrected in UML and YANG (e.g. MacInterface_1.0.0-tsp.200123.1415+yang.4).


Add SBUS support for controls

Hi,
In order to use the sololink with a wider variety of boards, I think it would be cool to have the possibility to output the rc channels through SBus instead of DSM.
Obviously that would require an external inverter...
If someone has the skills/wants to do that... I'd be willing to pay for that feature if necessary.
thank you

As far as I can tell the DSM is the only thing holding back sololink (NOT artoo) from been a general purpose control link. I am currently building from source but the plan is to implement some sort of toggle to change from DSM to PPM to maybe SBus. PPM is something I will  implement first. The easy way around this would be to use an arduino to convert DSM to SBus. Take a look: https://github.com/simondlevy/SpektrumDSM

this is not the place for feature-requests, this is for bugs/faults/errors.


[Event Request] Page 6510 - Item Tracking Lines - OnDeleteRecordOnBeforeTempItemTrackLineDelete

Dear Support,
We would like to add a new event OnDeleteRecordOnBeforeTempItemTrackLineDelete in the following trigger using the IsHandled pattern.
This would allow us to further customize the code and migrate existing customizations.
trigger OnDeleteRecord(): Boolean
var
    TrackingSpec: Record "Tracking Specification";
    WMSManagement: Codeunit "WMS Management";
    AlreadyDeleted: Boolean;
    IsHandled: Boolean; //New Code --++
begin
    OnBeforeDeleteRecord(Rec);

    TrackingSpec."Item No." := Rec."Item No.";
    TrackingSpec."Location Code" := Rec."Location Code";
    TrackingSpec."Source Type" := Rec."Source Type";
    TrackingSpec."Source Subtype" := Rec."Source Subtype";
    WMSManagement.CheckItemTrackingChange(TrackingSpec, Rec);

    OnDeleteRecordOnAfterWMSCheckTrackingChange(TrackingSpec, Rec);
    //New Code --
    IsHandled := false;
    OnDeleteRecordOnBeforeTempItemTrackLineDelete(Rec, xRec, DeleteIsBlocked, CurrentSignFactor, SourceQuantityArray[1] < 0, IsHandled);
    if not IsHandled then
    //New Code ++
        if not DeleteIsBlocked then begin
            AlreadyDeleted := TempItemTrackLineDelete.Get(Rec."Entry No.");
            TempItemTrackLineDelete.TransferFields(Rec);
            Rec.Delete(true);

            if not AlreadyDeleted then
                TempItemTrackLineDelete.Insert();
            ItemTrackingDataCollection.UpdateTrackingDataSetWithChange(
              TempItemTrackLineDelete, CurrentSignFactor * SourceQuantityArray[1] < 0, CurrentSignFactor, 2);
            if TempItemTrackLineInsert.Get(Rec."Entry No.") then
                TempItemTrackLineInsert.Delete();
            if TempItemTrackLineModify.Get(Rec."Entry No.") then
                TempItemTrackLineModify.Delete();
        end;
    CalculateSums();

    exit(false);
end;

Event Signature:
    [IntegrationEvent(false, false)]
    local procedure OnDeleteRecordOnBeforeTempItemTrackLineDelete(TrackingSpecification: Record "Tracking Specification"; xTrackingSpecification: Record "Tracking Specification"; DeleteIsBlocked: Boolean, CurrentSignFactor: Integer; LineIsDemand: Boolean; var IsHandled: Boolean)
    begin
    end;

Thanks for reporting this. We agree, and we’ll publish a fix asap, either in an update for the current version or in the next major release. Please do not reply to this, as we do not monitor closed issues. If you have follow-up questions or requests, please create a new issue where you reference this one.
Build ID: 10836.


Amount validation is requested on Connect with Plaid after trying to add BA manually

If you haven’t already, check out our contributing guidelines for onboarding and email<EMAIL_ADDRESS>to request to join our Slack channel!

Version Number: 1.4.48-0
Reproducible in staging?: y
Reproducible in production?: couldn't check
If this was caught during regression testing, add the test name, ID and link from TestRail: n/a
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL:
Issue reported by: Applause internal team
Slack conversation:
Action Performed:
Pre-requisite: user must be logged in and have created a workspace.

Go to Workspace > Bank account.
Select Connect manually.
Initiate the add bank account flow with the testing credentials until you reach the "Validate your bank account" page.
Click on the back arrow.
Click on "Start over".
Select Connect online with Plaid.
Select Regions bank and use the testing credentials.
Confirm the account.
Verify you land on "Validate your bank account" page.

Expected Result:
The user should be able to continue with the add BA flow (enter Personal info, Company info, Beneficial owners).
Actual Result:
The user is taken to "Validate your bank account" page after confirming the account.
Workaround:
unknown
Platforms:

Which of our officially supported platforms is this issue occurring on?

[ ] Android: Native
[ ] Android: mWeb Chrome
[x] iOS: Native
[ ] iOS: mWeb Safari
[x] MacOS: Chrome / Safari
[ ] MacOS: Desktop

Screenshots/Videos
Add any screenshot/video evidence
https://github.com/Expensify/App/assets/38435837/365b89bb-0d90-4b8d-b6b1-01db57d842d7

View all open jobs on GitHub

@techievivek FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors.

Related? https://github.com/Expensify/App/issues/32356

It's a feature, not a bug.
Disconnecting from a policy when in PENDING or OPEN state doesn't remove it from the account anymore. It just detaches it from the policy. So, when re-entering the same bank account, you don't need to redo it all. It just attaches the existing one.
If you actually delete it from your account from your personal settings, you'll have to redo it all, as before.

@m-natarajan seeing as this is a feature not a bug, do you agree the TR steps need to be updated to avoid this being reported again?


Added "facts about quantum computing"

[ x] I have read freeCodeCamp's contribution guidelines.
[ x] My pull request has a descriptive title (not a vague title like Update index.md)
[ x] My pull request targets the master branch of freeCodeCamp.
[x ] None of my changes are plagiarized from another source without proper attribution.
[ x] My article does not contain shortened URLs or affiliate links.

If your pull request closes a GitHub issue, replace the XXXXX below with the issue number.
Closes #XXXXX

Hi @laveesh-gupta
As there has been no response from your end for a while, we are closing this PR.
Feel free to request this PR to be reopened or create a new PR, if you still wish to make the changes you originally added plus any additional change requests asked of you.  Also, remember to update your fork, so you have the latest version of master in case it has changed significantly.
Happy Coding!