Optimize docker image size

Problem
The current Dockerfile works well but has some issues:

It uses a large base image, node:21-slim
It copies the whole workspace context to the image, which increases the size as well as the chance of accidentally baking in secrets, like env files (COPY ./ ./)
It does not use multi-stage builds and retains all dev dependencies during runtime
It has NextJS telemetry enabled
It requires specific --build-args to be supplied but does not actually do anything with them
It installs prisma manually since it is not a runtime dependency in package.json

A built image on linux/amd64 is around 1.2GB in size. This size can be reduced significantly.
Changes
This PR addresses each of the issues and reduces the image size from 1.2GB to a nice 200MB. Changes include:

Use node:21-alpine for a smaller base image
Copy workspace objects into the image specifying each object separately
Use multi-stage builds to ensure that only runtime dependencies and the minimal set of application files are included in the resulting deployable image
Disable NextJS telemetry
Set placeholder POSTGRES_* env vars in the Dockerfile itself so that the user does not have to remember to supply them
Move prisma from dev dependencies to actual dependencies in package.json

The multi-stage build is set up like so:

base stage

Copy workspace application files into the image
Install dev dependencies
Invoke npm run build

runtime-deps stage

Copy the built NextJS application from base
Install only the runtime dependencies
Compress the application into a zstd archive, reducing its file size significantly

runner stage

Copy the compressed archive from runtime-deps
Copy the entrypoint scripts from the workspace
Upon container startup, decompress the archive and start the application

The compression/decompression steps contribute an around 200MB size reduction, using the compression algorithm zstd, which is a great balance of size reduction and processing speed. However, they cause a couple seconds of processing time both at compression time (during build) and at decompression time (during first container startup). This is time that is saved in disk and network I/O.
Whether or not to include the compression/decompression may be controversial and can be removed if it is not seen as a good fit. I personally think it is a good thing to include.

