Notify user when a provider is not active.

User Story
As a user I would like to be notified when one of my providers is not active.  They become inactive when the cloud provider check fails.  This check is currently done when a provider is created or edited.
Once Platform Sources integration is complete it can also be set when the platform polls cost management for status for a source (https://github.com/project-koku/koku/issues/1309).
When active=false it means that the the cloud service provider's configuration is incorrect for what cost management is expecting and the user would no longer be seeing any updates from the account.
Impacts
API, UI, Docs
Assumptions

This is first a spike research story just to give the frontend situational awareness of the feature to alert the user within cost management that a source is misconfigured.  More UX is needed as well but it would be good to get the technical ball rolling to see what's feasible and to make further backend issues if needed.
https://github.com/project-koku/koku/pull/1351 is merged and active flag is on the provider response object.
A frontend engineer could see how feasible using the active flag is from a provider HTTP response, but further backend changes could be done if necessary.  For example create a query parameter for ?active=false to return a list of all inactive providers.  If the response is non-zero we could provide the link to the platform sources status page.

UI Details
More detailed error status will be stored in Platform Sources and maybe we could just link to that page?
Acceptance Criteria

[ ] Frontend engineer understands the situation and has provided some feedback as to whether or not the existing active flag is sufficient to be able to show a warning icon/link to the platform sources status page showing the account in question.

Each time a page is rendered, we ensure there are providers, and display an empty state if none exists.
If an active flag is provided via the response, we could do something with that. Although, it's not clear how we would show this information in the UI?
I would prefer not to make a separate API call (e.g., with the ?active=false query param) to return a list of inactive providers? I believe we already have a list of providers.

Sorry @dlabrecq.  Missed this reply!  Now that application status is starting to appear in the platform sources UI we could start making traction on this.  Agreed that avoiding separate API calls for this is preferred.  I think the UI would change if there is a single provider with active=false.  From the cost mgmt UI we don't care about which provider it is we just need to signal to the user and provide a link to the platform sources list page so they can see the status and error message of the Unavailable source.
@nlcwong any ideas on how this notification could be shown in the current or revamped POC mocks?
@rvsia How feasible would it be to add a filter by application-type?  I see we can already filter by Source-type.  Having a link with an application-type filter query parameter would work well for this.  User clicks the bad source alert icon from cost and it links to platform sources page with that application=cost-mgmt filter query parameter.

@dccurtis it’s not currently possible to filter by application type, API does not support this feature.

@dccurtis it’s not currently possible to filter by application type, API does not support this feature.

@rvsia how can we get this type of feature supported in the API?

@nlcwong I totally agree with you, I wanted this feature a few months ago - we created a JIRA task (see https://projects.engineering.redhat.com/browse/TPINVTRY-706). However, there is no news about it since then, so the only thing we can do is to talk with Sources backend team and prioritize it.

@gtanzillo could we prioritize https://projects.engineering.redhat.com/browse/TPINVTRY-706 to support this functionality?
This will be particularly useful when there are multiple applications on a source.  Today you have to read the popover text of the source status icon and figure out what applications are in trouble by reading all of the text.  The icon graphical state isn't useful to know which application is in trouble.
With this filter I would imagine the UI could show only the status for that particular application, so the icon state would graphically signal to the user what the application status is.  They can click on the status icon to see only a single error message for the filtered application.

Created Jira epic https://issues.redhat.com/browse/COST-56


use official tree-sitter-ruby instead of fork

I think I would prefer not pinning a particular revision. version = ... might be ineffective (docs aren't clear on it), but it gives us an indication of what lib version we want to use. If a build fails, we can pin the last working revision then. Otherwise, I support the switch to upstream.


Reusable subDAG components

 Issue by elijahbenizzy
Saturday Mar 12, 2022 at 00:24 GMT
Originally opened as https://github.com/stitchfix/hamilton/issues/86

Is your feature request related to a problem? Please describe.
Reusing functions, helpers, etc... are all nice and good. However, sometimes you want to be able to reuse large subcomponents in the DAG.
Describe the solution you'd like
Two idea:

Use the Driver to stich bigger DAGs together
Two decorator (still need to fully think this through)

This uses prefixes, but some actual namespace notion could be nice here.
@hamilton.subdag_split(
    inputs={
        'subdag_1' : {'source' : 'source_for_dag_1'}, # subdag 1 gets its source from a different place than subdag 1
        'subdag_2 : {'source' : 'source_for_dag_2'}}}
def data(source: str) -> pd.DataFrame:
    return _load_data(source)

def foo(data) -> pd.Series:
    return _do_something(data)

@hamilton.subdag_join(subdag='subdag_1')
def process_subdag_1(foo) -> pd.Series:
    return _process_some_way(foo)

The framework would then compile this in a fancy way -- ensuring that every node between the splits and the joins is turned into one for each subdag, under a separate namespace. TBD on how to access it.
Describe alternatives you've considered
Not allowing this -- I don't have a concrete use-case blocking for anyone but we have observed one at Stitch Fix.
Additional context
Thinking ahead here.

 Comment by elijahbenizzy
Sunday Sep 18, 2022 at 04:45 GMT

OK, starting to think about this one. This is not something we want yet, but it is something we should plan for. Going to propose the following spec, I think this is much cleaner. See code example:
# marketing_module.py
def signups(raw_signup_data: pd.Series, business_line: str) -> pd.Series:
    ...

def marketing_spend(all_marketing_data: pd.Series, business_line: str) -> pd.Series:
    ...

def acquisition_cost(signups: pd.Series, marketing_spend: pd.Series) -> pd.Series:
    ...

def acquisition_cost_smoothed() -> pd.Series:
    ...

# dataflow.py
import marketing_module
@ubernode( # For lack of a better name...
    load_from=marketing_module, # modules or list of functions, cause why not?
    inject={'business_line' : value('womens')}, #this parameter gets injected in
    namespace='womens', # all nodes are named `womens.<node>`
    extract={'acquisition_cost' : 'acquisition_cost_womens', 'acquisition_cost_smoothed' : 'acquisition_cost_smoothed_womens'}
)
# Not sure what this function should look like. Idea would be to error out if you don't include all sources in the subDAG, then print out the signature for them to copy/paste.
def acquisition_data_womens(
    raw_signup_data: pd.Series,
    all_marketing_data: pd.Series) -> MultiNodeOutput(acquisition_cost_smoothed_womens=pd.Series, acquisition_cost_womens=pd.Series):
    pass

Motivation
Hamilton is a new paradigm for writing dataflow code. Nodes in a dataflow map 1:1 with functions, exactly. As opposed to a system in which some lower-level DSL (E.G. python) is used to construct static dataflows, we specifically trade off verbosity (of which Hamilton has plenty) for readability, debuggability, ease of development, etc.. We consider this to be strictly good, but it does not work for all cases, namely that of repetition and configuration (corresponding to for and if/else in a more traditional paradigm). Thus we've introduced a few decorators (parameterize and config.when) to allow for greater flexibility while preserving the benefits of Hamilton. These tend to break down, however, when one wants to apply for-loops over higher-level constructs in the DAG. For example, one might have a set of metrics that they wish to run on both the mens and womens business line. There are a few currently feasible approaches, each of which has its trade-offs:

Run separate drivers: works if materialization should be kept separate and these datums aren't joined as part of the dataflow.

Run a node that instantiates a driver and runs that (yikes)

However, none of these solve the problem of actually repeating in the same DAG. This proposal does that.
Terminology
namespace A way to differentiate two nodes with the same name. E.G. with node baz and namespaces foo and bar, we have nodes foo.bar and foo.baz. This exists solely in conjunction with new subdags.
subdag A subset of the DAG that is introduced by parameterizing something.
API
Calling the decorater uberdag, although we need a better name. It takes in the following:

A list of functions or a module (load_from above)
Parameters/config to inject (inject above). No reason it can't be the same as parameterized
a namespace (namespace above/how to refer to all the intermediate nodes)
Output mapping (extract_outputs) above, referring to the nodes from the subdag the user wishes to extract, and how to name them.
Maybe a config if we're feeling fancy -- this allows us to configure the subDAG.

Then we have the function we decorate. Note that this is actually just gravy (we don't need it with the decorator), but let's make it show something to have it be readable:

Input parameters correspond to all non-injected inputs/types from the subDAG.
Output type is a MultiNodeOutput or something like that. Basically a typeddict with all the outputs.

This is a pain, so we have an error message when its not correct that prints the correct values.
Implementation
So this is easy enough. All we do is:

If module is passed in, resolve that to functions
if we already did (1) or functions are passed in, resolve the functions to nodes, using our config
change those nodes to have the namespaced name so they can coexist
Add identity nodes to ensure outputs have the right name
Validate, suggest function signature
Return all created nodes.

Might see how I feel and prototype this soon -- it'll be <100 LOC. And solves this problem in an extremely comprehensive, powerful, and readable way (I think).

 Comment by elijahbenizzy
Saturday Oct 29, 2022 at 17:18 GMT

Alright -- prototype is here: https://github.com/stitchfix/hamilton/pull/199. I want to get this out soon for power users. Need to rethink parts of the API.

 Comment by skrawcz
Sunday Jan 29, 2023 at 07:05 GMT

Leaving some API thoughts here:

One could just use Hamilton within hamilton.

@extract_columns(*["video_title", "title_length", "title_word_count"])
def load_df(path: str) -> pd.DataFrame:
    _df = pd.read_csv(path)
    dr = driver.Driver(_df.to_dict(orient="series"), inner_transforms)
    df = dr.execute(["video_title", "title_length", "title_word_count"])
    return df

We could also constrain a decorator that effectively does the above two lines of code ^

@extract_columns(*["video_title", "title_length", "title_word_count"])
@inner_execute(inner_transforms, outputs=["video_title", "title_length", "title_word_count"])
def load_df(path: str) -> pd.DataFrame:
    _df = pd.read_csv(path)
    return _df

With (1) it would be very opaque.
With (2) we would have some visibility into creating a single DAG -- with a best guess of determining inputs/no static guarantee with "inner" DAG (it would be a runtime check). Would require some internal work though.

 Comment by skrawcz
Sunday Jan 29, 2023 at 07:17 GMT

@elijahbenizzy can you put the current API in here too?

 Comment by elijahbenizzy
Sunday Jan 29, 2023 at 18:49 GMT

Leaving some API thoughts here:

One could just use Hamilton within hamilton.

@extract_columns(*["video_title", "title_length", "title_word_count"])
def load_df(path: str) -> pd.DataFrame:
    _df = pd.read_csv(path)
    dr = driver.Driver(_df.to_dict(orient="series"), inner_transforms)
    df = dr.execute(["video_title", "title_length", "title_word_count"])
    return df

We could also constrain a decorator that effectively does the above two lines of code ^

@extract_columns(*["video_title", "title_length", "title_word_count"])
@inner_execute(inner_transforms, outputs=["video_title", "title_length", "title_word_count"])
def load_df(path: str) -> pd.DataFrame:
    _df = pd.read_csv(path)
    return _df

With (1) it would be very opaque. With (2) we would have some visibility into creating a single DAG -- with a best guess of determining inputs/no static guarantee with "inner" DAG (it would be a runtime check). Would require some internal work though.

Not much of a difference between @inner_execute and what we already with `reuse_functions. It just joins it. So sure, if you have a set of columns producing a dataframe it could be syntactic sugar on top. IMO Running Hamilton within Hamilton is a bit of an anti-pattern. No lineage guarentees, no way to abstract execution, encapsulation is busted...

 Comment by elijahbenizzy
Sunday Jan 29, 2023 at 18:50 GMT

Re: the current API -- see this: https://github.com/stitchfix/hamilton/blob/main/decorators.md#reuse_functions.

 Comment by skrawcz
Friday Feb 17, 2023 at 22:30 GMT

maybe this is a better API:

@parameterized_subdag(sub_dag, # functions or modules
                      config={"loader": "source_3"},
                      inputs={"source_3_path": source("source_3_path")})
def source_3_combined_data(combined_data: pd.DataFrame, something_not_in_inner: pd.Series) -> pd.DataFrame:
    # function name as namespace
    return combined_data

This is now complete and released! See https://github.com/stitchfix/hamilton/issues/86 (from old repo)


All drafts show up in "My Drafts" when viewing Kumite logged out

Looks like its either a caching issue or its just showing everyone's drafts.
See https://www.codewars.com/kumite/575ac6edae163f636d0004e1?sel=575b9fe05214bc5e15000141

Closing old issue. I don't see "My Drafts" in linked page.


gestureRecognizer remains undefined.

Have I written custom code (as opposed to using a stock example script provided in MediaPipe)
Yes
OS Platform and Distribution
MacBook Pro M2, Ventura 13.0 (22A380)
MediaPipe Tasks SDK version
JavaScript / Web
Task name (e.g. Image classification, Gesture recognition etc.)
Gesture recognition
Programming Language and version (e.g. C++, Python, Java)
JavaScript (ReactJS)
Describe the actual behavior
gestureRecognizer does not create an instance of the GestureRecognizer class and remains undefined, therefore not allowing predictions for landmarks on the video.

UPDATE: Comments.

Describe the expected behaviour
gestureRecognizer variable is properly defined in the useEffect, allowing normal functionality. This has worked previously, and yet now seems to not work despite no apparent changes ... unsure why.

Standalone code/steps you may have used to try to get what you need
https://github.com/MJKingsbury/Theresynth_JS/blob/main/src/Video.js

A link to the code trying to utilise MediaPipe.

Other info / Complete Logs
ERROR UPDATED IN COMMENTS.

console-export-2023-4-1_15-46-8.txt
This is the output from the console, showing the filesetresolver working correctly, and the gesturerecognizer remaining undefined.

EDIT: After some modifications to the code linked above, the gestureRecognizer appears to now be correctly initializing, however no gestures are being returned in the results. I have pushed the now modified code to the repo. Sometimes when I run the code, it doesn't throw errors, however occasionally I receive the following error:
Uncaught (in promise) Error: WaitUntilIdle failed: $CalculatorGraph::Run() failed in Run:
Calculator::Process() for node "mediapipe_tasks_vision_gesture_recognizer_gesturerecognizergraph__mediapipe_tasks_vision_hand_landmarker_handlandmarkergraph__mediapipe_tasks_vision_hand_detector_handdetectorgraph__mediapipe_tasks_components_processors_imagepreprocessinggraph__ImageToTensorCalculator" failed: RET_CHECK failure (third_party/mediapipe/calculators/tensor/image_to_tensor_utils.cc:56) roi->width > 0 && roi->height > 0 ROI width and height must be > 0.; WaitUntilIdle failed
handleErrors vision_bundle.js:1
finishProcessing vision_bundle.js:1
process vision_bundle.js:1
processVideoData vision_bundle.js:1
recognizeForVideo vision_bundle.js:1
predictions Video.js:39
predictions Video.js:56
predictions Video.js:56
predictions Video.js:56
predictions Video.js:56
predictions Video.js:56
predictions Video.js:56
predictions Video.js:56
predictions Video.js:56
predictions Video.js:56
predictions Video.js:56
predictions Video.js:56
predictions Video.js:56
predictions Video.js:56
predictions Video.js:56
predictions Video.js:56
predictions Video.js:56
predictions Video.js:56
predictions Video.js:56
predictions Video.js:56
predictions Video.js:56
predictions Video.js:56
predictions Video.js:56
predictions Video.js:56
predictions Video.js:56
predictions Video.js:56
predictions Video.js:56
predictions Video.js:56
predictions Video.js:56
predictions Video.js:56
predictions Video.js:56
predictions Video.js:56
predictions Video.js:56
predictions Video.js:56
predictions Video.js:56
predictions Video.js:56
predictions Video.js:56
predictions Video.js:56
predictions Video.js:56
predictions Video.js:56
predictions Video.js:56
predictions Video.js:56
predictions Video.js:56
predictions Video.js:56
predictions Video.js:56
predictions Video.js:56
predictions Video.js:56
predictions Video.js:56
predictions Video.js:56
predictions Video.js:56
predictions Video.js:56
predictions Video.js:56
No landmarks are shown on screen during testing. Any help would be appreciated.

Hello @MJKingsbury,
Would you please let us know the version you are using, Is older version of gestureRecognizer being used here? if, We can get the information about version of model used that will be more helpful to understand the issue better. Thank you

Hi @schmidt-sebastian,
Could you please look into this issue? Thank you

@kuaashish I'm looking to have this project completed ASAP, is there an older version of gestureRecognizer I can use for the time being that allows me to capture hand depth data, positioning and also read specific gestures?

@schmidt-sebastian Hi, the repo is linked here: https://github.com/MJKingsbury/Theresynth_JS
Does this provide all the necessary files? I'm not sure what else is needed re: build instructions.

Errors from updated code:
I0000 00:00:1681570183.358000       1 hand_gesture_recognizer_graph.cc:256] Custom gesture classifier is not defined. vision_wasm_internal.js:1103:8
I0000 00:00:1681570183.375000       1 gl_context_webgl.cc:151] Successfully created a WebGL context with major version 3 and handle 1 vision_wasm_internal.js:1103:8
I0000 00:00:1681570183.376000       1 gl_context.cc:359] GL version: 3.0 (OpenGL ES 3.0 (WebGL 2.0)) vision_wasm_internal.js:1103:8
W0000 00:00:1681570183.376000       1 gl_context.cc:1000] OpenGL error checking is disabled vision_wasm_internal.js:1103:8
Graph successfully started running. vision_wasm_internal.js:1087:8
Hi! Video.js:42
predict Video.js:55
Hi! Video.js:42
predict Video.js:55
Uncaught (in promise) TypeError: WebGL2RenderingContext.texImage2D: Argument 6 is not valid for any of the 6-argument overloads.
bindTextureToStream vision_bundle.js:1
node_modules bundle.js:47897
wrapStringPtr vision_bundle.js:1
addGpuBufferAsImageToStream vision_bundle.js:1
process vision_bundle.js:1
processVideoData vision_bundle.js:1
recognizeForVideo vision_bundle.js:1
predictions Video.js:57
Video Video.js:43
React 8
workLoop scheduler.development.js:266
flushWork scheduler.development.js:239
performWorkUntilDeadline scheduler.development.js:533
js scheduler.development.js:571
js scheduler.development.js:633
factory react refresh:6
Webpack 24
vision_bundle.js:1
Uncaught (in promise) TypeError: WebGL2RenderingContext.texImage2D: Argument 6 is not valid for any of the 6-argument overloads.
bindTextureToStream vision_bundle.js:1
node_modules bundle.js:47897
wrapStringPtr vision_bundle.js:1
addGpuBufferAsImageToStream vision_bundle.js:1
process vision_bundle.js:1
processVideoData vision_bundle.js:1
recognizeForVideo vision_bundle.js:1
predictions Video.js:57
Video Video.js:43
React 8
workLoop scheduler.development.js:266
flushWork scheduler.development.js:239
performWorkUntilDeadline scheduler.development.js:533
js scheduler.development.js:571
js scheduler.development.js:633
factory react refresh:6
Webpack 24
vision_bundle.js:1
I0000 00:00:1681570183.426000       1 hand_gesture_recognizer_graph.cc:256] Custom gesture classifier is not defined. vision_wasm_internal.js:1103:8
I0000 00:00:1681570183.443000       1 gl_context_webgl.cc:151] Successfully created a WebGL context with major version 3 and handle 1 vision_wasm_internal.js:1103:8
I0000 00:00:1681570183.443000       1 gl_context.cc:359] GL version: 3.0 (OpenGL ES 3.0 (WebGL 2.0)) vision_wasm_internal.js:1103:8
W0000 00:00:1681570183.444000       1 gl_context.cc:1000] OpenGL error checking is disabled vision_wasm_internal.js:1103:8
Graph successfully started running. vision_wasm_internal.js:1087:8
Hi! Video.js:42
predict Video.js:55
INFO: Created TensorFlow Lite XNNPACK delegate for CPU. vision_wasm_internal.js:1103:8
E0000 00:00:1681570183.459000       1 image_to_tensor_utils.cc:56] INTERNAL: RET_CHECK failure (third_party/mediapipe/calculators/tensor/image_to_tensor_utils.cc:56) roi->width > 0 && roi->height > 0 ROI width and height must be > 0. vision_wasm_internal.js:1103:8
Stack trace: vision_wasm_internal.js:1103:8
E0000 00:00:1681570183.460000       1 calculator_graph.cc:851] INTERNAL: CalculatorGraph::Run() failed in Run: vision_wasm_internal.js:1103:8
Calculator::Process() for node "mediapipe_tasks_vision_gesture_recognizer_gesturerecognizergraph__mediapipe_tasks_vision_hand_landmarker_handlandmarkergraph__mediapipe_tasks_vision_hand_detector_handdetectorgraph__mediapipe_tasks_components_processors_imagepreprocessinggraph__ImageToTensorCalculator" failed: RET_CHECK failure (third_party/mediapipe/calculators/tensor/image_to_tensor_utils.cc:56) roi->width > 0 && roi->height > 0 ROI width and height must be > 0. [type.googleapis.com/mediapipe.StatusList='\n\xd7\x03\x08\r\x12\xd2\x03\x43\x61lculator::Process() for node "mediapipe_tasks_vision_gesture_recognizer_gesturerecognizergraph__mediapipe_tasks_vision_hand_landmarker_handlandmarkergraph__mediapipe_tasks_vision_hand_detector_handdetectorgraph__mediapipe_tasks_components_processors_imagepreprocessinggraph__ImageToTensorCalculator" failed: RET_CHECK failure (third_party/mediapipe/calculators/tensor/image_to_tensor_utils.cc:56) roi->width > 0 && roi->height > 0 ROI width and height must be > 0.'] vision_wasm_internal.js:1103:8
=== Source Location Trace: === vision_wasm_internal.js:1103:8
third_party/mediapipe/calculators/tensor/image_to_tensor_utils.cc:56 vision_wasm_internal.js:1103:8
third_party/mediapipe/calculators/tensor/image_to_tensor_calculator.cc:223 vision_wasm_internal.js:1103:8
third_party/mediapipe/framework/calculator_node.cc:948 vision_wasm_internal.js:1103:8
E0000 00:00:1681570183.460000       1 calculator_graph.cc:851] INTERNAL: CalculatorGraph::Run() failed in Run: vision_wasm_internal.js:1103:8
Calculator::Process() for node "mediapipe_tasks_vision_gesture_recognizer_gesturerecognizergraph__mediapipe_tasks_vision_hand_landmarker_handlandmarkergraph__mediapipe_tasks_vision_hand_detector_handdetectorgraph__mediapipe_tasks_components_processors_imagepreprocessinggraph__ImageToTensorCalculator" failed: RET_CHECK failure (third_party/mediapipe/calculators/tensor/image_to_tensor_utils.cc:56) roi->width > 0 && roi->height > 0 ROI width and height must be > 0. [type.googleapis.com/mediapipe.StatusList='\n\xd7\x03\x08\r\x12\xd2\x03\x43\x61lculator::Process() for node "mediapipe_tasks_vision_gesture_recognizer_gesturerecognizergraph__mediapipe_tasks_vision_hand_landmarker_handlandmarkergraph__mediapipe_tasks_vision_hand_detector_handdetectorgraph__mediapipe_tasks_components_processors_imagepreprocessinggraph__ImageToTensorCalculator" failed: RET_CHECK failure (third_party/mediapipe/calculators/tensor/image_to_tensor_utils.cc:56) roi->width > 0 && roi->height > 0 ROI width and height must be > 0.'] vision_wasm_internal.js:1103:8
=== Source Location Trace: === vision_wasm_internal.js:1103:8
third_party/mediapipe/calculators/tensor/image_to_tensor_utils.cc:56 vision_wasm_internal.js:1103:8
third_party/mediapipe/calculators/tensor/image_to_tensor_calculator.cc:223 vision_wasm_internal.js:1103:8
third_party/mediapipe/framework/calculator_node.cc:948 vision_wasm_internal.js:1103:8
E0000 00:00:1681570183.460000       1 calculator_graph.cc:851] INTERNAL: CalculatorGraph::Run() failed in Run: vision_wasm_internal.js:1103:8
Calculator::Process() for node "mediapipe_tasks_vision_gesture_recognizer_gesturerecognizergraph__mediapipe_tasks_vision_hand_landmarker_handlandmarkergraph__mediapipe_tasks_vision_hand_detector_handdetectorgraph__mediapipe_tasks_components_processors_imagepreprocessinggraph__ImageToTensorCalculator" failed: RET_CHECK failure (third_party/mediapipe/calculators/tensor/image_to_tensor_utils.cc:56) roi->width > 0 && roi->height > 0 ROI width and height must be > 0. [type.googleapis.com/mediapipe.StatusList='\n\xd7\x03\x08\r\x12\xd2\x03\x43\x61lculator::Process() for node "mediapipe_tasks_vision_gesture_recognizer_gesturerecognizergraph__mediapipe_tasks_vision_hand_landmarker_handlandmarkergraph__mediapipe_tasks_vision_hand_detector_handdetectorgraph__mediapipe_tasks_components_processors_imagepreprocessinggraph__ImageToTensorCalculator" failed: RET_CHECK failure (third_party/mediapipe/calculators/tensor/image_to_tensor_utils.cc:56) roi->width > 0 && roi->height > 0 ROI width and height must be > 0.'] vision_wasm_internal.js:1103:8
=== Source Location Trace: === vision_wasm_internal.js:1103:8
third_party/mediapipe/calculators/tensor/image_to_tensor_utils.cc:56 vision_wasm_internal.js:1103:8
third_party/mediapipe/calculators/tensor/image_to_tensor_calculator.cc:223 vision_wasm_internal.js:1103:8
third_party/mediapipe/framework/calculator_node.cc:948 vision_wasm_internal.js:1103:8
Hi! Video.js:42
predict Video.js:55
E0000 00:00:1681570183.461000       1 gl_graph_runner_internal_image.cc:68] Adding Image to stream image_in was not ok: INTERNAL: Graph has errors: vision_wasm_internal.js:1103:8
Calculator::Process() for node "mediapipe_tasks_vision_gesture_recognizer_gesturerecognizergraph__mediapipe_tasks_vision_hand_landmarker_handlandmarkergraph__mediapipe_tasks_vision_hand_detector_handdetectorgraph__mediapipe_tasks_components_processors_imagepreprocessinggraph__ImageToTensorCalculator" failed: RET_CHECK failure (third_party/mediapipe/calculators/tensor/image_to_tensor_utils.cc:56) roi->width > 0 && roi->height > 0 ROI width and height must be > 0. [type.googleapis.com/mediapipe.StatusList='\n\xd7\x03\x08\r\x12\xd2\x03\x43\x61lculator::Process() for node "mediapipe_tasks_vision_gesture_recognizer_gesturerecognizergraph__mediapipe_tasks_vision_hand_landmarker_handlandmarkergraph__mediapipe_tasks_vision_hand_detector_handdetectorgraph__mediapipe_tasks_components_processors_imagepreprocessinggraph__ImageToTensorCalculator" failed: RET_CHECK failure (third_party/mediapipe/calculators/tensor/image_to_tensor_utils.cc:56) roi->width > 0 && roi->height > 0 ROI width and height must be > 0.'] vision_wasm_internal.js:1103:8
=== Source Location Trace: === vision_wasm_internal.js:1103:8
third_party/mediapipe/calculators/tensor/image_to_tensor_utils.cc:56 vision_wasm_internal.js:1103:8
third_party/mediapipe/calculators/tensor/image_to_tensor_calculator.cc:223 vision_wasm_internal.js:1103:8
third_party/mediapipe/framework/calculator_node.cc:948 vision_wasm_internal.js:1103:8
E0000 00:00:1681570183.462000       1 calculator_graph.cc:851] INTERNAL: CalculatorGraph::Run() failed in Run: vision_wasm_internal.js:1103:8
Calculator::Process() for node "mediapipe_tasks_vision_gesture_recognizer_gesturerecognizergraph__mediapipe_tasks_vision_hand_landmarker_handlandmarkergraph__mediapipe_tasks_vision_hand_detector_handdetectorgraph__mediapipe_tasks_components_processors_imagepreprocessinggraph__ImageToTensorCalculator" failed: RET_CHECK failure (third_party/mediapipe/calculators/tensor/image_to_tensor_utils.cc:56) roi->width > 0 && roi->height > 0 ROI width and height must be > 0. [type.googleapis.com/mediapipe.StatusList='\n\xd7\x03\x08\r\x12\xd2\x03\x43\x61lculator::Process() for node "mediapipe_tasks_vision_gesture_recognizer_gesturerecognizergraph__mediapipe_tasks_vision_hand_landmarker_handlandmarkergraph__mediapipe_tasks_vision_hand_detector_handdetectorgraph__mediapipe_tasks_components_processors_imagepreprocessinggraph__ImageToTensorCalculator" failed: RET_CHECK failure (third_party/mediapipe/calculators/tensor/image_to_tensor_utils.cc:56) roi->width > 0 && roi->height > 0 ROI width and height must be > 0.'] vision_wasm_internal.js:1103:8
=== Source Location Trace: === vision_wasm_internal.js:1103:8
third_party/mediapipe/calculators/tensor/image_to_tensor_utils.cc:56 vision_wasm_internal.js:1103:8
third_party/mediapipe/calculators/tensor/image_to_tensor_calculator.cc:223 vision_wasm_internal.js:1103:8
third_party/mediapipe/framework/calculator_node.cc:948 vision_wasm_internal.js:1103:8
E0000 00:00:1681570183.462000       1 calculator_graph.cc:851] INTERNAL: CalculatorGraph::Run() failed in Run: vision_wasm_internal.js:1103:8
Calculator::Process() for node "mediapipe_tasks_vision_gesture_recognizer_gesturerecognizergraph__mediapipe_tasks_vision_hand_landmarker_handlandmarkergraph__mediapipe_tasks_vision_hand_detector_handdetectorgraph__mediapipe_tasks_components_processors_imagepreprocessinggraph__ImageToTensorCalculator" failed: RET_CHECK failure (third_party/mediapipe/calculators/tensor/image_to_tensor_utils.cc:56) roi->width > 0 && roi->height > 0 ROI width and height must be > 0. [type.googleapis.com/mediapipe.StatusList='\n\xd7\x03\x08\r\x12\xd2\x03\x43\x61lculator::Process() for node "mediapipe_tasks_vision_gesture_recognizer_gesturerecognizergraph__mediapipe_tasks_vision_hand_landmarker_handlandmarkergraph__mediapipe_tasks_vision_hand_detector_handdetectorgraph__mediapipe_tasks_components_processors_imagepreprocessinggraph__ImageToTensorCalculator" failed: RET_CHECK failure (third_party/mediapipe/calculators/tensor/image_to_tensor_utils.cc:56) roi->width > 0 && roi->height > 0 ROI width and height must be > 0.'] vision_wasm_internal.js:1103:8
Uncaught (in promise) Error: Encountered multiple errors: Adding proto packet of type mediapipe.NormalizedRect to stream norm_rect was not ok: $Graph has errors:
Calculator::Process() for node "mediapipe_tasks_vision_gesture_recognizer_gesturerecognizergraph__mediapipe_tasks_vision_hand_landmarker_handlandmarkergraph__mediapipe_tasks_vision_hand_detector_handdetectorgraph__mediapipe_tasks_components_processors_imagepreprocessinggraph__ImageToTensorCalculator" failed: RET_CHECK failure (third_party/mediapipe/calculators/tensor/image_to_tensor_utils.cc:56) roi->width > 0 && roi->height > 0 ROI width and height must be > 0., WaitUntilIdle failed: $CalculatorGraph::Run() failed in Run:
Calculator::Process() for node "mediapipe_tasks_vision_gesture_recognizer_gesturerecognizergraph__mediapipe_tasks_vision_hand_landmarker_handlandmarkergraph__mediapipe_tasks_vision_hand_detector_handdetectorgraph__mediapipe_tasks_components_processors_imagepreprocessinggraph__ImageToTensorCalculator" failed: RET_CHECK failure (third_party/mediapipe/calculators/tensor/image_to_tensor_utils.cc:56) roi->width > 0 && roi->height > 0 ROI width and height must be > 0.; WaitUntilIdle failed
handleErrors vision_bundle.js:1
finishProcessing vision_bundle.js:1
process vision_bundle.js:1
processVideoData vision_bundle.js:1
recognizeForVideo vision_bundle.js:1
predictions Video.js:57
Video Video.js:43
React 8
workLoop scheduler.development.js:266
flushWork scheduler.development.js:239
performWorkUntilDeadline scheduler.development.js:533
js scheduler.development.js:571
js scheduler.development.js:633
factory react refresh:6

@schmidt-sebastian @kuaashish Any update on this?

Thanks for the update.

It's kind of late but I can tell this problem is from caching for hot reload when using a router. I was facing the same issue when developing a VueJs app using MediaPie.
I fixed it by clearing gestureRecognizer before unmounting every time, remember to try to clear your event listener as well

function handlerGestureRecognition(){
if (!gestureRecognizer) {
    console.log("gestureRecognizer not Loaded");
    return;
  }
// your code handle gesture recognition from video stream
}

// clear variable before you destroying component
onBeforeUnmount(() => {

  gestureRecognizer = null;
  stopStream();
  const video = document.getElementById(webcamName.value) as HTMLVideoElement;
  video.removeEventListener("loadeddata", predictWebcam);
});`


Is there a way to make ItemComponent active and its parent nodes open at the same time ?

Hi @iannbing, First of all, Thanks for the wonderful library which helped me a lot.
But I am facing lil issue with the openNodes prop. let me show you the code.
`
Hello CodeSandbox
Start editing to see some magic happen!
<TreeMenu
openNodes={["mammal","canidae"]}
activeKey="mammal/canidae/dog"
data={dataInArray}
>
{({ search, items }) => {
return (
<>
<input onChange={(e) => search(e.target.value)} />

{items.map((props) => {
const childrenProps = {
...props,
onClick: () => window.open(props.url)
// style: { color: props.color || "black" }
};
              return <ItemComponent {...childrenProps} />;
            })}
          </ul>
        </>
      );
    }}
  </TreeMenu>
</div>`

Here, I tried to open all the parent nodes till their children, but it is just opening the first parent let's say mammal. also, I m unable to expand(also click) the rest of the parents till dog.

Yeah, It works.
Thanks for making it to my consideration ! @iannbing


Clone some of the component pools into a new registry

I may have found a way to clone specific component pools into a new registry while preserving entity identifiers. sparse_set should only be cloneable if the component is copyable. The following simple test prints 14 14 if Component is copyable and fails to compile with Cannot clone non-copyable component if Component is not copyable.
struct Component {
  int value;

  // Component(Component &&) = default;
  // Component &operator=(Component &&) = default;
  // explicit Component(int value)
  //  : value{value} {}
};

int main() {
  entt::registry<> reg;
  auto e = reg.create();
  reg.assign<Component>(e, 14);
  std::cout << reg.get<Component>(e).value << ' ';
  entt::registry<> cloned = reg.clone<Component>();
  std::cout << cloned.get<Component>(e).value << '\n';
  return 0;
}

Move-only components can still be used within the registry, they just cannot be cloned. CRTP is used to give the sparse_set a clone_to function if the component is_copy_constructible.
@@ -534,6 +534,12 @@
         reverse.clear();
         direct.clear();
     }
+
+    void basic_clone_to(sparse_set<entity_type> *other) {
+        assert(other);
+        other->reverse = reverse;
+        other->direct = direct;
+    }

 private:
     std::vector<entity_type> reverse;
@@ -541,6 +547,25 @@
 };

+template <typename Derived, bool Copyable>
+class clone_base;
+
+template <typename Entity, typename Type>
+class clone_base<sparse_set<Entity, Type>, false> : public sparse_set<Entity> {
+    // no clone
+};
+
+template <typename Entity, typename Type>
+class clone_base<sparse_set<Entity, Type>, true> : public sparse_set<Entity> {
+public:
+    void clone_to(sparse_set<Entity> *other) {
+        assert(other);
+        sparse_set<Entity>::basic_clone_to(other);
+        auto *otherDerived = static_cast<sparse_set<Entity, Type> *>(other);
+        otherDerived->instances = static_cast<sparse_set<Entity, Type> *>(this)->instances;
+    }
+};
+
 /**
  * @brief Extended sparse set implementation.
  *
@@ -564,7 +589,10 @@
  * @tparam Type Type of objects assigned to the entities.
  */
 template<typename Entity, typename Type>
-class sparse_set<Entity, Type>: public sparse_set<Entity> {
+class sparse_set<Entity, Type>: public clone_base<sparse_set<Entity, Type>, std::is_copy_constructible_v<Type>> {
+    template <typename Derived, bool Copyable>
+    friend class clone_base;
+
     using underlying_type = sparse_set<Entity>;
     using traits_type = entt_traits<Entity>;

A new member function on the registry creates a new registry by cloning the given components.
@@ -1472,6 +1472,28 @@

         return { (*this = {}), assure };
     }
+
+private:
+
+    template <typename Component>
+    std::unique_ptr<sparse_set<entity_type>> clone_pool() {
+        static_assert(std::is_copy_constructible_v<Component>, "Cannot clone non-copyable component");
+        auto poolPtr = std::make_unique<sparse_set<entity_type, Component>>();
+        static_cast<sparse_set<entity_type, Component> *>(&pool<Component>())->clone_to(poolPtr.get());
+        return poolPtr;
+    }
+
+public:
+    template <typename... Components>
+    registry<entity_type> clone() {
+        registry<entity_type> newReg;
+        newReg.pools.reserve(sizeof...(Components));
+        (newReg.pools.push_back(clone_pool<Components>()), ...);
+        newReg.entities = entities;
+        newReg.available = available;
+        newReg.next = next;
+        return newReg;
+    }

 private:
     std::vector<std::unique_ptr<sparse_set<Entity>>> handlers;

It might be faster to clone_to a given registry to avoid a few memory allocations. But then you might get entity IDs mixed up.
Copying the whole registry without having to list off all of the components is difficult. If the clone_to function was virtual, you'd need to provide an implementation for when the component is not copyable. You can't static_assert(false) in there because then you can't build the vtable. The best you can do is assert(false) but I'd rather catch it at compile-time.
If you're "double-buffering" the registry then you probably only need to clone a few components. Maybe you could clone the rendering components and render the current frame while you're running game logic for the next frame.
If you only need to copy one component pool and you don't care about entity IDs then you could memcpy a raw_view.

Before to discuss a solution, I want to know why on the earth a registry should support full/partially cloning pools. :smile:
I mean, what is the actual problem? Do you really need to copy the internal arrays of a sparse set for that? If the goal is to store aside things for a frame so that you can work on them offline, hardly you need the overhead of a sparse set.

@skypjack There is more than one way of copying components. Each has its own strengths and weaknesses. I suggest you discuss this in the wiki somewhere because it seems like a common request. This is just one way of doing it. There are other ways that don’t require changes to EnTT.

I personally don’t actually use EnTT for any kind of threading 😄 so it may be more constructive to hear from those who do.

Yeah, indeed. I'm not sure that cloning a registry/pool is the best solution.
As an example, if you want to put aside things so as to render in parallel, you don't need the overhead of a sparse set. It's a waste of memory and CPU cycles for something you won't use anyway.
Because of this I'm asking the why behind this. Let's see if others pop up to join the discussion.

I brought this up with kerndog on gitter.

Network syncing. My client simulation runs 10 steps, copies itself at time 10, and then does 10 more "predictive steps". Client then gets a state update from server for the time 10 state. It compares that against the time 10 state cache. If there's errors, it'll paste the state update into the cache, then fast-forward this updated state to time 20, at which point it becomes the master state. These corrections
may ultimately lead to rubber-banding or teleporting of agents, but at least the state is now more correct between users. This requires being able to copy the whole registry state.

My EnTT simulation is compiled separately from my godot engine. The engine will still be using EntityId's though to keep track of data though. For instance a physics object will have a entity id associated with it. On a frame update it may want to send a request through a middleware api to access the position associated with that EntityId, and the easiest way for me to to implement this is to just have a copy of the registry. About 1/2 of the components are being accessed by the engine, and so it seems to me to just be simpler to copy the whole registry.

2 has work-arounds maybe, but I'm pretty sure copying each sparse-set is fine for now. I went into this with the plan of being able to copy easily, so all components I care about are trivially copyable for that reason. That's also why I excluded std:: containers in the components as well.
1 requires reliably reproducing the registry, but Idk if that's my ultimate networking strategy.

There is also a 3rd option. You want to memcopy entity render data to ship into a few Rendering Systems to run in a pipeline with the rest of the engine. This is something i wanted to do myself but couldnt. Without pipelining, you cant reach true near 100% parallelism.

true, but that means tighter integration with my game rendering / physics engine. I.e. render systems doesn't work well with godot which is more object oriented. I'm more going for a "sim server" thread with a "game engine thread".

To make it more clear for  the reason 1, i'm not saying copying the registry for network communication, but rather for rollbacks. http://www.gabrielgambetta.com/client-side-prediction-server-reconciliation.html
E.g. client keeps copy of registry at time 10, gets server update at time 20 with time 10 timestamp, checks for equivalency in time 10 registry cache, and if divergent, will fast-forward the fixed timestemp 10  registry to the current time to become the master registry state.

Hi @pgruenbacher, @Kerndog73, I'm very interested about learning other problems/use-cases, thanks for the discussion!
The rollback case is what led me to ask for the Save/Restore functionality (see issue #27 ), and we use it extensively in my company.
For my use-case I save the entire state of the simulation (i.e. everything in the registry) every few seconds and restore whenever I need. I voluntarily chosen not to save/restore a subset because is very error prone on a system where new components can be added dynamically, and could require saving as well.
The only case I can think skipping some of the components could make sense is for heavy and static resources (meshes, images, etc.). The solution I used for that was to use a separate ResourceManager and only keep the reference (a custom smart ptr in my case) in the components.
The client/server use case you pointed to is interesting, but I'm still thinking if is not better to have a proper protocol between the client and the server to communicate changes. I'm using EnTT in a distributed simulation framework, and for that need we use gRPC (any RPC lib will do the job). This has the nice side effect that I don't require the clients to actually use an ECS, so it makes it easier to integrate existing libraries/functionalities.
Just my 2 cents, sorry for the rant :)

hm well I intend to simulate thousands of moving agents all the time, so each client is running their semi-deterministic simulation with lockstep user commands, but with the server sending master updates to everyone to make sure any divergences in the simulations are resolved. RPC to send agent updates would be too difficult on the bandwidth I think for hundreds of nearby agents. though who knows, I still avoid networking prototypes out of pure fear.

Ok, sorry if I'm late, I was out of home during the weekend.
@pgruenbacher
Bullet 1. Just out if curiosity: did you consider using snapshot stuff for reconciliation? If you excluded it, can I ask you why?
The problem of sending over the network a registry as-is is that you are going to waste a lot of resources. Snapshot tries to reduce the overhead to some extents. Then you can just load the snapshot in an empty registry and you've your local copy to compare with.
Bullet 2. Sparse sets consume memory. If you don't need them, if you don't need all the features of a registry, I wouldn't recommend to keep up and running a copy of a registry. I personally use multiple registries though, so just a consideration: take under control your memory usage if you do it. :+1:
@vblanco20-1

There is also a 3rd option. You want to memcopy entity render data to ship into a few Rendering Systems to run in a pipeline with the rest of the engine. This is something i wanted to do myself but couldnt.

Why you couldn't? You can memcpy components at once with entity. What was the problem?

But in order to achieve rollback, I need to keep a copy of the game state to fast forward from, since my sim code cant reverse operations

full deep copy when doing the cache, but I'm willing to manually list the components during the clone call since it's pretty easy to know all the components that are part of it. if you think snapshot does the job I'm fine with trying it, I just wanted to make sure it makes sense.

Tbh I've never tried it, but probably it could work with an archive implementation that just forwards everything to a loader.
I'll keep the issue open for a while anyway. I want to think to it twice to see if there is an easier way to do it.

See branch experimental for a full implementation. It doesn't support runtime views for several reasons.
In case of positive or no feedback, I'll merge it on master later today or tomorrow. Then I'll close the issue.

@Kerndog73 @pgruenbacher
I thought a bit about this. I see some problems with blindly copying only some component types from a registry to another one.
In particular:

You cannot copy only the sparse sets. If you want it to work properly you must copy also the list of entities and destroyed entities of the registry itself. This will probably lead to orphans that is in charge to the user to clean up if required.
You cannot copy things on a registry that isn't empty, unless you decide to completely overwrite it. That's because in all the other cases there is the risk to have inconsistencies on identifiers. As an example, you copy component A at step 1, then component B at step 2. If an entity identifier has been recycled and was assigned to A at step 1 and to B at step 2, what you obtain is a broken instance of a registry.

For point 2, you can still move-assign an empty registry to the target one and it will erase everything at once. Then you can copy-assign the pools you want.
Point 1 is arguable the fact that an hypothetical full/partial copy function should also get rid of orphans. It means to waste CPU cycles for something that could be pointless, if all what an user wants is to put aside some (let me say) constant memory to reuse later.
Btw at a first glance it's possible to implement a partial copy of a registry with the limitations above mentioned. I'm still not that sure it's a good idea to do that in a real world software.
I mean, if all what I want is to create a memory of some components for a step back, I'd just use a dedicated component. In case of multiple steps back, well, in case the number is fixed it doesn't change much and dedicated component could work fine as well, otherwise I'd rather use a different data structure.
The problem is that a registry occupies more memory than what you would need for a backlog, that's all.
What about?

The point 2) is no longer relevant to me really. I'm moving most engine code into my simulation code (rendering and maybe even physics) and using dual/triple buffers to handle.
The point 1) still stands in terms of a backlog cache for fast-forwarding. I'm not sure how copying entities of registry along with all of the components would be an issue? All the data is laid out easily enough to copy it seems...
std::vector<std::unique_ptr<sparse_set<Entity>>> handlers;
std::vector<std::unique_ptr<sparse_set<Entity>>> pools;
std::vector<entity_type> entities;
size_type available{};
entity_type next{};

Kerndog's implementation seemed to cover it after looking at it again. Handlers shouldn't be copied cause I think they have pointers by their nature, they'd just be re-implemented on the other registry after it's been created and copied to. But once a registry's entities and pools are copied into a new registry, both registries are now completely independent of one another. no pointers. no containers. if I were to run a simulation step on each registry, they'd both get the same results deterministically without affecting each other. To achieve determinism requires pretty much copying everything, so might as well copy everything at that point. The whole point of a simulation registry state is to contain all information that will reproduce a simulation, other stuff like caching should really happen outside of it.
and again to clarify the idea of the networking. https://i.stack.imgur.com/Ya1JT.png
I'm probably doing a mix of lock-step.
let's say i have 10,000 agents simulating, each has a position.
I'm at time 5.
I send a message to the server that I want to move 5,000 agents of group 1 relation to a circle goal.
I send message to server saying "give all agents of group 1 circle goal action"
I don't do anything client-side yet other than maybe audio + visual response to the action.
For times 6,7,8,9 I get server messages saying "no new actions". I simply step the client simulation.
At time 10 everyone get message back from server saying "player 1 is moving all agents of group 1 to circle goal"
My client simulation starts simulating the time 10 step with the new player 1 (me) action applied.
Because it's time 10, I also make a copy of the simulation state in memory.
... more steps go by
At time 19 I get an packet from he server with positional data for agents 1-100. I reconcile that positional data on my copy, and then run that copy up to time 19. I discard my original state since it's invalid. If there were any differences between server and user simulations, the user sees rubber-banding for agents 1-100.
sorry for wall of text.

Gonna go a bit more in-depth with the "for pipelining" use case of registry clone.
With an ECS, paralelism is already quite easy to do. You can fairly trivially run systems at the same time, and you can also use parallel for. But both of those have sync points where all the threads need to wait for other to finish.
When you run 2 systems in parallel, the final time would be whatever takes the most time to execute, since one thread ends early, and just needs to wait until the other one finishes.
When you perform parallel-for, there is allways going to be a case where some tasks are longer than others, and they take time to execute. A bigger number of tasks can allow less "difference" becouse it averages out, but then you need to deal with bigger task overhead wich is very bad. This makes the case where 7 threads are waiting for the 8th of them to finish its task.
Apart from that, adding and removing entities and components can be unsafe, so you need to put them in a queue or similar to "defer" them, and then do it singlethread. While this happens, all the other hreads cant do anything.
A very common pattern, used everywhere, is to do pipelining. In a ECS engine, you can have a "simulation" thread, and a render thread. The simulation does almost everything, and then the rendering thread prepares the DirectX or similar calls to send to the driver. If you pipeline simulation with rendering,all the cases ive talked above (where stuff is waiting) will be filled with the tasks from the rendering. This can be done with audio, but luckily audio doesnt need nearly the same amount of interoperability with the ECS itself. Similar case with asset loading.
If you can do a "fast" copy of the simulation registry into a rendering related registry, then you can pipeline your rendering with your simulation almost trivially. I wanted to do that in my own experiment, but got bottlenecked on those sync points i commented about.
Of course, this can be fairly niche, and its not that easy to do the pipelining properly, but it does allow you to implement pipelining, while it wasnt possible to do before.

To keep track of the discussion on gitter, I add that persistent views can be a problem in case of partial copies - ie a view for A/B would break in case an user decides to copy only one of the components.
Possible solutions:

Do not copy persistent views.
Runtime asserts in the codebase and warnings in the documentation.
Copy only acceptable persistent views if possible.

I'm taking a look at this these days. Maybe I found a suboptimal but less impactful solution. Let's see.
The API will be something like this:
a_registry.clone<A, B, C>(another_registry);

I must admit that clone doesn't sound good and I'm open to suggestions for something different.
The list of components is something in which I'm interested because it's unlikely that I want to copy all the instances of all the components with such a tool. I mean, it's something that rarely makes sense at all and this approach works in both cases, so...
I'm looking forward to comments and feedback. :+1:

I think that "WIP API" looks perfectly fine, i like how its just obvious. Clone as the verb is precisely what you are doing with the word, and then the logical type list of the components.
There is only one thing i think on that, and is a way to maybe typedef the typelist.
For example:
`
//somewhere, maybe on the top of a file or in a class?
using RenderTypelist = entt::componentlist<A,B,C,D>;
//later down the line, as part as the update code
a_registry.clone(another_registry);
//what about...
using TransformComponentList = typelist<Position,Rotation,Scale,Transform,RenderTransform>;
using RenderableComponentList = typelist<3Dmesh,Sprite,Material,OpenglState0>;
using GeneralComponentList = typelist<Parent,Static,Disabled,Name>;
a_registry.clone<TransformComponentList, RenderableComponentList,GeneralComponentList>(another_registry);
`
The type list of the clone is very likely to grow into a lot of components, so being able to "define" them somewhere for usage later over different clones would be VERY useful. Of course, this is just syntactic sugar, and would be doable with macros.

I'd benefit from that alot ^ https://i.kym-cdn.com/photos/images/newsfeed/000/176/345/ALOT2.png?1316561264

I see a problem with the cloning functionality. Probably something that can be solved easily. Roughly speaking, the destination registry must be empty, at least the pools of the components to clone.
The loader member function solved the problem by cleaning it up before to return. The same approach can be used here. Btw all the entities and the components are erased in this case.

Please, see branch experimental, in particular the registry::clone member function.
I'm looking forward to your feedback before to merge it on master. Thanks.

I checked it out and it compiles fine for me. unittests worked.
emptyRegistry.clone(registry) clones no components which is to be expected, though Idk if we want to be more explicit in saying sizeof...Component > 0. Idk how useful it is cloning a registry of just the ents and not any components...
I'm trying to test to see if a full_clone method was possible (clone all component pools)  without having to explicitly list the components. This may be possible by iterating over the pools that exist with valid pointers, but I'm having trouble at the moment figuring out how to do the valid copies and instantiation, simply because understanding the internal workings of registry is a bit complex for my testing timeframe.

looking around a little more, full_clone doesn't seem possible actually. disregard. type list compatibility though would be useful I think, even better will be to allow for multiple type lists to be passed in. From what I can tell clone is missing the type_list functionality.

Idk how useful it is cloning a registry of just the ents and not any components...

Fair enough.

looking around a little more, full_clone doesn't seem possible actually.

The main problem with a full copy is that the clone functionality should be pushed down to the sparse set in the form of a virtual method. However, sparse sets have only the requirements that components be movable. Therefore it would break a bit the design with two possible solutions:

Get rid of the requirements and turn it to movable + copyable.
Detect if a type of component is copyable and override the virtual function accordingly: if it's copyable everything works like a charm, if it's not... well, what you would expect? An assert? An empty member function? Definitely fragile.

even better will be to allow for multiple type lists to be passed in

Good point. I'll add some code to merge type lists.

From what I can tell clone is missing the type_list functionality.

Everything is missing type list functionality. I've yet to introduce them all around and I can guarantee clone will be involved by that change. Btw that's another issue. I prefer to keep the two sets of changes separated.

Just found this issue when searching for clone/copy.
In my use case, I require a full/deep copy operation - I am holding a different perspective of the game world for every unit (as their views are warped by the speed of light and the resulting delays in information), where that view includes a full ECS copy.
As time passes, events arrive at each unit and I update their own ECS instances based on the event. I cannot share an ECS instance (entt::registry) among the objects - modifying a component in one must not touch that same component in another.

See branch experimental. I've still to document it, but some tests could help me to find out bugs (if any).
@pgruenbacher auto reg = registry.clone() performs now a deep copy of the registry without a type list. :+1:

Please, see branch experimental. Feedback are really, really, really appreciated. :+1:


Allow to pass BasePermission subclass/instance as condition (resolve #3)

Resolve #3

Thanks! I can definitely value in allowing regular Permissions as inputs to a statement's "condition" - it seems like it would ease reuse of condition logic across policies. Also, it would likely make it easier for existing codebases that use regular Permissions to transition to using this project.
However, statements would no longer be JSON serializable, which wouldn't allow loading statements as easily from a data store, a feature outlined here: https://github.com/rsinger86/drf-access-policy#loading-statements-from-external-source. My other concern is that a policy's logic would no longer be encapsulated in a single file/document, as the Permission classes would be defined elsewhere.
Though, I'm coming at this from the perspective of the projects that I work on - where it's really nice for non-programmers to edit JSON in a web GUI to change authorization rules. So maybe there is a clean way to design a clean API to handle both cases: JSON serializable statements as well as more code-centric ones with direct reference to Python constructs.
I'm certainly open to this approach, but should probably mull it over more. I'd appreciate any of your thoughts here.

OK, I understand your point of view. If you want to keep everything in JSON format the only solution I can think of would be to pass absolute import path (i.e. "import:rest_framework.permissions.IsAuthorized"). I don't know would be it useful or not, but it will work as compromise solution.
P.S. If I need to determine dynamic permissions through admin site I usually use default model permissions (create, update, delete and read).

Implement "condition": "import:rest_framework.permissions.IsAuthorized" syntax.


cmd/govim: Vim sometimes freezes on triggering completion

What version of Vim/Gvim are you using?
Vim/Gvim version
$ vim --version
VIM - Vi IMproved 8.1 (2018 May 18, compiled Apr 11 2019 17:46:54)
macOS version
Included patches: 1-1150
Compiled by Homebrew
Huge version without GUI.
Triggered completion via <c-x><c-o>
What did you expect to see?
The completion options appear.
What did you see instead?
Vim hang for maybe 30 seconds or so, showing -- Omni completion (^O^N^P) -- Searching... in the status bar.
The full log output is here (the log file is too big for an issue or even viewing in the regular gist UI). You can see at the end, there's a ~30 gap where nothing happens. During that time vim was unresponsive (I suppose due to #99).

Strange one. Because it appears from the govim logs that Vim is just doing nothing (see 019-04-19T06:54:09.811351 - the completion results have been sent to Vim).
I've just merged 8a9e8cab3c6c992f2cf781b5855b78c6011b6356 to always create a Vim channel log file. This will help confirm that Vim has received the message sent from govim. See https://github.com/myitcv/govim/wiki/Debugging-govim-plugin-failures for more details on log file creation.
Please can you upgrade to the latest govim and see if you can repro this?
I also note you're using a version of Vim that is slightly behind the very aggressive demands of https://github.com/myitcv/govim/wiki/FAQ#what-versions-of-vim-and-go-are-supported-with-govim! Any chance you can upgrade to at least the minimum shown in https://github.com/myitcv/govim/blob/master/.travis.yml?

I just got another one of these. Again, while editing a file I can't share unfortunately.
This time I don't think it was after triggering completion manually. I also spotted this in :messages:
Error detected while processing function <SNR>36_callbackAutoCommand:
line    4:
E605: Exception not caught: got error whilst handling autocommand:1: driver error: ChannelExpr("{\"Num\": bufnr(\"\"),
 \"Name\": expand('%:p'), \"Contents\": join(getline(0, \"$\"), \"\\n\")}") failed: failed to expr({"Num": bufnr(""),
"Name": expand('%:p'), "Contents": join(getline(0, "$"), "\n")}) in Vim: Caught 'Vim:Interrupt' in function <SNR>36_ca
llbackAutoCommand[2]..<SNR>36_define, line 48

Not sure if that's relevant.
Will keep adding any extra information I can gather along the way :-)

I also just update govim, so will be able to post the channel logs next time.

Per our offline exchange, I think you're currently running into a variant of https://github.com/golang/go/issues/31341. If you look at the bottom of the govim log you'll see something like:
2019-04-22T08:46:49.872631: gopls stderr: panic: runtime error: slice bounds out of range
2019-04-22T08:46:49.872650: gopls stderr:
2019-04-22T08:46:49.872659: gopls stderr: goroutine 3160 [running]:
2019-04-22T08:46:49.873354: gopls stderr: golang.org/x/tools/internal/span.ToUTF16Column(0xc, 0xa, 0x100, 0xc00008f600, 0x100, 0x100, 0xffffffffffffffff, 0xc, 0xa)
2019-04-22T08:46:49.873374: gopls stderr: 	/Users/someone/pkg/mod/golang.org/x/tools@v0.0.0-20190417223002-a5870b403859/internal/span/utf16.go:41 +0x57a
2019-04-22T08:46:49.873705: gopls stderr: golang.org/x/tools/internal/lsp/protocol.(*ColumnMapper).Position(0xc009583c20, 0xc, 0xa, 0x100, 0x0, 0x0, 0x13309ad, 0x13b87c0)
2019-04-22T08:46:49.873722: gopls stderr: 	/Users/someone/pkg/mod/golang.org/x/tools@v0.0.0-20190417223002-a5870b403859/internal/lsp/protocol/span.go:62 +0x63
2019-04-22T08:46:49.873734: gopls stderr: golang.org/x/tools/internal/lsp/protocol.(*ColumnMapper).Range(0xc009583c20, 0xc00823f8b0, 0x50, 0xc, 0xa, 0x100, 0xc, 0xa, 0x100, 0x0, ...)
2019-04-22T08:46:49.873765: gopls stderr: 	/Users/someone/pkg/mod/golang.org/x/tools@v0.0.0-20190417223002-a5870b403859/internal/lsp/protocol/span.go:50 +0x40c
2019-04-22T08:46:49.873798: gopls stderr: golang.org/x/tools/internal/lsp.toProtocolDiagnostics(0x14d22e0, 0xc007f120c0, 0x14d2460, 0xc00010e400, 0xc000188150, 0x1, 0x1, 0x1, 0x0, 0xc00231b3c8, ...)
2019-04-22T08:46:49.873812: gopls stderr: 	/Users/someone/pkg/mod/golang.org/x/tools@v0.0.0-20190417223002-a5870b403859/internal/lsp/diagnostics.go:85 +0x215
2019-04-22T08:46:49.873850: gopls stderr: golang.org/x/tools/internal/lsp.(*Server).publishDiagnostics(0xc0000da7e0, 0x14d22e0, 0xc007f120c0, 0xc00010e400, 0xc00823f860, 0x50, 0xc000188150, 0x1, 0x1, 0x0, ...)
2019-04-22T08:46:49.873872: gopls stderr: 	/Users/someone/pkg/mod/golang.org/x/tools@v0.0.0-20190417223002-a5870b403859/internal/lsp/diagnostics.go:60 +0x82
2019-04-22T08:46:49.873882: gopls stderr: golang.org/x/tools/internal/lsp.(*Server).cacheAndDiagnose.func1(0xc00010e400, 0xc0000da7e0, 0xc00d41f090, 0x50)
2019-04-22T08:46:49.873892: gopls stderr: 	/Users/someone/pkg/mod/golang.org/x/tools@v0.0.0-20190417223002-a5870b403859/internal/lsp/diagnostics.go:37 +0x356
2019-04-22T08:46:49.873899: gopls stderr: created by golang.org/x/tools/internal/lsp.(*Server).cacheAndDiagnose
2019-04-22T08:46:49.873907: gopls stderr: 	/Users/someone/pkg/mod/golang.org/x/tools@v0.0.0-20190417223002-a5870b403859/internal/lsp/diagnostics.go:21 +0x157
2019-04-22T08:46:49.960962:

The gopls folks have included some mitigation code for this as of golang.org/x/tools v0.0.0-20190422233926-fe54fb35175b, but I'm seeing an off-by-one error in that. So I'll wait until we have a proper fix before moving forward.
So I'm going to mark this as a dup of #98. Please shout if you see any other completion-related bugs that warrant either reopening this issue or a new one.
Thanks again for the detail on all of this


Report code should be word-wrapped

Currently, code shown in the report overflows the container. This should be word-wrapped so it looks nicer and is easier to read.
This should be a matter of adding some CSS to report.css, e.g.
.prettyprint {
    word-wrap: break-word;
}

Resolved in this CL.


Add cookie_secure boolean to php.ini?

The playbook telusdigital/playbook-telus-fibre and telusdigital/playbook-telus-international require cookies to be sent over a secure connection.  Would it be wise to enable this by default in our php role?
More information here under the header session.cookie_secure

Fixed by #9


Fix ReplaceDialog Action: DialogContext.BeginDialogAsync(): A dialog …

Fixes #5624
Description
The ReplaceDialog Action was using dc.Parent context to end the current active dialog (dialog that should replaced) and begin "new dialog", but the issue is our new dialog is not registered on the parent context because it's not recognized as a dependency for the InvokeDialog Action.
Example:

the main dialog "Empty" recognize "FirstChild" as a dependency because it's evaluate it from "Begin[FirstChild]" Dialog, but it's not considering the dependencies of "FirsrChild" it self, because it's consider that  "FirstChild" dependencies installed and will run on "FirstChild" context.
but in "ReplaceDialog" action the case is deferent because it's  not running on the current context, instead it's running on the Parent context "Empty".
Specific Changes

Change on Microsoft.Bot.Builder.Dialogs.Adaptive.Actions.ReplaceDialog
Change on Microsoft.Bot.Builder.Dialogs.Adaptive.AdaptiveDialog
Add Microsoft.Bot.Builder.Dialogs.IHaveParentDialogDependencies

The idea behind my solution that the actions "ReplaceDialog" running on the parent context should inform that it's a dependency for the parent container. and the AdaptiveDialogs "FirstChild" should return it as a dependencies for it self (only the dependencies that should run on parent context).

I checked all tests locally on same branch and it sucess:

Thanks @QaisAlkhateeb for submitting this. This looks like it does fix the issue. But i'm not sure the solution is generic enough, it looks a little ad-hoc to me that we specifically pass children context's dependencies to it's parent at certain case.
This looks to me is a generic dependency installed issue (the parent context failed to pull the child context's dependencies) or it's an execution issue that perhaps we should run the replace dialog in child context, or we could consider have a global dependencies center to solve such kind of issues.
@tomlm @Stevenic do you have comments on this?

Thanks @boydc2014 for your valuable notes,
I agree with you i did not make this fix general, because those types of dependencies are specific (maybe ReplaceDialog action is the only one action have dependencies to run on parent).
I tried some fixes related to run the ReplaceDialog action on the same context but I think that will break the definition of "ReplaceDialog" action.
And actually what i did is to solve what you mentioned (the parent context failed to pull the child context's dependencies) by adding this public interface "IHaveParentDependencies" which is a general interface, and any Dialog have this type of dependencies all it need is to implement it. Then the ChildContext will recognize that this action require some dependencies to be pulled to the parent and will add them to it's own dependencies.
I'm glad to hear all your notes, especially since I will try to actively participate on Bot Framework Repos

If I understand the issue correctly, it's in the bootstrapping of the parent DialogSet that is broken in case of replace dialog:
You have dialogs, Root, X, Y, Z.
To try and remove complexity we automatically detect references by walking the triggers and actions to discover dependencies which get added to the parent.Dialogs DialogSet property, as that is the way we resolve across turn boundaries to continue.
Root
	Trigger(x) => Begin(X)
X
	Trigger(foo) => Replace(Y)
Y
	Trigger(foo) => Replace(Z)
Z
	Trigger(foo) => Replace(X)

When we gather dialogs into the parent dialog set we don't normally promote past the dialogcontainer (aka AdaptiveDialog) as it's supposed to be self-contained unit.  If you look at the dialogsets for these dialogs I think you see the following dependencies.
Root => X
X => Y
Y => Z
Z => X

ReplaceDialog semantics break this dependency calculation because ReplaceDialog actually should be added to the parent dialog as a dependency.  Aka, the desired dependency state I think is:
Root => X, Y, Z

Because when X does a ReplaceDialog(T) it's in the parents context, and so X, Y, Z are peers of each other that belong in parents dialog set.
OK. great issue. I think your solution is in the right direction...
We don't need the IHaveParentDialogDependencies interface.  We really try to avoid interfaces these days in the SDK in general, the ones that are in there are esssentially legacy from before we realized that wasn't a good idea.
Possible Solutions:
Option 1 - Manual dependencies
This is only an issue for anything that calls dc.Parent.ReplaceDialog() which in the SDK is only ReplaceDialog. While we have done a bunch of work to make it so that you don't have to be aware of dialogSets, you are not blocked from doing this because we give you the ability to explicitely set dependencies in an AdaptiveDialog via the .dialogs property
To make replaceDialog work you simply need to add it to the parents dialogset.  You can do this via the JSON editor like this:
{
  "$kind": "Microsoft.AdaptiveDialog",
  "dialogs": [
    "x",
    "y",
    "z"
  ],
  ...
}

Or via the AdaptiveDialog extremely poorly named "Dialogs added to DialogSet" in composer like this:

Option 2 - Just promote ReplaceDialog assets across the parent dependency boundary.
We could just change AdaptiveDialog GetDependencies() like you had it to promote ReplaceDialog dependencies
   public IEnumerable<Dialog> GetDependencies()
   {
            EnsureDependenciesInstalled();

            // Expose required nested dependencies for ReplaceDialog
            foreach (var dlg in Dialogs)
            {
                if (dlg is ReplaceDialog replaceDialog)
                {
                    foreach (var item in replaceDialog.GetDependencies())
                    {
                        yield return item;
                    }
                }
            }

            yield break;
        }

Option 3 - Create a way of knowing that an external reference is happening
This is what you were modeling with your interface definition. The problem with this is that this is not a DialogContainer issue, it really is an AdaptiveDialog issue.  Normally I would say we add a method to Dialog.cs, but since it's an AdaptiveDialog issue and we don't have a base "Action" class I think that means we have to add an interface. If we add an interface I think I would name it IAdaptiveDialogDependencies with method GetAdaptiveDialogDependencies()
At any rate, at first I thought your solution was in the weeds, but you ended up doing option 3 which is actually a general purpose solution, so good job and thanks.

Thanks @tomlm for this Greate explantation that maybe it supposed to be added by me from the first time 👀 , actually i resisted the idea of adding the Interface, but as you mentioned i ended up implementing it this way because i saw it's the best option.

@QaisAlkhateeb Will be great if you could update your PR based on suggestions from Tom to move forward.

@QaisAlkhateeb Will be great if you could update your PR based on suggestions from Tom to move forward.

I already did it  https://github.com/microsoft/botbuilder-dotnet/pull/5656/commits/c2c89c434454ef1b54043afebdc18995bd0dc614

@johnataylor Ping.


Basic projections (SELECT)

TseeseCake must support:

[X] the projection of Column (Measurement, Timestamp or Facet)
[X] the projection of a freely defined expression and the definition of its alias

Implemented in 0.1.10


PYTEST_ADDOPTS env var not respected for test debug configuration with debugpy

Type: Bug

Behaviour
Expected vs. Actual
When using pytest-cov options are present in settings.json python.testing.pytestArgs, I would expect to be able to disable pytest-cov during test debugging when using the documenations suggested workaround of setting "env": {"PYTEST_ADDOPTS": "--no-cov" } in the test configuration with purpose "debug-test". This still works when specifying "type": "python" in the launch configuration, but when specifying "type":  "debugpy" as  suggested by the deprication warning, it does not.
Actual behaviour when "type":  "debugpy" and "env": {"PYTEST_ADDOPTS": "--no-cov" } is set in launch configuration and "--cov" is included in python.testing.pytestArgs in settings.json, the test debugger does not stop on breakpoints. If I remove "--cov" form python.testing.pytestArgs or set "type": "python" in the launch config, breakpoints work as expected. It appears that the environment variables are being properly set in the test environment.
Steps to reproduce:

add the follwing to settings.json "python.testing.pytestArgs": ["--cov", "tests/"]
set the following test debug configuration in launch.json
{
"name": "Python: Debug Tests",
// "type": "python", // Works when type is set to python
"type": "debugpy",
"request": "launch",
"program": "${file}",
"purpose": [
"debug-test"
],
"env": {
"PYTEST_ADDOPTS": "--no-cov"
},
"console": "integratedTerminal",
"justMyCode": true
},
set a breakpoint in a pytest function
run the test function via the debug panel, debug indiviual test button
observe that breakpoints are not stopped at
remove --cov from settings.json
run the test function via the debug panel, debug indiviual test button
observe that breakpoints work as expected
modify launch.json config to  use "type":  python
add --cov back to settings.json pytest args
run the test function via the debug panel, debug indiviual test button
observer that breakpoints work as expected

Diagnostic data

Python version (& distribution if applicable, e.g. Anaconda): 3.11.4
Type of virtual environment used (e.g. conda, venv, virtualenv, etc.): Venv
Value of the python.languageServer setting: Default

Output for Python in the Output panel (View→Output, change the drop-down the upper-right of the Output panel to Python)

XXX

User Settings

languageServer: "Pylance"

testing
• pytestArgs: "<placeholder>"
• pytestEnabled: true

experiments
• optInto: ["pythonTestAdapter"]

Extension version: 2023.25.10292213
VS Code version: Code - Insiders 1.86.0-insider (05047486b6df5eb8d44b2ecd70ea3bdf775fd937, 2024-01-31T03:29:26.801Z)
OS version: Linux x64 6.5.0-15-generic snap
Modes:

System Info

Item
Value

CPUs
13th Gen Intel(R) Core(TM) i7-13700 (24 x 5100)

GPU Status
2d_canvas: enabledcanvas_oop_rasterization: disabled_offdirect_rendering_display_compositor: disabled_off_okgpu_compositing: enabledmultiple_raster_threads: enabled_onopengl: enabled_onrasterization: enabledraw_draw: disabled_off_okskia_graphite: disabled_offvideo_decode: enabledvideo_encode: disabled_softwarevulkan: disabled_offwebgl: enabledwebgl2: enabledwebgpu: disabled_off

Load (avg)
0, 0, 0

Memory (System)
30.97GB (20.27GB free)

Process Argv
--no-sandbox --force-user-env --unity-launch --crash-reporter-id 3aa60ae4-37a9-4e56-8adf-187f0d7e643f

Screen Reader
no

VM
0%

DESKTOP_SESSION
ubuntu

XDG_CURRENT_DESKTOP
Unity

XDG_SESSION_DESKTOP
ubuntu

XDG_SESSION_TYPE
x11

A/B Experiments
vsliv368:30146709
vspor879:30202332
vspor708:30202333
vspor363:30204092
vstes516:30244333
vscod805cf:30301675
vsaa593:30376534
py29gd2263:30784851
c4g48928:30535728
962ge761:30841072
pythongtdpath:30726887
welcomedialog:30812478
pythonidxpt:30768918
pythonnoceb:30776497
asynctok:30898717
dsvsc013:30777762
dsvsc014:30777825
dsvsc015:30821418
pythontestfixt:30866404
pythonregdiag2:30926734
pyreplss1:30879911
pythonmypyd1:30859725
pythoncet0:30859736
pythontbext0:30879054
accentitlementst:30870582
dsvsc016:30879898
dsvsc017:30880771
dsvsc018:30880772
d34g3935:30953408
b5d27386:30943795
fegfb526:30952798
7j2b6412:30951517
bg6jg535:30946824
ccp1r6:30950905

Hello! Could you include your logs from the python output channel? For your logs, can you first set your log level to trace via theDeveloper: set log level command in the command palette? I am specifically looking to see if we can find where the command is called to debug and see the args passed there.
@paulacamargo25 any other thoughts / suggestions on what to try to debug this?

Sorry for the late reply. I will work on this and add it to the issue.
Thank you for following up on this.
On Wed, Mar 27, 2024 at 2:22 PM Eleanor Boyd @.***>
wrote:

Hello! Could you include your logs from the python output channel? For
your logs, can you first set your log level to trace via theDeveloper:
set log level command in the command palette? I am specifically looking
to see if we can find where the command is called to debug and see the args
passed there.
@paulacamargo25 https://github.com/paulacamargo25 any other thoughts /
suggestions on what to try to debug this?
—
Reply to this email directly, view it on GitHub
https://github.com/microsoft/vscode-python/issues/22820#issuecomment-2024012470,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/BCDCLCJ6WL3DYMS4LFAEMP3Y2M2AZAVCNFSM6AAAAABCTYBLF6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMRUGAYTENBXGA
.
You are receiving this because you authored the thread.Message ID:
@.***>

Hi! So debugging and coverage don't work together (more on that here https://github.com/microsoft/vscode-python/issues/19322). Seems like you are adding coverage in the test args then attempting to remove it in the debug launch config environment? So it seems like the pytest arg is being respected and not the env var correct? I think this is how pytest does precedence and therefore would be the expected outcome.

Hi @eleanorjboyd so long story short, it appears this has been resolved in a recent update. I have modified my lauch.json to use debugpy again and I am able to get it to stop at breakpoints using the  env var
I'm now on
Python extension: v2024.5.11021008 (pre-release)
Version: 1.89.0-insider
Commit: a2194e8c49790e2139c139a0d986e815ebd43e5b
Date: 2024-04-16T05:50:26.167Z
Electron: 28.2.8
ElectronBuildId: 27744544
Chromium: 120.0.6099.291
Node.js: 18.18.2
V8: 12.0.267.19-electron.0
OS: Linux x64 6.5.0-27-generic snap
Using launch config:
{
            "name": "Python: Debug Tests",
            "type": "debugpy", // This used to not work
            // "type": "python",
            "request": "launch",
            "program": "${file}",
            "purpose": [
                "debug-test"
            ],
            "env": {
                "PYTEST_ADDOPTS": "--no-cov",
            },
            "console": "integratedTerminal",
            "justMyCode": true
        },

I can't comment on how pytest does precedence of args vs env vars. Quick search didn't make it clear for me.
However, the VSCode documentation recommends the setup that I have (using the PYTEST_ADDOPTS env var) to disable coverage during debugging but allow coverage when running with the built in test runner.  I had been using this for quite a while with
From VSCode docs:

You can also configure pytest using a pytest.ini file as described on pytest Configuration.

Note If you have the pytest-cov coverage module installed, VS Code doesn't stop at breakpoints while debugging because pytest-cov is using the same technique to access the source code being run. To prevent this behavior, include --no-cov in pytestArgs when debugging tests, for example by adding "env": {"PYTEST_ADDOPTS": "--no-cov"} to your debug configuration. (See Debug Tests above about how to set up that launch configuration.) (For more information, see Debuggers and PyCharm in the pytest-cov documentation.)

Hi @alenzo-arch, glad this is working! Generally the rule should be Command-line arguments take precedence over environment variables so if you run into a situation where that is not the case please let me know and I can look into it further.
We do know that coverage and debugging doesn't work so we remove coverage args from the user args when calling debugging so it is likely having to do with that since we had an issue a few weeks ago with the arg parsing not working as desired.
Generally this problem will be helped by our proposal to allow custom arguments per run type so hopefully we will get working on that soon and that could be useful to you. Thanks!


docs: Fix npm flag in docs

The --dev option I think is used to only install dev dependencies, while --save-dev is for adding things to devDeps. It's kind of annoying since yarn uses the --dev option for dev deps 😅

Codecov Report

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

@@          Coverage Diff          @@
##           master     #6   +/-   ##
=====================================
  Coverage     100%   100%
=====================================
  Files           1      1
  Lines          34     34
  Branches        5      5
=====================================
  Hits           34     34

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 432ce16...8f71416. Read the comment docs.

@all-contributors please add @msrose for docs

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

npm package (@latest dist-tag)
GitHub release

Your semantic-release bot :package::rocket:


Fix #543

This is a fix to issue #543

I signed it!

Thanks for the fix! We need a test that fails before the change to make sure we don't regress.

I tried to run tests, but I had to install java first, and I didn't really want to do that. Any ways to test without java?

I maintain a fork that can run the tests without Java. If you're interested I can see if I can extract the changes required to make that work.
@justinfagnani is there a reason we run the tests through WCT instead of Karma? I migrated the tests to Karma in my own fork because I can't install Java, and it looks like others are also having the same problem. If we migrate the project to Karma it could facilitate easier test running for all contributors.

I've added test-cases that fail and rebased the fix after the commit with the failing tests