Support arguments capture for verify blocks

It seems that capture is not supported for verify blocks.
Suppose we have the following:
interface Foobar {
    fun foo(bar: String)
}

And then we mock/verify it in the test:
val mockFoobar = mock<Foobar>()

mockFoobar.foo("bar")

verify {
    val container = mutableListOf<String>()
    mockFoobar.foo(capture(container))

    assertTrue(container.isNotEmpty())
}

This assertion will fail, because nothing was actually captured and container is empty.
Am I missing some additional setup or mock arguments capture is indeed not yet supported in verify blocks?

Hi! Just like in MockK, using capture inside a verify block doesn’t produce any results. This is because capture is more like a callback: it only records arguments when the associated answer is actually invoked.
What’s your specific use case? Could simply using capture within an every block address your needs?

Thanks for looking at this!
The use-case is to just extract the argument for the more further assertion. Like speaking about the example above, it could be:
val value = container.first()
assertThat(value).isXXX()
...

Of course it is possible to use matching:
verify {
  mockFoobar.foo(bar = matching {
       assertThat(it).isXXX()
       true
  }
}

But coming with the Mockito Kotlin usage background, where captors can be used in the verify block:
val captor = argumentCaptor<String>()
verify(mockFoobar).foo(bar = captor.capture())

It was a bit confusing to see here that captor can be technically invoked in the verify block, but nothing is actually captured (maybe it is worth then to log some warning or make a mention in the docs?).

How does it work with the Mockito?? Does it push all the arguments that were recorded for matching call all at once??
fooBar.call(1)
fooBar.call(2)
verify {
    val list = mutableListOf<Int>()
    fooBar.call(capture(list))
    println(list) // prints [1, 2]
}

Yes. This would be the following snippet:
val foobar = mock<Foobar>()
foobar.foo("a")
foobar.foo("b")

val captor = argumentCaptor<String>()
verify(foobar, times(2)).foo(captor.capture())

println(captor.allValues) // prints [a, b]

At first glance, it seems possible to implement. I'll investigate further. If possible, I'll include it in version 2.7.0.


Create datalog query from JSON Schema or Typescript schema

Derive queries automatically from Typescript or JSON Schema.
Cells should contain json-typed data

A useful first step to unblock integration is just the ability to query open-ended JSON, i.e. what in typescript is:
type JSONValue =
| string
| number
| boolean
| null
| JSONValue[]
| { [key: string]: JSONValue };

Closing this because I believe we have implemented most of this using builder DSLs in https://github.com/commontoolsinc/labs/tree/main/typescript/packages/lookslike-high-level/src/sugar


Artman logging publishing python

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

Merging [#28][cc-pull] into [master][cc-base-branch] will increase coverage by 0.28%

@@             master        #28   diff @@
==========================================
  Files            26         27     +1
  Lines           793        817    +24
  Methods           0          0
  Messages          0          0
  Branches          0          0
==========================================
+ Hits            551        570    +19
- Misses          242        247     +5
  Partials          0          0

Powered by Codecov. Last updated by [c99ab1f...2a95450][cc-compare]
[cc-base-branch]: https://codecov.io/gh/googleapis/artman/branch/master?src=pr
[cc-compare]: https://codecov.io/gh/googleapis/artman/compare/c99ab1fa5b6fb28249c706f9091ec3950de3d29a...2a95450420e0da4de3ce665eaf3cc076cc936e9d
[cc-pull]: https://codecov.io/gh/googleapis/artman/pull/28?src=pr


How to I append Images in my User Message?

I'm aware of the following format in Python to give Images to models. But can't find any information its Go equivalent code.
messages = [
        {
            "role": "system",
            "content": "Do something",
        },
        {
            "role": "user",
            "content": [{
                "type": "image_url",
                "image_url": {
                    "url": f"data:image/jpeg;base64,{base64_image}"
                }
            }]
        },
    ]

Thanks for the help

For people asking it's:
image := openai.ImagePart(fmt.Sprintf("data:image/jpeg;base64,%s", base64Image))
messages := openai.F([]openai.ChatCompletionMessageParamUnion{
		openai.SystemMessage("This is a system Prompt"),
		openai.UserMessageParts(image),
	})

How can I analyze an image @Aryan-401 ?

func AnalyseImage(base64Image string) {
	client := openai.NewClient(
		option.WithAPIKey("My API Key"),
	)
	image := openai.ImagePart(fmt.Sprintf("data:image/jpeg;base64,%s", base64Image))
	messages := openai.F([]openai.ChatCompletionMessageParamUnion{
		openai.SystemMessage("This is a system Prompt"),
		openai.UserMessageParts(image),
		openai.UserMessage("Incase you want to add a text user message too"),
	})
	chatCompletion, err := client.Chat.Completions.New(context.TODO(), openai.ChatCompletionNewParams{
		Messages: messages,
		Model: openai.F(openai.ChatModelGPT4o),
	})
	if err != nil {
		panic(err.Error())
	}
	fmt.Println(chatCompletion.Choices[0].Message.Content)
}

Here is a generic function description that you could use for Image + Text in your prompt.


Cannot change the num value of the block at mobilephone platform

Expected Behavior
I want to change the num of block at mobilephone platform ,but faild
Actual Behavior
The num text of the block always display the default number.
Steps to Reproduce
There are some video you can look the probem through them
num.zip
1.
I find the num text value has already change inside  when I do change step ,but it not display outside.
By the road of solve this problem ,I find the Blockly.Field.prototype.updateTextNode_ funtion has ability to display the num text value,but it not work in source core. I let it work in both Blockly.Field.prototype.forceRerender  and Blockly.FieldTextInput.prototype.setValue function . the problem seem dispeared.
2
But  I find anhter problem By the way. when I click undo btn,the blocks disappeared but the dropdown leaved somtimes.More detail step seem the numPadNotDispear video. I find write   Blockly.DropDownDiv.hide() and Blockly.WidgetDiv.hide(true) in Blockly.FieldTextInput.prototype.dispose function could resolve this problem.but ,sadly,it still has problem leave. let`s,look the 3
numPadNotDispear_.zip
3
the leave bug.zip
last
Although i has solute 1 and 2.but I  suspect  is not so simple. Seems ,some problem still leave, it was related to  undo and redo.its more complex. I find anther problem relate to num text value 、redo and undo when project operate in real mobilephone. but its accidental appearancel.
Big bug width undo and redo, hope the scratch-blocks corporation could Solve them perfectly
Notice

look close my operate step
look clear the plat

Operating System and Browser
_e.g. win10 64bit ; chrome 66.0.3359.181

@thisandagain

this.updateTextNode_() 兄弟加上这个就解决了吗


RuntimeError when training image-wise network

I encountered this problem when running in mode "0" to train image-wise network after done training patch-wise one.
Traceback (most recent call last):
File "train.py", line 18, in
iw_model.train()
File "/home/xiaohui8/SR/ICIAR2018/src/models.py", line 300, in train
loss.backward()
File "/home/xiaohui8/miniconda3/envs/pytorch-CycleGAN-and-pix2pix/lib/python3.5/site-packages/torch/tensor.py", line 93, in backward
torch.autograd.backward(self, gradient, retain_graph, create_graph)
File "/home/xiaohui8/miniconda3/envs/pytorch-CycleGAN-and-pix2pix/lib/python3.5/site-packages/torch/autograd/init.py", line 90, in backward
allow_unreachable=True)  # allow_unreachable flag
RuntimeError: one of the variables needed for gradient computation has been modified by an inplace operation

I encountered this problem when running in mode "0" to train image-wise network after done training patch-wise one.
Traceback (most recent call last):
File "train.py", line 18, in
iw_model.train()
File "/home/xiaohui8/SR/ICIAR2018/src/models.py", line 300, in train
loss.backward()
File "/home/xiaohui8/miniconda3/envs/pytorch-CycleGAN-and-pix2pix/lib/python3.5/site-packages/torch/tensor.py", line 93, in backward
torch.autograd.backward(self, gradient, retain_graph, create_graph)
File "/home/xiaohui8/miniconda3/envs/pytorch-CycleGAN-and-pix2pix/lib/python3.5/site-packages/torch/autograd/init.py", line 90, in backward
allow_unreachable=True) # allow_unreachable flag
RuntimeError: one of the variables needed for gradient computation has been modified by an inplace operation

I change nn.Dropout(inplace=True) to nn.Dropout()


WIP : Incorporating ESM2

@tymor22 try this iteration.  The ESM2 wrapper is now an nn.Module so the number of trainable parameters shouldn't be under-reported now.


[feature idea] opening balanced channels

When you do bos open there is no way to specify that a channel should push some sats on the other side.
This should be a repeated --push_amount flag to correspond with the peer public key amount

How about --give
bos open  --amount  --give

Sounds good to me. It's more clear than the push amount semantic we have on lnd.

Should be available in 5.47.0

Tested today. Works like a charm! 🎉
Thank you for the effort!


Always terminate Monitor thread

Added try-finally block to Application.annotate_spectra to ensure Monitor thread is always joined, even on some unknown exception. Although we catch all sorts of exceptions, there might always be a new one - in such case, it would pop up on top without join being called, resulting in "infinite" tool runs.
Close #86.

Seems fine - just also please add the info to the changelog in the PR.
I assume this is quite tricky to test, but would you have some idea how one could go about this?

I suppose we would have to change the top-level code a little bit. If the Monitor and Annotator were passed to Application.annotate_spectra, we could mock them in a test and (maybe?) observe if mocked Monitor is terminated when mocked Annotator raises an exception. This would, however, influence how the top-level is called even in Galaxy wrapper.

This means the constructor would change and we would inject the Monitor? I think this is fair, if it the constructor it can even have a default Monitor created there, that is fine if the call in the Galaxy wrapper has to change if that means we can actually test it.

This means the constructor would change and we would inject the Monitor? I think this is fair, if it the constructor it can even have a default Monitor created there, that is fine if the call in the Galaxy wrapper has to change if that means we can actually test it.

I tried to implement this in 2d2d161, let me know what you think about it. As you suggested, there are default objects created if they are not passed, so Galaxy wrapper does not need to be changed. I created "fake" Monitor and Annotator classes which can be used to mimic the behaviour of annotation process while allowing us to control if an exception is raised and whether the Monitor thread was terminated.

I think the default constructor calls (without conversions) can be moved to the default parameter values and it should be considered whether an annotator without any conversions is a valid object or not - if not, then they can also be instantiated before the annotate_spectra function and maybe have to be passed explicitly.

Good points, thanks! Actually converters can be empty (and in the case of Monitor it actually makes sense), I just changed their default value from None to empty dict. I moved constructor calls (without conversions) to the default parameter values of annotate_spectra as suggested.


url escape the path for windows

@zanderz can you please check this out on Windows when you get a chance?

Fine to wait until next admin build


Entry-Key Format

Sorry that I directly have 2 feature requests.
Since there is already the nice Abbreviation method, would it be possible to do something similar with a Key-generator?
My favourite key name is AllLastNamesOfAuthorsCamelCased:YYYY.
I am not 100& sure how one could set this (maybe different styles or even keeping the default?) but it would be a neat idea if there is a way to do so.

This is a bit tricky because I currently just resort to a few regexes for extracting authors, year, and title.
In principle, I ought to be doing this with a BibTeX parser but I didn't want to take on more dependencies than necessary - i.e., I just wanted to return a string that could then potentially be parsed by some Julia implementation of a BibTeX parser later (I use my own unregistered one - https://github.com/thchr/SimpleBibTeX.jl - but I know there many other, probably much more mature ones).
Without a proper BibTeX parser, extending this is probably going to be fragile and quite constrained. I.e., for now, I'll probably punt on this.

Right, it is a bit tricky and for best of cases we have a Bib(La)TeX parser for that.
Your Parser looks nice and simple and seems to also allow for BibLaTeX directly. If you do not mind I might try to find time to document it a bit (I grew kind of into a documentation nerd).


fix (application): do no panic on nil pointer

Description
Check the pointer before using it. First reported in #549 but has been unreproducible. Added a debug message if it can be reproduced other places to get a better understanding.
If this panic occurs again, debug instructions can be found: debugging
Fixes: #549
Type of change

Bug fix (non-breaking change which fixes an issue)

QA steps
I do not recommend the plan from the bug, it is huge and requires many modifications to run. You're welcome to try it if you wish
terraform {
  required_providers {
    juju = {
      version = ">0.13.0"
      source  = "juju/juju"
    }
  }
}

provider "juju" {
}

resource "juju_model" "one" {
  name = "testing"
}

resource "juju_application" "test" {
   model = juju_model.one.name
   charm {
     name = "juju-qa-test"
   }
}

resource "juju_application" "githubrunner" {
  name  = "github-runner"
  model = juju_model.one.name

  charm {
    name     = "github-runner"
    channel  = "latest/stable"
    base =<EMAIL_ADDRESS>  }
  units = 1

  storage_directives = {
    runner = "2G"
  }
}

A set of tests are timing out, but not with failures.


Add functions to get CIK from ticker or company name

Adds a function to get a CIK from a ticker, and a function to get a list of CIKs and list of similar company names (if several company names match the string) for a given string

I think this would be a great function to have! It might be useful to see if there would be a way to avoid using BeautifulSoup and get the CIK's directly from a GET request. Not sure if this is possible. Will look into possibilities.

Yeah, I will also have look into. Basically, SEC site doesn't provide any API and so beautifulSoup is the only way unless we will have to rely on third-party services.

I think it might be best to create this in a separate file (like cik.py). I used the code you wrote a while back and changed a few things. If you like any of it, feel free to use it for your PR.
import requests
from bs4 import BeautifulSoup

def get_ciks_for_company_name(self, company_name):
    base = 'https://www.sec.gov/cgi-bin/cik_lookup'
    params = {'company': company_name}
    r = requests.post(base, params=params)
    data = r.text
    soup = BeautifulSoup(data, features='html.parser')
    cik_list = list(a.get_text() for a in soup.select('pre > a') if 'CIK=' in a['href'])
    company_list = list(str(a.next_sibling).strip()
                        for a in soup.select('pre > a') if 'CIK=' in a['href'])
    return cik_list, company_list

def get_cik_for_ticker(self, ticker):
    base = 'http://www.sec.gov/cgi-bin/browse-edgar'
    params = {'action': 'getcompany', 'CIK': ticker}
    r = requests.get(base, params=params)
    data = r.text
    soup = BeautifulSoup(data, features='html.parser')
    cik = str(soup.find('input', {'name': 'CIK'})['value'])
    return cik

This was taken care of in #83 with the CIKValidator class (used by the CIK class).


switch gputbefore and gputafter

Hi,
I noticed today that YankyGPutBefore and YankyGPutAfter are mixed up. Probably not so many people are actually using this feature :)
On a side note: the difference between YankyPutBefore and YankyGPutBefore (and likewise for ...After) seems relevant only for linewise yanks, as is vanilla vim behaviour. What do you think about extending this to characterwise yanks? In other words, I would suggest adding a configuration option, so YankyPutAfter with a characterwise selection puts the cursor at the beginning of the pasted text. It should probably be an opt-in configuration option, because it overrides vanilla vim behaviour.

Actually, I changed my mind on this, it's probably overkill to implement it in this plugin, one can simply create mapping to <Plug>YankyPutBefore`[
I think I will use that mapping for a while and see if it's actually useful.

Thanks for your feedback!


[RESOLVED] Unavailable by ICMP ping

Problem started at 19:20:14 on 2022.08.07
Problem name: Unavailable by ICMP ping
Host: MF-FG
Severity: High
Operational data: Down (0)
Original problem ID: 2975
Event details in Zabbix: http://<IP_ADDRESS>/tr_events.php?triggerid=23130&eventid=2975

Problem has been resolved in 12m 0s at 19:32:14 on 2022.08.07
Problem name: Unavailable by ICMP ping
Host: MF-FG
Severity: High
Original problem ID: 2975


Create Email Signatures

Following this tutorial: http://matt.coneybeare.me/how-to-make-an-html-signature-in-apple-mail-for-sierra-os-x-10-dot-12/

Created an initial design and am working on instructions to add it to personal computers. But the html seems to break in threaded emails.

People should be discouraged from using signatures in more than the original message, anyway, as they tend to clutter up the view and interfere with a proper reading. This is especially true for large signatures (not saying that's what your design is). Oh, and email apps tend to break things like this, because they are much more strict and limited with the html.


Protocol notes don't actually deploy multiple versions

#5 changes the protocol notes so that there's a version field included in the URL paths. This way, in the future, there can be a separately-rendered set of docs for each tag or branch.
However, the current deploy pipeline uses the firebase cli, which only does atomic deployments, so there's no way to add a set of files to the existing site, and this means that only the most recently deployed version will actually appear.  At the moment this isn't a big deal because there's just one version anyways.

A setup that would be really useful for development would be:

on pushes to branch branch, deploy notes to protocol.penumbra.zone/branch/..., removing any previous contents of /branch/...;
on pushes of tag tag, deploy notes to protocol.penumbra.zone/tag/..., removing any previous contents of /tag/...;
when a branch branch is deleted, remove everything under protocol.penumbra.zone/branch/...;

This way, it would be possible to preview notes or API documentation of in-progress work.
I think this should be possible with Github Actions, but it might require changes to the hosting in order to be able to make partial updates and deletions, since the firebase cli only performs atomic updates.  S3+Cloudfront or something would probably work just as well.

We haven't done this in the last year and a half and things have worked out, so we can probably skip it.


Write API Documentation

We should document our API for the impermanent loss charts and make that documentation public. We already have OpenAPI/Swagger set up so we just need to write the docs.

Swagger explorer up at https://app.sommelier.finance/api/explorer/

Swagger explorer up at https://app.sommelier.finance/api/explorer/


GAnarchy - "federated" (not sure if right term) git-based projects

Please take a look at these:

https://ganarchy.github.io/
https://ganarchy.autistic.space/
https://cybre.space/tags/gan385e734a52e13949a7a5c71827f6de920dbfea43

please explain how this relates to forge federation
what does it do?
how does it work?

it doesn't federate code, it only federates issues... well not yet but anyway that's part of the goal.
other than that it's basically trying to remove the upstream. because upstreams are bad. instead, everything should be decentralized and integrated. it's meant to integrate with the fediverse using web+ganarchy links, which should be overriden on a per-(mastodon-)instance basis to point to admin-chosen ganarchy instances. this seems more important to the whole federated thing than actual federation, as it then becomes about user choice and curation.
the idea of static pages makes it easy for anyone to run it - you can set it up on github.io or on your own server or whatnot, as there's no server-side code.
by checking ganarchy instances with your project on them, you don't need PRs. also ppl don't need to know how to code to use this, they just need to know how to merge things. this gives ppl the power of curation. the power of curating features. if a lot of ppl like a feature then a lot of ppl can merge that feature and then a large amount of the repos will contain that feature, making that feature more likely to spread further.
it's not feature-complete, but it's definitely usable in production! (i.e. production-ready) while it doesn't (yet) have a federation protocol, and ActivityPub support turns out to be... difficult, to say the least, it's still quite nice IMO.
every project has a project commit. you can take that project commit's and use it on the fediverse as a hashtag, as in https://cybre.space/tags/gan385e734a52e13949a7a5c71827f6de920dbfea43 - this is basically a federated issue tracker with no central authority, but with great moderation/curation potential. I just couldn't figure out a way to pull these in because AP doesn't have an endpoint for it.

I call it "federated" because of the whole curation thing. I'd like it to be proper-federated at some point (yet still have the curation thing ofc), but I'm not too bothered by it.

it definitely federates now: https://github.com/ganarchy/ganarchy.github.io/blob/master/private/targets.txt
and you can even fork whole instances: https://github.com/ganarchy/ganarchy.github.io


Polkadot v0.9.19

set substrate branch to polkadot-v0.9.19

Apply WeightToFeePolynomials to pallet_transaction_payment as it is done in substrate node/runtime/src/lib,rs
change sub-comm ands for benchmark

set integritee pallets branch to polkadot-v0.9.19

The node can start the sync process with the live network.
The weight fees in the pallet_transaction-payment has changed. There is no more TransactionByteFee but LengthFee. I add the WeightToFeePolynomial mechanics used in substrate. @brenzi, @clangenb : Please check if it is what we want.

@echevrier after my review I thought, we should have a note in the SignedExtra about the api-client issue, e.g.:
// Todo: Integrate upstream-changes after https://github.com/scs/substrate-api-client/issues/211 has been solved.

@echevrier after my review I thought, we should have a note in the SignedExtra about the api-client issue, e.g.:
// Todo: Integrate upstream-changes after scs/substrate-api-client#211 has been solved.

Or we create an issue ;)

@echevrier after my review I thought, we should have a note in the SignedExtra about the api-client issue, e.g.:
// Todo: Integrate upstream-changes after scs/substrate-api-client#211 has been solved.

Or we create an issue ;)

Haha, you are right, but I'd vote for still having a remark in the code. :)


Bumps megaparsec bounds

I've relaxed the bounds on megaparsec so that it will compile with the latest Stackage nightly snapshot that includes megaparsec-6.5.0.

Thanks! I also published a new revision with the relaxed bounds


Update to Jakarta packages

Working with newer frameworks it is necessary to move some javax packages to their successors in the jakarta tree.
jscep uses javax. Are there any plans to migrate?

Can you raise a PR?
On Thu, 14 Sept 2023 at 09:06, Andreas Kuehne @.***>
wrote:

Working with newer frameworks it is necessary to move some javax packages
to their successors in the jakarta tree.
jscep uses javax. Are there any plans to migrate?
—
Reply to this email directly, view it on GitHub
https://github.com/jscep/jscep/issues/292, or unsubscribe
https://github.com/notifications/unsubscribe-auth/AAE5UO3NSJWT3I2DXFPGXHTX2K3IXANCNFSM6AAAAAA4XVUAGA
.
You are receiving this because you are subscribed to this thread.Message
ID: @.***>

Yes, will do.

Thanks
On Thu, 14 Sept 2023 at 09:45, Andreas Kuehne @.***>
wrote:

Yes, will do.
—
Reply to this email directly, view it on GitHub
https://github.com/jscep/jscep/issues/292#issuecomment-1719023330, or
unsubscribe
https://github.com/notifications/unsubscribe-auth/AAE5UO3URASVFFF4HSKKLH3X2K72XANCNFSM6AAAAAA4XVUAGA
.
You are receiving this because you commented.Message ID:
@.***>

See fix in PR 301

Any update on this? I see the PR is open but there hasn't been any activity recently

Any plans for a release with this? We use jscep and are facing increasing pressure to replace javax.* with jakarta.*.


very dificult to engage openpilot Honda Passport

Describe the bug
on every drive it is very difficult to engage openpillot. It takes multiple tries to get it to engage.
How to reproduce or log data
Just try to engage openpilot. you will be on a straight open road and no one around and it takes me a numerous tries to get it to engage.
Expected behavior
I expect that when i push the set button it will engage every time just as if i was using the stock Honda cruise control.
**Device/Version information **
Device: comma two
Dongle ID: d5450ec7974784ca
Route: d5450ec7974784ca|2020-10-20--17-06-17
Timestamp: 17:12:01 / 17:12:46 / 17:14:27 / 17:14:52 / 17:15:48 / 17:16:47 / 17:16:50 / 17:16:58 / 17:17:10 / 17:19:10 / 17:20:11 / 17:20:55 / 17:20:59 / 17:22:14
Version: openpilot v0.7.9-release
Car make/model: Honda Passport 2019

Additional context
I know i am new, only have it 7 days, But i have used a cruise control my whole life. it is very difficult to get it to engage and stay engaged. sometimes it will come on and stay engaged for 5 / 10 seconds then beeboop off. over and over. takes like 7 tries every time.

Looks like the problem is related to https://github.com/commaai/openpilot/issues/2376, so I'm going to close this issue.


Add labels to piechart

Firstly thanks for this project! I relate to the reasons for starting it...
On to the labels issue... I tried to use the java plugin code to render labels on a piechart using this bar chart example:
https://github.com/pepstock-org/Charba-Showcase/blob/master/src/org/pepstock/charba/showcase/client/samples/VerticalBarPluginLabelView.java
But for pie chart, x and y is always the same value, and I can't find a way to figure out how the arcs are going to place it differently with that plugin.
This seems to be a common question for chart.js and there is an external plugin for this:
https://github.com/emn178/Chart.PieceLabel.js/
Demo here will illustrate:
https://emn178.github.io/Chart.PieceLabel.js/samples/demo/
My jsinterop knowledge is rather limited, and so maybe you can give an example of how one would integrate an external javascript plugin?
Or maybe you have a simple java way you can think of for doing this?

@ruzkant I've commited in ShowCase project (in my branch "stock") an example how to use Piecelabel plugin.
What done?

I got the Chart.PieceLabel.js and store in my project into folder resource/js.

Charba is expecting that the options of a plugin are located in a object called "plugins". The PieceLabel plugin no! Therefore I've change the 168 of the plugin from

 var pieceLabel =  chartInstance.options.pieceLabel;
to
 var pieceLabel =  chartInstance.options.plugins.piecelabel;
Pay attention that this plugin is not following a guideline about plugin to use. Chart.js recommends that the plugin ID can't contain uppercase letters.

I've created a Client Bundle to get the JS plugin

I've created an Injector to load the JS plugin into page.

I've created a GWT Javascript object,with some properties to configure PieceLabel

I've created my view with a PieChart with the following statement to activate the plugin:

PieceLabelOptions option = new PieceLabelOptions();
option.setRender("percentage");
option.setPrecision(2);
option.setFontColor("white");
option.setFontSize(16);

try {
	chart.getOptions().getPlugins().setOptions(PieceLabelOptions.ID, option.getObject());
} catch (InvalidPluginIdException e) {
	new Toast("Invalid PlugiID!", Level.ERROR, e.getMessage()).show();
}

This is the result:

The new code will be deployed as part of Charba showcase soon!

@stockiNail Thanks so much!!! This will be very useful in reusing Chart.js community resources.
Here is my working sample:

Much appreciated!
I am not sure if I should close the item or if you want to do some more things before doing that, so leaving it open, but I consider it closed for my case.

@ruzkant  Thank you too!
This issue is remembering me that I have to implement a way to load and use whatever JS plugin of Chart.js by Charba. I'm gonna close the issue when I'll commit this feature.
New feature should implement:

Ignore uppercase of Plugin ID (even if it is a best practice of Chart.js)
Add the plugin configuration in whatever configuration object (not only into "plugins") like options, axes, datasets and so on.
Provide a common way to import the JS by ClientBundle or by HTTP (if you don't want to maintain it in the project)
Anything else to enable it....

Sounds good. I am just happy to have something in the meantime :)
I am trying to get rid of google charts. I use the GWT Material Design project for the UI widgets and they are shifting to amcharts, which is free only with a link to their site on every chart. My needs are relatively simple for now, and this is working well so far. The responsive option works reasonable well so far as well.

I notice you posted an issue on gwt material, so you know the project. I gave you a mention in the gwt material gitter channel: https://gitter.im/GwtMaterialDesign/gwt-material

I'm using GWT Material as well and Charba is working well.
I have seen the integration with amcharts but I don't like to put any link on my application.
That's why I developed Charba! ;)
Of course I'm aware that some features are still missing but I'm gonna develop them asap!

@ruzkant I've committed in "stock" branch some improvements to use external java script plugins into Charba.
The improvements are:

You don't need Injector class specific for every plugin. The Injector class of Charba can add a script (by ClientBundle and TextResource)
to load the script by HTTP from GWT is not a good idea because is async. If you don't want to add the script of plugin into the project, you should add it into  HTML page by

Thanks will have a look...

@ruzkant New plugins injection/integration has been deployed into new version 1.4.

Thanks @stockiNail will migrate and see how it goes...

@stockiNail I have upgraded to 1.4 and my charts are still working. Appreciate the quick response and detailed instructions. Thanks!

@ruzkant FYI we decided to include out of the box labels CHART.JS plugin (former pieceLables) in Charba (next version, 2.1), with all configuration and callback properties. Hopefully can be useful.

@stockiNail Thanks. My project is on hold for a bit unfortunately, but when I get a chance I'd like to upgrade to not let it become stale...


Catalyst integration

Closes #112
PR PR in dvc.org: iterative/dvc.org#2748

Thanks for the contribution @pacifikus !
Just one minor comment regarding loader_key prefix

Forgot to comment that tests should be updated to match the new behavior

Codecov Report

Merging #139 (a23e42e) into master (3286543) will decrease coverage by 0.18%.
The diff coverage is 100.00%.

:exclamation: Current head a23e42e differs from pull request most recent head 59c88fa. Consider uploading reports for the commit 59c88fa to get more accurate results

@@            Coverage Diff             @@
##           master     #139      +/-   ##
==========================================
- Coverage   90.43%   90.25%   -0.19%
==========================================
  Files          13       13
  Lines         324      318       -6
==========================================
- Hits          293      287       -6
  Misses         31       31

Impacted Files
Coverage Δ

dvclive/catalyst.py
100.00% <100.00%> (ø)

dvclive/dvc.py
60.97% <0.00%> (-0.93%)
:arrow_down:

dvclive/__init__.py

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 3286543...59c88fa. Read the comment docs.


publish to crates.io

Although cargo can use the git protocol, it may be more convenient if it can be installed on crates.io.
At the same time, llrt has not been published to crates.io. In order to prevent others from registering it first, maybe an empty package can be used as a placeholder?

That's the plan! Publish will happen on next release (this week)

Considering that llrt compilation is very complicated, it would be more convenient if it could support cargo-binstall
https://github.com/cargo-bins/cargo-binstall

@richarddavison how are ya'll going on publishing to crates.io?


cli panics with out of bounds error

Describe the Bug
Trying to just compile my project to the web, I stumbled upon this panic message.
I think this may happen because of version mismatch between the cli app and the dependency.
After running cargo update everything works fine.
Steps to Reproduce
I can not really show the code. I may try to provide a simplified example if needed
OS: Windows
Rust version: rustc 1.55.0 (c8dfcfe04 2021-09-06)
wasm-bindgen-cli version: 0.2.77
wasm-bindgen dependency version: 0.2.76
Running command: wasm-bindgen --target=web --no-typescript --out-dir tmp target/wasm32-unknown-unknown/release/theproject.wasm
Expected Behavior
wasm-bindgen does its magic without any errors
Actual Behavior
wasm-bindgen panics with following message:
thread 'main' panicked at 'index out of bounds: the len is 0 but the index is 0', C:\Users\myusername\.cargo\registry\src\github.com-1ecc6299db9ec823\wasm-bindgen-cli-support-0.2.77\src\descriptor.rs:205:15

Additional Context
As I said, looks like problems with different versions. I remember wasm-bindgen would just panic instantly with message saying that versions should match. I guess it is not the case anymore? So this took me a while to even think about running cargo update

Yes recently the version-match was removed because it was hoped to get caught by other things and/or not change much. I believe that's the cause of this.

Uh oh!
Yeah I worked on this in #2546 with the hope of removing this requirement.
It looks like something is going wrong.. Alex if you already know the issue definitely let me know and I can get it fixed it.
Otherwise I can take a look into this later tonight and figure out what's going wrong!
IIRC this should have actually worked in theory.. so it's probably a minor oversight or something.. hopefully..!

Oh I'm not sure what actually caused this, I'd assume that something about the schema probably changed and the version number of the schema was forgotten to get bumped, but I would have to track things down to be sure.

Ahh got it.
Yeah, just checked and this test is failing:
https://github.com/rustwasm/wasm-bindgen/blob/723674820fa78115cdafabadfb7a4b52fbd4285d/crates/shared/src/schema_hash_approval.rs#L13-L16
Seems like we just need to start running it in CI.

I'm on it one sec.

@kuviman (and anyone else that comes here) sorry about this.
In short.. we currently need to manually change the schema version whenever one of wasm-bindgen's internal data structures changes.
This is used to ensure that you get a nice error when trying to use two versions of wasm-bindgen with different schemas.
There's a test that fails when we forget to change this schema version.
But this test wasn't running in CI so no one noticed / remembered to change the schema version.
#2680 runs this test in CI so we shouldn't forget again!
In the future.. we could automatic this entirely using a proc macro that hashes the tokens and generated the schema version variable or something.. but since the schema doesn't change often we probably won't need to go that route.
Sorry!