Add validation to enum control

Fixes elyra-ai/elyra#1893.
When required enum is not populated:

When required enum is populated:

Developer's Certificate of Origin 1.1
   By making a contribution to this project, I certify that:

   (a) The contribution was created in whole or in part by me and I
       have the right to submit it under the Apache License 2.0; or

   (b) The contribution is based upon previous work that, to the best
       of my knowledge, is covered under an appropriate open source
       license and I have the right under that license to submit that
       work with modifications, whether created in whole or in part
       by me, under the same open source license (unless I am
       permitted to submit under a different license), as indicated
       in the file; or

   (c) The contribution was provided directly to me by some other
       person who certified (a), (b) or (c) and I have not modified
       it.

   (d) I understand and agree that this project and the contribution
       are public and that a record of the contribution (including all
       personal information I submit with it, including my sign-off) is
       maintained indefinitely and may be redistributed consistent with
       this project or the open source license(s) involved.

Codecov Report

Merging #186 (0a17eea) into master (ab76611) will decrease coverage by 0.04%.
The diff coverage is 61.11%.

@@            Coverage Diff             @@
##           master     #186      +/-   ##
==========================================
- Coverage   73.42%   73.37%   -0.05%
==========================================
  Files          50       51       +1
  Lines        1731     1743      +12
  Branches      410      415       +5
==========================================
+ Hits         1271     1279       +8
- Misses        361      362       +1
- Partials       99      102       +3

Impacted Files
Coverage Δ

...line-editor/src/CustomFormControls/EnumControl.tsx
70.00% <50.00%> (-5.00%)
:arrow_down:

...c/CustomFormControls/validators/enum-validators.ts
80.00% <80.00%> (ø)

...-editor/src/CustomFormControls/validators/index.ts
90.00% <100.00%> (+1.11%)
:arrow_up:

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 ab76611...0a17eea. Read the comment docs.


user-data, meta-data, and network-config filenames

The Readme.md instructions said, "Mount the boot partition (of the .img file) to add user-data, meta-data and optionally network-config files to the root of it. Unmount it again, once added."
Are those filenames simply user-data, meta-data and network-config without the suffixes or are they user-data.yaml, meta-data.yaml and optionally network-config.yaml as listed in this project's root and examples directories?

I think both work – if I remember correctly. Have you tried it out?


Favicons are not being displayed.

Hey @imfing
The template is mostly working out great, but there's a small persisting issue of the custom favicons. I tried cloning a fresh starter template and following the instructions we added in PR #37, but I cannot seem to override the default favicons. I created a video to demo this:
https://github.com/imfing/hextra/assets/46340124/b11b9572-c45f-4ecf-bdd6-19c5922c9a0a
In the above video, I have:

Cloned the Hextra Starter Template.
Run the server.
Created a folder called static.
Pasted favicons into it.
Restarted the server.

Let's find a solution to this.

Additional Information:
If I create a file named favicons.html and place it at /layouts/partials/favicons.html and add the following code to it:
<link rel="shortcut icon" type="image/x-icon" href="favicon.ico">

then the favicon displays, but only on the homepage of the site. The favicon does not display if I go to the Docs or About pages.

Hey @imfing
The template is mostly working out great, but there's a small persisting issue of the custom favicons. I tried cloning a fresh starter template and following the instructions we added in PR #37, but I cannot seem to override the default favicons. I created a video to demo this:
https://github.com/imfing/hextra/assets/46340124/b11b9572-c45f-4ecf-bdd6-19c5922c9a0a
In the above video, I have:

Cloned the Hextra Starter Template.

Run the server.

Created a folder called static.

Pasted favicons into it.

Restarted the server.

Let's find a solution to this.

After restarted the server, could you also try restarting the browser? or open the URL in incognito?

@Welding-Torch
I think you're missing the files favicon.svg and favicon-dark.svg (optional), as the SVG favicons take precedence over the favicon.ico file.
SVG favicons are supported by modern web browsers, while the .ico favicon is mainly for backward compatibility. I should highlight this in the documentation.

I added the favicon-dark.svg file and opened in incognito, and now the favicon loads everywhere. Solved!

I struggled with this issue a bit today. It's probably worth pointing out that without specifically adding favicon-dark.svg, the default icon is displayed if you're viewing in dark mode. The documentation only specifically calls out a need for favicon.ico and favicon.svg so I missed this initially.

Include both favicon.ico and favicon.svg files in your project to ensure your site’s favicons display correctly.


limited leftnav and breadcrumb to only top main el

Issue
Fix #219
Test URLs

Before: https://main--merative2--hlxsites.hlx.page/blog/4-ways-rsna-laid-out-imaging-ai-future
After: https://issue-219-blog-fragment-bug--merative2--hlxsites.hlx.page/blog/4-ways-rsna-laid-out-imaging-ai-future

Description
Addition of a fragment that has another main element basically triggered the auto-blocking of another set of left nav and breadcrumb for blog pages.

pagespeed shows 98 with speed index being the main problem. should be ok.


Alexa Calling feature help

Briefly summarize your issue:
We want to integrate Alexa calling feature into our device. Is this supported in present SDK as we are using avs-1.14.0?
What is the expected behavior?
We want Alexa calling feature as it runs on Amazon Echo devices.
But now when we ask Alexa to call then response is "Not supported at your device".
Tell us about your environment:
AVS SDK Version 1.14.0 Cross Compiled to run on below Hardware.
PulseAudio
Bluetooth
What version of the AVS Device SDK are you using?
1.14.0
Tell us what hardware you're using:
Other: Hardware: Samsung Artik 305 Secure Board
ARH: ARMv7
Tell us about your OS (Type & version):
Linux, Ubuntu 16.04
Linux artik 4.4.71-UNRELEASED #1 SMP PREEMPT Tue Aug 20 18:39:35 IST 2019 armv7l armv7l armv7l GNU/Linux

Hello @mohitbansal19,
Integration of Alexa Calling requires special permissions.  Please use the following form to request access to this feature: Contact AVS Device SDK Team
Best regards,
-SWH

Thanks for help.

I have compiled Alexa SampleApp from Alexa AutoSDK version 2.1 . When i am saying  " Alexa, Call XYZ", the response i am getting is "calling with alexa is not supported on this device, u can use alexa app for calling ". How can i make SampleApp for calling. What special permission is required and how it will help for successfull integration Alexa Calling.
GitHub Link for Log :
https://github.com/syedfaisal5/Programming/blob/master/DeviceDOesntSupportCalling.txt


TSC compiler fails to resolve node typings if started with -p

TypeScript Version:  2.0.0
**Steps""

create new directory
npm init (fill in the values)
npm install --save<EMAIL_ADDRESS>npm install --save @types/node
add the following setting to the workspace settings "typescript.tsdk": "./node_modules/typescript/lib"
create a tsconfig.json with the following settings:

{
	"compilerOptions": {
		"module": "commonjs",
		"moduleResolution": "node"
	},
	"exclude": [
		"node_modules"
	]
}

create TS file main.ts with the following content

import * as cp from 'child_process';

Observe: everything is ok in VS Code. No errors and code assist works

open shell on the workspace
execute .\node_modules.bin\tsc -p .
Observe: compile errors are printed

main.ts(1,21): error TS2307: Cannot find module 'child_process'.

execute .\node_modules.bin\tsc
Observe everything is ok

Might hit more people when migrating to 2.0.0. Almost all our scripts call tsc with -p .

I just ran into the opposite problem a few hours ago. tsc -p compiled without errors, but there were red squiggles in VSCode on all the node imports. When I added a typeRoots setting to tsconfig.json, they were both happy. Something is definitely out of sync between the two.

should be fixed in typescript@next and next TS 2.0 release.


Disable app service's ftp

Closes #1743
What is being addressed
App Service has FTP access but that is considered less secure.
How is this addressed

Disable all ftp access since we don't use it anyway (although sftp could also be enforced if we needed it)
Small add vnet_route_all_enabled site config settings which is a newer alternative to the old WEBSITE_VNET_ROUTE_ALL

/test-extended


Remove endpoint 5 on the tv-app as it creates some random ZAP behavior

Problem
Our ZAP CI is randomly failing because the tv-app.zap configuration is breaking some assertions made by ZAP afaict.
Looking into the configuration of the tv-app I guess the endpoint 5 can be removed. This endpoint is configured to act similarly to the all-clusters-app but it conflicts with the device type used for the rest of the app.
Summary of Changes

Remove endpoint 5 from the tv-app configuration
Update gen/ folder

Awesome. The Endpint 5 is not needed at all. It was there only for testing purposes.

Marking this as hotfix, given it's breaking builds pretty reliably...

all auto-generated code so looks safe to approve


"brew upgrade dart" Notice : Error: No available formula with the name "dart"

When i use brew upgrade dar in the terminal on mac os, The log notice Error: No available formula with the name "dart";
The flutter doctor -v is:
flutter doctor -v
[✓] Flutter (Channel stable, v1.9.1+hotfix.6, on Mac OS X 10.14.6 18G103, locale
    zh-Hans-CN)
    • Flutter version 1.9.1+hotfix.6 at /Users/czc/developerment/flutter
    • Framework revision 68587a0916 (7 weeks ago), 2019-09-13 19:46:58 -0700
    • Engine revision b863200c37
    • Dart version 2.5.0

[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
    • Android SDK at /Users/czc/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling
      support)
    • Platform android-29, build-tools 29.0.2
    • Java binary at: /Applications/Android
      Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build
      1.8.0_202-release-1483-b49-5587405)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 10.3)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 10.3, Build version 10G8
    • CocoaPods version 1.8.4

[✓] Android Studio (version 3.5)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 40.2.2
    • Dart plugin version 191.8593
    • Java version OpenJDK Runtime Environment (build
      1.8.0_202-release-1483-b49-5587405)

[✓] IntelliJ IDEA Community Edition (version 2019.2.3)
    • IntelliJ at /Applications/IntelliJ IDEA CE.app
    • Flutter plugin version 40.2.4
    • Dart plugin version 192.7402