I like most of the changes (except that I'm not all that sold on the compression parts, but this feels very subjective)!
I have https://github.com/spliit-app/spliit/pull/73 open to try to allow the next public (at least) env vars to be present at build time, since they are not respected if they are not, and the solution introduced here would just add more and more env vars as they are introduced to the Dockerfile, which seems a bit messy.
If my changes or something similar could be incorporated in this PR, that PR could be closed down in favour of these changes.
You probably have a better understanding of what the best practices around those things than I do, so if there is another solution that brings about the same result I would be equally good with that.
Currently have tried building this branch locally with a completely empty next-env.d.ts  (i just ran touch) and if I add NEXT_PUBLIC_ENABLE_EXPENSE_DOCUMENTS to the container (along with the needed S3_UPLOAD-vars, no expense attachment option is shown.
This is exactly the same functionality as currently, so I'm not saying this needs to be fixed specifically in this PR
My main concern is just adding a long list of mocked env vars right into the Dockerfile

I like most of the changes (except that I'm not all that sold on the compression parts, but this feels very subjective)! I have #73 open to try to allow the next public (at least) env vars to be present at build time, since they are not respected if they are not, and the solution introduced here would just add more and more env vars as they are introduced to the Dockerfile, which seems a bit messy.
If my changes or something similar could be incorporated in this PR, that PR could be closed down in favour of these changes.
You probably have a better understanding of what the best practices around those things than I do, so if there is another solution that brings about the same result I would be equally good with that.
Currently have tried building this branch locally with a completely empty next-env.d.ts  (i just ran touch) and if I add NEXT_PUBLIC_ENABLE_EXPENSE_DOCUMENTS to the container (along with the needed S3_UPLOAD-vars, no expense attachment option is shown. This is exactly the same functionality as currently, so I'm not saying this needs to be fixed specifically in this PR My main concern is just adding a long list of mocked env vars right into the Dockerfile

Thanks for the review. I think I'll drop the compression stuff for now, I can later open a new PR for them specifically so that the other changes are not blocked. I'll take a look at #73 and check if there's an elegant solution that could be implemented on top of this PR.

@justcallmelarry I made some changes:

Remove compressions steps. The image is now around 400MB.
Add contents of #73
Use server actions to get env feature flags during runtime

With these changes, the three environment variables NEXT_PUBLIC_ENABLE_EXPENSE_DOCUMENTS, NEXT_PUBLIC_ENABLE_CATEGORY_EXTRACT and NEXT_PUBLIC_ENABLE_RECEIPT_EXTRACT are properly evaluated during runtime, and the user can configure those settings at container startup time. This is nice, since now changing those settings does not mandate a rebuild.
The fix works by directly reading the global.process.env namespace in a server action. The regular process.env has the build-time baked values but the this one has the runtime ones. Kind of a weird quirk of NextJS if you ask me.
Note: the zod validations for these environment variables work, but seem to only trigger when accessing the app, not when starting up the container.

@jantuomi nice 👍
I am sure that just having the PUBLIC_* env var set during build works, since that's how I'm running my own instance (set to false at build, then changed via container.env at runtime), and I'm not really great at next/ts in general, so I won't comment on that fix overall.
I do think that the docker changes are great, and was trying to reach a similar result myself, but the aforementioned lack of knowledge of next made it a huge trial-and-error-process that did not bear fruit.
if Sebastien thinks the ts-parts looks good, I can at least vouch for the docker-related parts

I found a part of the reason for our confusion: in the expression {process.env.NEXT_PUBLIC_ENABLE_EXPENSE_DOCUMENTS && <Card ... />}, the env var is a string. In JS, only the empty string is falsy. As such, the string "false" will be evaluated as true. I think there is something related to this happening in your environment.
Can you try manually specifying NEXT_PUBLIC_ENABLE_EXPENSE_DOCUMENTS=false in container.env and see if the expense document component is rendered?
A common pattern regarding env vars is to parse the strings to a proper data object, similar to what is going on in the env schema with Zod. Then, in application code, you would only refer to this parsed object and not the raw env vars from process.env.

I found a part of the reason for our confusion: in the expression {process.env.NEXT_PUBLIC_ENABLE_EXPENSE_DOCUMENTS && <Card ... />}, the env var is a string. In JS, only the empty string is falsy. As such, the string "false" will be evaluated as true. I think there is something related to this happening in your environment.
Can you try manually specifying NEXT_PUBLIC_ENABLE_EXPENSE_DOCUMENTS=false in container.env and see if the expense document component is rendered?
A common pattern regarding env vars is to parse the strings to a proper data object, similar to what is going on in the env schema with Zod. Then, in application code, you would only refer to this parsed object and not the raw env vars from process.env.

ah, that makes sense, i have NEXT_PUBLIC_ENABLE_CATEGORY_EXTRACT set to false, but I still get the spinner for category when i enter a title, so this also explains that behaviour

The string/bool coercion issue is present in the env Zod validations as well. I added some preprocessing to those env vars so that they are validated correctly.
I used the parsed Zod object to provide the runtime env. We have to wrap the reference to env in a server action (snippet) to force NextJS to evaluate the env on the server. I don't think there's a way around that. Other than that, this is pretty elegant imo.
import { env } from '@/lib/env'
async function getEnvOnServer() {
    'use server'
    return env;
}

With these changes, the env vars seem to work.

The string/bool coercion issue is present in the env Zod validations as well. I added some preprocessing to those env vars so that they are validated correctly.
I used the parsed Zod object to provide the runtime env. We have to wrap the reference to env in a server action (snippet) to force NextJS to evaluate the env on the server. I don't think there's a way around that. Other than that, this is pretty elegant imo.
import { env } from '@/lib/env'
async function getEnvOnServer() {
    'use server'
    return env;
}

With these changes, the env vars seem to work.

hmm, I might misunderstand how this works, but now it kinda looks like all of the env vars are exposed to the frontend code?
if this makes the env object available in browser then some of the secrets are pretty bad to expose

I think you understand correctly 😅 we obviously need to only allow the NEXT_PUBLIC_* vars through. Allowing everything would be pretty bad

I think you understand correctly 😅 we obviously need to only allow the NEXT_PUBLIC_* vars through. Allowing everything would be pretty bad

That's why I thought the previous solution looked nice from my perspective 😄

Alright, I brought back the feature flags object, this time using the Zod object behind the scenes 👍

With the latest changes I think this is ready for merging 👍


feat: add KeepKey recovery workflow & PIN on initialize

Description

Adds KeepKey recovery workflow, allowing a KeepKey to be restored from a recovery seed
Adds PIN entry to the KeepKey initialize workflow

Note: wallet state refactored to have a deviceState property object, with a setDeviceState reducer to consolidate reducers.
Notice

[x] Have you followed the guidelines in our Contributing guide?
[x] Have you checked to ensure there aren't other open Pull Requests for the same update/change?

Pull Request Type

[ ] :bug: Bug fix (Non-breaking Change: Fixes an issue)
[ ] :hammer_and_wrench: Chore (Non-breaking Change: Doc updates, pkg upgrades, typos, etc..)
[x] :nail_care: New Feature (Breaking/Non-breaking Change)

Issue (if applicable)

Closes https://github.com/shapeshift/web/issues/1411
Closes https://github.com/shapeshift/web/issues/1413

Risk

The recovery functionality is a new flow, so the risk of regression here is low
The requirement to enter a PIN on KeepKey initialization was added, so we'll need to confirm that this flow still functions as expected

Testing
Attempt to connect to a "wiped" KeepKey and you'll be presented with a modal that allows you to initialize a new wallet, or recover an existing wallet from a seed.
In particular, we want to extensively test the wallet recovery flow and character entry behavior.
Screenshots (if applicable)

This feature is one that could be easily broken by accident in the future by another developer. I'd like to see an attempt, at least, at some test coverage. A separate PR for that would be okay.

KeepKey Wiped Successfully

Upon connecting a factory-new KK -- or one which has been recovered after a failed firmware update -- the user gets dropped to this screen, which could be misleading if the user didn't initiate a wipe.
The user can select the close or back buttons to exit the initialization flow, possibly by accident. This will drop them into a broken state until they choose to disconnect their wallet. This may be a non-obvious fix, especially if the user got into the state accidentally.

Label Your KeepKey

Setting a label is optional and this should be communicated to the user somehow.

Enter Your New Pin / Confirm Your New Pin

"PIN" should be capitalized.
This screen should focus the entry field to allow the PIN to be entered using only the numpad keys, which map to the KK's on-screen PIN layout.
Pressing the "Enter" key should have the same effect as pressing the confirm key.
Confirming the new PIN on the first screen and loading the second one briefly flashes "Unlock" instead of "Save PIN" on the button
If you exit after the first PIN screen, restarting the flow will hang unless you replug your device.
Pressing "Confirm" without any numbers entered greys out the button and prevents further progress. The PIN screen is also still displayed on device even after pressing the back button, breaking the previous flows. (Setting a PIN is technically optional during initialization, so trying a blank one could be a valid choice. Still, with my security hat on I'm happy to hide that from users. If we're going to do that, though, we should disable the button if it's blank.)

Write down Recovery Sentence

Capitalize "down" for title case
Would read more naturally as "Write Down Your Recovery Sentence" as previous steps used "Your" as well
Pressing "Cancel" doesn't exit the screen or do anything, though it leaves the device in an uninitialized state

Wipe Your KeepKey

Pressing the cancel button results in an error toast
Re-pairing after wipe hangs

Enter your Recovery Sentence

Capitalize "your"
The specific letter choice loses all meaning after each character is entered, so it should be displayed as a dot instead of a letter.
Run-on sentence; recommend something like"Using the scrambled keyboard legend on your KeepKey, enter the first 4 letters of each word. If there are less than 4 letters in the word, press Enter, hit the spacebar, or click next when you're done typing."
There's no way to back up to a previous word after mis-entering one
Mis-entering the whole phrase shows "Setting up device..." but it never completes and the device is left uninitialized

In this state, re-pairing the device can get you back to an initialization flow, but if you back out you'll see "Setting up device" again instead of getting booted back to the wallet selection screen.

After Initialization

The "update success" messages display on various KK settings: I filed https://github.com/shapeshift/web/issues/1592 before I realized I was on the wrong branch! Same behavior with the label screen at least.

Great notes @mrnerdhair- TY!

For posterity, the following tickets were spun off @mrnerdhair's comments above:

Handle factory-new KeepKey connections: https://github.com/shapeshift/web/issues/1609
Gracefully handle not completing the KeepKey initialization flow: https://github.com/shapeshift/web/issues/1610
Fix "Cancel" button on "Write down Recovery Sentence" modal: https://github.com/shapeshift/web/issues/1614
Handle incorrect seed phrase entry: https://github.com/shapeshift/web/issues/1618
Add copy communicating that a KeepKey label is optional when initializing: https://github.com/shapeshift/web/issues/1611
KeepKey and PIN entry copy updates: https://github.com/shapeshift/web/issues/1612
Improve PIN modal: https://github.com/shapeshift/web/issues/1613
Re-pairing a KeepKey after wiping it hangs: https://github.com/shapeshift/web/issues/1616
Add the ability to go back to previous words when restoring a KeepKey from a recovery phrase: https://github.com/shapeshift/web/issues/1617


spawn curl ENOENT AWS Lambda

Hi,
I wish to use this package in a lambda function but I am receiving the following error.
ERROR	Uncaught Exception	{"errorType":"Error","errorMessage":"spawn curl ENOENT","code":"ENOENT","stack":["Error: spawn curl ENOENT"
I created a small POC using this package, that works perfectly, but fails in the lambda environment.

Having the same issue here


Feature request: Show attributes of entities

It would be great if I could add attributes of entities similarly to how it is done in apex charts

Duplicate of issue #16


I want to propagate TraceId to all places where parallelStream() and CustomForkJoinPool is used.

I would like to know how to propagate the TraceId within the Java Stream API in Spring Cloud Sleuth.
In the code below, the trace_id is not propagated, and each client ends up having an individual TraceId.
TestForkJoinPool testForkJoinPool = new TestForkJoinPool(10);
Span span = tracer.nextSpan(tracer.currentSpan());

testForkJoinPool.submit(() -> {
    try (SpanInScope ignored = tracer.withSpan(span)) {
        IntStream.range(1, 20).parallel().forEach(idx -> {
            httpClient.get(1000L);
        });
    } finally {
        span.end();
    }
}).get();

However, if we modify the above code as shown below, the TraceId is propagated.
TestForkJoinPool testForkJoinPool = new TestForkJoinPool(10);
Span span = tracer.nextSpan(tracer.currentSpan());

testForkJoinPool.submit(() -> {
    IntStream.range(1, 20).parallel().forEach(idx -> {
        try (SpanInScope ignored = tracer.withSpan(span)) {
            httpClient.get(1000L);
        } finally {
            span.end();
        }
    });
}).get();

Unfortunately, applying SpanInScope to all existing Stream API code as mentioned above has its limitations. Is there a way to inject SpanInScope with minimal modifications to the existing Stream API code?
Thank you.

Have you tried LazyTraceExecutor?

@jonatan-ivanov
Thank you for your feedback.
As you mentioned, I used LazyTraceExecutor as you suggested, but I still confirmed that the span is not propagated.
I have verified that the span is propagated correctly when not using parallel().
    @Bean(name = "peterPool")
    @Lazy
    public Executor getCustomForkJoinPool(Tracer tracer) {
        final ForkJoinPool.ForkJoinWorkerThreadFactory factory = pool -> {
            final ForkJoinWorkerThread worker = ForkJoinPool.defaultForkJoinWorkerThreadFactory.newThread(pool);
            worker.setName("peterPool" + worker.getPoolIndex());
            return worker;
        };

        return new LazyTraceExecutor(beanFactory,
                new ForkJoinPool(Runtime.getRuntime().availableProcessors(), factory, null, true));
    }

    private final Executor peterPool;

    @GetMapping("/test")
    public String test() throws ExecutionException, InterruptedException {
        peterPool.execute(() -> {
            IntStream.range(1, 20).parallel().map(idx -> {
                httpClient.get(1000L);
                return idx;
            }).sum();
        });

        return "test";
    }

Your example does not use LazyTraceExecutor. You create a bean of it but the parallel stream does not use it. I checked a few things and I don't see the way using an executor/completion service in parallel streams. So I guess the solution is you need to instrument it on your own (basically what LazyTraceExecutor) does.


Generic constraint on returned function should generate type mismatch, but doesn't

TypeScript Version:  2.1.5
Code
The following is closest to the actual code we used to discover the bug.
Playground link
// import {Component, ComponentClass} from 'react'
interface ComponentClass<P> {
    new (): Component<P, {}>;
}

class Component<P, S> { }

function decorator(someArg: string): <P, Comp extends ComponentClass<P>> (DecoratedComponent: Comp) => Comp {
    return function <Props>(DecoratedComponent: ComponentClass<Props>) {
        return class Inner extends Component<Props, void> {}
    }
}

function badDecorator(someArg: string): <T> (DecoratedComponent: T) => T {
    return function <Props>(DecoratedComponent: ComponentClass<Props>) {
        return class Inner extends Number { }
    }
}

@decorator('foo') // This infers Props correctly
class FooComponent extends Component<{ some: string, props: number }, void> { }

@badDecorator('foo') // Bullshit, T cannot be both typeof OtherComponent and T extends Number
class OtherComponent extends Component<{ some: string, props: number }, void> { }

// foo is typeof OtherComponent, but it's actually typeof Inner
var foo = badDecorator('foo')(OtherComponent)

An even simpler example is as follows:
function foo(): <T> (arg: T) => T {
  return function(arg) {
    return 42;
  }
}

var x = foo()('string'); // typeof x = string, wrong, x is a number.
console.log(x); // 42

Expected behavior:
A compiler error of some sort:

Either don't let me return 42 because it can't guarantee that it matches any T (if it were T extends number, it would have been fine)
Or don't let me pass 'string' because it can't guarantee that the it will match the return type of T extends number.

Actual behavior:
Compiler doesn't complain.
cc @benjamingr @mosho1 @awalgarg

cc @linkgoron

This is an error now


Material Lint

Something simular to twbs/bootlint
could be useful in the future.

Closing this issue since it isn't something we have the capability to support directly. If anyone from the community wants to try such a thing, they are more than welcome to give it a go.


WalletConnect. Refresh won't update the list of accounts

Description
When user refresh walletconnect wallet it will request old list of accounts.
Steps to Reproduce

Connect to WalletConnect
Add new network to the config
Refresh wallet

Expected Behavior
Wallet connect will be requested with updated network list
Actual Behavior
Refresh will request old list of networks
Environment
https://github.com/novasamatech/nova-spektr/commit/b3a381d4e43fe8ca1218e07e785f903d5eda47a4

Probably may be fixed with https://github.com/novasamatech/nova-spektr/pull/1255

Case:

Add account via WC or Nova -> refresh
Actual result:

after accepting the refresh in Nova it adds second wc session in Nova app, popup with refresh request is not hiding

Expected result:

We are use SignClient.connect method with pairing topic to update accounts/networks from nova wallet.
But when we try to do it right after initial connection, we receive error No matching key. pairing topic doesn't exist.
But after few days everything works fine. (Friday => Monday)

Status verification: ✅


Unable to create independent axes for each subplot in any grid layout

I created a grid layout for 9 different tags of a pandas dataframe (time series data) with x-axis as timestamp and y-axis as the tag value. Time range is constant across all the columns as they are different measurements in the same timeframe.
After creating the plot, I noticed that the y-axis and x-axis are share across all the plots. Is there any parameter to stop sharing axis (x/y/both).
I used the following code to create subplots with the help of  hv.Layout function. Is there any other method to create these subplots using datashader without sharing axes.
def apply_formatter(plot, element):
    plot.handles['xaxis'].formatter = DatetimeTickFormatter()

def f(tag_list, start, end):  # functions takes in list of tags (length 9), star & end time of the plot

    %%opts RGB [finalize_hooks=[apply_formatter] width=500 height=300 show_grid=False]

    def ds_plot(tag):
        time = df.loc[start:end].index.values.astype('int64')/10**6 # df index is time
        tag_to_plot = df.loc[start:end][tag]
        plot = hv.Scatter((time, tag_to_plot))
        d = datashade(plot))
        return d

    ds_dict = {tag:ds_plot(tag) for tag in tag_list}

    first_row = [ ds_dict[i] for i in tag_list[:3]]
    second_row = [ ds_dict[i] for i in tag_list[3:6]]
    third_row = [ ds_dict[i] for i in tag_list[6:9]]

    layout = hv.Layout(first_row + second_row + third_row).cols(3)  # plot in 3 rows and 3 columns

    return layout

The easiest way to stop them from being shared is by labeling the dimensions on your scatter, in your case you would do:
plot = hv.Scatter((time, tag_to_plot), 'Time', tag)

Alternatively you can disable shared axes as a normalization option using so called normalization options, which you can set using the %%opts magic with %%opts RGB {+axiswise} or using .opts like this:
d = datashade(plot)).opts(norm={'axiswise': True})

Thanks. Both of the methods worked. Using first method, I can share just x-axis (time) while keeping y-axis(tag values) independent for each subplot.


Fixes #1957 - additional containers in CDK config

Direct link to docs: https://medplum-www-git-cody-additional-containers-medplum.vercel.app/docs/self-hosting/datadog


Autotests: query attributes for SMARTS

It is planned to create automation tests for validating query attributes for SMARTS format

Probably due to backmerge ticket wasn't closed automatically so I am closing it manually.


Pass  --suppress-unimplemented to the compiler workflow

Makes it easier to see actual issues.

Goon CI failure is due to https://github.com/OpenDreamProject/OpenDream/issues/1821


Translation is not working in component - displays key instead of value

I have followed the docs and tried to use it in exactly the same way as in the example.
I have a Card component that uses:
import {useTranslation} from 'next-i18next';
const {t} = useTranslation('common');

then trying to use it as a text on the button:
<button>{t('read_more')}</button>
common.json file:
{   "read_more": "Button text!" }
I'm really not sure what I'm doing wrong... it will display the text as 'read_more' on the button rather than 'Button text!' I tried so many different things and have no clue why this is happening.

I'm using the translations from home.json on my index page and had no issues, the Card component is on that page.
export async function getStaticProps({previewData, locale}) {
    const client = createClient({previewData});

    const articles = await client.getAllByType('article', {limit: 3});

    return {
        props: {
            articles,
            ...(await serverSideTranslations(locale, [
                'home',
                'common',
            ] ))
        },
    };
}

I understand I could pass it to the component itself but I want a default value from translations on that component if it's not passed.

https://github.com/i18next/next-i18next#translate-in-child-components

https://github.com/i18next/next-i18next#translate-in-child-components

Yes, I'm trying to do point 3. but it's not working...

create a minimal reproducible example

here it seems to work: https://github.com/i18next/next-i18next/blob/e6b5085b5e92004afa9516bd444b19b2c8cf5758/examples/simple/components/Footer.tsx#L6

This is what leaves me confused if it works on your example, it's literally the same thing what I've got.
Here is minimal example, it doesn't work even as simple page :(
import {serverSideTranslations} from 'next-i18next/serverSideTranslations';
import {useTranslation} from 'next-i18next';

export default function Test() {
    const {t} = useTranslation('common');
    return <p>{t('read_more')}</p>
}

export async function getStaticProps({locale}) {
    return {
        props: {
            ...(await serverSideTranslations(locale, ['common']))
        },
    };
}

This is not a reproducible example, this is just a code snippet, but try to set the debug option to true and check the logs for more information.

sorry, can't help without a reproducible example.... I suspect your config is wrong.

config:
module.exports = {
    i18n: {
        defaultLocale: 'en-GB',
        locales: ['en-GB', 'de-DE'],
    },
}

Nothing out of ordinary here... mind you translations on index page are working fine, contained in home.json - I'll try to produce minimal example at some point later

@adrai
All right, I got this sorted - looks like it was an issue with cache in dev or something, not sure why this happened though!
Before setting up an example for you I decided to test it on stackblitz - I forked my repo and it displayed the button text correctly - so to fix this I removed .next directory from my project and restarted the dev server.


Log response as well as request

Signed-off-by: Matthew de Detrich<EMAIL_ADDRESS>

Codecov Report

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

@@           Coverage Diff           @@
##           master      #36   +/-   ##
=======================================
  Coverage   70.91%   70.91%
=======================================
  Files          20       20
  Lines         447      447
  Branches       10       10
=======================================
  Hits          317      317
  Misses        130      130

Impacted Files
Coverage Δ

...n/scala/org/zalando/kanadi/api/Subscriptions.scala
66.04% <ø> (ø)
: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 bcab041...8a60b0d. Read the comment docs.


Question about average reward

Hi again.
Thank you for the quality code. I am using it for long time to build my own project.
Here is the question.
How do you normally calculate the average reward?
in your code, there is "print_interval". This averages rewards of last 20 (default)  steps.
But, when i go to other codes (like openai, spinningup), I think they are using 100 for default length.
So, i know choosing the length is my own choice.
But, when you think writing a official paper(conference paper), How do you set up for this length?
for example, in the ppo paper (https://arxiv.org/pdf/1707.06347.pdf), in the figure 3, there is reward figure.
I want to know the default length.
in the ppo paper, in the a2c paper, they do not reveal how they calculate the average.
they might average during the total episode?
they might average during the last 100 step?
Help me, if you know.

Hi. That's a good question. But did you check the paper before I recommended? It is important to notify authors' experiments to people. So It needs to check multiple experiments on different seeds for the same task. That's the common mean in papers. But if you want to check agent performance in one task, it is natural to check k-lengths mean in only one experiment. That's the difference.


Errors in deleted file remain being detected

Check for existing issues

[X] Completed

Describe the bug / provide steps to reproduce it
When you delete the files with the errors, Zed should not display errors anymore.
Reproduce:

Create a file with syntax error
Make sure Zed detects it
Delete the file and every occurrence
Observe Zed still shows the errors

Environment
Zed: v0.73.3 (stable)
OS: macOS 13.0.0
Memory: 64 GiB
Architecture: aarch64
If applicable, add mockups / screenshots to help explain present your vision of the feature
https://user-images.githubusercontent.com/98678118/220276264-f144ec53-a25f-4319-8724-db3511032b42.mov
If applicable, attach your ~/Library/Logs/Zed/Zed.log file to this issue.
If you only need the most recent lines, you can run the zed: open log command palette action to see the last 1000.
Nothing special

Note that same thing happens for warnings


Failed to instantiate module / Angular issue ?

Hello,
I have installed the enhanced table plugin (v7.16.2) on my redhat server.
Everything's good but when I want to create an Enhanced Table Visualization, I got this error :
[$injector:modulerr] Failed to instantiate module kibana/enhanced_table_vis due to:
[$injector:modulerr] Failed to instantiate module tableVisI18n due to:
[$injector:pget] Provider 'i18n' must define $get factory method.
The Angular documentation say this :
This error occurs when attempting to register a provider that does not have a $get method
https://code.angularjs.org/1.8.2/docs/error/$injector/pget
I don't have skills to fix this issue... Anyone can help me ?
Thank's

My bad ! I found this thread that already speaking about this issue : https://github.com/fbaligand/kibana-enhanced-table/discussions/253
I close this issue.

Hi @adm-crow,
Actually, this error is very weird because:

$get function is defined in 'i18n' provider: https://github.com/fbaligand/kibana-enhanced-table/blob/master/public/angular/i18n/provider.ts#L25
With exactly the same enhanced-table code, it doesn't work for Kibana 7.16.0 to Kibana 7.16.2, but it works for Kibana 7.16.3+ and also Kibana 7.15.x

That's why the recommendation is to use Kibana 7.16.3.
And given, that enhanced-table is totally not usable with this bug, I will remove packages for Kibana 7.16.0 to 7.16.2.

Thanks for your answer @fbaligand !
I have updated to the 7.17 version and all is fine ! :)


Remove unused CompileMode::all_modes

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @ehuss (or someone else) soon.
If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.
Please see the contribution instructions for more information.

@bors r+

:pushpin: Commit a11f206f5f556946f00bf73c0091cb3266900277 has been approved by ehuss

:hourglass: Testing commit a11f206f5f556946f00bf73c0091cb3266900277 with merge 68b63d2a1aacc46eb4004cf5dfcd6ae5c886555c...

:sunny: Test successful - checks-actions
Approved by: ehuss
Pushing 68b63d2a1aacc46eb4004cf5dfcd6ae5c886555c to master...


SurvivalPlot component

This introduces a SurvivalPlot component. The new example app demonstrates how it works.

[Current coverage][cc-pull] is 60.39%

Merging [#310][cc-pull] into [master][cc-base-branch] will decrease coverage by 1.64%

@@             master       #310   diff @@
==========================================
  Files            24         25     +1
  Lines           627        654    +27
  Methods           0          0
  Messages          0          0
  Branches          0          0
==========================================
+ Hits            389        395     +6
- Misses          238        259    +21
  Partials          0          0

Powered by Codecov. Last updated by [dabaa7f...3952328][cc-compare]
[cc-base-branch]: https://codecov.io/gh/Kitware/candela/branch/master?src=pr
[cc-compare]: https://codecov.io/gh/Kitware/candela/compare/dabaa7f671fd16230722c7cd2bb8fbb42ca43f2e...3952328c3e90509e28973d1933f92a097339cd9d?src=pr
[cc-pull]: https://codecov.io/gh/Kitware/candela/pull/310?src=pr

This is neat; it LGTM.
If we start getting a lot of specialized candela components like this (e.g. this is almost the same thing as the line chart, but with some secret sauce), is there a plan for categorizing them? I'm mainly asking for the sake of a future Resonant Lab menu redesign with unique glyphs for each candela component (#164). Is there a way that we'd want candela components to describe themselves in the spec (e.g. point to an image as its icon)?

I haven't thought about categorizing yet but it's definitely something we should consider. I want to be careful about two things: (1) designing too closely to what Resonant Lab wants (by, e.g., requiring a lot of stuff that's meant solely for UI reasons), and (2) lining up a graphical design workload (for icons, etc.) in the future that grows linearly with the number of components.
On the other hand, since Resonant Lab may be the main way new users come to Candela, some amount of UI design "sparkle" may be helpful.

I like the self-contained idea of having the icon alongside the component in Candela (I think I brought it up at one point) but I also see Roni's point. There certainly shouldn't be a requirement that a Candela component needs an icon to be included in Candela - there should be a generic icon. I could go either way on whether the icons we do have should be in Candela or ResonantLab.
As for categorization, I think it's a good idea but not for the sake of icons. I don't think I'd want something like survival plot to be part of a "Line Charts" category. Instead, specialized vis should be categorized more based on data type or domain than on what it ends up looking like. A "Clinical" category might be a good place to put this plot.

Hmm... maybe that's what felt a little funny to me. The plot is named in terms of the data it shows, not what it looks like (most of the existing components feel like they're defined the other way). That's totally cool—it's the whole "start with a dataset" vs "start with a visualization" thing. I imagine a plot like this might feature prominently in the "Example projects" section (with data pre-wired), but the visualization itself might be buried in a "Clinical" category in the "Choose a visualization" interface.
I guess this means that eventually Resonant Lab should be responsible for hard-coding which candela components are general-purpose, not candela components announcing their general-purpose-ness on their own.


Fix format parameter mismatch

This fixes #2234.
I got started by fixing the issue with calling format on variables. I then found an edge case where calling Kernel.format or Kernel.sprintf instead of format or sprintf would cause false positives.

:+1:


fix: reduce max packet receive time during leader window

Problem

In certain cases (if the transaction container is emptied during a leader's window), the scheduler controller may wait up to 100 milliseconds for incoming packets.
Summary of Changes
Reduce the constant max wait from 100 ms to 10 ms.

LGTM.
"Okay, it's bad we'll wait up to 100ms, but surely we'll hit the packet limit first in the practical case"

checks packet limit *

🤡

so then I said its okay we just need to get 700,000 packets

i never added the damn ci flag. will watch this and merge

What are the implications of this change?

What are the implications of this change?

from OP: "In certain cases (if the transaction container is emptied during a leader's window), the scheduler controller may wait up to 100 milliseconds for incoming packets."
There is a (somewhat rare) case where the scheduler will collect packets for 100 ms before it even begins scheduling. That's 1/4 of the a slot... This will reduce this time to 10ms so that there is never a time where the scheduler is twiddling its thumbs waiting for packets.


[#4449] Fix race-condition when closing a NioSocketChannel or EpollSo…

…cketChannel
Motivation:
Fix a race-condition when closing NioSocketChannel or EpollSocketChannel while try to detect if a close executor should be used and the underlying socket was already closed. This could lead to an exception that then leave the channel / in an invalid state and so could lead to side-effects like heavy CPU usage.
Modifications:
Catch possible socket exception while try to get the SO_LINGER options from the underlying socket.
Result:
No more race-condition when closing the channel is possible with bad side-effects.

lgtm

Cherry-picked into 4.0 (61b5792340197b38b7fb4be7168835c429bd5315), 4.1 (0ec34b5f761f88bbb88def1216f5bae64a0a2d4b) and master (4ddbeff24672432634bcd6effc531d36da79bf7c)

@normanmaurer - Delete branch?


Add lchmod for bsd

What does this PR do
Checklist:

[ ] I have read CONTRIBUTING.md
[ ] I have written necessary tests and rustdoc comments
[ ] A change log has been added if this PR modifies nix's API

Oh, I had better to search it in code first. Thank you for explanation!


Add placeholders for "Time to retain data (in ms)" ,"Maximum message size in bytes *" fields within Create Topic

Describe the bug
Add placeholders for "Time to retain data (in ms)" ,"Maximum message size in bytes *" empty fields and display inline values of filled input fields within Create Topic
Set up
https://www.kafka-ui.provectus.io/
Steps to Reproduce

Navigate to Topics
Add a Topic

Expected behavior

Inline visualization for input fields values should be displayed as in attached second screenshot

Placeholder "Time to retain data"should be for "Time to retain data (in ms)" field  and placeholder "Maximum message size" should be for "Maximum message size in bytes *" field in case of letting these fields empty (first screenshot)

Screenshots

good for grabs

@Haarolean @armenuikafka can I take this issue?

@Haarolean @armenuikafka can I take this issue?

yep, sure. Sorry for the delay, inbox cluttering  :)


error: use of unresolved identifier 'router' in main.swift

Hi, I created a bot based on the "hello-bot". And when I was trying to compile, I got these errors:
error: use of unresolved identifier 'router' and error: use of unresolved identifier 'router' (but on the line 26).
So, what do I need to do to solve the problem?

the 26th line isn't a problem (I just removed it as it was in the guide)

Ok, so I just watched the word reverser bot's code and then I added this string: let router = Router(bot: bot)


Post 2022 04 30

Sorry. Just opened this PR to your repo instead of mine. :laughing:
You can delete this.


slider-nav centering

To avoid inline styling and give simpler control to users I suggest removing
left: 50% and margin-right inline styling from the nav, which the javascript sets, and instead use this for example on .slider-nav:
left: 0;
right: 0;
margin-left: auto;
margin-right: auto;
Should center it just fine, and make it a bit simpler for users to control the nav with their own css, without fooling around in the javascript deleting and changing stuff :)

Glide has been released in version v2.0.0. If the problem remains, please set up a new thread.


Czech - Fixed translation of 'Light Theme'

Description:
Czech translation of "Light theme" is wrong. The word "Lehký" is being used when something is not heavy (it's related to weight and not to brightness). The proper translation is "Světlý".

Thanks for the contribution and for the good explanation. It makes sense to fix this copy.


How to disable the horizontal scrollbar?

Add this to the scrollbar props
renderTrackHorizontal={props => <div {...props} style={{display: 'none'}} className="track-horizontal"/>}

usually if the horizontal bar is appearing is because the inner content wrapper does not have overflow: hidden

@pawelangelow If there's a autoHeight flag, the height of renderView need to be handled seperately.
@malte-wessel What about providing a separate flag for this feature?

i use this trick:
const ref = useRef();
const someRef = useRef({
scrollLeft: 0,
scrollTop: 0,
});
const handleOnScrollFrame = useCallback(event => {
if (disabled) {
ref.current.scrollLeft(someRef.current.scrollLeft);
ref.current.scrollTop(someRef.current.scrollTop);
} else {
someRef.current.scrollLeft = event.scrollLeft;
someRef.current.scrollTop = event.scrollTop;
}
}, [disabled])
<Scrollbars
onScrollFrame={handleOnScrollFrame}
ref={ref}
{...props}
>
{children}

In addition to @creativelikeadog 's answer ->
renderView={props => (
    <div {...props} style={{ ...props.style, overflowX: 'hidden' }} />
)}

I had to set overflow-x of the content wrapper to hidden.

That code works great in Firefox.  But for my application it actually broke it in Chrome.  In Chrome, part of the bottom got chopped off or hidden, I am assuming the height of the scrollbar.


Signalling matchmaker

Extract SignallingWebServer matchmaker socket into it's own class to help make the code more readable
relates to #10

@adamrehn @mentalnote

You will need to sign your commit before I can merge it: https://docs.github.com/articles/about-gpg/


[Help] Update a column's titleSpan

Is there a way to update a column's titleSpan, after the grid has been built? Something like stateManager.setColumnProperty(column: ..., titleSpan: ...)?
Use case: the widget building the PlutoGrid has a useShortColumnNames boolean being passed in, and in didUpdateWidget I'd like to update the titleSpan accordingly.
Thanks for PlutoGrid -- it's fantastic!

Ah, it seems I can just directly modify e.g. stateManager.columns[0].titleSpan. Thanks again for PlutoGrid!


[cxx-interop] Disable failing tests to unblock nightly toolchains

rdar://93341210

@swift-ci please smoke test


Determining Realistic Motor and Control Params

I have a quadcopter with a flight controller running ArduPilot. I'm looking to use PyFlyt to train an RL policy to complete different maneuvers with a simulated quadcopter. I then plan to transfer this policy to my actual quadcopter.
Do you have any recommendations on calculating or measuring the motor and control params that will most accurately model real life? I plan to use the primitive_drone example as a starting point. Would it be useful to incorporate the actual PID values from ArduPilot at all?

Calculating motor params is a fairly easy task that can be done using simple motor thrust and torque stands. You will also need to obtain inertia and mass values which can be done using a simple scale and trifilar pendulum test. As for PID values, I do believe that copying the values over directly would not work since Ardupilot's params may incorporate a different scaling and saturation regime. That said, comverting the PID values over should not be an impossible task. I am willing to help with this if you can describe your goals in a bit more detail.

I plan to modify the hover and waypoint demos. My goal is to have the primitive_drone quadcopter dodge incoming projectiles. Its default state will be to hover in place. Then as a projectile approaches (I'm planning to use those green orbs from the waypoint demo), the quad will do some sort of flip or maneuver to avoid the projectile. Then it will return to hovering at the home position.
Creating this environment will be a task of its own. I'll probably spend most of the time tuning the reward function to achieve the behavior I desire.
But after the drone can dodge projectiles in simulation, I want to transfer the RL model to an FPV racing drone (Holybro Kopsis). I'm running ArduPilot on the flight controller and I will use a Linux companion computer to send it commands. I will most likely use the default flight mode 0 in PyFlyt (angular velocities and thrust). And so I'd send angular velocity and thrust commands to the ArduPilot flight controller as well.
At first glance, I can tell that the primitive_drone model is much more sluggish than an FPV racing drone. I'm going to try to tune the params to make it more agile so it can dodge faster projectiles. I think the hardest part of this project will be accurately simulating the FPV racing drone. Specifically finding appropriate PID values will be a challenge. One reason I plan to use the angular velocity and thrust commands is that it allows the flight controller to handle the lower level control. I won't need to account for propeller pitch and diameter, motor sizing, battery voltage... It will just use its PID values to maintain the requested angular velocities and thrust. As long as the angular acceleration and maximum thrust match between the simulator and real life, I think I should be able to transfer the learned maneuvers to the real FPV racing drone.

That's a very cool application, and one that I was hoping to see PyFlyt being used for eventually - happy to see that you're taking up this mantle. Let me know if there's anything that we can help with, and whether there are any physics inconsistencies between your system identification parameters and PyFlyt. We will be happy to accomodate any suggested changes.


A Prompt 'Farmer Does Not Belong to a Batch' Shows up Upon Saving a Farmland

Description
A prompt shows up while saving a farmland.

Reproduction steps

Go to farmland management.

Click Pietro Farmland.

Click Save.

Expected behavior
This prompt is only appropriate in farmer management.
Relevant log output
No response
Affected browsers (if applicable)
No response

Please verify whether the farmer in the farmland actually belongs to the batch.


load more

How to add loadmore function with the binding-collection-adapter...

You are more likely to get a response for general databinding questions on somewhere like StackOverflow


Remove signal event listeners on finish

What it says in the title.
Fixes #510

coverage: 98.19% (-0.07%) from 98.263%
when pulling e770884baf39fc6293372da8667eaf452de50a1c on issue-510
into 79b3290723c4211e6a873eff297b059c752bd5c4 on main.


Events as iterator instead of vec, move quit to an event instead of bool

Perhaps moving the quit bool into an event survives from #190?
checklist

[x] Check that you've added passing tests and documentation
[x] Add a simulator example(s) where applicable Not applicable
[x] Add a CHANGELOG.md entry in the Unreleased section under the appropriate heading (Added, Fixed, etc) Not applicable
[x] Run rustfmt on the project
[x] Run ./build.sh (Linux/macOS only) and make sure it passes. If you use Windows, check that CI passes once you've opened the PR.

Simulator hasnt been released though, so theres no change to log

ping @jamwaffles or anyone else, any thoughts on this?

Thanks!


Canceling picker can close another opened picker

Testing https://github.com/Microsoft/vscode/issues/11110

write an extension that opens the picker with a cancellation token that cancels itself after 5 seconds (also configure it to keep open on focus lost)
run the extension to open quick open
open another picker (e.g. encoding)

=> after 5 seconds the encoding picker closes
I think the cancellation token should only work on the request that was made to open the picker in the first place.
let disposable = vscode.commands.registerCommand('extension.sayHello', () => {
    // The code you place here will be executed every time your command is executed

    const src = new vscode.CancellationTokenSource();

    setTimeout(function() {
        src.cancel();
    }, 3000);

    // Display a message box to the user
    vscode.window.showQuickPick(["foo", "bar"], { ignoreFocusOut: true }, src.token).then(res => {
        console.log("res is null?: " + (res === null));
        console.log("res is undefined?: " + (res === void 0));
    });
});

and the inverse: "Opening quick pick doesn't cancel an existing quick pick"...


Fix CMake build on a root folder that contains spaces

Tracked on [LRS-779]

@OhadMeir ?

@OhadMeir ?

I tried it on Thursday and it did not work but could not share screen with Tamir due to technical issues. Will continue with him tomorrow.


Vite + react-i18next issue

Describe the bug
When using the production mode from vite combined with react-i18next we get a weird issue where _typeof (babel) function is no longer defined properly.
If I comment either this component or react-i18next usage the build version works.
I've enabled the source maps to help out with the debug process but its a bit overwhelming for me to check the entire code of this codebase. I found that the LocaleProvider from antd might be the culprit.
To Reproduce
Steps to reproduce the behavior:

git clone https://github.com/codrin-iftimie/antd-vite-trial
npm i
npm run dev - (works)
npm run build && npx serve dist (no longer works)

Expected behavior
Definitely, it should not break the build when adding this library to an existing stack.
Versions (please complete the following information):
Latest versions of everything. Check the package.json
Let me know if there is more info I can provide and thanks for this wonderful component!
Later edit: Lowering the version of antd to 4.10.3 no longer breaks the build >.<

Hello,
Thanks for using this library, and thanks for the issue! 🙂
I'm able to reproduce your bug with your test repository, but I didn't understand why. So I decided to check if it was working with the same dependencies on a code sandbox to see if it could possibly be a build problem. When I said build I talk about packages, typescript and build management.
Here is the link of this Cron component with react-i18next perfectly working: https://codesandbox.io/s/test-react-js-cron-i18next-sn3z7?file=/src/App.tsx
So I guess the library is working with react-i18next, and it's something else in your work that create the issue. Maybe you can try to reproduce with another way to build. Maybe you can try with a basic create-react-app with only the required dependencies.
For the moment I don't have any clue about why the bug happen since it's working in the codesandbox example.

Thank you for the quick reply. Maybe I haven't described the bug correctly. The library works well in dev mode (which I'm guessing the code sandbox uses). There is no compatibility issue there.
The problem arises when the actual code is bundled and minimized. I have no idea why this happens.
Weirdly enough when lowering the antd version (4.10.x) I was no longer able to reproduce the bug (bundled version works). In my case, I'm trying to update all libraries to the latest version to remove any security issues libraries might have.

Hum I'm not sure either if code sandbox use dev mode or prod mode.
What I was talking about is I think the problem come from the way you're building your project. I checked with a create-react-app build, and it's working in production mode.
Here is the test repository: https://github.com/xrutayisire/react-js-cron-i18next
So you should try to see why you have a problem with vite. I will also try to find the problem (and a solution :D), but I don't have a lot of time

I was not able to reproduce with create-react-app, so I still assume it's a build problem. Did you have time to take a look to find out why your build create this problem?

I test with cra as well. Seems to be working both dev and production build.
Closing. Might be something upstream. Thanks!

Just in case some1 else encounters this:
Check this code
https://github.com/codrin-iftimie/antd-vite-trial/commit/8c767582ad19201ed3a5564fe76f8bb1ac977c0b#diff-6a3b01ba97829c9566ef2d8dc466ffcffb4bdac08706d3d6319e42e0aa6890ddR4
You have to force vite to use the "lib" directory.
Also to have this working I had to actually use at least one antd component in my application.
I have no idea why I encountered this issue and why in CRA works without any issue.
To help out ppl using this keywords:
Vite, react-i18next, react-js-cron and and play well on this latest master of antd-vite-trial


Add package version and very simple about page

Codecov Report

Merging #463 into master will decrease coverage by <.01%.
The diff coverage is 77.77%.

@@            Coverage Diff             @@
##           master     #463      +/-   ##
==========================================
- Coverage   78.72%   78.72%   -0.01%
==========================================
  Files          32       33       +1
  Lines        2435     2444       +9
  Branches      154      154
==========================================
+ Hits         1917     1924       +7
- Misses        473      475       +2
  Partials       45       45

Impacted Files
Coverage Δ

cabot/urls.py
100% <ø> (ø)
:white_check_mark:

cabot/version.py
100% <100%> (ø)

cabot/init.py
100% <100%> (ø)
:white_check_mark:

cabot/cabotapp/views.py
64.12% <33.33%> (-0.21%)
:x:

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 224f022...50ee054. Read the comment docs.

No tests? ;-)

@JeanFred added tests just for you


Reorganise Hooks reference into meaningful sections

The hooks reference was in no discernible order, and getting long enough that it's pretty much impossible to find anything. This is my attempt to reorganise it into meaningful subsections, along with some minor formatting tweaks (making the hook names into headings, removing versionadded:: 0.7 tags, and removing one last errant django-compressor artefact).

Bravo @gasman!

@gasman, looks much better! Thanks!

Merged in cddbc7c4a83001a1c6193ea905144638cc2d7859 + parents.


Update for TTD - Node+VSCode, bug fixes, x-plat

-Changes needed for debugging with Node & VSCode (see PR #1215).

Various bug fixes
-Perf in interperter loop
-Break in release ch
-Disable JIT issues (issue #1244)

x-plat types & API defs in JsRT

x-plat host support and all TTD tests in Linux

@dilijev @jianchun @agarwal-sandeep @digitalinfinity @Yongqu please review

@jianchun @digitalinfinity There is also a change to runtests.py that forces it to a single thread. I added a tag "sequential" to rl that allows the tests in a directory to be run sequentially and in-order for a directory but runtests does not recognize this flag yet.

/// <param name="flushAndCloseStream">The <c>JsTTDFlushAndCloseStreamCallback</c> function for flushing and closing a HANDLE as needed.</param>

update it after API signature change

Refers to: lib/Jsrt/ChakraDebug.h:815 in 9bcf567. [](commit_id = 9bcf56725459d23b441515607f1515863d172677, deletion_comment = False)

@dotnet-bot
test Windows arm_test please
test Windows x86_debug please

@dotnet-bot  test Windows arm_debug please


trigger build

Signed-off-by: Zhiwei Yin<EMAIL_ADDRESS>

/assign @qiujian16

/approve
/lgtm

refer to https://github.com/open-cluster-management/backlog/issues/16302


Add thumb option to armv7, armv7eb, aarch64

Probably easier to add thumb opt to constants and handle it in GadgetSearch

thumb will be an options checkbox, triggers repooling all in thumb

GadgetSearch support added, need to add GadgetAnalysis (commit is local)

Added


Bug report: Invalid regular expression: /Theory of knowledge (/i: Unterminated group

I encountered an error: Invalid regular expression: /Theory of knowledge (/i: Unterminated group

Hey @jatin-toddleapp could you provide a screenshot or video, unable to see error with same text. Was this filter or search?

after copy & pasting the text with brackets, if I remove the closing bracket.
Uploading Screen Recording 2024-02-19 at 5.25.32 PM.mov…


undefined method `asset_path'

Hi, I keep getting this error, and I'm not sure why.
I don't get it all the time, but most of the time it's there.
[SassC::FunctionsHandler] undefined method `asset_path' for #<#<Class:0x00007fb5b065aca8>:0x00007fb5b065a0f0>
                    ------------------------------------------------
      Jekyll 4.0.0   Please append `--trace` to the `build` command
                     for any additional information or backtrace.
                    -----------------------------------------------

Here's the trace.
[SassC::FunctionsHandler] undefined method `asset_path' for #<#<Class:0x00007fe0830e97d0>:0x00007fe0830e9528>
Traceback (most recent call last):
	46: from /Users/myuser/.rvm/gems/ruby-2.6.3@blog_jkl/gems/concurrent-ruby-1.1.5/lib/concurrent/executor/ruby_thread_pool_executor.rb:319:in `block in create_worker'
	45: from /Users/myuser/.rvm/gems/ruby-2.6.3@blog_jkl/gems/concurrent-ruby-1.1.5/lib/concurrent/executor/ruby_thread_pool_executor.rb:319:in `catch'
	44: from /Users/myuser/.rvm/gems/ruby-2.6.3@blog_jkl/gems/concurrent-ruby-1.1.5/lib/concurrent/executor/ruby_thread_pool_executor.rb:320:in `block (2 levels) in create_worker'
	43: from /Users/myuser/.rvm/gems/ruby-2.6.3@blog_jkl/gems/concurrent-ruby-1.1.5/lib/concurrent/executor/ruby_thread_pool_executor.rb:320:in `loop'
	42: from /Users/myuser/.rvm/gems/ruby-2.6.3@blog_jkl/gems/concurrent-ruby-1.1.5/lib/concurrent/executor/ruby_thread_pool_executor.rb:337:in `block (3 levels) in create_worker'
	41: from /Users/myuser/.rvm/gems/ruby-2.6.3@blog_jkl/gems/concurrent-ruby-1.1.5/lib/concurrent/executor/ruby_thread_pool_executor.rb:348:in `run_task'
	40: from /Users/myuser/.rvm/gems/ruby-2.6.3@blog_jkl/gems/concurrent-ruby-1.1.5/lib/concurrent/promise.rb:563:in `block in realize'
	39: from /Users/myuser/.rvm/gems/ruby-2.6.3@blog_jkl/gems/concurrent-ruby-1.1.5/lib/concurrent/executor/safe_task_executor.rb:19:in `execute'
	38: from /Users/myuser/.rvm/gems/ruby-2.6.3@blog_jkl/gems/concurrent-ruby-1.1.5/lib/concurrent/synchronization/mutex_lockable_object.rb:41:in `synchronize'
	37: from /Users/myuser/.rvm/gems/ruby-2.6.3@blog_jkl/gems/concurrent-ruby-1.1.5/lib/concurrent/synchronization/mutex_lockable_object.rb:41:in `synchronize'
	36: from /Users/myuser/.rvm/gems/ruby-2.6.3@blog_jkl/gems/concurrent-ruby-1.1.5/lib/concurrent/synchronization/mutex_lockable_object.rb:41:in `block in synchronize'
	35: from /Users/myuser/.rvm/gems/ruby-2.6.3@blog_jkl/gems/concurrent-ruby-1.1.5/lib/concurrent/executor/safe_task_executor.rb:24:in `block in execute'
	34: from /Users/myuser/.rvm/gems/ruby-2.6.3@blog_jkl/gems/sprockets-4.0.0/lib/sprockets/manifest.rb:125:in `block (2 levels) in find'
	33: from /Users/myuser/.rvm/gems/ruby-2.6.3@blog_jkl/gems/sprockets-4.0.0/lib/sprockets/base.rb:88:in `find_all_linked_assets'
	32: from /Users/myuser/.rvm/gems/ruby-2.6.3@blog_jkl/bundler/gems/jekyll-assets-63f8aa316574/lib/jekyll/assets/patches/cached_environment.rb:37:in `block (2 levels) in <module:CachedEnvironment>'
	31: from /Users/myuser/.rvm/gems/ruby-2.6.3@blog_jkl/gems/sprockets-4.0.0/lib/sprockets/base.rb:81:in `find_asset'
	30: from /Users/myuser/.rvm/gems/ruby-2.6.3@blog_jkl/gems/sprockets-4.0.0/lib/sprockets/cached_environment.rb:44:in `load'
	29: from /Users/myuser/.rvm/gems/ruby-2.6.3@blog_jkl/gems/sprockets-4.0.0/lib/sprockets/loader.rb:43:in `load'
	28: from /Users/myuser/.rvm/gems/ruby-2.6.3@blog_jkl/gems/sprockets-4.0.0/lib/sprockets/loader.rb:335:in `fetch_asset_from_dependency_cache'
	27: from /Users/myuser/.rvm/gems/ruby-2.6.3@blog_jkl/gems/sprockets-4.0.0/lib/sprockets/loader.rb:59:in `block in load'
	26: from /Users/myuser/.rvm/gems/ruby-2.6.3@blog_jkl/gems/sprockets-4.0.0/lib/sprockets/loader.rb:182:in `load_from_unloaded'
	25: from /Users/myuser/.rvm/gems/ruby-2.6.3@blog_jkl/gems/sprockets-4.0.0/lib/sprockets/processor_utils.rb:65:in `call_processors'
	24: from /Users/myuser/.rvm/gems/ruby-2.6.3@blog_jkl/gems/sprockets-4.0.0/lib/sprockets/processor_utils.rb:65:in `reverse_each'
	23: from /Users/myuser/.rvm/gems/ruby-2.6.3@blog_jkl/gems/sprockets-4.0.0/lib/sprockets/processor_utils.rb:66:in `block in call_processors'
	22: from /Users/myuser/.rvm/gems/ruby-2.6.3@blog_jkl/gems/sprockets-4.0.0/lib/sprockets/processor_utils.rb:84:in `call_processor'
	21: from /Users/myuser/.rvm/gems/ruby-2.6.3@blog_jkl/gems/sprockets-4.0.0/lib/sprockets/bundle.rb:27:in `call'
	20: from /Users/myuser/.rvm/gems/ruby-2.6.3@blog_jkl/gems/sprockets-4.0.0/lib/sprockets/cached_environment.rb:44:in `load'
	19: from /Users/myuser/.rvm/gems/ruby-2.6.3@blog_jkl/gems/sprockets-4.0.0/lib/sprockets/loader.rb:43:in `load'
	18: from /Users/myuser/.rvm/gems/ruby-2.6.3@blog_jkl/gems/sprockets-4.0.0/lib/sprockets/loader.rb:335:in `fetch_asset_from_dependency_cache'
	17: from /Users/myuser/.rvm/gems/ruby-2.6.3@blog_jkl/gems/sprockets-4.0.0/lib/sprockets/loader.rb:59:in `block in load'
	16: from /Users/myuser/.rvm/gems/ruby-2.6.3@blog_jkl/gems/sprockets-4.0.0/lib/sprockets/loader.rb:182:in `load_from_unloaded'
	15: from /Users/myuser/.rvm/gems/ruby-2.6.3@blog_jkl/gems/sprockets-4.0.0/lib/sprockets/processor_utils.rb:65:in `call_processors'
	14: from /Users/myuser/.rvm/gems/ruby-2.6.3@blog_jkl/gems/sprockets-4.0.0/lib/sprockets/processor_utils.rb:65:in `reverse_each'
	13: from /Users/myuser/.rvm/gems/ruby-2.6.3@blog_jkl/gems/sprockets-4.0.0/lib/sprockets/processor_utils.rb:66:in `block in call_processors'
	12: from /Users/myuser/.rvm/gems/ruby-2.6.3@blog_jkl/gems/sprockets-4.0.0/lib/sprockets/processor_utils.rb:84:in `call_processor'
	11: from /Users/myuser/.rvm/gems/ruby-2.6.3@blog_jkl/gems/sprockets-4.0.0/lib/sprockets/processor_utils.rb:33:in `call'
	10: from /Users/myuser/.rvm/gems/ruby-2.6.3@blog_jkl/gems/sprockets-4.0.0/lib/sprockets/processor_utils.rb:22:in `block in <class:CompositeProcessor>'
	 9: from /Users/myuser/.rvm/gems/ruby-2.6.3@blog_jkl/gems/sprockets-4.0.0/lib/sprockets/processor_utils.rb:65:in `call_processors'
	 8: from /Users/myuser/.rvm/gems/ruby-2.6.3@blog_jkl/gems/sprockets-4.0.0/lib/sprockets/processor_utils.rb:65:in `reverse_each'
	 7: from /Users/myuser/.rvm/gems/ruby-2.6.3@blog_jkl/gems/sprockets-4.0.0/lib/sprockets/processor_utils.rb:66:in `block in call_processors'
	 6: from /Users/myuser/.rvm/gems/ruby-2.6.3@blog_jkl/gems/sprockets-4.0.0/lib/sprockets/processor_utils.rb:84:in `call_processor'
	 5: from /Users/myuser/.rvm/gems/ruby-2.6.3@blog_jkl/gems/sprockets-4.0.0/lib/sprockets/sassc_processor.rb:31:in `call'
	 4: from /Users/myuser/.rvm/gems/ruby-2.6.3@blog_jkl/gems/sprockets-4.0.0/lib/sprockets/sassc_processor.rb:58:in `call'
	 3: from /Users/myuser/.rvm/gems/ruby-2.6.3@blog_jkl/gems/sprockets-4.0.0/lib/sprockets/utils.rb:138:in `module_include'
	 2: from /Users/myuser/.rvm/gems/ruby-2.6.3@blog_jkl/gems/sprockets-4.0.0/lib/sprockets/sassc_processor.rb:59:in `block in call'
	 1: from /Users/myuser/.rvm/gems/ruby-2.6.3@blog_jkl/gems/sassc-2.2.1/lib/sassc/engine.rb:49:in `render'
/Users/myuser/Work/blog/_assets/stylesheets/vendor/open-iconic-bootstrap.scss:6: Error: error in C function asset_path: undefined method `asset_path' for #<#<Class:0x00007fe0830e97d0>:0x00007fe0830e9528> (SassC::SyntaxError)
        on line 6:194 of _assets/stylesheets/vendor/open-iconic-bootstrap.scss, in function `asset_path`
        from line 6:194 of _assets/stylesheets/vendor/open-iconic-bootstrap.scss
        from line 23:9 of _assets/stylesheets/main.scss
>> pen-iconic.ttf')) format('truetype'), url(asset_path('open-iconic.svg#iconic

Hey @chalmagean can you try the master branch and see if this is still an issue?

Not sure if it's related but now I'm getting the following when I try to build my site for production.
/Users/myuser/.rvm/gems/ruby-2.6.3@blog_jkl/bundler/gems/jekyll-assets-3c371cf3fa5f/lib/jekyll/assets/plugins/html/defaults/img.rb:40:in `set_integrity': undefined method `update' for #<Liquid::Tag::Parser:0x00007fc2fb35b018> (NoMethodError)

I see that jekyll-assets depends on liquid-tag-parser 1.0.0, and they are now at 1.9.

"They're" would be me as that's my library.  Jekyll-Assets relies on ~> 1.0 not = 1.0.0 so you can run bundle update any time you please to get any version of that dependency within the 1.x semantic range. Please provide a proper trace, not just the error, I can do nothing with an error, thanks!

Sorry, I didn't realize that.
JEKYLL_ENV=production jekyll b --trace
Configuration file: /Users/myuser/Work/blog/_config.yml
            Source: /Users/myuser/Work/blog
       Destination: /Users/myuser/Work/blog/_site
 Incremental build: disabled. Enable with --incremental
      Generating...
         AutoPages: Disabled/Not configured in site.config.
        Pagination: Complete, processed 1 pagination page(s)
  Liquid Exception: undefined method `update' for #<Liquid::Tag::Parser:0x00007ff36d483790> in /Users/myuser/Work/blog/_posts/2014-11-11-how-i-create-a-new-rails-project.md
Traceback (most recent call last):
	50: from /Users/myuser/.rvm/gems/ruby-2.6.3@blog_jkl/bin/ruby_executable_hooks:24:in `<main>'
	49: from /Users/myuser/.rvm/gems/ruby-2.6.3@blog_jkl/bin/ruby_executable_hooks:24:in `eval'
	48: from /Users/myuser/.rvm/gems/ruby-2.6.3@blog_jkl/bin/jekyll:23:in `<main>'
	47: from /Users/myuser/.rvm/gems/ruby-2.6.3@blog_jkl/bin/jekyll:23:in `load'
	46: from /Users/myuser/.rvm/gems/ruby-2.6.3@blog_jkl/gems/jekyll-4.0.0/exe/jekyll:15:in `<top (required)>'
	45: from /Users/myuser/.rvm/gems/ruby-2.6.3@blog_jkl/gems/mercenary-0.3.6/lib/mercenary.rb:19:in `program'
	44: from /Users/myuser/.rvm/gems/ruby-2.6.3@blog_jkl/gems/mercenary-0.3.6/lib/mercenary/program.rb:42:in `go'
	43: from /Users/myuser/.rvm/gems/ruby-2.6.3@blog_jkl/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `execute'
	42: from /Users/myuser/.rvm/gems/ruby-2.6.3@blog_jkl/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `each'
	41: from /Users/myuser/.rvm/gems/ruby-2.6.3@blog_jkl/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `block in execute'
	40: from /Users/myuser/.rvm/gems/ruby-2.6.3@blog_jkl/gems/jekyll-4.0.0/lib/jekyll/commands/build.rb:18:in `block (2 levels) in init_with_program'
	39: from /Users/myuser/.rvm/gems/ruby-2.6.3@blog_jkl/gems/jekyll-4.0.0/lib/jekyll/command.rb:89:in `process_with_graceful_fail'
	38: from /Users/myuser/.rvm/gems/ruby-2.6.3@blog_jkl/gems/jekyll-4.0.0/lib/jekyll/command.rb:89:in `each'
	37: from /Users/myuser/.rvm/gems/ruby-2.6.3@blog_jkl/gems/jekyll-4.0.0/lib/jekyll/command.rb:89:in `block in process_with_graceful_fail'
	36: from /Users/myuser/.rvm/gems/ruby-2.6.3@blog_jkl/gems/jekyll-4.0.0/lib/jekyll/commands/build.rb:36:in `process'
	35: from /Users/myuser/.rvm/gems/ruby-2.6.3@blog_jkl/gems/jekyll-4.0.0/lib/jekyll/commands/build.rb:65:in `build'
	34: from /Users/myuser/.rvm/gems/ruby-2.6.3@blog_jkl/gems/jekyll-4.0.0/lib/jekyll/command.rb:28:in `process_site'
	33: from /Users/myuser/.rvm/gems/ruby-2.6.3@blog_jkl/gems/jekyll-4.0.0/lib/jekyll/site.rb:76:in `process'
	32: from /Users/myuser/.rvm/gems/ruby-2.6.3@blog_jkl/gems/jekyll-4.0.0/lib/jekyll/site.rb:201:in `render'
	31: from /Users/myuser/.rvm/gems/ruby-2.6.3@blog_jkl/gems/jekyll-4.0.0/lib/jekyll/site.rb:507:in `render_docs'
	30: from /Users/myuser/.rvm/gems/ruby-2.6.3@blog_jkl/gems/jekyll-4.0.0/lib/jekyll/site.rb:507:in `each_value'
	29: from /Users/myuser/.rvm/gems/ruby-2.6.3@blog_jkl/gems/jekyll-4.0.0/lib/jekyll/site.rb:508:in `block in render_docs'
	28: from /Users/myuser/.rvm/gems/ruby-2.6.3@blog_jkl/gems/jekyll-4.0.0/lib/jekyll/site.rb:508:in `each'
	27: from /Users/myuser/.rvm/gems/ruby-2.6.3@blog_jkl/gems/jekyll-4.0.0/lib/jekyll/site.rb:509:in `block (2 levels) in render_docs'
	26: from /Users/myuser/.rvm/gems/ruby-2.6.3@blog_jkl/gems/jekyll-4.0.0/lib/jekyll/site.rb:523:in `render_regenerated'
	25: from /Users/myuser/.rvm/gems/ruby-2.6.3@blog_jkl/gems/jekyll-4.0.0/lib/jekyll/renderer.rb:63:in `run'
	24: from /Users/myuser/.rvm/gems/ruby-2.6.3@blog_jkl/gems/jekyll-4.0.0/lib/jekyll/renderer.rb:80:in `render_document'
	23: from /Users/myuser/.rvm/gems/ruby-2.6.3@blog_jkl/gems/jekyll-4.0.0/lib/jekyll/renderer.rb:127:in `render_liquid'
	22: from /Users/myuser/.rvm/gems/ruby-2.6.3@blog_jkl/gems/jekyll-4.0.0/lib/jekyll/liquid_renderer/file.rb:32:in `render!'
	21: from /Users/myuser/.rvm/gems/ruby-2.6.3@blog_jkl/gems/jekyll-4.0.0/lib/jekyll/liquid_renderer/file.rb:60:in `measure_time'
	20: from /Users/myuser/.rvm/gems/ruby-2.6.3@blog_jkl/gems/jekyll-4.0.0/lib/jekyll/liquid_renderer/file.rb:33:in `block in render!'
	19: from /Users/myuser/.rvm/gems/ruby-2.6.3@blog_jkl/gems/jekyll-4.0.0/lib/jekyll/liquid_renderer/file.rb:53:in `measure_bytes'
	18: from /Users/myuser/.rvm/gems/ruby-2.6.3@blog_jkl/gems/jekyll-4.0.0/lib/jekyll/liquid_renderer/file.rb:34:in `block (2 levels) in render!'
	17: from /Users/myuser/.rvm/gems/ruby-2.6.3@blog_jkl/gems/jekyll-4.0.0/lib/jekyll/liquid_renderer/file.rb:49:in `measure_counts'
	16: from /Users/myuser/.rvm/gems/ruby-2.6.3@blog_jkl/gems/jekyll-4.0.0/lib/jekyll/liquid_renderer/file.rb:35:in `block (3 levels) in render!'
	15: from /Users/myuser/.rvm/gems/ruby-2.6.3@blog_jkl/gems/liquid-4.0.3/lib/liquid/template.rb:220:in `render!'
	14: from /Users/myuser/.rvm/gems/ruby-2.6.3@blog_jkl/gems/liquid-4.0.3/lib/liquid/template.rb:207:in `render'
	13: from /Users/myuser/.rvm/gems/ruby-2.6.3@blog_jkl/gems/liquid-4.0.3/lib/liquid/template.rb:242:in `with_profiling'
	12: from /Users/myuser/.rvm/gems/ruby-2.6.3@blog_jkl/gems/liquid-4.0.3/lib/liquid/template.rb:208:in `block in render'
	11: from /Users/myuser/.rvm/gems/ruby-2.6.3@blog_jkl/gems/liquid-4.0.3/lib/liquid/block_body.rb:91:in `render'
	10: from /Users/myuser/.rvm/gems/ruby-2.6.3@blog_jkl/gems/liquid-4.0.3/lib/liquid/block_body.rb:103:in `render_node_to_output'
	 9: from /Users/myuser/.rvm/gems/ruby-2.6.3@blog_jkl/bundler/gems/jekyll-assets-3c371cf3fa5f/lib/jekyll/assets/tag.rb:63:in `render'
	 8: from /Users/myuser/.rvm/gems/ruby-2.6.3@blog_jkl/bundler/gems/jekyll-assets-3c371cf3fa5f/lib/jekyll/assets/tag.rb:51:in `render_raw'
	 7: from /Users/myuser/.rvm/gems/ruby-2.6.3@blog_jkl/bundler/gems/jekyll-assets-3c371cf3fa5f/lib/jekyll/assets/tag.rb:158:in `internal'
	 6: from /Users/myuser/.rvm/gems/ruby-2.6.3@blog_jkl/bundler/gems/jekyll-assets-3c371cf3fa5f/lib/jekyll/assets/default.rb:42:in `set'
	 5: from /Users/myuser/.rvm/gems/ruby-2.6.3@blog_jkl/bundler/gems/jekyll-assets-3c371cf3fa5f/lib/jekyll/assets/default.rb:42:in `each'
	 4: from /Users/myuser/.rvm/gems/ruby-2.6.3@blog_jkl/bundler/gems/jekyll-assets-3c371cf3fa5f/lib/jekyll/assets/default.rb:47:in `block in set'
	 3: from /Users/myuser/.rvm/gems/ruby-2.6.3@blog_jkl/bundler/gems/jekyll-assets-3c371cf3fa5f/lib/jekyll/assets/default.rb:81:in `run'
	 2: from /Users/myuser/.rvm/gems/ruby-2.6.3@blog_jkl/bundler/gems/jekyll-assets-3c371cf3fa5f/lib/jekyll/assets/default.rb:81:in `each'
	 1: from /Users/myuser/.rvm/gems/ruby-2.6.3@blog_jkl/bundler/gems/jekyll-assets-3c371cf3fa5f/lib/jekyll/assets/default.rb:82:in `block in run'
/Users/myuser/.rvm/gems/ruby-2.6.3@blog_jkl/bundler/gems/jekyll-assets-3c371cf3fa5f/lib/jekyll/assets/plugins/html/defaults/img.rb:40:in `set_integrity': undefined method `update' for #<Liquid::Tag::Parser:0x00007ff36d483790> (NoMethodError)

Hmmm... that makes the error very clear!


add imconnect.co.za

University official website URL: https://www.iiemsa.co.za/
Course: https://www.iiemsa.co.za/courses/bachelor-of-computer-and-information-sciences-in-application-development/
Email format is used here: https://portal.iiemsa.co.za/student-hub/GeneralEnquiry.aspx

@vijal-patel Thank you for your patience while waiting for a review and processing your request. Pull request merged.


Polymer conformation

This draft PR introduces a new Species class, PolymerConformation(ComplexSpecies), which is used to store a set of OrderedPolymerSpecies and a set of ComplexSpecies representing binding between OrderedMonomers of the OrderedPolymerSpecies.
Why is this necessary? Currently, BioCRNpyler does not have an easy way to represent Polymers which have been bound together. Some simple examples include hairpins or Looping where a single polymer binds to itself, which occur in RNA secondary structures as well as providing a mechanistic basis for many DNA regulatory elements, and things like integrases where multiple pieces of DNA can bind and recombine. The goal of this Species representation is that it will allow for such conformations to be represented and modeled unambiguously as elements of a CRN
Lots of files have changed, but most of these changes are due to bugs that were found in the course of building this feature and new/changed test files. The key new pieces of code are all in Species.py. They are the new PolymerConformation class and an expansion of Complex(..) class which produces ComplexSpecies of different sorts.
Main Changes:

MonomerCollection class is a superclass of OrderedPolymer and contains a list of OrderedMonomers without any additional informations. OrderedMonomer.parent (and therefore, Species.parent) must be a MonomerCollection.
PolymerConformation class is a subclass Species and MonomerCollection. It contains a list of OrderedPolymerSpecies and a list of ComplexSpecies representing binding between OrderedPolymerSpecies' monomers. Tests have been added for this classes functionality.
Complex class function has changed to produce PolymerConformations when needed. Test cases have been added.
remove_bindloc has been made recursive so that the top level of Species' parent-child relationship is inserted into reactions and/or a CRN.
These changes have resulted in a number of smaller changes propogating throughout the code and numerous test cases.

In general I like this. I think we would need to address how combinatorial enumeration treats these constructs.
When you say construct.update_combinatorial_complexes(list(active_components)) you are relying on differentiating linear polymers from complexes of those polymers. Combinatorial Enumeration does this:

create all species assuming that only one component (in active_components) is active
create "mix and match" polymers where you take subunits from above and combine them with subunits created at different positions

For 2 to work you must be able to sift through a list of polymers and figure out which ones are versions of the same polymer but with stuff bound at different locations. After all, we are interested in all of the ways that things can be bound to the same polymer. This is how I am currently using the base_species member. Each polymer has a simple Species object inside which is basically the "name" of the polymer which has nothing bound at any location. This is different from the name member since it is shared between many different versions of the same polymer (but in that case the name of these different versions must be different or else compilation won't make sense).
How does that work for a PolymerConformation? I think a regular Species type of thing will not be enough.
I want to get rid of it altogether by allowing a OrderedMonomer to have a flag which says if it is part of a polymer or not. That will allow a polymer full of ComplexSpecies to dig out the proper Species that make up the polymer itself. And, it will allow creation of new polymers by feeding them ComplexSpecies, and the result will make sense.
What happens if a ComplexSpecies containing two monomers is fed in like this?
We can avoid this problem in many ways but at the end of the day it seems important to me to keep the physical configuration of the polymer (covalent connection of polymer subunits) stored somehow. Allowing complex configurations of polymers just highlights this problem, I think.

In general I like this. I think we would need to address how combinatorial enumeration treats these constructs.
When you say construct.update_combinatorial_complexes(list(active_components)) you are relying on differentiating linear polymers from complexes of those polymers. Combinatorial Enumeration does this:

create all species assuming that only one component (in active_components) is active
create "mix and match" polymers where you take subunits from above and combine them with subunits created at different positions

For 2 to work you must be able to sift through a list of polymers and figure out which ones are versions of the same polymer but with stuff bound at different locations. After all, we are interested in all of the ways that things can be bound to the same polymer. This is how I am currently using the base_species member. Each polymer has a simple Species object inside which is basically the "name" of the polymer which has nothing bound at any location. This is different from the name member since it is shared between many different versions of the same polymer (but in that case the name of these different versions must be different or else compilation won't make sense).
How does that work for a PolymerConformation? I think a regular Species type of thing will not be enough.
I want to get rid of it altogether by allowing a OrderedMonomer to have a flag which says if it is part of a polymer or not. That will allow a polymer full of ComplexSpecies to dig out the proper Species that make up the polymer itself. And, it will allow creation of new polymers by feeding them ComplexSpecies, and the result will make sense.
What happens if a ComplexSpecies containing two monomers is fed in like this?
We can avoid this problem in many ways but at the end of the day it seems important to me to keep the physical configuration of the polymer (covalent connection of polymer subunits) stored somehow. Allowing complex configurations of polymers just highlights this problem, I think.

Thanks for the feedback @dr3y. Here are some thoughts:
With regards to Combinatorial Enumeration: I was hoping we could reuse the combinatorial stuff in each DNAConstruct. Basically, for each construct in the PolymerConformation, do the Combinatorial Enumeration keeping any bound complexes constant (this will require the ability to freeze a combinatorial site, which should be possible). Each set of combinations from each DNAConstruct could then be combined to get the full combinatorial set. One catch of this is that the IntegraseEnumerator will have to call the TxExplorer and TlExplorer itself - but I think that is probably inevitable. In other words, a DNAConstruct with integrase sites will overwrite its TxExplorer with an IntegraseExplorer which figures out integrations and also controls an internal TxExplorer.
With regards to OrderedMonomer flags: this won't work, as you describe, with PolymerConformation because in the case there are multiple Polymers, it won't be clear which one an OrderedMonomer belongs to. Here is an alternative thought: what if we use the OrderedMonomer.parent to keep track of this? The parent of a ComplexSpecies is the OrderedMonomer to which it is bound. The Parent of an OrderedMonomer is an OrderddPolymerSpecies. If an OrderedPolymerSpecies is in a PolymerConformation, it's parent will be the conformation. The parent of a  ComplexSpecies in a PolymerConformation bound to multiple OrderedMonomers will have the PolymerConformation as its parent. This has the nice feature that "remove_bind_loc" can now work recursively until it finds a Species with no parent! Conceptually, what I am thinking here is to add a flexible and arbitrary hierarchical description to these networks of OrderedMonomers.

Thanks for the feedback @dr3y. Here are some thoughts:
With regards to Combinatorial Enumeration: I was hoping we could reuse the combinatorial stuff in each DNAConstruct. Basically, for each construct in the PolymerConformation, do the Combinatorial Enumeration keeping any bound complexes constant (this will require the ability to freeze a combinatorial site, which should be possible). Each set of combinations from each DNAConstruct could then be combined to get the full combinatorial set. One catch of this is that the IntegraseEnumerator will have to call the TxExplorer and TlExplorer itself - but I think that is probably inevitable. In other words, a DNAConstruct with integrase sites will overwrite its TxExplorer with an IntegraseExplorer which figures out integrations and also controls an internal TxExplorer.
With regards to OrderedMonomer flags: this won't work, as you describe, with PolymerConformation because in the case there are multiple Polymers, it won't be clear which one an OrderedMonomer belongs to. Here is an alternative thought: what if we use the OrderedMonomer.parent to keep track of this? The parent of a ComplexSpecies is the OrderedMonomer to which it is bound. The Parent of an OrderedMonomer is an OrderddPolymerSpecies. If an OrderedPolymerSpecies is in a PolymerConformation, it's parent will be the conformation. The parent of a  ComplexSpecies in a PolymerConformation bound to multiple OrderedMonomers will have the PolymerConformation as its parent. This has the nice feature that "remove_bind_loc" can now work recursively until it finds a Species with no parent! Conceptually, what I am thinking here is to add a flexible and arbitrary hierarchical description to these networks of OrderedMonomers.

I made some minor comments. I got lost in the technical details of how the new classes are working so a documentation would definitely be helpful if someone new has to use these features.
Other than that I am wondering if this PR changes in any way the basic usage of Species across the software?

I made some minor comments. I got lost in the technical details of how the new classes are working so a documentation would definitely be helpful if someone new has to use these features.
Other than that I am wondering if this PR changes in any way the basic usage of Species across the software?

I made some minor comments. I got lost in the technical details of how the new classes are working so a documentation would definitely be helpful if someone new has to use these features.

I tried to provide descriptions in the Complex and PolymerConformation doc string, as well as in some of the test cases. Were these inadequate? Use examples (in an ipython notebook) will be coming in a later PR when I wrap this Species in a Component. Rushing this one because there are co-dependencies with stuff Andrey is working on.

Other than that I am wondering if this PR changes in any way the basic usage of Species across the software?

No - this PR does not change how normal Species, ComplexSpecies, or even OrderedPolymerSpecies work. These are all additional features built on top of those.

I made some minor comments. I got lost in the technical details of how the new classes are working so a documentation would definitely be helpful if someone new has to use these features.

I tried to provide descriptions in the Complex and PolymerConformation doc string, as well as in some of the test cases. Were these inadequate? Use examples (in an ipython notebook) will be coming in a later PR when I wrap this Species in a Component. Rushing this one because there are co-dependencies with stuff Andrey is working on.

Other than that I am wondering if this PR changes in any way the basic usage of Species across the software?

No - this PR does not change how normal Species, ComplexSpecies, or even OrderedPolymerSpecies work. These are all additional features built on top of those.


Unit testing tips french

Thanks for the translation, but please keep the English version as default and only add a link to french version maybe in the Introduction  section.

Hi,
Ok :)

Hi @sarven,
It ok right now.

It's done.


Move to fast_jsonapi

Reason for this switch:

It feels more "Railsy", as illustrated by the fact that there's no extra configuration necessary.
It uses oj behind the scenes which I successfully used in the past.
It's developed by Netflix, which probably means it's gonna be around for a while.

All those in favor, say aye 😉

Less dependencies, no config, how cool is this 🔥

Also convenient caching for data that's not changing often, e.g.:
cache_options enabled: true, cache_length: 12.hours


GlCanvas cleanup

This is a first refactor of GlCanvas / CaptureWindow. Sorry for the large PR, I kept running into small inconsistencies during the refactor that made it hard to find a reasonable cutoff point, and I wanted to avoid submitting it half-done because I had to revisit and change previous commits quite a bit as my assumptions continued to be incorrect...
Goals of this PR
Remove the code duplication and inconsistent behavior of GlCanvas and CaptureWindow
A lot of functionality (e.g. picking) was partially implemented in GlCanvas, but only worked for CaptureWindow. Other functionality was implemented in GlCanvas and then reimplemented (sometimes with minor changes) in CaptureWindow. Now, GlCanvas fully takes care of picking and tracking mouse interactions, whereas CaptureWindow add all functionality related to TimeGraph and Scrollbars.
Break down GlCanvas to improve Unit Test coverage
As a first step, all functionality related to viewport sizes, coordinate conversion, and virtual "camera placement" (e.g. position of the screen within the 2D world) moved to a new class Viewport. This new class is properly unit tested.
Next steps

Pass Batcher* and Viewport* instead of GlCanvas* where possible. This will decouple most components from GlCanvas, and will decouple rendering from coordinate translation.
Change horizontal scrolling and scaling to use the Viewport functionality. Currently, this is handled by TimeGraph, which is quite inconsistent (Viewport::GetWorldTopLeft()[0] is always 0!)
Move the layering definitions into a separate class
Move the actual "Renderpass" functionality into a new class that is linked to a viewport - so we get rid of the implicit assumptions that "some elements are drawn in screen space, others in world space", and remove the implicit 2nd renderpass that happens on picking, as this causes issues with state changes in between those two renderpasses.

Green selection rectangle is not sticky anymore (is this intended?). It is an important feature for the upcoming selection stats.
Right click used to give Orbit focus, now if Orbit is not in focus and we try to right-click and drag, the green rectangle does not appear
Vertical scrolling in a single direction makes the vertical slider jump up and down (see video)

The intent was to keep the existing behavior, so all changes mentioned above can be considered bugs. I'll take a look and fix them.

Thanks for the thorough reviews, @pierricgimmig @karupayun @florian-kuebler. I've addressed the comments in follow-up commits, PTAL.
Pierric: I did not yet find the reason for the weird scrollbar jumping, but I'll investigate further before merging this. I'll update as soon as I find something.

Right click used to give Orbit focus, now if Orbit is not in focus and we try to right-click and drag, the green rectangle does not appear

@pierricgimmig On windows, this works as expected... sure this is related to the changes here? I did not touch anything above OrbitGl, and can't see how those chances should influence window focus as all of this handling is done in OrbitQt.

Vertical scrolling in a single direction makes the vertical slider jump up and down (see video)

@pierricgimmig I've found the reason and fixed it. This was actually a one-line change, I moved the update of Viewport Extents to be done right after track rendering.


Keep a consistent button name between undelete dialog

Storage Explorer Version: 1.11.2
Build: 20191220.9
Branch: hotfix/1.11.2-to-master
Platform/OS: Windows 10/ CentOS 7.6.1810 (Core)/ MacOS High Sierra
Architecture: ia32/x64
Regression From: Not a regression
Steps to reproduce:

Expand one GPV2 storage account -> Enable soft delete policy for Blob Containers.
Create a blob container -> Upload one blob.
Delete the uploaded blob -> Switch to 'Active and deleted blobs' -> Right click the deleted blob.
Select 'Undelete Selected' and 'Undelete by Date... ' respectively -> Check button name on the two Undelete dialog.

Expect Experience:
Keep a consistent button name.
Actual Experience:
Display an inconsistent button name.

More Info:

It is better to update title of Undelete dialog to 'Undelete Selected Blobs'.

Change by date dialog to say "OK"


fix(custom-element): update initial render for defineCustomElement to run after nextTick

Problem
There is an edge case where using Vue generated custom elements inside of a Vue app with v-model will cause duplication inside of the ShadowRoot.
Solution
Waiting for the nextTick seems to resolve a collision between v-model and the custom element's initial render. This fix also limits impact to custom element users rather than all Vue users.
For example, you can also resolve the issue by putting a small timeout (or presumably also waiting for nextTick) around the initial setting of the value in vModel.ts.
mounted(el, { value }) {
    setTimeout(() => {
      el.value = value == null ? '' : value
    }, 1)
  },

Tests
There is a reproduction included in the issue to test against. I'd like to add some tests for this, but I'm still trying to figure out the best place/way to do that.
close: #9885

Found a better solution that can be implemented by library authors instead of making the change here in Vue core.

Here are some examples in the SFC playground to test the change:

Custom elements duplicating sometimes when using v-model
No duplication with the nextTick update


Invalid Response Data for a Valid Chocolatey Package

Are you experiencing an issue with...
shields.io
🐞 Description
I am facing issue with the Chocolatey Version badge for a particular package. That package is available on chocolatey but no info is being fetched.
🔗 Link to the badge
https://img.shields.io/chocolatey/v/tgpt
💡 Possible Solution
It could be a problem on Chocolatey's side

Hmm.
The reason this is failing is because we're expecting the query
curl "https://community.chocolatey.org/api/v2/Packages()?%24filter=Id+eq+%27tgpt%27+and+IsLatestVersion+eq+true" -H "Accept: application/json"

to return a single object in the results array, but we are getting back 2.
Any idea how both 1.6.7 and 1.6.8 have got "IsLatestVersion": true set on them?

I see. I had pushed 1.6.8 before 1.6.7 got approved and then they both got approved together and looks like it messed things up. I guess pushing an update would fix it

OK. I'm going to close this as I think this one is something to be resolved upstream, rather than something we want to try and implement behaviour to handle.


'Women's Collection' Section Styling

Title and Issue number
'Women's Collection' Section Styling
Close #3721
Output
Before

After

Checklist:

[x] I have mentioned the issue number in my Pull Request.
[x] I have commented my code, particularly in hard-to-understand areas
[ ] I have created a helpful and easy to understand README.md

Hi @MohitGupta121
Kindly review this pull request.


GPRPosterior.predict_f can return negative variances

Bug
Calling predict_f on a GPRPosterior object can sometimes return negative variance values.
To reproduce
Check out trieste commit 23b84936642af2f8b580cc09fbd79528b32c8dea and run test_active_learning.py::test_optimizer_learns_feasibility_set_of_thresholded_branin_function (with --runslow yes argument). The NaN or Inf values encountered in criterion error is a result of predict calls delegated to GPRPosterior.predict_f returning negative values.
Expected behavior
Variances values are all > 0.
System information

GPflow version: 2.4.0
GPflow installed from: pip install gpflow
TensorFlow version: 2.4.4
Python version  3.7.3
Operating system: ubuntu

Additional context
For now working around this by clipping all variances to a positive value.

Simpler working example
I've saved a GPR model that shows this behaviour. Gunzip gpr.pickle.gz and run the following:
import pickle
import gpflow
import tensorflow as tf

with open('gpr.pickle', 'rb') as f: model = pickle.load(f)
posterior = model.posterior(gpflow.posteriors.PrecomputeCacheType.VARIABLE)
grid = tf.constant([[i/2,j/2] for i in range(3) for j in range(3)], dtype=tf.float64)
print(model.predict_f(grid))
print(posterior.predict_f(grid))

Observe that while the means are accurate, the variances aren't always, and one of them is negative. Also note the following variance weirdness:
print(posterior.predict_f(tf.constant([[0,1]]*3, dtype=tf.float64)))
print(posterior.predict_f(tf.constant([[0,1]]*4, dtype=tf.float64)))
print(posterior.predict_f(tf.constant([[0,1]]*5, dtype=tf.float64)))

Related to #1058 (and maybe #1059)?