[✓] VS Code (version 1.39.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.5.1

[✓] Connected device (1 available)
    • iPhone Xʀ • EC2AFEC9-362C-42C4-B645-CBE2E6BD09A6 • ios •
      com.apple.CoreSimulator.SimRuntime.iOS-12-4 (simulator)

• No issues found!

Make sure that you have run:
$ brew tap dart-lang/dart

before trying to install dart using Homebrew.

Solved my problem too.

Solved my problem

That did the trick... thanks.


Better image sampling

Constrains image sampling to the actual atlas region for a given image and adds a half pixel adjustment to sample from the pixel center.
Addresses #719 and maybe #656
Example 2x2 image with red, blue, cyan and magenta pixels:

@dfrg can I adopt this PR to get it over the finish line?

If you have the bandwidth, please feel free. I do have the fine code to handle extend modes and nearest neighbor sampling but it’s not plumbed through. Would you like me to push that to this branch?

If it's not plumbed through yet, I think a follow-up draft PR would be better. But if you want to make that PR now, and let me do the rebase, that would be fine by me.

I’m not by a computer at the moment so if you’d like to just push this one through, I’ll send a follow up later.

@dfrg requesting your review on the GPU side code. I'll wire up the tests tomorrow.

Removal of clamp LGTM but Raph was fairly insistent on only doing texture loads when area[i] != 0.

And that's why we ask for review :)

One thing I notice is that there's an apparent visual discontinuity along the boundary points, i.e. where we move from sampling one set of pixels to sampling a different set of pixels.
That's especially visible in the cyan parts in your example image. I presume that's an expected artifact of bilinear filtering?

One thing I notice is that there's an apparent visual discontinuity along the boundary points, i.e. where we move from sampling one set of pixels to sampling a different set of pixels.
That's especially visible in the cyan parts in your example image. I presume that's an expected artifact of bilinear filtering?

Indeed, particularly in this case where we’re upsampling a 2x2 image 300x.
Thanks for pushing this through!


Improve precision in CKKS Compress for FLEXIBLEAUTO(EXT)

Currently the generic implementation in the base RNS scheme is used. We need to add special logic to update the scaling factor. This leads to precision loss of 3-4 bits.
For reference, see the implementation of CKKS Compress in PALISADE: https://gitlab.com/palisade/palisade-release/-/blob/master/src/pke/lib/scheme/ckks/ckks-impl.cpp?ref_type=heads#L1815

When Compress is called for FLEXIBLEAUTO and FLEXIBLEAUTOEXT, it reduces the noise degree to 1 and then simply drops remaining RNS limbs (to the desired level). If all we do after this is decryption, this does not increase the approximation error. If we use it before any flavor of bootstrapping, we need to multiply the ciphertext by the appropriate adjustment factor that will set the scaling factor for the destination level.

No action is needed.


Generated SVG has not the expected format warning

Specifying SVG render format can sometimes cause: Generated SVG has not the expected format. There might be image size problems. warning, which causes the SVG translate scale attribute not to be removed. I believe this might have to do with the fact that SVG_PATTERN pattern ("<svg width=\"(\\d+)p[tx]\" height=\"(\\d+)p[tx]\"(.*?)>\n"                     + "<g(.*?)transform=\"(scale\\(.*?\\))?") specifies new line separator as \n char, whereas in my case it was \r\n. I think using \s* instead should solve the issue. I'm using GraphvizCmdLineEngine with Graphviz 2.38.0.
Temporary fix that worked for me was setting the dpi attribute of graph explicitly to empty value:
graph.graphAttrs().add("dpi", "");

Thanks for the catch.
Windows newlines and regexes, two things to avoid 😃


add method for GET /v3/markers/counts

Add method to fetch all unread streams with counts of unread entries.

Thanks for PR.


[Bug] TC-TIMESYNC-2.3 fails if TIMESYNC.S.F03 is not supported

From chip-certification-tool created by pankore: CHIP-Specifications/chip-certification-tool#967
Describe the bug
If declared not supporting TIMESYNC.S.F03 and disable TrustedTimeSource (TIMESYNC.S.A0003), the automated script will fail.
PICS is not indicated in the test plan, and automated script does not include PICS.
Step requiring PICS 1, 3, 4, 5
Test-plan:
https://github.com/CHIP-Specifications/chip-test-plans/blob/master/src/cluster/time_synchronization.adoc#tc-timesync-2-3-settrustedtimesource-command-with-dut_server
Steps to reproduce the behavior
No response
Expected behavior
No response
Log files
Test Harness log:
TC-TIMESYNC-2.3.log
PICS file
No response
Screenshots
No response
Environment
No response
Additional Information
No response

@rquidute TC-TIMESYNC-2.3 test uses TIMESYNC.S.F03 high level pics and it should not be executed when TIMESYNC.S.F03 is false.
@pankore Seems like a test-plan issue please file a ticket in test-plan repo, once test-plan is updated we will update the script accordingly.

@manjunath-grl I had filed an issue but doesn't seem to have assign to anyone. https://github.com/CHIP-Specifications/chip-test-plans/issues/3433

@pankore  AND @rquidute
The TC-TIMESYNC-2.3 test case is depending  on TIMESYNC.S.F03 at a high level in the PICS, and the test case will not be selected if TIMESYNC.S.F03 is set to false.

And it's not a Test-plan Issue
PICS for all time sync test cases apply to the entire test and are listed in the PICS section at the top of the test. None of the tests have individual steps that are PICS-gated
Issue raised for the same earlier : https://github.com/CHIP-Specifications/chip-test-plans/issues/3219

There is a note in Issue https://github.com/CHIP-Specifications/chip-test-plans/issues/3433 asking to test again since this PR was merged: https://github.com/project-chip/connectedhomeip/pull/29378
I performed an execution in my setup and the test passed.

Hi @manjunath-grl is this issue still valid? I was able to run successfully.

The test script aligns with the test plan, and no modifications are needed since the comment in issue 3433 suggests that the SDK has been fixed. The ticket owner should retest this test case.
CC @raju-apple @rquidute


typo: heirarchy -> hierarchy

@nschonni : Thanks for your contribution! The author, @mihart, has been notified to review your proposed change.

:white_check_mark: Validation status: passed

File
Status
Preview URL
Details

powerbi-docs/consumer/end-user-drill.md
:white_check_mark:Succeeded

For more details, please refer to the build report.
Note: If you changed an existing file name or deleted a file, broken links in other files to the deleted or renamed file are listed only in the full build report.

Merging typo fix


fixSelectStmt's constructor should initialize originSelectList member

Proposed changes
Issue Number: close #xxx

Further comments
If this is a relatively large or complex change, kick off the discussion at<EMAIL_ADDRESS>by explaining why you chose the solution you did and what alternatives you considered, etc...

run buildall

run buildall


Preload fails with ludwig

I am using ludwig on cpu only mode on multicore system. I run as below
horovodrun -np 24 -H localhost:24 --binding-args="-bind-to socket -map-by socket" ludwig train --training_set train.csv --validation_set valid.csv --random_seed 42 -cf ${MODELFILE} --model_name ${MODELNAME}
Now I am trying to preload the model file for a different run (all else being the same. Infact, exact same data file even).
horovodrun -np 24 -H localhost:24 --binding-args="-bind-to socket -map-by socket" ludwig train --training_set train.csv --validation_set valid.csv --random_seed 42 -cf ${MODELFILE} --model_name ${MODELNAME} -mlp results/experiment_train_model/model
I am assuming this is the correct way to make multicore (otherwise ludwig just runs on single core)
It fails with error
[1,2]<stderr>:    "Intra op parallelism cannot be modified after initialization.")
[1,2]<stderr>:RuntimeError: Intra op parallelism cannot be modified after initialization.

Any idea why preload fails ?
Will build a reproducer if needed, but want to eliminative trivial issues if I am missing something.

OS:  18.04.1-Ubuntu
Python version 3.7.6
Ludwig version
Tensorflow 2.3.1

Hey @mangleddata, thanks for reporting this.  This does look like a bug on our side when specifying the model_load_path.  The root of the problem, I suspect, is that we are no plumbing the parameters here, resulting in attempts to initialize TensorFlow with different parameters.  I'll take a look at this today.

Hey @mangleddata, can you try #1011 and let me know if it addresses your issue?

@tgaddair Thanks for fixing it. I am able to preload now.

One related question. I have the following scenario
Run 1: Have features_{0..100} and have a trained model.
Run 2: I now have a new feature feature_101 added to the same data set and have a new features added to the model file.  Now using the pretrained model in run 1 for run 2 still seems to run - but from what I could tell, it drops the newly added feature (I don't see the feature in the input_features array in description.json)
Is this expected ?


can't round-trip strings as binary

@pytest.mark.parametrize('s, val, out', [
    (b'foo', b'foo', b'foo'),
    ('foo', b'foo', b'foo'),
    (u'foo', b'foo', b'foo'),
])
def test_text_round_trip_binary(s, val, out):
    if out is None:
        out = s

    wire_val = BinaryTypeSpec.to_wire(s)
    assert wire_val == BinaryValue(val)
    assert BinaryTypeSpec.from_wire(wire_val) == out

tests/spec/test_primitive.py:55: in test_text_round_trip_binary
    wire_val = BinaryTypeSpec.to_wire(s)
thriftrw/spec/primitive.py:67: in to_wire
    check.instanceof_surface(self, value)
thriftrw/spec/check.py:55: in instanceof_surface
    instanceof_class(type_spec, type_spec.surface, value)
thriftrw/spec/check.py:61: in instanceof_class
    'Cannot serialize %r into a "%s".' % (value, type_spec.name)
E   TypeError: Cannot serialize u'foo' into a "binary".

@junchaowu @breerly @kriskowal

Decided to not do this unicode coercion automatically.


Create quizzForkYani.md

Hi this Yani Mira from Estiam.
In the class E5 WMD B, here is my pull request with a quizz.

Sujre thing  ! I changed the name of the file


Fix dump snapshot encryption info not right after rename.

What problem does this PR solve?
Issue Number: close #4841
Problem Summary:

after fullpath changed, we need link encryption info.

What is changed and how it works?
Check List
Tests

[ ] Unit test
[ ] Integration test
[ ] Manual test (add detailed scripts or steps below)
[ ] No code

Side effects

[ ] Performance regression: Consumes more CPU
[ ] Performance regression: Consumes more Memory
[ ] Breaking backward compatibility

Documentation

[ ] Affects user behaviors
[ ] Contains syntax changes
[ ] Contains variable changes
[ ] Contains experimental features
[ ] Changes MySQL compatibility

Release note

None

/run-all-tests

/merge

/merge


TypeScript Kernel selected as default for new Jupyter notebook

Type: Bug
repo

With the node.js notebooks extension installed
Create a new Jupyter notebook using the Create: new Jupyter notebook command

Bug
The TypeScript kernel is selected by default
VS Code version: Code - Insiders 1.73.0-insider (Universal) (9ad069358e9f09d1f49a90db36b73c953505438a, 2022-10-27T08:46:34.216Z)
OS version: Darwin x64 21.6.0
Modes:
Sandboxed: Yes

System Info

Item
Value

CPUs
Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz (16 x 2400)

GPU Status
2d_canvas: enabledcanvas_oop_rasterization: disabled_offdirect_rendering_display_compositor: disabled_off_okgpu_compositing: enabledmetal: disabled_offmultiple_raster_threads: enabled_onopengl: enabled_onrasterization: enabledraw_draw: disabled_off_okskia_renderer: enabled_onvideo_decode: enabledvideo_encode: enabledvulkan: disabled_offwebgl: enabledwebgl2: enabledwebgpu: disabled_off

Load (avg)
5, 4, 4

Memory (System)
32.00GB (0.54GB free)

Process Argv
--crash-reporter-id 48781ca2-1705-4f64-9bab-325055aab55d

Screen Reader
no

VM
0%

Verbose logs:

Visual Studio Code - Insiders (1.73.0-insider, undefined, desktop)
Jupyter Extension Version: 2022.10.1103021110.
Python Extension Version: 2022.17.13001027.
Workspace folder /Users/matb/projects/san
info 10:37:08.844: ZMQ install verified.
User belongs to experiment group 'jupyterTestcf'
User belongs to experiment group 'jupyterEnhancedDataViewer'
info 10:37:09.373: Old kernelSpecs (created by Jupyter Extension) stored in directory /Users/matb/Library/Jupyter/kernels/__old_vscode_kernelspecs
debug 10:37:09.374: LocalKernelFinder: load initial set of kernels
debug 10:37:09.374: Get Custom Env Variables, Class name = w (started execution), Arg 1: undefined, Arg 2: "RunPythonCode"
info 10:37:09.376: LSP Notebooks experiment is enabled
debug 10:37:09.376: Get Active Interpreter, Class name = j (started execution), Arg 1: "~/projects/san"
debug 10:37:09.378: Get Custom Env Variables, Class name = w (started execution), Arg 1: undefined, Arg 2: "RunNonPythonCode"
debug 10:37:09.379: Get Custom Env Variables, Class name = w (started execution), Arg 1: undefined, Arg 2: "RunPythonCode"
debug 10:37:09.379: Get Custom Env Variables, Class name = w (started execution), Arg 1: "~/projects/san", Arg 2: "RunNonPythonCode"
debug 10:37:09.379: Get Custom Env Variables, Class name = w (started execution), Arg 1: "~/projects/san", Arg 2: "RunPythonCode"
debug 10:37:09.379: getCondaFile, Class name = k (started execution)
debug 10:37:09.379: getCondaVersion, Class name = k (started execution)
debug 10:37:09.379: getCondaVersionFromPython, Class name = k (started execution)
debug 10:37:09.380: RemoteKernelFinder: load cache true
debug 10:37:09.380: RemoteKernelFinder: Writing 0 remote kernel connection metadata to cache
debug 10:37:09.380: Found 0 cached controllers
debug 10:37:09.380: Creating 0 controllers
debug 10:37:09.391: Getting Jupyter KernelSpec Root Path, Class name = j, completed in 15ms, has a truthy return value, , Return Value: <Uri:/Users/matb/Library/Jupyter/kernels>
debug 10:37:09.396: LocalKernelFinder: loaded initial set of kernels
debug 10:37:09.399: getCondaFile, Class name = k, completed in 20ms, has a truthy return value
debug 10:37:09.399: getCondaVersion, Class name = k, completed in 20ms, has a truthy return value
debug 10:37:09.427: Get Custom Env Variables, Class name = w, completed in 53ms, has a truthy return value, Arg 1: undefined, Arg 2: "RunPythonCode"
debug 10:37:09.427: Get Jupyter Sub Paths, Class name = j, completed in 53ms, has a truthy return value, Arg 1: "", Arg 2: "kernels", Return Value:
debug 10:37:09.427: Get Jupyter Kernel Paths, Class name = j, completed in 53ms, has a truthy return value, Arg 1: "", Return Value:
debug 10:37:09.428: Get KernelSpec root path, Class name = j, completed in 54ms, has a truthy return value, Arg 1: {"_isCancelled":false,"_emitter":null}, Return Value: <Uri:/usr/share/jupyter/kernels>, <Uri:/usr/local/share/jupyter/kernels>, <Uri:/Users/matb/Library/Jupyter/kernels>
debug 10:37:09.428: Get Custom Env Variables, Class name = w, completed in 50ms, has a truthy return value, Arg 1: undefined, Arg 2: "RunNonPythonCode"
debug 10:37:09.428: Get Custom Env Variables, Class name = w, completed in 50ms, has a truthy return value, Arg 1: undefined, Arg 2: "RunPythonCode"
debug 10:37:09.428: Get Custom Env Variables, Class name = w, completed in 49ms, has a truthy return value, Arg 1: "~/projects/san", Arg 2: "RunNonPythonCode"
debug 10:37:09.429: Get Custom Env Variables, Class name = w, completed in 50ms, has a truthy return value, Arg 1: "~/projects/san", Arg 2: "RunPythonCode"
info 10:37:09.429: Preferred Remote kernel for Untitled-1.ipynb is undefined
debug 10:37:09.438: Not Searching for kernels as path does not exist, /usr/share/jupyter/kernels
debug 10:37:09.438: Not Searching for kernels as path does not exist, /usr/local/share/jupyter/kernels
debug 10:37:09.501: Rank Kernels, Class name = p (started execution), Arg 1: "Untitled-1.ipynb", Arg 2: "", Arg 3: {"orig_nbformat":4}, Arg 4: undefined, Arg 5: "", Arg 6: undefined
info 10:37:09.503: Preferred Remote kernel for Untitled-1.ipynb is undefined
info 10:37:09.503: Find preferred kernel for Untitled-1.ipynb with metadata {"orig_nbformat":4} & preferred interpreter <undefined>
debug 10:37:09.504: Rank Kernels, Class name = p, completed in 4ms, has a falsy return value, Arg 1: "Untitled-1.ipynb", Arg 2: "", Arg 3: {"orig_nbformat":4}, Arg 4: undefined, Arg 5: "", Arg 6: undefined
debug 10:37:09.504: Rank Kernels, Class name = p (started execution), Arg 1: "Untitled-1.ipynb", Arg 2: "", Arg 3: {"orig_nbformat":4}, Arg 4: undefined, Arg 5: "", Arg 6: undefined
info 10:37:09.588: Preferred Remote kernel for Untitled-1.ipynb is undefined
info 10:37:09.589: Find preferred kernel for Untitled-1.ipynb with metadata {"orig_nbformat":4} & preferred interpreter <undefined>
debug 10:37:09.589: Rank Kernels, Class name = p, completed in 85ms, has a falsy return value, Arg 1: "Untitled-1.ipynb", Arg 2: "", Arg 3: {"orig_nbformat":4}, Arg 4: undefined, Arg 5: "", Arg 6: undefined
debug 10:37:09.590: Compute Preferred Controller, Class name = C, completed in 90ms, has a truthy return value, Arg 1: <Uri:Untitled-1.ipynb>, Return Value: {}
debug 10:37:09.617: Get Active Interpreter, Class name = j (started execution), Arg 1: undefined
debug 10:37:09.628: Get Active Interpreter, Class name = j, completed in 252ms, has a truthy return value, Arg 1: "~/projects/san", Return Value: {"id":"/usr/local/bin/python","sysPrefix":"/Library/Frameworks/Python.framework/Versions/3.10","displayPath":{"$mid":1,"path":"/usr/local/bin/python","scheme":"file"},"envName":"","uri":{"$mid":1,"path":"/usr/local/bin/python","scheme":"file"},"displayName":"","envType":"Unknown","version":{"major":3,"minor":10,"patch":4,"raw":"3.10.4 (v3.10.4:9d38120e33, Mar 23 2022, 17:29:05) [Clang 13.0.0 (clang-13<IP_ADDRESS>)]"}}
debug 10:37:09.628: Get Active Interpreter, Class name = j, completed in 11ms, has a truthy return value, Arg 1: undefined, Return Value: {"id":"/usr/local/bin/python","sysPrefix":"/Library/Frameworks/Python.framework/Versions/3.10","displayPath":{"$mid":1,"path":"/usr/local/bin/python","scheme":"file"},"envName":"","uri":{"$mid":1,"path":"/usr/local/bin/python","scheme":"file"},"displayName":"","envType":"Unknown","version":{"major":3,"minor":10,"patch":4,"raw":"3.10.4 (v3.10.4:9d38120e33, Mar 23 2022, 17:29:05) [Clang 13.0.0 (clang-13<IP_ADDRESS>)]"}}
debug 10:37:09.628: interpreterPackages getPackageInformation, Class name = r (started execution), Arg 1: {"interpreter":{"id":"/usr/local/bin/python","sysPrefix":"/Library/Frameworks/Python.framework/Versions/3.10","displayPath":{"$mid":1,"path":"/usr/local/bin/python","scheme":"file"},"envName":"","uri":{"$mid":1,"external":"file:///usr/local/bin/python","path":"/usr/local/bin/python","scheme":"file"},"displayName":"","envType":"Unknown","version":{"major":3,"minor":10,"patch":4,"raw":"3.10.4 (v3.10.4:9d38120e33, Mar 23 2022, 17:29:05) [Clang 13.0.0 (clang-13<IP_ADDRESS>)]"}}}
debug 10:37:09.628: Create activated Env, Class name = w (started execution), Arg 1: {"allowEnvironmentFetchExceptions":true,"interpreter":{"id":"/usr/local/bin/python","sysPrefix":"/Library/Frameworks/Python.framework/Versions/3.10","displayPath":{"$mid":1,"path":"/usr/local/bin/python","scheme":"file"},"envName":"","uri":{"$mid":1,"external":"file:///usr/local/bin/python","path":"/usr/local/bin/python","scheme":"file"},"displayName":"","envType":"Unknown","version":{"major":3,"minor":10,"patch":4,"raw":"3.10.4 (v3.10.4:9d38120e33, Mar 23 2022, 17:29:05) [Clang 13.0.0 (clang-13<IP_ADDRESS>)]"}}}
debug 10:37:09.628: Getting activated env variables, Class name = K (started execution), Arg 1: undefined, Arg 2: <Uri:/usr/local/bin/python>, Arg 3: true
debug 10:37:09.629: Getting activated env variables impl, Class name = K (started execution), Arg 1: undefined, Arg 2: <Uri:/usr/local/bin/python>
debug 10:37:09.629: Getting activated env variables ourselves, Class name = K (started execution), Arg 1: undefined, Arg 2: <Uri:/usr/local/bin/python>
debug 10:37:09.629: Get Interpreter details, Class name = j (started execution), Arg 1: "/usr/local/bin/python"
debug 10:37:09.629: Got activation Env Vars without any caching. Key is /Users/matb/projects/san_/usr/local/bin/python
debug 10:37:09.629: Getting activated env variables from Python, Class name = K (started execution), Arg 1: undefined, Arg 2: <Uri:/usr/local/bin/python>
debug 10:37:09.629: Get Custom Env Variables, Class name = w (started execution), Arg 1: undefined, Arg 2: "RunPythonCode"
debug 10:37:09.629: Cached data exists getEnvironmentVariables, <No Resource>
debug 10:37:09.629: Cached custom vars data exists getCustomEnvironmentVariables, <No Resource>
debug 10:37:09.629: Get Custom Env Variables, Class name = w, completed in 0ms, has a truthy return value, Arg 1: undefined, Arg 2: "RunPythonCode"
debug 10:37:09.636: Get Interpreter details, Class name = j, completed in 7ms, has a truthy return value, Arg 1: "/usr/local/bin/python"
debug 10:37:09.636: Create ProcessService, Class name = h (started execution), Arg 1: undefined
debug 10:37:09.636: Get Custom Env Variables, Class name = w (started execution), Arg 1: undefined, Arg 2: "RunNonPythonCode"
debug 10:37:09.636: Cached data exists getEnvironmentVariables, <No Resource>
debug 10:37:09.636: Getting env activation commands, Class name = K (started execution), Arg 1: undefined, Arg 2: <Uri:/usr/local/bin/python>
debug 10:37:09.636: Getting activation commands for file:///usr/local/bin/python
debug 10:37:09.636: Getting activation commands for file:///usr/local/bin/python are not cached. May take a while.
debug 10:37:09.636: Get Custom Env Variables, Class name = w (started execution), Arg 1: undefined, Arg 2: "RunPythonCode"
debug 10:37:09.636: Cached data exists getEnvironmentVariables, <No Resource>
debug 10:37:09.636: Get Custom Env Variables, Class name = w, completed in 0ms, has a truthy return value, Arg 1: undefined, Arg 2: "RunNonPythonCode"
debug 10:37:09.636: Get Custom Env Variables, Class name = w, completed in 0ms, has a truthy return value, Arg 1: undefined, Arg 2: "RunPythonCode"
debug 10:37:09.636: Create ProcessService, Class name = h, completed in 0ms, has a truthy return value, Arg 1: undefined
debug 10:37:09.726: Loading kernelspec from /Users/matb/Library/Jupyter/kernels/typescript/kernel.json for
info 10:37:09.780: Got empty env vars with python /usr/local/bin/python in 151ms
debug 10:37:09.780: Getting activated env variables from Python, Class name = K, completed in 151ms, has a falsy return value, Arg 1: undefined, Arg 2: <Uri:/usr/local/bin/python>
debug 10:37:09.780: Got env vars with python /usr/local/bin/python in 151ms with 0 variables
debug 10:37:09.780: Got env vars from Python faster, but empty /usr/local/bin/python
debug 10:37:09.781: Getting env activation commands, Class name = K, completed in 145ms, has a falsy return value, Arg 1: undefined, Arg 2: <Uri:/usr/local/bin/python>
debug 10:37:09.781: Getting activated env variables ourselves, Class name = K, completed in 152ms, has a truthy return value, Arg 1: undefined, Arg 2: <Uri:/usr/local/bin/python>
debug 10:37:09.782: Got env vars ourselves /usr/local/bin/python in 153ms with 39 variables
debug 10:37:09.782: Getting activated env variables impl, Class name = K, completed in 153ms, has a truthy return value, Arg 1: undefined, Arg 2: <Uri:/usr/local/bin/python>
debug 10:37:09.782: Getting activated env variables, Class name = K, completed in 154ms, has a truthy return value, Arg 1: undefined, Arg 2: <Uri:/usr/local/bin/python>, Arg 3: true
debug 10:37:09.782: Create activated Env, Class name = w, completed in 154ms, has a truthy return value, Arg 1: {"allowEnvironmentFetchExceptions":true,"interpreter":{"id":"/usr/local/bin/python","sysPrefix":"/Library/Frameworks/Python.framework/Versions/3.10","displayPath":{"$mid":1,"path":"/usr/local/bin/python","scheme":"file"},"envName":"","uri":{"$mid":1,"fsPath":"/usr/local/bin/python","external":"file:///usr/local/bin/python","path":"/usr/local/bin/python","scheme":"file"},"displayName":"","envType":"Unknown","version":{"major":3,"minor":10,"patch":4,"raw":"3.10.4 (v3.10.4:9d38120e33, Mar 23 2022, 17:29:05) [Clang 13.0.0 (clang-13<IP_ADDRESS>)]"}}}
info 10:37:09.783: Process Execution: > /usr/local/bin/python -m pip list
> /usr/local/bin/python -m pip list
debug 10:37:09.796: Found 1 cached controllers
debug 10:37:09.796: Creating 1 controllers
debug 10:37:09.796: Creating notebook controller for startUsingLocalKernelSpec (id=.typescript./tslab./.tslab#kernel#--config-path#{connection_file}) with name 'TypeScript'
debug 10:37:09.797: Creating notebook controller for startUsingLocalKernelSpec (id=.typescript./tslab./.tslab#kernel#--config-path#{connection_file}) with name 'TypeScript'
debug 10:37:09.904: Rank Kernels, Class name = p (started execution), Arg 1: "Untitled-1.ipynb", Arg 2: "", Arg 3: {"orig_nbformat":4}, Arg 4: undefined, Arg 5: "", Arg 6: undefined
info 10:37:09.905: Preferred Remote kernel for Untitled-1.ipynb is undefined
info 10:37:09.905: Find preferred kernel for Untitled-1.ipynb with metadata {"orig_nbformat":4} & preferred interpreter <undefined>
debug 10:37:09.906: Rank Kernels, Class name = p, completed in 2ms, has a truthy return value, Arg 1: "Untitled-1.ipynb", Arg 2: "", Arg 3: {"orig_nbformat":4}, Arg 4: undefined, Arg 5: "", Arg 6: undefined
info 10:37:09.906: Preferred Remote kernel for Untitled-1.ipynb is undefined
info 10:37:09.906: Preferred kernel .typescript./tslab./.tslab#kernel#--config-path#{connection_file} is exact match or top match for non python kernels, (true, undefined, false, undefined)
info 10:37:09.907: PreferredConnection: .typescript./tslab./.tslab#kernel#--config-path#{connection_file} found for NotebookDocument: Untitled-1.ipynb
debug 10:37:09.907: TargetController found ID: startUsingLocalKernelSpec:.typescript./tslab./.tslab#kernel#--config-path#{connection_file} for document Untitled-1.ipynb
debug 10:37:09.908: Compute Preferred Controller, Class name = C, completed in 4ms, has a truthy return value, Arg 1: <Uri:Untitled-1.ipynb>, Return Value: <Return value cannot be serialized for logging>
debug 10:37:10.425: getCondaVersionFromPython, Class name = k, completed in 1046ms, has a truthy return value
debug 10:37:10.582: Full interpreter list after refreshing (total 961ms, resolve 3ms, refresh 958ms) is length: 5, /usr/bin/python3:undefined::/usr/bin/python3:/usr/bin/python3, /Users/matb/.pyenv/versions/2.7.18/bin/python:undefined:Pyenv:/Users/matb/.pyenv/versions/2.7.18/bin/python:/Users/matb/.pyenv/versions/2.7.18/bin/python, /usr/local/bin/python:undefined::/usr/local/bin/python:/usr/local/bin/python, /Users/matb/opt/anaconda3/bin/python:base:Conda:/Users/matb/opt/anaconda3/bin/python:/Users/matb/opt/anaconda3/bin/python, /usr/local/bin/python3.9:undefined::/usr/local/bin/python3.9:/usr/local/bin/python3.9
debug 10:37:10.593: Python environment /usr/local/bin/python from Python Extension API is {"internal":{"path":"/usr/local/bin/python","id":"/usr/local/bin/python","executable":{"uri":{"$mid":1,"path":"/usr/local/bin/python","scheme":"file"},"bitness":"64-bit","sysPrefix":"/Library/Frameworks/Python.framework/Versions/3.10"},"version":{"major":3,"minor":10,"micro":4,"release":{"level":"final","serial":0},"sysVersion":"3.10.4 (v3.10.4:9d38120e33, Mar 23 2022, 17:29:05) [Clang 13.0.0 (clang-13<IP_ADDRESS>)]"},"tools":[]},"id":"/usr/local/bin/python"} and translated is {"id":"/usr/local/bin/python","sysPrefix":"/Library/Frameworks/Python.framework/Versions/3.10","displayPath":{"$mid":1,"path":"/usr/local/bin/python","scheme":"file"},"envName":"","uri":{"$mid":1,"path":"/usr/local/bin/python","scheme":"file"},"displayName":"","envType":"Unknown","version":{"major":3,"minor":10,"patch":4,"raw":"3.10.4 (v3.10.4:9d38120e33, Mar 23 2022, 17:29:05) [Clang 13.0.0 (clang-13<IP_ADDRESS>)]"}}
debug 10:37:10.595: Get Active Interpreter, Class name = j (started execution), Arg 1: "~/projects/san"
debug 10:37:10.601: Python environment /usr/bin/python3 from Python Extension API is {"internal":{"path":"/usr/bin/python3","id":"/usr/bin/python3","executable":{"uri":{"$mid":1,"fsPath":"/usr/bin/python3","path":"/usr/bin/python3","scheme":"file"},"bitness":"64-bit","sysPrefix":"/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9"},"version":{"major":3,"minor":9,"micro":6,"release":{"level":"final","serial":0},"sysVersion":"3.9.6 (default, Sep 13 2022, 22:03:16) \n[Clang 14.0.0 (clang-14<IP_ADDRESS>)]"},"tools":[]},"id":"/usr/bin/python3"} and translated is {"id":"/usr/bin/python3","sysPrefix":"/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9","displayPath":{"$mid":1,"path":"/usr/bin/python3","scheme":"file"},"envName":"","uri":{"$mid":1,"external":"file:///usr/bin/python3","path":"/usr/bin/python3","scheme":"file"},"displayName":"","envType":"Unknown","version":{"major":3,"minor":9,"patch":6,"raw":"3.9.6 (default, Sep 13 2022, 22:03:16) \n[Clang 14.0.0 (clang-14<IP_ADDRESS>)]"}}
debug 10:37:10.601: Getting Jupyter KernelSpec Root Path, Class name = j, completed in 6ms, has a truthy return value, , Return Value: <Uri:/Users/matb/Library/Jupyter/kernels>
debug 10:37:10.602: Get Jupyter Kernel Paths, Class name = j, completed in 7ms, has a truthy return value, Arg 1: "", Return Value:
debug 10:37:10.602: Get KernelSpec root path, Class name = j, completed in 7ms, has a truthy return value, Arg 1: {"_isCancelled":false,"_emitter":null}, Return Value: <Uri:/usr/share/jupyter/kernels>, <Uri:/usr/local/share/jupyter/kernels>, <Uri:/Users/matb/Library/Jupyter/kernels>
debug 10:37:10.602: Get Active Interpreter, Class name = j, completed in 7ms, has a truthy return value, Arg 1: "~/projects/san", Return Value: {"id":"/usr/local/bin/python","sysPrefix":"/Library/Frameworks/Python.framework/Versions/3.10","displayPath":{"$mid":1,"path":"/usr/local/bin/python","scheme":"file"},"envName":"","uri":{"$mid":1,"path":"/usr/local/bin/python","scheme":"file"},"displayName":"","envType":"Unknown","version":{"major":3,"minor":10,"patch":4,"raw":"3.10.4 (v3.10.4:9d38120e33, Mar 23 2022, 17:29:05) [Clang 13.0.0 (clang-13<IP_ADDRESS>)]"}}
debug 10:37:10.602: Get Active Interpreter, Class name = j (started execution), Arg 1: "~/projects/san"
debug 10:37:10.608: Python environment /Users/matb/.pyenv/versions/2.7.18/bin/python from Python Extension API is {"internal":{"path":"/Users/matb/.pyenv/versions/2.7.18/bin/python","id":"/Users/matb/.pyenv/versions/2.7.18/bin/python","executable":{"uri":{"$mid":1,"fsPath":"/Users/matb/.pyenv/versions/2.7.18/bin/python","path":"/Users/matb/.pyenv/versions/2.7.18/bin/python","scheme":"file"},"bitness":"64-bit","sysPrefix":"/Users/matb/.pyenv/versions/2.7.18"},"version":{"major":2,"minor":7,"micro":18,"release":{"level":"final","serial":0},"sysVersion":"2.7.18 (default, Mar 28 2022, 15:17:32) \n[GCC Apple LLVM 13.1.6 (clang-13<IP_ADDRESS>)]"},"tools":["Pyenv"]},"id":"/Users/matb/.pyenv/versions/2.7.18/bin/python"} and translated is {"id":"/Users/matb/.pyenv/versions/2.7.18/bin/python","sysPrefix":"/Users/matb/.pyenv/versions/2.7.18","displayPath":{"$mid":1,"path":"/Users/matb/.pyenv/versions/2.7.18/bin/python","scheme":"file"},"envName":"","uri":{"$mid":1,"external":"file:///Users/matb/.pyenv/versions/2.7.18/bin/python","path":"/Users/matb/.pyenv/versions/2.7.18/bin/python","scheme":"file"},"displayName":"","envType":"Pyenv","version":{"major":2,"minor":7,"patch":18,"raw":"2.7.18 (default, Mar 28 2022, 15:17:32) \n[GCC Apple LLVM 13.1.6 (clang-13<IP_ADDRESS>)]"}}
debug 10:37:10.608: Getting Jupyter KernelSpec Root Path, Class name = j, completed in 5ms, has a truthy return value, , Return Value: <Uri:/Users/matb/Library/Jupyter/kernels>
debug 10:37:10.609: Get Jupyter Kernel Paths, Class name = j, completed in 6ms, has a truthy return value, Arg 1: "", Return Value:
debug 10:37:10.609: Get KernelSpec root path, Class name = j, completed in 6ms, has a truthy return value, Arg 1: {"_isCancelled":false,"_emitter":null}, Return Value: <Uri:/usr/share/jupyter/kernels>, <Uri:/usr/local/share/jupyter/kernels>, <Uri:/Users/matb/Library/Jupyter/kernels>
debug 10:37:10.609: Get Active Interpreter, Class name = j, completed in 7ms, has a truthy return value, Arg 1: "~/projects/san", Return Value: {"id":"/usr/local/bin/python","sysPrefix":"/Library/Frameworks/Python.framework/Versions/3.10","displayPath":{"$mid":1,"path":"/usr/local/bin/python","scheme":"file"},"envName":"","uri":{"$mid":1,"path":"/usr/local/bin/python","scheme":"file"},"displayName":"","envType":"Unknown","version":{"major":3,"minor":10,"patch":4,"raw":"3.10.4 (v3.10.4:9d38120e33, Mar 23 2022, 17:29:05) [Clang 13.0.0 (clang-13<IP_ADDRESS>)]"}}
debug 10:37:10.609: Get Active Interpreter, Class name = j (started execution), Arg 1: "~/projects/san"
debug 10:37:10.625: Python environment /Users/matb/opt/anaconda3/bin/python from Python Extension API is {"internal":{"path":"/Users/matb/opt/anaconda3/bin/python","id":"/Users/matb/opt/anaconda3/bin/python","executable":{"uri":{"$mid":1,"fsPath":"/Users/matb/opt/anaconda3/bin/python","path":"/Users/matb/opt/anaconda3/bin/python","scheme":"file"},"bitness":"64-bit","sysPrefix":"/Users/matb/opt/anaconda3"},"environment":{"type":"Conda","name":"base","folderUri":{"$mid":1,"path":"/Users/matb/opt/anaconda3","scheme":"file"}},"version":{"major":3,"minor":9,"micro":7,"release":{"level":"final","serial":0},"sysVersion":"3.9.7 (default, Sep 16 2021, 08:50:36) \n[Clang 10.0.0 ]"},"tools":["Conda"]},"id":"/Users/matb/opt/anaconda3/bin/python"} and translated is {"id":"/Users/matb/opt/anaconda3/bin/python","sysPrefix":"/Users/matb/opt/anaconda3","envPath":{"$mid":1,"path":"/Users/matb/opt/anaconda3","scheme":"file"},"displayPath":{"$mid":1,"path":"/Users/matb/opt/anaconda3","scheme":"file"},"envName":"base","uri":{"$mid":1,"external":"file:///Users/matb/opt/anaconda3/bin/python","path":"/Users/matb/opt/anaconda3/bin/python","scheme":"file"},"displayName":"base","envType":"Conda","version":{"major":3,"minor":9,"patch":7,"raw":"3.9.7 (default, Sep 16 2021, 08:50:36) \n[Clang 10.0.0 ]"}}
debug 10:37:10.626: Getting Jupyter KernelSpec Root Path, Class name = j, completed in 16ms, has a truthy return value, , Return Value: <Uri:/Users/matb/Library/Jupyter/kernels>
debug 10:37:10.627: Get Jupyter Kernel Paths, Class name = j, completed in 17ms, has a truthy return value, Arg 1: "", Return Value:
debug 10:37:10.627: Get KernelSpec root path, Class name = j, completed in 17ms, has a truthy return value, Arg 1: {"_isCancelled":false,"_emitter":null}, Return Value: <Uri:/usr/share/jupyter/kernels>, <Uri:/usr/local/share/jupyter/kernels>, <Uri:/Users/matb/Library/Jupyter/kernels>
debug 10:37:10.627: Get Active Interpreter, Class name = j, completed in 18ms, has a truthy return value, Arg 1: "~/projects/san", Return Value: {"id":"/usr/local/bin/python","sysPrefix":"/Library/Frameworks/Python.framework/Versions/3.10","displayPath":{"$mid":1,"path":"/usr/local/bin/python","scheme":"file"},"envName":"","uri":{"$mid":1,"path":"/usr/local/bin/python","scheme":"file"},"displayName":"","envType":"Unknown","version":{"major":3,"minor":10,"patch":4,"raw":"3.10.4 (v3.10.4:9d38120e33, Mar 23 2022, 17:29:05) [Clang 13.0.0 (clang-13<IP_ADDRESS>)]"}}
debug 10:37:10.627: Get Active Interpreter, Class name = j (started execution), Arg 1: "~/projects/san"
debug 10:37:10.632: Python environment /usr/local/bin/python3.9 from Python Extension API is {"internal":{"path":"/usr/local/bin/python3.9","id":"/usr/local/bin/python3.9","executable":{"uri":{"$mid":1,"fsPath":"/usr/local/bin/python3.9","path":"/usr/local/bin/python3.9","scheme":"file"},"bitness":"64-bit","sysPrefix":"/usr/local/opt/python@3.9/Frameworks/Python.framework/Versions/3.9"},"version":{"major":3,"minor":9,"micro":14,"release":{"level":"final","serial":0},"sysVersion":"3.9.14 (main, Sep  6 2022, 23:29:09) \n[Clang 13.1.6 (clang-13<IP_ADDRESS>.5)]"},"tools":[]},"id":"/usr/local/bin/python3.9"} and translated is {"id":"/usr/local/bin/python3.9","sysPrefix":"/usr/local/opt/python@3.9/Frameworks/Python.framework/Versions/3.9","displayPath":{"$mid":1,"path":"/usr/local/bin/python3.9","scheme":"file"},"envName":"","uri":{"$mid":1,"external":"file:///usr/local/bin/python3.9","path":"/usr/local/bin/python3.9","scheme":"file"},"displayName":"","envType":"Unknown","version":{"major":3,"minor":9,"patch":14,"raw":"3.9.14 (main, Sep  6 2022, 23:29:09) \n[Clang 13.1.6 (clang-13<IP_ADDRESS>.5)]"}}
debug 10:37:10.632: Getting Jupyter KernelSpec Root Path, Class name = j, completed in 5ms, has a truthy return value, , Return Value: <Uri:/Users/matb/Library/Jupyter/kernels>
debug 10:37:10.633: Get Jupyter Kernel Paths, Class name = j, completed in 6ms, has a truthy return value, Arg 1: "", Return Value:
debug 10:37:10.633: Get KernelSpec root path, Class name = j, completed in 6ms, has a truthy return value, Arg 1: {"_isCancelled":false,"_emitter":null}, Return Value: <Uri:/usr/share/jupyter/kernels>, <Uri:/usr/local/share/jupyter/kernels>, <Uri:/Users/matb/Library/Jupyter/kernels>
debug 10:37:10.633: Full interpreter list is length: 5, /usr/local/bin/python::Unknown:/usr/local/bin/python, /usr/bin/python3::Unknown:/usr/bin/python3, /Users/matb/.pyenv/versions/2.7.18/bin/python::Pyenv:/Users/matb/.pyenv/versions/2.7.18/bin/python, /Users/matb/opt/anaconda3/bin/python:base:Conda:/Users/matb/opt/anaconda3/bin/python, /usr/local/bin/python3.9::Unknown:/usr/local/bin/python3.9
debug 10:37:10.634: Get Active Interpreter, Class name = j, completed in 7ms, has a truthy return value, Arg 1: "~/projects/san", Return Value: {"id":"/usr/local/bin/python","sysPrefix":"/Library/Frameworks/Python.framework/Versions/3.10","displayPath":{"$mid":1,"path":"/usr/local/bin/python","scheme":"file"},"envName":"","uri":{"$mid":1,"path":"/usr/local/bin/python","scheme":"file"},"displayName":"","envType":"Unknown","version":{"major":3,"minor":10,"patch":4,"raw":"3.10.4 (v3.10.4:9d38120e33, Mar 23 2022, 17:29:05) [Clang 13.0.0 (clang-13<IP_ADDRESS>)]"}}
debug 10:37:10.638: Not Searching for kernels as path does not exist, /Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/share/jupyter/kernels
debug 10:37:10.638: Not Searching for kernels as path does not exist, /Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/share/jupyter/kernels
debug 10:37:10.638: Not Searching for kernels as path does not exist, /Users/matb/.pyenv/versions/2.7.18/share/jupyter/kernels
debug 10:37:10.638: Not Searching for kernels as path does not exist, /Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/share/jupyter/kernels
debug 10:37:10.638: Not Searching for kernels as path does not exist, /Users/matb/.pyenv/versions/2.7.18/share/jupyter/kernels
debug 10:37:10.639: Not Searching for kernels as path does not exist, /Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/share/jupyter/kernels
debug 10:37:10.639: Not Searching for kernels as path does not exist, /Users/matb/.pyenv/versions/2.7.18/share/jupyter/kernels
debug 10:37:10.639: Not Searching for kernels as path does not exist<EMAIL_ADDRESS>debug 10:37:10.649: Loading kernelspec from /Library/Frameworks/Python.framework/Versions/3.10/share/jupyter/kernels/python3/kernel.json for /usr/local/bin/python
debug 10:37:10.649: Loading kernelspec from /Users/matb/opt/anaconda3/share/jupyter/kernels/python3/kernel.json for /Users/matb/opt/anaconda3/bin/python
debug 10:37:10.671: Hiding default kernel spec 'Python 3 (ipykernel)', 'pythonjvsc74a57bd0949777d72b0d2535278d3dc13498b2535136f6dfe0678499012e853ee9abcab1', /python
debug 10:37:10.671: Hiding default kernel spec 'Python 3 (ipykernel)', 'pythonjvsc74a57bd0c35a74a3850f235c1e9c2026de8023a5cd91a63c7369f2d07139a955bab08ad4', ~/opt/anaconda3/bin/python
debug 10:37:10.673: Found 6 cached controllers
debug 10:37:10.673: Creating 6 controllers
debug 10:37:10.673: Creating notebook controller for startUsingPythonInterpreter (id=.jvsc74a57bd0949777d72b0d2535278d3dc13498b2535136f6dfe0678499012e853ee9abcab1./usr/local/python./usr/local/python.-m#ipykernel_launcher) with name 'Python 3.10.4'
debug 10:37:10.673: Creating notebook controller for startUsingPythonInterpreter (id=.jvsc74a57bd0949777d72b0d2535278d3dc13498b2535136f6dfe0678499012e853ee9abcab1./usr/local/python./usr/local/python.-m#ipykernel_launcher) with name 'Python 3.10.4'
debug 10:37:10.674: Creating notebook controller for startUsingPythonInterpreter (id=.jvsc74a57bd031f2aee4e71d21fbe5cf8b01ff0e069b9275f58929596ceb00d14d90e3e16cd6./usr/bin/python3./usr/bin/python3.-m#ipykernel_launcher) with name 'Python 3.9.6'
debug 10:37:10.674: Creating notebook controller for startUsingPythonInterpreter (id=.jvsc74a57bd031f2aee4e71d21fbe5cf8b01ff0e069b9275f58929596ceb00d14d90e3e16cd6./usr/bin/python3./usr/bin/python3.-m#ipykernel_launcher) with name 'Python 3.9.6'
debug 10:37:10.674: Creating notebook controller for startUsingPythonInterpreter (id=.jvsc74a57bd0c08ed6923d212ea8bc0a3a1e19da13c7ecd07f4d6de60b22fa51428ec745f9b6./Users/matb/.pyenv/versions/2.7.18/python./Users/matb/.pyenv/versions/2.7.18/python.-m#ipykernel_launcher) with name 'Python 2.7.18'
debug 10:37:10.675: Creating notebook controller for startUsingPythonInterpreter (id=.jvsc74a57bd0c08ed6923d212ea8bc0a3a1e19da13c7ecd07f4d6de60b22fa51428ec745f9b6./Users/matb/.pyenv/versions/2.7.18/python./Users/matb/.pyenv/versions/2.7.18/python.-m#ipykernel_launcher) with name 'Python 2.7.18'
debug 10:37:10.675: Creating notebook controller for startUsingPythonInterpreter (id=.jvsc74a57bd0c35a74a3850f235c1e9c2026de8023a5cd91a63c7369f2d07139a955bab08ad4./Users/matb/opt/anaconda3/python./Users/matb/opt/anaconda3/python.-m#ipykernel_launcher) with name 'base (Python 3.9.7)'
debug 10:37:10.676: Creating notebook controller for startUsingPythonInterpreter (id=.jvsc74a57bd0c35a74a3850f235c1e9c2026de8023a5cd91a63c7369f2d07139a955bab08ad4./Users/matb/opt/anaconda3/python./Users/matb/opt/anaconda3/python.-m#ipykernel_launcher) with name 'base (Python 3.9.7)'
debug 10:37:10.676: Creating notebook controller for startUsingPythonInterpreter (id=.jvsc74a57bd0397704579725e15f5c7cb49fe5f0341eb7531c82d19f2c29d197e8b64ab5776b./usr/local/bin/python3.9./usr/local/bin/python3.9.-m#ipykernel_launcher) with name 'Python 3.9.14'
debug 10:37:10.676: Creating notebook controller for startUsingPythonInterpreter (id=.jvsc74a57bd0397704579725e15f5c7cb49fe5f0341eb7531c82d19f2c29d197e8b64ab5776b./usr/local/bin/python3.9./usr/local/bin/python3.9.-m#ipykernel_launcher) with name 'Python 3.9.14'
debug 10:37:10.778: Rank Kernels, Class name = p (started execution), Arg 1: "Untitled-1.ipynb", Arg 2: "", Arg 3: {"orig_nbformat":4}, Arg 4: undefined, Arg 5: "", Arg 6: undefined
info 10:37:10.778: Preferred Remote kernel for Untitled-1.ipynb is undefined
info 10:37:10.778: Find preferred kernel for Untitled-1.ipynb with metadata {"orig_nbformat":4} & preferred interpreter <undefined>
debug 10:37:10.778: Rank Kernels, Class name = p, completed in 0ms, has a truthy return value, Arg 1: "Untitled-1.ipynb", Arg 2: "", Arg 3: {"orig_nbformat":4}, Arg 4: undefined, Arg 5: "", Arg 6: undefined
info 10:37:10.779: Preferred Remote kernel for Untitled-1.ipynb is undefined
debug 10:37:10.779: Rank Kernels, Class name = p (started execution), Arg 1: "Untitled-1.ipynb", Arg 2: "", Arg 3: {"orig_nbformat":4}, Arg 4: undefined, Arg 5: "", Arg 6: undefined
info 10:37:10.779: Preferred Remote kernel for Untitled-1.ipynb is undefined
info 10:37:10.779: Find preferred kernel for Untitled-1.ipynb with metadata {"orig_nbformat":4} & preferred interpreter <undefined>
debug 10:37:10.780: Rank Kernels, Class name = p, completed in 1ms, has a truthy return value, Arg 1: "Untitled-1.ipynb", Arg 2: "", Arg 3: {"orig_nbformat":4}, Arg 4: undefined, Arg 5: "", Arg 6: undefined
info 10:37:10.780: Preferred Remote kernel for Untitled-1.ipynb is undefined
debug 10:37:10.781: Compute Preferred Controller, Class name = C, completed in 4ms, has a truthy return value, Arg 1: <Uri:Untitled-1.ipynb>, Return Value: {}
debug 10:37:11.059: _jupyterPythonPathFunction: "file:///Users/matb/projects/san" is not a notebook
debug 10:37:11.326: Get Active Interpreter, Class name = j (started execution), Arg 1: "Untitled-1.ipynb"
debug 10:37:11.327: Get Active Interpreter, Class name = j, completed in 1ms, has a truthy return value, Arg 1: "Untitled-1.ipynb", Return Value: {"id":"/usr/local/bin/python","sysPrefix":"/Library/Frameworks/Python.framework/Versions/3.10","displayPath":{"$mid":1,"path":"/usr/local/bin/python","scheme":"file"},"envName":"","uri":{"$mid":1,"path":"/usr/local/bin/python","scheme":"file"},"displayName":"","envType":"Unknown","version":{"major":3,"minor":10,"patch":4,"raw":"3.10.4 (v3.10.4:9d38120e33, Mar 23 2022, 17:29:05) [Clang 13.0.0 (clang-13<IP_ADDRESS>)]"}}
debug 10:37:11.327: _jupyterPythonPathFunction: Giving Pylance "/usr/local/bin/python" as python path for "untitled:Untitled-1.ipynb?jupyter-notebook"
debug 10:37:15.079: interpreterPackages getPackageInformation, Class name = r, completed in 5451ms, has a falsy return value, Arg 1: {"interpreter":{"id":"/usr/local/bin/python","sysPrefix":"/Library/Frameworks/Python.framework/Versions/3.10","displayPath":{"$mid":1,"path":"/usr/local/bin/python","scheme":"file"},"envName":"","uri":{"$mid":1,"fsPath":"/usr/local/bin/python","external":"file:///usr/local/bin/python","path":"/usr/local/bin/python","scheme":"file"},"displayName":"","envType":"Unknown","version":{"major":3,"minor":10,"patch":4,"raw":"3.10.4 (v3.10.4:9d38120e33, Mar 23 2022, 17:29:05) [Clang 13.0.0 (clang-13<IP_ADDRESS>)]"}}}


Conditional types

This PR introduces conditional types which add the ability to express non-uniform type mappings. A conditional type selects one of two possible types based on a condition expressed as a type relationship test:
T extends U ? X : Y

The type above means when T is assignable to U the type is X, otherwise the type is Y. Evaluation of a conditional type is deferred when evaluation of the condition depends on type variables in T or U, but is resolved to either X or Y when the condition depends on no type variables.
An example:
type TypeName<T> =
    T extends string ? "string" :
    T extends number ? "number" :
    T extends boolean ? "boolean" :
    T extends undefined ? "undefined" :
    T extends Function ? "function" :
    "object";

type T0 = TypeName<string>;  // "string"
type T1 = TypeName<"a">;  // "string"
type T2 = TypeName<true>;  // "boolean"
type T3 = TypeName<() => void>;  // "function"
type T4 = TypeName<string[]>;  // "object"

Conditional types in which the checked type is a naked type parameter are called distributive conditional types. Distributive conditional types are automatically distributed over union types during instantiation. For example, an instantiation of T extends U ? X : Y with the type argument A | B | C for T is resolved as (A extends U ? X : Y) | (B extends U ? X : Y) | (C extends U ? X : Y).
type T10 = TypeName<string | (() => void)>;  // "string" | "function"
type T12 = TypeName<string | string[] | undefined>;  // "string" | "object" | "undefined"
type T11 = TypeName<string[] | number[]>;  // "object"

In instantiations of a distributive conditional type T extends U ? X : Y, references to T within the conditional type are resolved to individual constituents of the union type (i.e. T refers to the individual constituents after the conditional type is distributed over the union type). Furthermore, references to T within X have an additional type parameter constraint U (i.e. T is considered assignable to U within X).
type BoxedValue<T> = { value: T };
type BoxedArray<T> = { array: T[] };
type Boxed<T> = T extends any[] ? BoxedArray<T[number]> : BoxedValue<T>;

type T20 = Boxed<string>;  // BoxedValue<string>;
type T21 = Boxed<number[]>;  // BoxedArray<number>;
type T22 = Boxed<string | number[]>;  // BoxedValue<string> | BoxedArray<number>;

Notice that T has the additional constraint any[] within the true branch of Boxed<T> and it is therefore possible to refer to the element type of the array as T[number]. Also, notice how the conditional type is distributed over the union type in the last example.
The distributive property of conditional types can conveniently be used to filter union types:
type Diff<T, U> = T extends U ? never : T;  // Remove types from T that are assignable to U
type Filter<T, U> = T extends U ? T : never;  // Remove types from T that are not assignable to U

type T30 = Diff<"a" | "b" | "c" | "d", "a" | "c" | "f">;  // "b" | "d"
type T31 = Filter<"a" | "b" | "c" | "d", "a" | "c" | "f">;  // "a" | "c"
type T32 = Diff<string | number | (() => void), Function>;  // string | number
type T33 = Filter<string | number | (() => void), Function>;  // () => void

type NonNullable<T> = Diff<T, null | undefined>;  // Remove null and undefined from T

type T34 = NonNullable<string | number | undefined>;  // string | number
type T35 = NonNullable<string | string[] | null | undefined>;  // string | string[]

function f1<T>(x: T, y: NonNullable<T>) {
    x = y;  // Ok
    y = x;  // Error
}

function f2<T extends string | undefined>(x: T, y: NonNullable<T>) {
    x = y;  // Ok
    y = x;  // Error
    let s1: string = x;  // Error
    let s2: string = y;  // Ok
}

Conditional types are particularly useful when combined with mapped types:
type FunctionPropertyNames<T> = { [K in keyof T]: T[K] extends Function ? K : never }[keyof T];
type FunctionProperties<T> = Pick<T, FunctionPropertyNames<T>>;

type NonFunctionPropertyNames<T> = { [K in keyof T]: T[K] extends Function ? never : K }[keyof T];
type NonFunctionProperties<T> = Pick<T, NonFunctionPropertyNames<T>>;

interface Part {
    id: number;
    name: string;
    subparts: Part[];
    updatePart(newName: string): void;
}

type T40 = FunctionPropertyNames<Part>;  // "updatePart"
type T41 = NonFunctionPropertyNames<Part>;  // "id" | "name" | "subparts"
type T42 = FunctionProperties<Part>;  // { updatePart(newName: string): void }
type T43 = NonFunctionProperties<Part>;  // { id: number, name: string, subparts: Part[] }

Combining all of the above to create a DeepReadonly<T> type that recursively makes all properties of an object read-only and removes all function properties (i.e. methods):
type DeepReadonly<T> =
    T extends any[] ? DeepReadonlyArray<T[number]> :
    T extends object ? DeepReadonlyObject<T> :
    T;

interface DeepReadonlyArray<T> extends ReadonlyArray<DeepReadonly<T>> {}

type DeepReadonlyObject<T> = {
    readonly [P in NonFunctionPropertyNames<T>]: DeepReadonly<T[P]>;
};

function f10(part: DeepReadonly<Part>) {
    let name: string = part.name;
    let id: number = part.subparts[0].id;
    part.id = part.id;  // Error
    part.subparts[0] = part.subparts[0];  // Error
    part.subparts[0].id = part.subparts[0].id;  // Error
    part.updatePart("hello");  // Error
}

Similar to union and intersection types, conditional types are not permitted to reference themselves recursively (however, indirect references through interface types or object literal types are allowed, as illustrated by the DeepReadonly<T> example above). For example the following is an error:
type ElementType<T> = T extends any[] ? ElementType<T[number]> : T;  // Error

For further examples see the tests associated with the PR.
EDIT: See #21496 for type inference in conditional types.
Fixes #12215.
Fixes #12424.

Here's a DeepPartial based on the DeepReadonly above:
type DeepPartial<T> =
    T extends any[] ? DeepPartialArray<T[number]> :
    T extends object ? DeepPartialObject<T> :
    T;

type DeepPartialArray<T> = Array<DeepPartial<T>>;

type DeepPartialObject<T> = {
    [P in keyof T]?: DeepPartial<T[P]>;
};

@mohsen1 @isiahmeadows:
type Xor<T, A, B> = T extends A ? (T extends B ? never : T) : (T extends B ? T : never);
type Person<T> = Xor<T, { name: string; }, { firstname: string; lastname: string; }>;

Hm. If one were to pass { name: 'a', firstname: 'b' }, I suppose it'd still go through. That makes sense, but at that point I'm not sure when one would actually one use a construct like this.

@tycho01

Hm. If one were to pass { name: 'a', firstname: 'b' }, I suppose it'd still go through. That makes sense, but at that point I'm not sure when one would actually one use a construct like this.

That is true, and good catch. Although, you could make it a little less crappy with an intersection type:
type Person<T> =
    Xor<T, { name: string; }, { firstname: string; }> &
    Xor<T, { name: string; }, { lastname: string; }>;

Although that brings the question again of a variadic union if you want it to scale past individual keys.

Now that we have Exclude now as a builtin type (which effectively amounts to set difference), it's probably better specified as this:
// type Exclude<T, A> = T extends A ? never : T;
type Xor<A, B> = Exclude<A | B, A & B>;
type Xor<A, B> = Exclude<A, B> | Exclude<B, A>;

And when you want to assert assignability, you should use Extract<T, Xor<A, B>>.

@tycho01 Loos like you neglected to define  DeepPartialArray.  Is it
interface DeepPartialArray<T> extends Array<DeepPartial<T> | undefined> { }

or something like that?

@jcalz: whoops, you're right! Not sure about the undefined (on phone atm), but yes.

Should there be a separate issue tracking allowing recursion in conditional types (or relaxing the circularity detection in the type system in general)?  I would 👍 the heck out of that issue.  Conditional types and infer have been absolutely amazing but I find that I keep running into this issue when trying to implement some type operations I've been waiting for.

I've seen this question before: how can you programmatically refer to a constituent of a tagged union given the value of the discriminant?  Before now the answer has always been "you can't do that directly".  Now the answer is something like:
type DiscriminateUnion<Union, TagKey extends keyof Union, TagValue extends Union[TagKey]> =
  Union extends Record<TagKey, TagValue> ? Union : never;

So, using the Shape example from the handbook you can do:
type DiscriminateShape<V extends Shape['kind']> = DiscriminateUnion<Shape, 'kind', V>
declare const rectangle: DiscriminateShape<'rectangle'>; // is a Rectangle

Anyone know if there's a canonical GitHub issue for this question? I feel certain I've seen it asked, but my search-fu is not strong.

@jcalz: whoops, you're right! Not sure about the undefined (on phone atm), but yes.

@jcalz:

Should there be a separate issue tracking allowing recursion in conditional types (or relaxing the circularity detection in the type system in general)? I would 👍 the heck out of such an issue. Conditional types and infer have been absolutely amazing but I find that I keep running into this limitation when trying to implement some type operations I've been waiting for.

Yeah, I'm interested in this as well -- you might know many of my types have relied on recursion.
From what I've gathered type recursion has come up in recent meetings (#21705, #21838) under a provisional while syntax currently investigated for Awaited at #21613.
I imagine that's probably a good place to join the ongoing discussion (issues, solutions), and it looks like over there they linked to a recursion-related issue as well, if perhaps a different one from the circularity detection you mentioned.
My primary issue with recursion is debugging issues when a type goes bad and compilation just won't terminate.

@tycho01

My primary issue with recursion is debugging issues when a type goes bad and compilation just won't terminate.

I presume you'd hit a stack overflow first, unless they at some point think to optimize recursive types via lowering their checker to use loops instead (which I don't find too terribly likely).

I presume you'd hit a stack overflow first

Also If you’re seeing a lot more stack overflows in type-level programming since 2.7.1, hopefully that should be fixed once this issue is closed: https://github.com/Microsoft/TypeScript/issues/21592 (scheduled for 2.7.2).

i question stack overflow cannot be cured by defining type smarter (by explicitly detecting an loop in them before processing), i am convinced it's doable because i cannot find a counter example

@aleksey-bykov: there are always going to be loops that can't be detected as long as the type system is turing complete

I considered type recursion a feature, not a bug. :)

@pelotom Does turing-completeness directly apply here where we're just considering termination of the while operator? Could it not be the case that while is defined in such a way that it is always guaranteed to terminate?

i mean type definition is a known thing (expressed via syntax) and detecting recurrent structures in it:

can be done separately and prior to processing it, so you are better armed upfront knowning there is recurrence or non of thereof
doing it upfront is as difficult or more likely less difficult than dealing with it as you go
additional syntax annotation (see rec in F#) can simplify it even further narrowing the scope of analysis to the current level only

Would it help if we enforced that all recursive types were tail-recursive? (Should we even do that?)

Would it help if we enforced that all recursive types were tail-recursive? (Should we even do that?)

To me it’s a feature that the type checker stack overflows instead of iterating forever 🤷♂

@aleksey-bykov

i mean type definition is a known thing (expressed via syntax) and detecting recurrent structures in it:

can be done separately and prior to processing it, so you are better armed upfront knowning there is recurrence or non of thereof

For direct recursion, yes. For mutual recursion, that's much harder, and it generally requires some sort of trampoline to recurse on an AST.

doing it upfront is as difficult or more likely less difficult than dealing with it as you go
additional syntax annotation (see rec in F#) can simplify it even further narrowing the scope of analysis to the current level only

For context, OCaml and friends require let rec to limit the complexity of detecting mutually recursive functions. But if you use specialized trampolines to perform tail call optimization in conditional types, you wouldn't even need that. (It's actually pretty straightforward to implement.)

And this is why I mostly question the TS team's ideas on looping - it's not hard to write a trampoline loop for an AST evaluator (which is IIUC basically how the type system is implemented to a large extent - evaluating a type AST to figure out what to check, then checking it against the expected type as necessary).

Hmm, I guess the recursion discussion is happening here.

@jcalz if hacky syntax counts, I put a recursion + conditionals PoC at #21613.

I'm trying to figure out if there's a way to remove an indexer signature from a type, but I can't seem to grasp any way it could work. Anyone has an idea whether it's possible? My issue seems to be that keyof T always widens to string and that every type implicitly extends a string indexer.
Here's an example of what I'd imagine:
type Options = {
    [key: string]: string;
    knownProperty: string;
    anotherKnownProperty: string;
}

type WithoutIndexer<T> = /* magic be here */
type OptionsWithoutIndexer = WithoutIndexer<Options>

// The above should not match this signature:
// { knownProperty: string; anotherKnownProperty: string }

@MartinJohns not sure this issue is the place for it, but as far as I know it's still not possible even with conditional types.  #16392 is closed but still might be the place for discussion?  Not sure.

I'm trying out conditional types and thought if it would be possible to implement function overloading through them. I'm probably trying to use them for something they are not supposed be used for, but in the current typescript@next (Version 2.8.0-dev.20180217) I get some strange results.
For simple cases it kind of works:
type Return<T> =
    T extends string ? number :
    T extends number ? string :
    never;

declare function foo<T> (v: T): Return<T>

const a: number = foo('foo');
const b: string = foo(42);

However if I try to implement the function, there is a problem that TypeScript can not actually match the return type:
function foo<T> (v: T): Return<T> {
    if (typeof v === 'string') {
        return 42; // Type '42' is not assignable to type 'Return<T>'.
    } else {
        return 'foo'; //  Type '"foo"' is not assignable to type 'Return<T>'.
    }
}

I believe I can understand why it behaves they way it behaves, however making the type of Return<T> in this case be a union of all the possible branches of the conditional pattern match (so string | number
in this case) inside of the the implementation could make relatively type-safe implementation fo the body of this function possible.

Regardless of the viability of the use case above, there seems to be a bug that causes this code:
type T0<T> = ({[K in keyof T]}) extends ({[key in K]: T[K]}) ? number : never;

with error:
/mnt/c/Users/dmitr_000/Documents/Development/get/node_modules/typescript/lib/tsc.js:60550
                throw e;
                ^

TypeError: Cannot read property 'kind' of undefined
    at emitType (/mnt/c/Users/dmitr_000/Documents/Development/get/node_modules/typescript/lib/tsc.js:55341:26)
    at emitMappedType (/mnt/c/Users/dmitr_000/Documents/Development/get/node_modules/typescript/lib/tsc.js:55508:17)
    at emitType (/mnt/c/Users/dmitr_000/Documents/Development/get/node_modules/typescript/lib/tsc.js:55380:28)
    at emitParenType (/mnt/c/Users/dmitr_000/Documents/Development/get/node_modules/typescript/lib/tsc.js:55472:17)
    at emitType (/mnt/c/Users/dmitr_000/Documents/Development/get/node_modules/typescript/lib/tsc.js:55374:28)
    at emitConditionalType (/mnt/c/Users/dmitr_000/Documents/Development/get/node_modules/typescript/lib/tsc.js:55455:17)
    at emitType (/mnt/c/Users/dmitr_000/Documents/Development/get/node_modules/typescript/lib/tsc.js:55370:28)
    at emitTypeWithNewGetSymbolAccessibilityDiagnostic (/mnt/c/Users/dmitr_000/Documents/Development/get/node_modules/typescript/lib/tsc.js:55338:13)
    at writeTypeAliasDeclaration (/mnt/c/Users/dmitr_000/Documents/Development/get/node_modules/typescript/lib/tsc.js:55839:13)
    at writeModuleElement (/mnt/c/Users/dmitr_000/Documents/Development/get/node_modules/typescript/lib/tsc.js:55631:28)

Sorry for such a long comment, and I would appreciate any hints if this direction is worth exploring at all.

It would be really cool if conditional types enabled function overloading for arrow functions

@felixfbecker its my understanding that they do:
type A = { a: any }
type AR = { ar: any }

type B = { b: any }
type BR = { br: any }

type C = { c: any }
type CR = { cr: any }

type T = A | B | C
const overloadedFunction = (param: T): T extends A ? AR : T extends B ? BR : CR => { ... }

@grassator said:

However if I try to implement the function, there is a problem that TypeScript can not actually match the return type:

function foo (v: T): Return {
    if (typeof v === 'string') {
        return 42; // Type '42' is not assignable to type 'Return'.
    } else {
        return 'foo'; //  Type '"foo"' is not assignable to type 'Return'.
    }
}

I like your idea; maybe you should make a new issue suggesting it?  Or is it a duplicate of #13995?  I think they are related: control flow analysis narrows the type of the value v, but doesn't constrain T itself to something like T extends string .  Not sure if we should expect TypeScript to just allow this as-is, but a workaround I've been using is the "one-signature overload", which relaxes the implementation rules to something closer to what you want:
function foo<T> (v: T): Return<T>;  // strict call signature
function foo(v: any): Return<any> { // looser impl signature
    if (typeof v === 'string') {
        return 42; // okay
    } else {
        return 'foo'; //  okay
    }
}

@jcalz

control flow analysis narrows the type of the value v, but doesn't constrain T itself to something like T extends string

I don't think it safe to back propagate narrowing to the type parameter in general.
function foo<T> (v: T, y: T): Return<T> {
    if (typeof v === 'string') {
        return 42; // this does not mean T extends string
    } else {
        return 'foo';
    }
}
foo<string | number>('a string', 42);

Type checking this example accurately seems hard, your solution seems the most pragmatic one.

Did you consider alternative syntax such as:
if(T extends U) X else Y

IMO it makes code nicer than ?: characters.

@NN--- while the JS if construction would be among the first things people learn of JS, it is actually not as close to the current construct as JS's ternary operator ? :.
The difference is if then is for statements (imperative), while the ternary operator returns a value. The current syntax is like a type-level equivalent of that.

I don't think this should be erroring on<EMAIL_ADDRESS>
interface ArrayOperations<T extends any[]> {
}

type WriteQuery<Type> = {[param in keyof Type]?: Type[param] extends any[] ? ArrayOperations<Type[param]>: Type[param]}

Error: [ts] Type 'Type[param]' does not satisfy the constraint 'any[]'.

@Griffork Is this a temporary workaround for you? I'm afraid I couldn't comment on what should or should not be the correct behaviour.
interface ArrayOperations<T extends any[]> {
}
type Is<T extends U,U> = T;
type WriteQuery<Type> = {[param in keyof Type]?: Type[param] extends Is<infer U,any[]> ? ArrayOperations<U>: Type[param]}

@Griffork is your issue a duplicate of one of #21729,  #21937 or #22347?

@Griffork That's a duplicate of #21729.

I want to write a function that takes all but 1 type. For example, a function that takes (any - boolean). Maybe I'm not understanding this correctly, but I feel like I should be able to do this:
type NotBoolean<T> = T extends boolean ? never : T

function isTruthy <T extends NotBoolean<T>> (value: T): boolean {
  if (value) {
    return true
  }

  return false
}

I want to exclude boolean from the domain of this function. If I do it that way I get Type parameter T has circular constraint and if I do this:
function isTruthy<T, U extends NotBoolean<T>> (value: U): boolean

Then isTruthy(false) compiles just fine.
Is this just not what conditional types are for, and I've misunderstood? Thanks!

I've found that circular constraints can be worked around with the following annoying default-param thing:
declare function isTruthy<T extends NotBoolean<U>, U=T> (value: T): boolean;
isTruthy(true); // error
isTruthy(false); // error
isTruthy(Math.random() < 0.5); // error
isTruthy("hey"); // okay
isTruthy(Math.random() < 0.5 ? true : "hey"); // error, true | "hey" is maybe a boolean?

That's a nice trick @jcalz.
Is this semantically the same?
declare isTruthy<T>(value: T & NotBoolean<T>): boolean;

Yep, sorry. I never know what keywords to use.

@jack-williams: I guess that works too.  I never can seem to predict when the compiler will successfully infer T from a value of type SomeTypeFunction<T>.  For example, if I do isTruthy(true) with your definition, the compiler sees T & NotBoolean<T> = true and somehow infers T = true, which implies that  T & NotBoolean<T> is acutally never, and you get the (desired) error.  That kind of breaks my brain.  I'd just as soon expect that it would give up and say T = {}, which makes T & NotBoolean<T> = {}, which matches the value true and there'd be no error.   So mostly I play around with things until they work.  Any insight someone has about this would be helpful.

@jcalz In most cases if there are multiple inference sites, as in T & Something<T> we either infer the common subtype if there is one, or otherwise just take the result from the first inference site. In this case, inferring from true to T is easy and we get an answer (true), but NotBoolean<T> doesn't produce an inference for T at all, so T becomes true (from the one successful inference), which is then used to instantiate T & NotBoolean<T>, which becomes true & never, which is never, which true is not assignable to, thus giving you the desired error.

Sorry if there is a more appropriate place to post this, but thanks for the new (albeit sometimes complicated) ways to express behavior!
type IsValidArg<T> = T extends object ? keyof T extends never ? false : true : true;

type NumberOfArgs<T extends Function> =
    T extends (a: infer A, b: infer B, c: infer C, d: infer D, e: infer E, f: infer F, g: infer G, h: infer H, i: infer I, j: infer J) => any ? (
        IsValidArg<J> extends true ? 10 :
        IsValidArg<I> extends true ? 9 :
        IsValidArg<H> extends true ? 8 :
        IsValidArg<G> extends true ? 7 :
        IsValidArg<F> extends true ? 6 :
        IsValidArg<E> extends true ? 5 :
        IsValidArg<D> extends true ? 4 :
        IsValidArg<C> extends true ? 3 :
        IsValidArg<B> extends true ? 2 :
        IsValidArg<A> extends true ? 1 : 0
    ) : 0;

function numArgs<T extends Function>(fn: T): NumberOfArgs<T> {
    return fn.length as any;
}

declare function exampleFunction(a: number, b: string, c?: any[]): void;
const test = numArgs(exampleFunction);

type Promisified<T extends Function> =
    T extends (...args: any[]) => Promise<any> ? T : (
        T extends (a: infer A, b: infer B, c: infer C, d: infer D, e: infer E, f: infer F, g: infer G, h: infer H, i: infer I, j: infer J) => infer R ? (
            IsValidArg<J> extends true ? (a: A, b: B, c: C, d: D, e: E, f: F, g: G, h: H, i: I, j: J) => Promise<R> :
            IsValidArg<I> extends true ? (a: A, b: B, c: C, d: D, e: E, f: F, g: G, h: H, i: I) => Promise<R> :
            IsValidArg<H> extends true ? (a: A, b: B, c: C, d: D, e: E, f: F, g: G, h: H) => Promise<R> :
            IsValidArg<G> extends true ? (a: A, b: B, c: C, d: D, e: E, f: F, g: G) => Promise<R> :
            IsValidArg<F> extends true ? (a: A, b: B, c: C, d: D, e: E, f: F) => Promise<R> :
            IsValidArg<E> extends true ? (a: A, b: B, c: C, d: D, e: E) => Promise<R> :
            IsValidArg<D> extends true ? (a: A, b: B, c: C, d: D) => Promise<R> :
            IsValidArg<C> extends true ? (a: A, b: B, c: C) => Promise<R> :
            IsValidArg<B> extends true ? (a: A, b: B) => Promise<R> :
            IsValidArg<A> extends true ? (a: A) => Promise<R> :
            () => Promise<R>
        ) : never
    );

declare function promisify<T extends Function>(fn: T): Promisified<T>;

declare function exampleFunction2(a: number, b: string, c?: any[]): RegExp;

const test2 = promisify(exampleFunction2);

https://github.com/Microsoft/TypeScript/issues/22899

@leonadler

@sirian please post code-fenced blocks instead of screenshots; no one wants to have to type in a dozen lines of code to add comments or observe behavior

@sirian are you asking a specific question?
My example was not meant to be feature-complete, just a result of experimenting with 2.8 for a few minutes. It depends on typescripts infer' keyword inferring parameter types as {}`:
type TypeOfFirstArg<T extends Function> = T extends (a: infer FirstArg) => any ? FirstArg : never;

function functionWithOneParameter(a: number) { }
let exampleA: TypeOfFirstArg<typeof functionWithOneParameter>;
// exampleA is of type "number", as you would expect

function functionWithNoParameter() { }
let exampleB: TypeOfFirstArg<typeof functionWithOneParameter>;
// exampleB is "{}", although I would have expected "never"

@leonadler It was just a notice, that IsValidArgs and NumberOfArgs is not correct (to prevent other users from using incorrect code).
@RyanCavanaugh Mi fault, I was sure I attached code.
type IsValidArg<T> = T extends object ? keyof T extends never ? false : true : true;

type Check<T> = IsValidArg<T> extends true ? T : never

declare function isValid<T extends Check<V>, V = T>(value: T):IsValidArg<T>;

isValid(3); // ok

isValid({}); // wrong, false === IsValidArg
isValid({} as Record<string, any>); // ok
isValid({} as {x?: any}); // ok

isValid(Function); //ok
isValid(class Foo{}); // ok
isValid(new class Foo{}); //wrong, false === IsValidArg
isValid(() => 1); // wrong, false === IsValidArg

isValid(0 as never); // wrong, true === IsValidArg

@leonadler I have an idea! We could use reverse extends check. Look at scratch:
type NumOfArgs<F extends Function> = F extends (a: infer A, b: infer B, c: infer C, ...args: (infer Z)[]) => infer R ? (
    ((a: A, b: B, c: C, ...args: Z[]) => R) extends F ? number :
    ((a: A, b: B, c: C) => R) extends F ? 3 :
    ((a: A, b: B) => R) extends F ? 2 :
    ((a: A) => R) extends F ? 1 :
    0
) : never;

@ahejlsberg I think many users will copy types from your examples from https://github.com/Microsoft/TypeScript/pull/21316#issue-164138025.
So some notices about type TypeName<T>

you missed symbol
typeof Object === "function" but TypeName<Object> === "object"

@sirian You seem to confuse "type A" with "object of type A".
The TypeName of an object with the type Object is "object".
Calling typeof Object retrieves the type of the constructor, which is "function".
When you call typeof a with an a that has the type Object, you will get "object", as expected.
Similarily, when you write let a: MyClass in TypeScript, it means a is an instance of the type MyClass, not a has the same type that the function MyClass has.
typeof Object === "function"
TypeName<typeof Object> === "function"
typeof Object.create(Object.prototype) === "object"
TypeName<Object> === "object"

class A { }
typeof A === "function"
TypeName<typeof A> === "function"
typeof (new A()) === "object"
TypeName<A> === "object"

type Boxed = T extends any[] ? BoxedArray<T[number]> : BoxedValue;

Is it possible to do following:
T extends R[] ? BoxedArray<R> : BoxedValue<T>

@pleerock T extends (infer R)[]

@princemaple thanks it worked. Actually BoxedArray<T[number]> worked as well but such syntax wasn't obvious to me


fix: Run terraform init on missing required provider

Put an x into the box if that apply:

[ ] This PR introduces breaking change.
[x] This PR fixes a bug.
[ ] This PR adds new functionality.
[ ] This PR enhances existing functionality.

Description of your changes

Fixes #585

How can we test changes

How can we reproduce it?

Use it with a fresh TF config where no provider has been installed, yet.

How can we test changes

Can you please provide a tf configuration that failed? I don't get what is " fresh TF config where no provider has been installed"

@MaxymVlasov , this happened for a fairly complex project setup that contains multiple separate Terraform configurations each with multiple modules. I was not able to create a really minimal example which reproduces the behavior I have seen for the real project. However, as the error message I saw (in the linked bug report) is an error from Terraform which can be fixed by running terraform init and this error message is not part of the list of "well known errors" in terraform_validate.sh which causes an error in the hook execution which can be easily fixed by adding this error message to the list, I'd argue that trying to find a way  to create a minimal reproducer of the actual situation is not of high value here. Hope you agree.

This PR is included in version 1.83.6 :tada:

In any case, thanks for contibution


Re-subscribe all subscriptions at runtime to different robot

[ X] I am at the right place and my issue is directly related to ROS#. General technical questions I would post e.g. at ROS Answers or Stack Overflow. For library-specific questions I would look for help in the corresponding library forums.
[X ] I have thoroughly read the Contributing Guideline and writing this issue is the right thing to do in my case.

I have a question!

[X] I searched the Wiki, open and closed issues for an answer. I tried my best to find the answer by myself without success. I believe that the discussion we will have in this issue, and the solutions we might find, will help me, and likely other community members who have a similar problem.

Here is my question:
I have 2 robots streaming identical topics and I need to repeatedly switch between the 2 robots at runtime. The robots each have their own ROS Master.  So, at runtime, I want change ROS#'s ROS master IP and then re-initialize / re-subscribe to my currently subscribed topics (since the ROS master IP was changed). Is there a best-practice for doing this in ROS#?

Hi @Chambana ,
I'd suggest to adjust RosConnector, UnitySubscriber and UnityPublisher (if you have).
To keep code simple, we currently initialize and start them once on Start() only.
To realize any type of (dis-/re-)connection application to different ROS systems, just call the corresponding methods when needed.
For switching between two ROS systems in your application, I'd proceed as follows:
First add a List of UnitySubscribers and UnityPublishers to RosConnector via GetComponents().
At runtime  (e.g. (Fixed)Update), when RosConnector is triggered to switch to the other ROS system (e.g. via Switch(string newUrl)):

tell all subscribers and publishers to unsubscribe / undavertise and stop their subscription threads
close connection and corresponding connection thread
start a new ConnectAndWait thread
tell all subscribers and publishers to subscribe / advertise again

If you find a way to generalize RosConnector and UnitySubscriber / UnityPublisher for a more flexible (dis-)connection at runtime without much increasing code complexity or reducing performance, please let me know.

Hi @Chambana , did you make progress on this issue? Did my suggestions help? How did you solve it?

Hi @Chambana , did you make progress on this issue? Did my suggestions help? How did you solve it?

@MartinBischoff : Hi Martin. Just want to give a small update. I managed to get this feature working with little additional code.
Essentially, the desired behavior is to always reconnect when the ROS master has disconnected. My comments below apply to the release 1.6 tag, but I believe still has utility for the latest versions.
I added a boolean connectedFlag within RosConnector that gets changed during OnConnect and OnDisconnect events. Then within the Update step of monobehavior, I check if there  the connectedFlag is off if it is, then I perform a RosSocket.Close() and rerun the ConnectAndWait()thread as well as fire a onReconnected event if the connection is successful. The event is only fired by again checking if the connectedFlag is now true. I found that using this additional connectedFlag was much faster than using WebSocket's approach for checking connection. Somehow, significant frames are dropped if the Websocket's "is connected" method is used.
I also made the Ros Connector a singleton. This enables an easy way for ROS publishers, subscribers, clients/servers in Unity to listen for the onReconnected event.
We also wrote a small wrapper on the main publisher, subscriber, clients and servers (services and actions) to instead look for the ROS connector singleton (instead of requiring the ROS connector to be on the same GameObject) and automatically perform the advertise/unadvertise subscribe/unsubscribe calls whenever the OnReconnect fires. This design choice assumes that there will only be a single ROS connector in the application, which is common anyway given there is usually only one ROS Master.
The implementation above accomplishes two features:

The ROS connector and Unity-specific ROS nodes automatically reconnect if the websocket intermittently drops out.
Changing ROS master's is a matter of changing the websocket IP then calling RosSocket.close() within the ROSConnector class . The robustness provided by the implementation automatically reconnects to a new ROS master.

Overall, the actual code implementation was very short and I believe can be easily integrated with any ROS# Unity implementations. Unfortunately, I cannot release the specific implementation I did without significant hassle. But I hope the description above is enough to make it a key feature in future ROS# releases.


Toolbar: remove exception for view_* buttons, handle empty groups.

Remove exceptional handling of view_* buttons (now handled in ui-classic).
Do not render empty spans.

To go with: https://github.com/ManageIQ/manageiq-ui-classic/pull/6324
Fixes: https://github.com/ManageIQ/manageiq-ui-classic/issues/6312

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

npm package (@latest dist-tag)
GitHub release

Your semantic-release bot :package::rocket:


Log in using enter key not working

Hello,
Try to log in using the ENTER key.

Hi, ENTER is works, but there is technical nuance in editor value handling. We will enhance this functionality.

Reorganized and
improved this functionality. Added support for custom login forms and
actions. In login form you can use "Tools" action category to show
actions as links (like registration or password recovery).


SAKIII-4485 uncheck all selectbox after deleting messages

https://jira.sakaiproject.org/browse/SAKIII-4485

Merged via squash


Parameter issues

Thanks for sharing, I have a question about the parameters, what does the Initial parameter refer to in this image

Thank you for your question. The initial parameters refer to the structural parameters made by Professor K. L. Wong (Figure below).

Thanks for the reply, I see what the Initial parameter means. I also have another question about the code, when running the predict code is always repeating the train code running process, is this problem caused by my own mistakes? Or has it always existed? Looking forward to hearing from you.

Thank you for your question. The predict.py script should not invoke train.py during its process. I suspect you might have mistaken the output of the prediction process for the training process. The role of predict.py is to predict over 2 million structures at a rate of about one prediction per millisecond. If you wish to accelerate this prediction process in parallel, you can run predict-gpu.py, but you will need to set up the CUDA environment accordingly.
I hope my answer is helpful to you. If you still have any issues, please feel free to post the runtime results, and we can discuss  further.


Window.opener is null on callback

Hello,
I have an Angular2 SPA running in Cordova. It uses an implicit flow for authentication with our server. This setup has been working fine for android but not Windows 10. I debugged using console logs and found that window.opener is null in Microsoft Edge when the popup is redirected to the callback page.
I found these 2 known issues which might be related on the bug tracker of Edge:
https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/8710056/
https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/11324352/
Does anyone have a work around or an explanation on how to get an Oauth authentication to work with an SPA on Edge?

I'm not familiar with that issue, sorry.

Any update?

Well I was not able to get any help from the resources I reached out to. I tried various workarounds which I will list bellow in the hopes that it might help others:

Checking if window.parent would have the callback function: no it does not.
Tried to save the callbackUrl with all its parameters in the localStorage and listening for a storage event in the main window then loading the user with the value: No event is triggered between the popup and its parent.
Tried to use the javascript postMessage function to notify the parent window: Nothing seems to reach the parent.
Not tried: Loading the user on the callback page with loginRedirectCallback and having the mainWindow check every second for a loaded user. That approach seemed clunky and would be ill-advised, might work though.

At that point I gave up on a Windows 10 implementation of a Cordova application using OpenIdConnect as its authentication protocol. I might try again but use Electron instead but that won't be any time soon. I believe that a standard Oauth2/OID authencation mechanism on Microsoft Edge to be broken at its most up to date release. I have found that other developpers seem to be having similar issues with Edge.

BTW, given the recent changes in OAuth2 attacks on native apps, Google has put out a library targeting native/Cordova clients: https://github.com/openid/AppAuth-JS


Delete Organization Manager should return 204 No Content

This is to be consistent with the matching remove operation, ideally these operations should be merged in to a single endpoint.
See:
http://apidocs.cloudfoundry.org/226/organizations/disassociate_manager_with_the_organization_by_username.html

Addressed in next cf-release https://github.com/cloudfoundry/cloud_controller_ng/commit/49ecead930a2aff53242554bbb0b2fa18b103d4e


Semantic based finders do not work in profile mode

Whether using Flutter driver, or using an e2e test, we should allow finding bySemanticsLabel in profile mode.
Currently, this doesn't work because the finder/commands use debugSemantics on RenderObject, which is guarded by asserts.
I propose we change this to be guarded by kReleaseMode.
/cc @albertwang0116 @goderbauer

I propose we change this to be guarded by kReleaseMode.

Make it so!


Environments terminate after 200 steps. How to change this behaviour?

Using the latest gym version environments will terminate after 200 time steps. In python I can write
env = gym.make("MountainCar-v0").env to change this behaviour. See also: http://stackoverflow.com/questions/42787924/why-is-episode-done-after-200-time-steps-gym-environment-mountaincar
But how could I get this working using the gym API in R? In the example_agent.R I tried
env_id = "MountainCar-v0.env"
instance_id = env_create(client, env_id)
but this returns an error.

It looks like the code to create a new environment currently does not allow one to instantiate gym environments that don't terminate after 200 time steps (original code found here: https://github.com/openai/gym-http-api/blob/master/gym_http_server.py#L43).
We can modify the create function to allow this behavior with a keyword argument, perhaps terminate_early. For example:
    def create(self, env_id, terminate_early=True):
        try:
            env = gym.make(env_id)
        except gym.error.Error:
            raise InvalidUsage("Attempted to look up malformed environment ID '{}'".format(env_id))
        if not terminate_early:
            env = env.env
        instance_id = str(uuid.uuid4().hex)[:self.id_len]
        self.envs[instance_id] = env
        return instance_id

The resulting client code would be (e.g. in R):
env_id = "MountainCar-v0"
instance_id = env_create(client, env_id, terminate_early = FALSE)

@catherio Any thoughts? I can make a pull request with the code change (and appropriate unit tests and documentation changes) if approved!

Hi @paulhendricks and @markdumke,
Actually, overriding the time limits while keeping the same env name is not desirable. Check out https://github.com/openai/gym/wiki/FAQ for more details. Basically, if you want an environment that does not respect the time limits, you have created an incompatible environment that should be given its own name. The workaround would be to create your own environment, and then reference it by name. If you have more questions once you've taken a look at the FAQ, let me know.