text:
[UI] Cannot update source from a failed app

Is there an existing issue for this?

[X] I have searched the existing issues

Current Behavior
Attempting to update a source from a failed app is not possible
Expected Behavior
It should be possible to source a failed up and have it into a running state
Steps To Reproduce

Install latest  epinio-dev commit (Currently: 23d440198092d8ac60089a7d176e041f2b9b68dd (HEAD -> epinio-dev, origin/epinio-dev) )
Deploy a faulty app (ie folder with images)
Try to update to a valid app (ie: source type = file with sample-app.tar.gz)

Observe error:

Environment
- OS: Linux
- Architecture:amd64
- Epinio Version: v1.8.0-20-g912b8964
- Cluster:
  - Provider: k3d
  - Options:1 node
  - Kubernetes Version: v1.25.4+k3s1

Logs
No response
Anything else?
No response

@andreas-kupries Is the a UI bug or something your way?

:eye: now ...

I tried to reproduce in CLI like this and here seems to work:

Deploy latest epinio
Deploy latest ui with

 kubectl set image -n epinio deployment/epinio-ui epinio-ui=ghcr.io/epinio/epinio-ui:latest-next

Push faulty app (ie with 1 single text file)

epinio push -n testapp-faulty -p ~/faulty-dir

Error log in server pod:
2023/05/17 09:33:35 EpinioServer: "msg"="ERROR" "error"="Failed to stage" "requestId"="4e620e0a-80c4-45e1-bd86-ddf592dcf64f" "origin"="/api/v1/namespaces/workspace/staging/7915a1de309d5acd/complete" "error"="Failed to stage"                                          │
│ 2023/05/17 09:33:35 EpinioServer: "msg"="Error" "error"="Failed to stage"

Now re-deploy again with correct folder:
epinio push -n testapp-faulty -p assets/sample-app

Deployment succeeds:
✔  App is online.
Name: testapp-faulty
Namespace: workspace
Builder Image:
Routes:
1: https://testapp-faulty.172.19.0.3.omg.howdoi.website

Yes. I saw the same thing just now, using the commands
 1012  ep push -n fox -p docs |& tee LOG-FAIL
 1013  ep push -n fox -p assets/sample-app |& tee LOG-OK

The logs
LOG-1-FAIL.orig.txt
LOG-1-FAIL.txt
LOG-2-OK.orig.txt
LOG-2-OK.txt
are for the failed initial push, and the following good one. The .orig files contain the unmodified logs.
The other two have the differing action hashes in the log lines replaced by the fixed string HASH to make diffing a bit nicer.
I believe that it would be a good idea to see the payloads of the requests made by the UI for both initial bogus app and the following nominally good app.
@mmartin24
One thing I note in the steps to repo above is that the two request use different app source types ?

Deploy a faulty app (ie folder with images)
Try to update to a valid app (ie: source type = file with sample-app.tar.gz)

I.e. a directory first, and then a pre-made tarball instead, right ?
This kind of different source types the CLI cannot do, and maybe that is where the UI goes off the rails ?
What happens if both attempts are done for directories ?
Or both attempts use tarballs ?

I just retried the same again in the UI. Pasting there the payload on the sourced app:
{"appchart":"standard","instances":1,"configurations":[],"settings":{},"environment":{"EPINIO_APP_DATA":"{\"source\":{\"type\":\"folder\",\"builderImage\":\"paketobuildpacks/builder:full\",\"folder\":{\"fileName\":\"sample-app\"}}}"},"routes":["testapp-faulty-ui.172.19.0.3.omg.howdoi.website"]}

@andreas-kupries, pls see following logs from CLI having faulty and ok directories:
faulty-dir.log
faulty-dir-ok.log
PS: I can't try with tarballs from cli

For the payloads in the UI I used these 2 tarballs:

faulty tarball: phayes-geoPHP-1.2-20-g6855624.tar.gz
ok tarball: sample-app.tar.gz

Payload on the faulty one (1st push):
{"name":"faulty-tarball-ui","configuration":{"appchart":"standard","settings":{},"instances":1,"configurations":[],"environment":{"EPINIO_APP_DATA":"{\"source\":{\"type\":\"archive\",\"builderImage\":\"paketobuildpacks/builder:full\",\"archive\":{\"fileName\":\"phayes-geoPHP-1.2-20-g6855624.tar.gz\"}}}"},"routes":null}}

Leading to this error:
{"errors":[{"status":500,"title":"Failed to stage","details":"stage-id = 039631da8a73d306"}]}

Payload on the correct one (sourced):
{"appchart":"standard","instances":1,"configurations":[],"settings":{},"environment":{"EPINIO_APP_DATA":"{\"source\":{\"type\":\"archive\",\"builderImage\":\"paketobuildpacks/builder:full\",\"archive\":{\"fileName\":\"sample-app.tar.gz\"}}}"},"routes":["faulty-tarball-ui.172.19.0.3.omg.howdoi.website"]}

Pls let me know if provided info is ok or is there anything that needs revisited on my side.

@andreas-kupries, pls see following logs from CLI having faulty and ok directories:
faulty-dir.log faulty-dir-ok.log PS: I can't try with tarballs from cli

Yes, CLI does not take tarballs. My questions were targeted at the UI only.
Based on these logs pushing a bad directory followed by a good directory is OK with the UI, i.e. app deploys on second push, right ?
And based on the second example with the payloads, pushing a faulty tarball followed by a good tarball, the UI is also ok, right ? (Because you did not mention an error coming after the second).
And assuming that the answers to the above were yes, then per the description, it is the combination of bad directory followed by a good tarball which breaks, right ?
Notes

The first payload is an AppCreateRequest, with the origin information just in the EPINIO_APP_DATA.
The second payload is an AppUpdateRequest. origin information again in the EV.
Given that the issues in the push were later on the payload of the upload, stage and deploy requests are of interest as well. The mentioned error, for example is the result of the stage request, not of the app create/update.
https://docs.epinio.io/explanations/detailed-push-process#the-process-visualized

Sorry for not specifying directly. The error is the same as described initially, the UI always fails the second time independently if it comes from the same source type or different. The CLI on the contrary succeeds. So no, it does not seem to be the combination of bad directory and good tarball which produces the error.
Will bring the logs in a moment

If this does turn out to be more UI related it might be worth pausing until both https://github.com/rancher/dashboard/pull/8797 and https://github.com/rancher/dashboard/pull/8672 are merged. The first in particular reworks a lot.

I verified that the update request sends always the same payload, either for faulty applications or not:
Good app
Request:
https://192.168.1.6:8005/pp/v1/direct/r/ZThhPrryoUeUuimbk4Gb-G3-I9A/api/v1/namespaces/francesco/applications/folder-10

Response:
{"appchart":"standard","instances":1,"configurations":[],"settings":{},"environment":{},"routes":["folder-10.46.101.17.26.nip.io"]}

Faulty app
Request:
https://192.168.1.6:8005/pp/v1/direct/r/ZThhPrryoUeUuimbk4Gb-G3-I9A/api/v1/namespaces/francesco/applications/folder-11

Response:
{"appchart":"standard","instances":1,"configurations":[],"settings":{},"environment":{},"routes":["folder-11.46.101.17.26.nip.io"]}

Note that the app source data is no more contained in the EPINIO_APP_VAR.
Given that, what is the difference between CLI and UI, in terms of api calls ?

The requests show only the API endpoint used. What was the body of these requests ?

The requests show only the API endpoint used. What was the body of these requests ?

Sorry, I wrote 'Response' instead of 'Payload' in mi comment , now it's fixed.

@torchiaf I'm not sure where we got to with this, is there a PR or is it ready to test?

Thanks @torchiaf for the comment.
I checked it and I could reproduce what you pointed out in cli.
I asked in slack if we could move the item to BE, but the UI flow seemed unclear.
@enrichman the flow in the UI was basically this:

Deploy a faulty app
Use the new update source functionality to point at a valid source (ie: https://github.com/epinio/epinio/tree/main/assets/sample-app)

An error appears while doing this
I am not sure if this clarifies the question about the flow followed

I can confirm that the steps to reproduce the bug in the UI are those mentioned by @mmartin24 .

Does this happen when changing the instance count when just using an app created by the CLI, or does the app need to come from the UI (and also updated by UI)?

authors: andreas-kupries mmartin24 richard-cox torchiaf

repo: epinio/ui


text:
Ajv is not validating $ref in schema. It is not checking existence.

I am trying validate petstore.json using ajv.
Schema: http://swagger.io/v2/schema.json
Json Data : https://github.com/OAI/OpenAPI-Specification/blob/master/examples/v2.0/json/petstore.json
Ajv is somehow not validating '$ref' in json. I am using the following code to validate the data.
var Ajv = require('ajv');
var ajv = new Ajv({schemaId: 'id',sourceCode: true,$data:true,missingRefs:true});
ajv.addMetaSchema(require('ajv/lib/refs/json-schema-draft-04.json'));
var schema = require('./schemav2.json');
var mydata = require("./petstore.json");
var valid = ajv.validate(schema, mydata);
if (!valid) console.log(ajv.errors);
console.log(typeof valid);

If I change 'petstore.json' like following (marked in bold). I am changing schema reference for default response. I am pointing it to $ref": "#/definitions/Error22, now #/definitions/Error22 does not exist in the document. I want ti throw error if reference in not valid but ajv validation passing it.
I need help to validate schema where it will check the existence of '$ref'.
"/pets": {
"get": {
"summary": "List all pets",
"operationId": "listPets",
"tags": [
"pets"
],
"parameters": [
{
"name": "limit",
"in": "query",
"description": "How many items to return at one time (max 100)",
"required": false,
"type": "integer",
"format": "int32"
}
],
"responses": {
"200": {
"description": "An paged array of pets",
"headers": {
"x-next": {
"type": "string",
"description": "A link to the next page of responses"
}
},
"schema": {
"$ref": "#/definitions/Pets"
}
},
"default": {
"description": "unexpected error",
"schema": {
"$ref": "#/definitions/Error22"
}
}
}
}

swagger schema (the one you are validating against) defines "$ref" as {"type": "string"}, so it is valid. Ajv will throw exception if you try to compile the schema with the missing "$ref". So to validate "refs" in swagger config file (petstore.json) you need to compile all schemas contained in that file.

source: gharchive/issue

authors: epoberezkin sauravpandit

repo: epoberezkin/ajv

license: MIT

license_type: permissive

license_source: github-api


text:
Fix/translate path to alias in export

What does this pull request change?
in export, translate path to alias, for example "dmss://system/SIMOS/Package" is translated to "CORE:Package" if the the document's meta has an alias that matches adress = "system/SIMOS" and protocol = "dmss"
Why is this pull request needed?
part of export functionality
Issues related to this change:
closes #310

todo return object instead of pass by ref

@soofstad  ready for a new review - tried to simplify the logic in replace_absolute_references_in_entity_with_alias() and updated replace_reference_with_alias_if_possible() to find the closest alias match instead of the first.

source: gharchive/pull-request

repo: equinor/data-modelling-storage-service


text:
Identify components

Create list of components based on existing canvas components in Power Apps studio

Button

Primary Contained
Primary Outlined

repo: equinor/design-system


text:
feat: Integrate metadata editor in the Symbol Editor

AB#125196
fix #567

:tada: This PR is included in version 1.1.0 :tada:
The release is available on GitHub release
Your semantic-release bot :package::rocket:

repo: equinor/engineering-symbols


text:
Read parameters txt nested parameters dict tests

Test coverage hunting.

Which issue/problem is targeted? Can you provide a description?

Which issue/problem is targeted? Can you provide a description?

Just test coverage hunting.

authors: janbjorge jcrivenaes

repo: equinor/fmu-dataio


text:
Added recalculation of CheckList for PunchListItem Creation, Deletion…

… and certain Updates

I'm not sure if this enpoint in webapi returns right away, and if it returns at all.  Either way, we should not await it/require it to work.

I'm not sure if this enpoint in webapi returns right away, and if it returns at all. Either way, we should not await it/require it to work.

@TordJoranger @janid1967  I think the question in regards to the recalculation being awaited on, is whether or not we should do a rollback if we fail to recalculate, as I do agree that we don't really need to wait for the recalculation to be done for us to finish
If we don't care about the recalculation endpoint failing for whatever reason or not, we can just fire and forget, otherwise we probably should keep the await

I'm not sure if this enpoint in webapi returns right away, and if it returns at all. Either way, we should not await it/require it to work.

@TordJoranger @janid1967 I think the question in regards to the recalculation being awaited on, is whether or not we should do a rollback if we fail to recalculate, as I do agree that we don't really need to wait for the recalculation to be done for us to finish If we don't care about the recalculation endpoint failing for whatever reason or not, we can just fire and forget, otherwise we probably should keep the await

Ok, lets discuss it later, but we don't need to hold the pr over it.

authors: TordJoranger agustarnason

repo: equinor/procosys-completion-api


text:
🐛 Login dialog does not appear for a server if cancelled first

:bug: Describe the bug
Login dialog does not appear if select same server after a cancel operation on the login dialog
To Reproduce
Steps to reproduce the behavior:

The step by step screenshot below explain the issue.
Expected behavior
When select a server from the dropdown list, if not already connected, the login dialog box must be displayed.
Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

OS: Windows 10
Browser chrome
Version : Version 88.0.4324.150 (Official Build) (64-bit)

Smartphone (please complete the following information):
N/A
Additional context
Add any other context about the problem here.

Thanks!,
That behaviour is not entirely intuitive. The issue is on the todolist already i believe
Btw: There is one "workaround" that I noticed after a while. It is possible to click the link right below the dropdown to reopen the dialog directly without changing providers..
This "workaround" is not optimal, not obvious either... Just wanted to share the info

Whaoo.. nice trick :-D ....

repo: equinor/witsml-explorer


text:
Readme bug

The Readme states:
$stack = new Stack($middleware, $default);
$response = $stack->dispatch($request);

However, currently that does not work. Currently, it have to state:
$stack = new Stack($middleware);
$response = $stack->dispatch($request, $default);

PRs which solves that:

#1 – Fix Stack implementation according to README.md
#2 – Fix README.md according to Stack implementation

It's more an philosophical question, which one to choose:

#1 leads to #5 – and that Stacks can be seen as delegates too
#2 leads to #4 – and that Stacks are middlewares too

@shadowhand Done, please start reading here :wink:

Fixed by #4 and further addressed in #7.

authors: schnittstabil shadowhand

repo: equip/dispatch

license: mit

license_source: bigquery


text:
Referencing pieces of text

This is a discussion of the referencing issue I alluded to in our mail exchanges about the new release of the EGD.
The purpose is to define a machine-actionable reference system for pieces of text: verses, lines, etc. Given a reference in some defined format (e.g. "line 5" or "face A, line 5 to line 6"), the machine should be able to locate the corresponding text in the XML file, and, optionally, to extract it.
I assume we only need this reference feature for the edition division. In this context, the following elements might bear a @n:
<milestone type="pagelike">
<pb>
<lb>
<milestone> # in gridlike partitions

<ab>

<lg>
<l>

Referring to gridlike <milestone>s does not seem useful, thus I ignore this case. The EGD does not prescribe to number <ab> and
, but I add them nonetheless in the discussion, in case people need that; currently, we have less than a dozen cases where they bear a @n.
We need a notation that can be processed by a machine, but I assume we want it to look fairly natural nonetheless (as in the examples above: "face B, line 5 to line 7", etc.) Since the format of @n is not restricted ("A" can represent a textpart division or a milestone, for instance), it is necessary to make each unit explicit, as in "face A, line 1" instead of "A1", "line A1", etc.
Let us review each element and describe how references to it would look like. The difficulty is to find unit names that look natural enough but that also unambiguously refer to a given XML element with a given set of attributes.

If the
 has a @subtype, use it as unit. Otherwise, use a unit named
"part". Thus:

  -> "item A"

  -> "part A"

Now, textpart divisions might have a heading (declared with ), which is supposed to be displayed instead of the one that would have been generated otherwise. Thus,

Frontal Face

... would result in "Frontal Face" instead of "Item A". Since "Item A" is not displayed, it is not possible for the reader to tell, without looking at the XML, what corresponds to the reference "item A".
To address this, we can either display "item A" in some way, or use the heading as reference, and generate references like "Frontal Face, line 1", etc. The first solution seems preferable to me, because, for the second to work, headings need to be unique, and this is not prescribed by the EGD.

 and <ab>
Use "paragraph" as unit:

  -> "paragraph 1"
<ab n="1">
  -> "paragraph 1"

This assumes that p/@n and ab/@n are unique among all
 and <ab> elements in a given division.
<lg>
Verses @n are displayed in Roman numerals, thus it seems natural to do the same in references. We would have:
<lg n="1"/>
  -> "verse I"

<l>
We cannot use "line" as unit, because this would better fit <lb>. We cannot use "pāda" either, since many <l> represent hemistiches. We could use "verse line" as in:
<lg n="1"><l n="a"/></lg>
  -> "verse I, verse line a"

This is verbose, however.
<milestone type="pagelike"> and <pb>
For milestones, use the provided @unit as unit; for <pb>, use the unit "page". Thus:
<milestone type="pagelike" unit="block" n="A">
  -> "block A"
<pb n="A">
  -> "page A"

This assumes that <pb> is equivalent to <milestone type="pagelike" unit="page">.
<lb>
Use "line" as unit.
<lb n="5">
  -> "line 5"

Conclusion
For the above to work, we need to make sure that the value of div/@subtype and milestone/@unit do not coincide in the same inscription; otherwise, the reference would be ambiguous. This is not enforced currently.
Likewise, div/@subtype and milestone/@unit should not have a value that is used as unit elsewhere; more specifically, they should not have the value "paragraph", "verse", "page", "line", "verse line".
For representing hierarchies, I propose we use a comma (e.g. "part 5, line 2"), as in normal references. For representing ranges, however, I do not think we can get away with using a dash (e.g. "line 2-5"), because this might mess with the format of @n. I thus suggest we use the explicit format "$unit n1 to $unit $n2", as in "line 2 to line 5". I think this can be parsed without ambiguity.

This seems to be a direct continuation of #270, which I think everybody should at least skim before commenting on the present issue.
I think we can all live without machine-actionable references to gridlike milestones, which would complicate the reference system very much (see e.g. here).
We never planned to number
 and <ab> elements and I don't think we should start doing so now. If anyone disagrees, please speak up now and state your reasons :) Otherwise, having an @n on a
 or <ab> in the edition division is an encoding error - if you can give me a list of where this occurs, I can have a look at the files. (Note that numbered paragraphs are of course mandatory in the translation [except for very short inscriptions] and permitted in the commentary.)
@michaelnmmeyer , what I don't understand here is the purpose for which you want to define the terms/units to use in references, such as "part" and "line". My best guess is that you are talking about generating display for encoded references, so that e.g. an encoded reference to a particular point in an edition would be displayed using these terms. Is that right? If not, or this is not the only thing you have in mind, then please clarify: why do we need a rigorous set of terms and what is wrong with e.g. referring to something displayed as "Frontal Face" using a reference involving "item A"? Are you for example talking about free-text queries that would be parsed by machine to jump to the requested point? I think that would be overkill.
(Incidentally, if your example
Frontal Face is from a file, then it is wrong; a "face" of an object is not an "item", which means "physically distinct objects". If it's just something you wrote as an illustration of the technicalities, then fine, but if it's from a file, then the encoder should be instructed to correct it.)
My comments on the rest of your post may be partly off because of the above lack of my understanding of the purpose.
For textpart divs without @subtype, I have no objection to the term "part". I'm also OK with displaying "Part " in the auto-generated headings for such textparts (if there are any textpart divs in our corpus that have neither a subtype nor a head), and with displaying "Part . " or  " . " for textparts with a head, without or with subtype respectively. Implementing this should alleviate your concern that "it is not possible for the reader to tell, without looking at the XML, what corresponds to the reference "item A"".  But @arlogriffiths may have a different opinion on this, since he and his team deal with cases like "South Doorjamb" which, when encoded as a textpart, has @subtype="item" @n="S" but the desired display is just "South Doorjamb" and not "Item S. South Doorjamb" (I'm basing this on resolved EGD comments of May and June 2020, which actually concerned milestone labels).
I would also be OK with making it explicit in the EGD that textpart heads must be unique. I think everybody would have taken this implicitly for granted anyway, as there would be no point to labelling your textparts if you used non-unique labels.
As I said above, I don't think we should introduce numbering for p and ab elements, so there will be no referencing of such elements.
For stanzas, displaying Roman numerals is fine. I'm also perfectly happy with "verse", but @arlogriffiths is likely to object to this, since by his definition the English term "verse" can also mean "one line of poetry" and rigorously uses "stanza"  for "a cohesive group of lines". So perhaps use "stanza" instead - though since I don't think I have ever seen "verse" used in the sense of "line" in Indological literature, while "verse" in the meaning "stanza" is ubiquitous in the same literature (and far more common than "stanza"), we might perhaps reconsider that.
In referring to verse lines, I agree that "verse line" is cumbersome. If we are only talking about the display of encoded references, then I think displaying nothing (just the @n) should be fine. Nobody will ever refer to a verse line without first identifying the verse (stanza), and the usual form of such references is simply "verse I a" or "verse XXV ab". (Whether to use a space between the stanza number and the <l> number, or to use nothing, or to use a comma and a space, is indifferent to me.)
For pagelike milestones, the solution should be the same as that for textparts, with @unit analogous to the @subtype of textparts, and  analogous to the  of textparts. The case is a little bit simpler since textparts are permitted without subtype, but milestones are not permitted without unit. However, the concerns about things like "south doorjamb" apply here too (actually, I think most, perhaps all, such cases have ultimately been encoded with milestones, not textparts), so referring just to the unit and n raises the same problems as referring to subtype and n in textparts does.
For <lb>, yes, line.
For uniqueness across div/@subtype and milestone/@unit: I again don't understand the purpose for which you need this. If my assumption that you are only talking about generating display, then I don't think this is much of a problem. The reference would be correctly encoded to a certain div or to a certain milestone, and the machine action would be based on the encoding, so there would be no processing difficulty. Editors (encoders) would never in my opinion use the same token for div/@subtype and milestone/@unit unless they then used unique values of @n across these, since they intuitively understand that these serve for segmenting and labelling the text, and they would not use the same heading twice in a printed edition. But if I am naively wrong about that and once in ten thousand editions we might potentially have a reference that is ambiguous for the human reader, I think we can live with that, since the ambiguity would only be present in the display, and not in the machine action. Or am I missing something and you want to use these terms for something other than display?
At any rate, I have no objection to making it explicit in the EGD that if an edition includes both textpart divs and pagelike milestones, and the editor deems it best to use the same token for the head of the former as for the label of the latter, then the <n> of each of these must be unique.
I'm also OK with explicitly forbidding  "paragraph", "verse" (or "stanza", "page", "line" and "verse line" (if we keep it) in div/@subtype and milestone/@unit.
I agree with using commas to separate the elements of the hierachy (except possibly for verse lines, see above), and with verbose display using "to" instead of hyphens.

The @n attribute is (legitimately?) used with p and ab  in critical editions, I am preparing for that, even though there is no display yet.
This whole referencing thing stems from Amandine's project. She needs a way

OK, so if I understand you correctly, we're basically talking about creating a new "code language" for references, that will have to be formulated rigorously by the person who uses it, and will be parsed by the machine. If devising this system does not take up an inordinate amount of time, does not require an inordinate degree of revision in the established encoding practice and the existing files, and is likely to be used by others beyond Amandine, then I'm all right with that. But if any of these three conditions are not met, then I think we (and especially the PIs) should seriously consider whether we really need to go there instead of, as you say, using XPath, which requires extra effort and learning on the part of the person(s) who will be encoding such references, but does not affect anyone else.
As for numbering paragraphs, I'm of course OK with doing so in critical editions and have not been aware that this was done there. I'm likewise OK with referring to both
 and <ab> elements as "paragraph ", though of course those who number such elements will then need rigorously to apply the same consecutive set of numbers to both (e.g. p1, p2, ab3, p4 etc... and not p1, p2, ab1, p3 etc., even though the former seems counterintuitive to me). [At this point I raise again the possibility that we just stop using <ab> altogether and change all existing <ab> elements to
 in our code. The distinction we make between p and ab is slightly fuzzy and not really useful.]
I still do not think we should introduce paragraph numbering for inscription editions. It is not clear to me if anyone has suggested that we do so, perhaps for Amandine to be able to refer to paragraphs from her table. If this is the case, then I think that instead of changing established projectwide practice for the sake of an individual project, it is the latter that could adapt and use what is already there, for instance line numbers, perhaps in pairs, pointing to the line in which a segment relevant to her begins, and also pointing to the line in which that segment ends. This would be actually be a more accurate reference system than referring to paragraphs, since the prose passeges of interest to her will in many cases be small parts of long paragraphs.
I am also slightly worried that if she (or anyone) starts referring to specific parts of our editions, i.e. essentially applying standoff markup to them, then what happens if our editions change? What if next month I revise one of my editions by splitting a previous long paragraph into two shorter ones? What if I get access to better visual documentation than before, and realise that a poorly legible passage originally encoded as prose was in fact verse, so that stanza numbering has to change in the file from that point onward? The only solution to this problem that I can see is for Amandine to create a fork of the repositories for her references, or to include some method of versioning in those references. Neither is ideal, and we can perhaps just live with the risk that such changes may happen (after all, we do the same when referring to stanza X of an inscription in a print publication). But someone needs to consider such eventualities.

For paragraphs numbering in diplomatic editions, I do not think anyone suggested it. I wrote a self-reminder to talk about it, but I do not remember the reason.
You point out a major issue in the last paragraph. For Amandine's case, I planned to save, for each reference, a commit hash plus the verse referred to, so as to detect potential modifications in numbering. This is not great, to say the least,  but the alternative is to store multiple revisions of our texts in the database, which would bring too much complication. I did that in the beginning, but abandoned the idea soon after.
In any case, maintaining working hyperlinks across revisions is a lot of (manual) work. I never do that in my own projects, precisely because the extra work does not seem worth the effort. If the original text is cited, finding its location does not take much time. Maybe it would not hurt much to just refer to the inscription id? To discuss with Amandine.

sorry, overwhelmingly busy. I concur with Manu's response and ask for patience so I can try to respond in due course to matters on which an explicit reaction has been requested from me.

I think this discussion hasn't been quite sorted out. At any rate, I have one additional observation here: the above statements about the need to make page, pagelike milestone and line numbers unique within any division needs to be qualified. When textpart divs are present, the uniqueness is a requirement within each textpart, but not within the div containing the textparts. I noticed when I opened https://dharmalekha.info/texts/INSVengiCalukya00091 that I now get a warning that pb and pagelike milestone elements do not have unique @n within this division (the edition div). The structure of this text is as follows:
textpart A: seal
  no subdivisions
textpart B: Plates
  pb 1r
  pb 1v, etc...
textpart C: Palimpsest
  pb 1r
  pb 1v, etc...

The identical pb numbers in textparts B and C need to be permitted, since they are in fact the very same pages (on which traces of an earlier inscription can be made out). But identical page or milestone numbering in textparts may be desirable in other cases too, so uniqueness must be enforced on the textpart level only.

This was intentional, addressed in 4c29818.

Did you mean unintentional? Anyway, I'm still getting the same error message on 00091.

I will have to write something more complicated. I expected <pb> only to occur within a
 or a <ab>.

<pb/> can and must be outside
 or <ab> for the first and last blank pages of copperplate sets, EGD §3.5.2. There's also another special case where this is permitted, but I do not know if it occurs in the corpus: lost medial plates as per §5.4.8.

yes, we certainly have such cases in our corpus. here's an example, though I am not sure the lost medial plates have been correctly encoded: https://dharmalekha.info/texts/INSIDENKTerep_II.

authors: arlogriffiths danbalogh michaelnmmeyer

repo: erc-dharma/project-documentation


text:
[Request] DockerHub

This project seems pretty fantastic! I'd love to run it on my unRAID server 24/7, but I can't find it on DockerHub. Is there plans to do so?

Thanks :)
You can find it here: https://hub.docker.com/repository/docker/erdnaxeli/castblock.

I just noticed that maybe you are talking about an ARM server. If so erdnaxeli/castblock:latest now support linux/arm too.

Actually, I'm on x86, but that's awesome for if I ever want to throw it on a Pi!
I did notice something weird though, I have to login to DockerHub in order to view the repo - which makes it inaccessible on unRAID. Any way to make it public-facing?

That's weird, the repo should be public. Did you actually try to do a docker pull ?

Docker pull works, but docker pull isn't 'supported' on unraid. I agree it's weird, I'm required to sign-in to access the dockerhub page. Can you replicate the same by logging out?

Glad to read you managed to pull the container :)
But indeed something is weird. I logged out, then when to the castblock and it redirected me to the login page. I retried (without login), and it worked… Second thing, the image is not visible through search: https://hub.docker.com/search?q=castblock&type=image. But my two other uploaded images are.

I just noticed that maybe you are talking about an ARM server. If so erdnaxeli/castblock:latest now support linux/arm too.

Hey there, while on the topic of Raspberry Pi support, would it be an option to add support for arm64 please?

@ToasterDEV I created a new issue for that :)
About dockerhub, I finally understood. In my previous comment (it is now edited) I posted a bad link:

correct link: https://hub.docker.com/r/erdnaxeli/castblock
incorrect link, required login: https://hub.docker.com/repository/docker/erdnaxeli/castblock/

Btw the project now correctly shows up in the search.

authors: SerinitySW ToasterDEV erdnaxeli

repo: erdnaxeli/castblock


text:
Falcon-11B: Dict key mismatch; expected keys: ['input_layernorm', 'mlp', 'self_attention']; dict: {'self_attention': {'query_key_value': {'kernel': Array

Describe the bug
Layer names do not coincide
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
Cell In[51], line 1
----> 1 output = trainer.train(
      2     model_parameters=model_parameters if not use_lora else None,
      3     state=None
      4 )
      5 # api.create_repo(new_repo_id, private=True, exist_ok=True)
      6 # api.upload_file(
      7 #     path_or_fileobj=output.checkpoint_path,
      8 #     repo_id=new_repo_id,
      9 #     path_in_repo=output.last_save_file_name
     10 # )

File /usr/local/lib/python3.10/site-packages/easydel/trainer/causal_language_model_trainer/causal_language_model_trainer.py:402, in CausalLanguageModelTrainer.train(self, model_parameters, state)
    395     termcolor.cprint(
    396         "Performance Mode is ON, we will ignore the Memory Tracking, WANDB Logging, and extra information "
    397         "Process.",
    398         color="red",
    399         force_color=True
    400     )
    401 start_time = time.time()
--> 402 sharded_state, shard_fns, gather_fns = self.initialize_state(
    403     model_parameters=model_parameters,
    404     state=state
    405 )
    407 count_model_parameters(sharded_state.params)
    408 with self.mesh:

File /usr/local/lib/python3.10/site-packages/easydel/trainer/causal_language_model_trainer/causal_language_model_trainer.py:290, in CausalLanguageModelTrainer.initialize_state(self, model_parameters, state)
    283     if not isinstance(model_parameters, flax.core.FrozenDict):
    284         prefix_print(
    285             "Warning",
    286             "Model Parameters should be like FrozenDict({'params': params}) make sure to "
    287             "pass as type FrozenDict in case of not getting UnExcepted Errors "
    288         )
--> 290     model_parameters = model_parameters if not self.arguments.do_shard_fns else jax.tree_util.tree_map(
    291         lambda f, x: f(x),
    292         shard_fns.params,
    293         model_parameters,
    294     )
    295     sharded_state = self.create_sharded_state_from_params_function(model_parameters)
    296 elif model_parameters is not None and self.checkpoint_path is not None:

File /usr/local/lib/python3.10/site-packages/jax/_src/tree_util.py:243, in tree_map(f, tree, is_leaf, *rest)
    210 """Maps a multi-input function over pytree args to produce a new pytree.
    211
    212 Args:
   (...)
    240   [[5, 7, 9], [6, 1, 2]]
    241 """
    242 leaves, treedef = tree_flatten(tree, is_leaf)
--> 243 all_leaves = [leaves] + [treedef.flatten_up_to(r) for r in rest]
    244 return treedef.unflatten(f(*xs) for xs in zip(*all_leaves))

File /usr/local/lib/python3.10/site-packages/jax/_src/tree_util.py:243, in <listcomp>(.0)
    210 """Maps a multi-input function over pytree args to produce a new pytree.
    211
    212 Args:
   (...)
    240   [[5, 7, 9], [6, 1, 2]]
    241 """
    242 leaves, treedef = tree_flatten(tree, is_leaf)
--> 243 all_leaves = [leaves] + [treedef.flatten_up_to(r) for r in rest]
    244 return treedef.unflatten(f(*xs) for xs in zip(*all_leaves))

ValueError: Dict key mismatch; expected keys: ['input_layernorm', 'mlp', 'self_attention']; dict: {'self_attention': {'query_key_value': {'kernel': Array([[ 1.355e-02, -5.432e-03,  3.442e-02, ..., -2.722e-02, -1.955e-05,
         3.613e-02],
       [ 3.015e-02, -7.751e-03,  7.568e-03, ...,  2.197e-02,  4.639e-02,
        -9.644e-03],
       [ 2.454e-02, -2.487e-03,  5.280e-03, ..., -1.880e-02,  1.770e-02,
        -6.989e-03],
       ...,
       [ 2.332e-02, -2.820e-02,  3.198e-02, ..., -3.198e-02,  4.395e-03,
        -1.233e-02],
       [ 1.855e-02,  1.465e-02, -7.935e-03, ...,  1.373e-02, -4.834e-02,
        -4.370e-02],
       [-6.683e-03, -1.288e-02, -1.575e-02, ...,  5.542e-02,  2.307e-02,
         2.490e-02]], dtype=float16)}, 'dense': {'kernel': Array([[-0.00836  , -0.001678 , -0.00867  , ..., -0.01227  ,  0.01355  ,
        -0.01868  ],
       [-0.03296  ,  0.02063  ,  0.04102  , ...,  0.0083   ,  0.00928  ,
         0.00806  ],
       [-0.01276  , -0.01794  , -0.01587  , ...,  0.00525  , -0.006165 ,
        -0.007812 ],
       ...,
       [-0.02185  , -0.00206  ,  0.01477  , ...,  0.003387 , -0.01953  ,
         0.03613  ],
       [-0.04712  , -0.00595  , -0.03174  , ..., -0.012695 , -0.02344  ,
        -0.00772  ],
       [ 0.03064  , -0.00653  , -0.002441 , ..., -0.01855  ,  0.0013275,
         0.002121 ]], dtype=float16)}}, 'mlp': {'dense_h_to_4h': {'kernel': Array([[-0.02246  , -0.00586  , -0.01007  , ..., -0.06006  , -0.002808 ,
        -0.01611  ],
       [-0.06006  ,  0.02307  , -0.00958  , ...,  0.0199   , -0.05127  ,
        -0.008484 ],
       [ 0.00203  ,  0.006897 ,  0.02405  , ...,  0.02368  ,  0.0008583,
        -0.03613  ],
       ...,
       [ 0.00296  ,  0.03076  ,  0.02747  , ..., -0.01538  ,  0.00409  ,
        -0.01227  ],
       [-0.03784  , -0.03198  ,  0.01672  , ...,  0.01831  ,  0.01538  ,
         0.002716 ],
       [ 0.02734  , -0.01904  , -0.0718   , ..., -0.005554 , -0.0166   ,
        -0.03735  ]], dtype=float16)}, 'dense_4h_to_h': {'kernel': Array([[ 0.0058  , -0.02832 ,  0.01575 , ...,  0.005707, -0.00132 ,
         0.0119  ],
       [-0.0094  ,  0.02283 , -0.02063 , ...,  0.01434 , -0.02417 ,
         0.02783 ],
       [-0.02002 ,  0.01294 ,  0.00116 , ...,  0.01099 ,  0.003296,
        -0.0371  ],
       ...,
       [-0.02246 ,  0.01733 ,  0.00638 , ...,  0.01892 , -0.01746 ,
        -0.0376  ],
       [ 0.003616, -0.01575 , -0.00867 , ...,  0.01007 ,  0.02771 ,
         0.0152  ],
       [-0.009766, -0.01855 , -0.00836 , ..., -0.01477 ,  0.007935,
        -0.0271  ]], dtype=float16)}}}.

To Reproduce
`!pip install fjformer datasets gradio wandb sentencepiece transformers=4.41.0 #git+https://github.com/huggingface/transformers -U -q
!pip install jax[tpu]==0.4.22 -f https://storage.googleapis.com/jax-releases/libtpu_releases.html
!pip install tensorflow --upgrade
HF_TOKEN = "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"
!python -c "from huggingface_hub.hf_api import HfFolder; HfFolder.save_token('<HF_TOKEN>')"
!apt-get update && apt-get upgrade -y && apt-get install golang -y
!pip install git+https://github.com/erfanzar/EasyDeL.git -U
from easydel import (
TrainArguments,
CausalLanguageModelTrainer,
AutoEasyDeLModelForCausalLM,
EasyDeLOptimizers,
EasyDeLSchedulers,
EasyDeLGradientCheckPointers,
EasyDeLState,
EasyDeLXRapTureConfig,
get_modules_by_type,
easystate_to_huggingface_model,
SFTTrainer,
conversations_formatting_function,
AutoEasyDeLConfig
)
from datasets import load_dataset
from flax.core import FrozenDict
from transformers import AutoTokenizer
from jax import numpy as jnp, sharding
import jax
from transformers import AutoConfig
from huggingface_hub import HfApi, hf_hub_download
import os
import datasets
import re
PartitionSpec = sharding.PartitionSpec
api = HfApi()
import safetensors.torch
import jax.numpy as jnp
import numpy as np
Correct repository ID
repo_id = "ssmits/Falcon2-5.5B-Dutch"
Define the base filename and the number of files you expect
base_filename = "model-"
num_files = 12  # Adjust this number based on how many files you have
List to store the file paths
file_paths = []
Loop through each file number and download
for i in range(1, num_files + 1):
file_suffix = f"{i:05d}-of-{num_files:05d}.safetensors"  # Formats the number as 00001-of-00012, etc.
filename = f"{base_filename}{file_suffix}"
# Downloading the model file
file_path = hf_hub_download(repo_id=repo_id, filename=filename, token=HF_TOKEN)

if file_path:
    file_paths.append(file_path)

Load each state
states = []
for path in file_paths:
with jax.default_device(jax.devices("cpu")[0]):
state_dict = safetensors.torch.load_file(path)
state_dict = jax.tree_map(lambda x: jnp.array(x.float().numpy(), dtype=jnp.float16), state_dict)
states.append(state_dict)
sharding_axis_dims = (1, 1, -1, 1)
max_length = 2048
input_shape = (1, max_length)
pretrained_model_name_or_path = "ssmits/Falcon2-5.5B-Dutch"
pretrained_model_name_or_path_tokenizer = "ssmits/Falcon2-5.5B-Dutch"
new_repo_id = "EasyDeL-SFT-Tuned-Model"
checkpoint_path = None
if checkpoint_path is None:
model, params = AutoEasyDeLModelForCausalLM.from_pretrained(
pretrained_model_name_or_path,
device=jax.devices('cpu')[0],
input_shape=input_shape,
device_map="auto",
sharding_axis_dims=sharding_axis_dims,
config_kwargs=dict(
use_scan_mlp=False,
ffn_hidden_size=16384
)
)
config = model.config
model_parameters = FrozenDict({"params": params})

else:
model_parameters = None
config = AutoEasyDeLConfig.from_pretrained(pretrained_model_name_or_path)
tokenizer = AutoTokenizer.from_pretrained(
pretrained_model_name_or_path_tokenizer,
trust_remote_code=True
)
tokenizer.padding_side = 'right'
block_size = 128
dtype = jnp.float16
use_lora = None
config.add_basic_configurations(
attn_mechanism="flash",
block_b=1,
block_q=block_size,
block_k=block_size,
block_k_major=block_size,
shard_attention_computation=True,
)
configs_to_initialize_model_class = {
"config": config,
"dtype": dtype,
"param_dtype": dtype,
"input_shape": input_shape
}
if tokenizer.pad_token is None:
tokenizer.pad_token = tokenizer.eos_token
rapture_config = EasyDeLXRapTureConfig(
model_parameters,
lora_dim=128,
fully_fine_tune_parameters=["embed_tokens"],
lora_fine_tune_parameters=["query_key_value"],
verbose=True
) if use_lora else None
from datasets import load_dataset
from transformers import AutoTokenizer
dataset_train = load_dataset(
"BramVanroy/ultra_feedback_dutch_cleaned",
name="sft_gpt4_hq",
split="train_sft"
)
tokenizer = AutoTokenizer.from_pretrained("ssmits/Falcon2-5.5B-Dutch")
def apply_template(example):
formatted_chat = []
for message in example['messages']:
role = message['role']
content = message['content']
formatted_chat.append(f"<|{role}|>\n{content}")
return {"formatted_chat": "".join(formatted_chat)}

dataset_train = dataset_train.map(apply_template, remove_columns=dataset_train.column_names)
print(dataset_train)
train_arguments = TrainArguments(
model_class=get_modules_by_type(config.model_type)[1],
configs_to_initialize_model_class=configs_to_initialize_model_class,
custom_rule=config.get_partition_rules(True),
num_train_epochs=1,
learning_rate=1e-5,
learning_rate_end=2e-6,
warmup_steps=400,
optimizer=EasyDeLOptimizers.ADAMW,
scheduler=EasyDeLSchedulers.WARM_UP_COSINE,
weight_decay=0.02,
total_batch_size=8,
max_sequence_length=max_length,
gradient_checkpointing=EasyDeLGradientCheckPointers.NOTHING_SAVEABLE,
sharding_array=sharding_axis_dims,
use_pjit_attention_force=False,
gradient_accumulation_steps=1,

init_input_shape=input_shape,
dtype=dtype,
param_dtype=dtype,
step_start_point=0,

model_name="EasyDeL-SFT",
training_time="1H", # setting maximum time on trainer for kaggle session
force_batch_and_gradient_accumulation_steps_calculation=False,
rapture_config=rapture_config,

)
trainer = SFTTrainer(
arguments=train_arguments,
train_dataset=dataset_train,
eval_dataset=None,
tokenizer=tokenizer,
dataset_text_field='formatted_chat',
packing=False,
num_of_sequences=2048,
checkpoint_path=checkpoint_path,
)
output = trainer.train(
model_parameters=model_parameters if not use_lora else None,
state=None
)
api.create_repo(new_repo_id, private=True, exist_ok=True)
api.upload_file(
path_or_fileobj=output.checkpoint_path,
repo_id=new_repo_id,
path_in_repo=output.last_save_file_name
)
print(config.multi_query)  # Output should be False
import transformers
with jax.default_device(jax.devices("cpu")[0]):
state = EasyDelState.load_state(
output.checkpoint_path,
input_shape=(8, 1),
)
if model_use_tie_word_embedding:
    state_new_params = {
        "params" : state.params["params"] | {
            "lm_head" : {
                "kernel" : state.params["params"]["model"]["embed_tokens"]["embedding"].T
            }
        }
    }

    state = state.replace( params = state_new_params )

config = AutoConfig.from_pretrained(pretrained_model_name_or_path)
tokenizer = AutoTokenizer.from_pretrained(pretrained_model_name_or_path)
config.dict.pop("_name_or_path", None)
with jax.default_device(jax.devices("cpu")[0]):
model = easystate_to_huggingface_model(
state=state,
base_huggingface_module=transformers.Qwen2ForCausalLM,
config=config
)
half_model = model.half()
tokenizer.push_to_hub(new_repo_id)
half_model.push_to_hub(new_repo_id, private=True)`

Im debugging at the moment and the problem is actually inside the huggingface
They will change the configuration s automatically and new decore arch will not be applied for falcon models
I have two ways
Recreate the whole reading and hub system of huggingface
Use simple static model converters  like what easylm or maxtext do for llama

Thank you for your quick reply. So the best action would be to wait until this huggingface problem is fixed? I can add the issue to the HF Falcon-11B repo.

@s-smits it's fixed, now i can finetune a Falcon11B model myself, you can try that

Awesome, testing it right now.

Action : Sharding Passed Parameters
XlaRuntimeError                           Traceback (most recent call last)
Cell In[25], line 1
----> 1 output = trainer.train(
2     model_parameters=model_parameters if not use_lora else None,
3     state=None
4 )
5 # api.create_repo(new_repo_id, private=True, exist_ok=True)
6 # api.upload_file(
7 #     path_or_fileobj=output.checkpoint_path,
8 #     repo_id=new_repo_id,
9 #     path_in_repo=output.last_save_file_name
10 # )
File /usr/local/lib/python3.10/site-packages/easydel/trainer/causal_language_model_trainer/causal_language_model_trainer.py:406, in CausalLanguageModelTrainer.train(self, model_parameters, state)
399     termcolor.cprint(
400         "Performance Mode is ON, we will ignore the Memory Tracking, WANDB Logging, and extra information "
401         "Process.",
402         color="red",
403         force_color=True
404     )
405 start_time = time.time()
--> 406 sharded_state, shard_fns, gather_fns = self.initialize_state(
407     model_parameters=model_parameters,
408     state=state
409 )
411 count_model_parameters(sharded_state.params)
412 with self.mesh:
File /usr/local/lib/python3.10/site-packages/easydel/trainer/causal_language_model_trainer/causal_language_model_trainer.py:299, in CausalLanguageModelTrainer.initialize_state(self, model_parameters, state)
288         prefix_print(
289             "Warning",
290             "Model Parameters should be like FrozenDict({'params': params}) make sure to "
291             "pass as type FrozenDict in case of not getting UnExcepted Errors "
292         )
294     model_parameters = model_parameters if not self.arguments.do_shard_fns else jax.tree_util.tree_map(
295         lambda f, x: f(x),
296         shard_fns.params,
297         model_parameters,
298     )
--> 299     sharded_state = self.create_sharded_state_from_params_function(model_parameters)
300 elif model_parameters is not None and self.checkpoint_path is not None:
301     raise EasyDeLTimerError(
302         "You can't pass model_parameters and checkpoint_path at same time"
303     )
[... skipping hidden 10 frame]

File /usr/local/lib/python3.10/site-packages/jax/_src/interpreters/pxla.py:1159, in ExecuteReplicated.call(self, *args)
1157   self._handle_token_bufs(result_token_bufs, sharded_runtime_token)
1158 else:
-> 1159   results = self.xla_executable.execute_sharded(input_bufs)
1160 if dispatch.needs_check_special():
1161   out_arrays = results.disassemble_into_single_device_arrays()
XlaRuntimeError: RESOURCE_EXHAUSTED: Error allocating device buffer: Attempting to allocate 128.00M. That was not possible. There are 88.58M free.; (1x1x0_HBM1): while running replica 0 and partition 0 of a replicated computation (other replicas may have failed as well).
Got an OOM with batch size 1 for TPU v3-8 so 128GB available. At least the model gets loaded now, so great addition.
os.environ["XLA_PYTHON_CLIENT_PREALLOCATE"]="false"
os.environ["XLA_PYTHON_CLIENT_MEM_FRACTION"]=".XX"
os.environ["XLA_PYTHON_CLIENT_ALLOCATOR"]="platform"

adding these would not help unfortunately.

you can train the model actually let me check and ill give you the code to how to train your model more efficiently

look I didn't actually finetune Falcon 11b but I'm finetuning Phi 14B so this code should work just fine
Configs

I'm training with batch size 6 since I'm using sequence sharing method on kaggle TPUs

sharding_axis_dims = (1, 1, 1, -1)
max_length = 2048
# max_length = 1792
input_shape = (1, max_length)

pretrained_model_name_or_path = "microsoft/Phi-3-medium-4k-instruct"
pretrained_model_name_or_path_tokenizer = pretrained_model_name_or_path
new_repo_id = "erfanzar/Phi-3-Medium-Instruct-v0.1"

dtype = jnp.bfloat16
use_lora = False
block_size = 512
attn_mechanism = "sharded_vanilla"

attention_partitions = dict(
    query_partition_spec=PartitionSpec(("dp","fsdp"), "sp", None, "tp"),
    key_partition_spec=PartitionSpec(("dp","fsdp"), "sp", None, "tp"),
    value_partition_spec=PartitionSpec(("dp","fsdp"), "sp", None, "tp"),
    bias_partition_spec=PartitionSpec(("dp","fsdp"), "sp", None, None),
    attention_partition_spec=PartitionSpec(("dp","fsdp"), "sp", None, "tp"),
)

LOADING MODEL
model, params = AutoEasyDeLModelForCausalLM.from_pretrained(
    pretrained_model_name_or_path,
    device = jax.devices('cpu')[0],
    input_shape = input_shape,
    device_map = "auto",
    sharding_axis_dims = sharding_axis_dims,
    verbose_params=True,
    config_kwargs=dict(
        use_scan_mlp=False,
        attn_mechanism=attn_mechanism,
        **attention_partitions
    ),
    **attention_partitions
)

config = model.config

model_use_tie_word_embedding = config.tie_word_embeddings

model_parameters = FrozenDict({"params" : params})

tokenizer = AutoTokenizer.from_pretrained(
    pretrained_model_name_or_path_tokenizer,
    trust_remote_code=True
)

config.add_basic_configurations(
    attn_mechanism=attn_mechanism,
    shard_attention_computation=True,
    **attention_partitions
)

configs_to_initialize_model_class={
    "config" : config,
    "dtype" : dtype,
    "param_dtype" : dtype,
    "input_shape" : input_shape
}

if tokenizer.pad_token == None:
    tokenizer.pad_token = tokenizer.eos_token

tokenizer.padding_side = "right"

It is working, apparently the problem was explicitly needing to state backend="tpu" at the TrainArguments, I assumed this was already set automatically through the CausalLanguageModelTrainer.

authors: erfanzar s-smits

repo: erfanzar/EasyDeL


text:
Added a WYSIWYG Type menu

When editing a md document in atom with the Medium Editor enabled there is a context WYSIWYG editor that will appear when a selection is made.
⚠ This issue depends on #17

@ericadamski Wow, that's super nice, might even be worth modularising it somehow for other packages to use…

@ChrisChinchilla that is a good idea, I will have to think about how to do that after I work a little more on the design of it :)

authors: ChrisChinchilla ericadamski

repo: ericadamski/atom-medium


text:
FileNotFoundError for madmax 'chia_plot'

This is probably user error, but wanted to report this just in case.
When configuring plotman 0.5 to use madmax, it's unable to find the command 'chia_plot'. When I was using madmax by itself, I was referencing it via its fully qualified path, so at first I thought an alias might fix it, but it did not. Eventually I ended up modifying manager.py to fully qualify the path to the chia_plot command, which did finally work.
(venv) tyler@chiaplotter:~/chia-blockchain$ plotman interactive
Traceback (most recent call last):
  File "/home/tyler/chia-blockchain/venv/bin/plotman", line 8, in <module>
    sys.exit(main())
  File "/home/tyler/chia-blockchain/venv/lib/python3.8/site-packages/plotman/plotman.py", line 243, in main
    interactive.run_interactive(
  File "/home/tyler/chia-blockchain/venv/lib/python3.8/site-packages/plotman/interactive.py", line 352, in run_interactive
    curses.wrapper(
  File "/usr/lib/python3.8/curses/__init__.py", line 105, in wrapper
    return func(stdscr, *args, **kwds)
  File "/home/tyler/chia-blockchain/venv/lib/python3.8/site-packages/plotman/interactive.py", line 129, in curses_main
    (started, msg) = manager.maybe_start_new_plot(
  File "/home/tyler/chia-blockchain/venv/lib/python3.8/site-packages/plotman/manager.py", line 227, in maybe_start_new_plot
    p = subprocess.Popen(plot_args,
  File "/usr/lib/python3.8/subprocess.py", line 858, in __init__
Traceback (most recent call last):
  File "/home/tyler/chia-blockchain/venv/bin/plotman", line 8, in <module>
    sys.exit(main())
  File "/home/tyler/chia-blockchain/venv/lib/python3.8/site-packages/plotman/plotman.py", line 243, in main
    interactive.run_interactive(
  File "/home/tyler/chia-blockchain/venv/lib/python3.8/site-packages/plotman/interactive.py", line 352, in run_interactive
    curses.wrapper(
  File "/usr/lib/python3.8/curses/__init__.py", line 105, in wrapper
    return func(stdscr, *args, **kwds)
  File "/home/tyler/chia-blockchain/venv/lib/python3.8/site-packages/plotman/interactive.py", line 129, in curses_main
    (started, msg) = manager.maybe_start_new_plot(
  File "/home/tyler/chia-blockchain/venv/lib/python3.8/site-packages/plotman/manager.py", line 227, in maybe_start_new_plot
    p = subprocess.Popen(plot_args,
  File "/usr/lib/python3.8/subprocess.py", line 858, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.8/subprocess.py", line 1704, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'chia_plot'

Modified line in manager.py that works:
if plotting_cfg.type == "madmax":
                if plotting_cfg.madmax is None:
                    raise Exception(
                        "madmax plotter selected but not configured, report this as a plotman bug",
                    )
-                 plot_args = ['chia_plot',
+                 plot_args = ['/home/tyler/madmax/chia-plotter/build/chia_plot',
                    '-n', str(1),
                    '-r', str(plotting_cfg.madmax.n_threads),
                    '-u', str(plotting_cfg.madmax.n_buckets),
                    '-t', tmpdir if tmpdir.endswith('/') else (tmpdir + '/'),
                    '-d', dstdir if dstdir.endswith('/') else (dstdir + '/') ]
                if dir_cfg.tmp2 is not None:
                    plot_args.append('-2')
                    plot_args.append(dir_cfg.tmp2 if dir_cfg.tmp2.endswith('/') else (dir_cfg.tmp2 + '/'))

Not sure if this is relevant, but I updated both plotman and madmax to their latest versions today after being about 2 months out of date on both.
Is there some other method of telling linux (other than an alias) or even python that chia_plot should refer to a specific path? Am I missing something with setting up madmax? Or should plotman be configurable to set a custom path to chia_plot?
Thanks!

The "quick" way would be to run PATH=/home/tyler/madmax/chia-plotter/build:$PATH plotman interactive.  The better way would be to add that to your path permanently in your ~/.profile.  You have to logout and back in to get the change in effect everywhere.  plotman will likely also get the ability to specify the path explicitly in the configuration file (https://github.com/ericaltendorf/plotman/pull/823).

Oh right, PATH! Thanks so much, worked like a charm.
For anyone who finds this later, I'm not sure if it mattered or not, but I noticed all the existing PATH additions in my .profile were wrapped in quotes, like PATH="/home/tyler/madmax/chia-plotter/build:$PATH" so I added it like that at the bottom of the file.

authors: altendky tcwatson

repo: ericaltendorf/plotman


text:
Add webpack to doc

The animated screenshot you used in the PR was cool. Should we  put that in the doc?

Yeah, vis is always good. By the way I am using licecap and it is just great.

authors: ericelliott nkbt

repo: ericelliott/prod-module-boilerplate


text:
[TST] Add docstrings for inflate_currency tests

PR Description
Please describe the changes proposed in the pull request:

Adds docstrings to tests in following modules:

finance

I did not write any of the original functions or tests, and am open to feedback for better descriptions.

This PR partially addresses #306.

PR Checklist

Please ensure that you have done the following:

[X] PR in from a fork off your branch. Do not PR from <your_username>:dev, but rather from <your_username>:<feature-branch_name>.

[X] If you're not on the contributors list, add yourself to AUTHORS.rst.

[ ] Add a line to CHANGELOG.rst under the latest version header (i.e. the one that is "on deck") describing the contribution.

Do use some discretion here; if there are multiple PRs that are related, keep them in a single line.

Quick Check
To do a very quick check that everything is correct, follow these steps below:

[X] Run the command make check from pyjanitor's top-level directory. This will automatically run:

black formatting
flake8 checking
running the test suite
docs build

Once done, please check off the check-box above.
If make check does not work for you, you can execute the commands listed in the Makefile individually.
Relevant Reviewers

Please tag maintainers to review.

@ericmjl

As a note, I generated this PR from VSCode's Github extension which is pretty great! (recent video) But unless I missed a step, it submitted an empty PR template at first.

repo: ericmjl/pyjanitor


text:
Running EF Core in Blazor WASM with SQLitePCL.raw

(Not sure this is the right place to discuss this - please close the issue if not @ericsink 😉)
Based on the Twitter thread:
https://twitter.com/PeerEmApp/status/1493816569075576835
Do we have some sample of how to run EF Core in a client-side Blazor WASM app with SQLitePCL.raw and IDBFS?
Thanks.

Caution! This only works in the published version, not in the debugger in debug mode.
First of all, the support for the IDBFS in the project must be switched on. To do this, this Empscripten compiler switch must be included in the project file:
<EmccExtraLDFlags>-lidbfs.js</EmccExtraLDFlags>
Next we need the javascript functions to handle the Emscripten file system.
"js/files.js":
function mount()
{
    FS.mkdir('/data');
    FS.mount(IDBFS, {}, '/data');
    FS.syncfs(true, function (err)
    {
        // Error
    });
}

function sync()
{
    FS.syncfs(function (err)
    {
        // Error
    });
}

Now add a button to the "Index.razor".
<button class="btn btn-primary" @onclick="Filetest">Click me</button>
And now the C# code in "Index.razor.cs":
using System;
using System.IO;
using Microsoft.AspNetCore.Components;
using Microsoft.JSInterop;

namespace BlazorWasmSqlite.Pages
{
    public partial class Index : ComponentBase
    {
        // Injections
        [Inject]
        private IJSRuntime JsRuntime { get; set; }

        protected override async void OnAfterRender(bool firstRender)
        {
            base.OnAfterRender(firstRender);

            // Mount IDBFS
            if (firstRender)
                await JsRuntime.InvokeVoidAsync("mount");
        }

        private async void Filetest()
        {
            // Test
            string filename = "/data/Test.txt";

            // Create if not exists
            if (File.Exists(filename))
                Console.WriteLine("File already exists.");
            else
            {
                Console.WriteLine("Create file.");

                // Write file
                File.WriteAllText(filename, "Hello persistent filesystem.");

                // Sync with IndexedDB
                await JsRuntime.InvokeVoidAsync("sync");
            }

            // Read
            if (File.Exists(filename))
                Console.WriteLine(File.ReadAllText(filename));
        }
    }
}

Thanks, @peerem for the sample 👍
Can you also show a sample of how to run this with EF Core in a client-side Blazor WASM?

Thanks, @peerem :-)
@ericsink, do you maybe have a sample with EF Core in a client-side Blazor WASM?

@patrickjahr Sorry, no. The Wasm support is very new, and it was done by @bricelam.  I haven't even tried working with it myself yet.

Caution! This only works in the published version, not in the debugger in debug mode.
First of all, the support for the IDBFS in the project must be switched on. To do this, this Empscripten compiler switch must be included in the project file:
<EmccExtraLDFlags>-lidbfs.js</EmccExtraLDFlags>
Next we need the javascript functions to handle the Emscripten file system.
"js/files.js":
function mount()
{
    FS.mkdir('/data');
    FS.mount(IDBFS, {}, '/data');
    FS.syncfs(true, function (err)
    {
        // Error
    });
}

function sync()
{
    FS.syncfs(function (err)
    {
        // Error
    });
}

Now add a button to the "Index.razor".
<button class="btn btn-primary" @onclick="Filetest">Click me</button>
And now the C# code in "Index.razor.cs":
using System;
using System.IO;
using Microsoft.AspNetCore.Components;
using Microsoft.JSInterop;

namespace BlazorWasmSqlite.Pages
{
    public partial class Index : ComponentBase
    {
        // Injections
        [Inject]
        private IJSRuntime JsRuntime { get; set; }

        protected override async void OnAfterRender(bool firstRender)
        {
            base.OnAfterRender(firstRender);

            // Mount IDBFS
            if (firstRender)
                await JsRuntime.InvokeVoidAsync("mount");
        }

        private async void Filetest()
        {
            // Test
            string filename = "/data/Test.txt";

            // Create if not exists
            if (File.Exists(filename))
                Console.WriteLine("File already exists.");
            else
            {
                Console.WriteLine("Create file.");

                // Write file
                File.WriteAllText(filename, "Hello persistent filesystem.");

                // Sync with IndexedDB
                await JsRuntime.InvokeVoidAsync("sync");
            }

            // Read
            if (File.Exists(filename))
                Console.WriteLine(File.ReadAllText(filename));
        }
    }
}

Hi, @peerem. I tried to execute the sample code in my small Blazor-WASM sample. But I run into the following issue:
IDBFS is not defined
Even though I have added the line <EmccExtraLDFlags>-lidbfs.js</EmccExtraLDFlags>  in my project file.
Do you have an idea?

Did you read the first line in my first post?
My project file looks like this:
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">

    <PropertyGroup>
        <TargetFramework>net6.0</TargetFramework>
        <RunAOTCompilation>false</RunAOTCompilation>
        <EmccExtraLDFlags>-lidbfs.js</EmccExtraLDFlags>
    </PropertyGroup>

    <ItemGroup>
        <PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="6.0.2" />
        <PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="6.0.2" PrivateAssets="all" />
    </ItemGroup>

</Project>

Yes, I saw the first post. Here is my project file from the small sample.
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">

	<PropertyGroup>
		<TargetFramework>net6.0</TargetFramework>
		<Nullable>enable</Nullable>
		<ImplicitUsings>enable</ImplicitUsings>
		<RunAOTCompilation>false</RunAOTCompilation>
		<EmccExtraLDFlags>-lidbfs.js</EmccExtraLDFlags>
	</PropertyGroup>

	<ItemGroup>
		<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="6.0.2" />
		<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="6.0.2" PrivateAssets="all" />
		<PackageReference Include="MudBlazor" Version="6.0.6" />
		<!-- EF Core and SQLite support -->
		<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="6.0.2" />
		<PackageReference Include="SQLitePCLRaw.bundle_e_sqlite3" Version="2.1.0-pre20220207221914" />
	</ItemGroup>

</Project>

Caution! This only works in the published version, not in the debugger in debug mode.

@peerem, yes, I published my project to the local file system and hosted it with IIS and Azure as an app service.
But unfortunately, both cases still have the same error message.

Works fine for me. Which version of Visual Studio are you using? I am using Visual Studio 17.1.0 on Windows. And which browser do you use? I tested with Chrome and Edge.

I also work with Visual Studio 2022 17.1.0 on Windows. I prefer to use chrome, but I have also tested it on edge.
Do you have a small example repo where I could look where I still have an issue?

That is interesting. I have a "pre" SDK on my machine (from a previously installed preview version) that supports the compiler switch.
C:\Program Files\dotnet\packs\Microsoft.NET.Runtime.WebAssembly.Sdk\6.0.2-mauipre.1.22102.15\Sdk
  - $(EmccVerbose)                      - Set to false to disable verbose emcc output.

  - $(EmccLinkOptimizationFlag)         - Optimization flag to use for the link step
  - $(EmccCompileOptimizationFlag)      - Optimization flag to use for compiling native files

  - $(EmccFlags)                        - Emcc flags used for both compiling native files, and linking
  - $(EmccExtraLDFlags)                 - Extra emcc flags for linking
  - $(EmccExtraCFlags)                  - Extra emcc flags for compiling native files
  - $(EmccTotalMemory)                  - Total memory specified with `emcc`. Default value: 536870912

You can find the documentation in the "WasmApp.targets" in the folder given above.

I saw on a fresh system that this above WebAssembly SDK is installed by Visual Studio 2022 and is up to date.
When I use the following package, I can't publish at all. It breaks off with error messages. Without this package everything works as before.
<PackageReference Include="SQLitePCLRaw.bundle_e_sqlite3" Version="2.1.0-pre20220207221914" />
You can see if the switch is passed to Emscripten in the following file. There should be "-lidbfs.js" as the last entry.:
<YourProjectDir>\obj\Release\net6.0\wasm\for-publish\emcc-link.rsp

An additional switch is required for this pre-release, otherwise Emscripten aborts with errors. It still has warnings, but it works for us.
<EmccExtraLDFlags>-lidbfs.js -s ERROR_ON_UNDEFINED_SYMBOLS=0</EmccExtraLDFlags>
When synchronizing too frequently, Emscripten throws exceptions, so we now do the synchronization via a timer every 10 seconds.

Super many thanks for your help @peerem. That has helped me a lot :-)

@patrickjahr you can find the sample repo of efcore with sqlite in blazor wasm here. Hope this helps.

FYI:
https://www.thinktecture.com/blazor/ef-core-and-sqlite-in-browser/

After mounting, the "populate" parameter in the "FS.syncfs" function should be set to "true", see the documentation and the example above.
https://emscripten.org/docs/api_reference/Filesystem-API.html#id2
"ERROR_ON_UNDEFINED_SYMBOLS" is no longer needed.

Thanks die the Feedback! I will change this 🙂

Also FYI:
https://youtu.be/2UPiKgHv8YE

In .Net 9 we now get the following error: "Disk i/o error".
As a note, "FS" is now "Blazor.runtime.Module.FS". See here:
https://github.com/dotnet/runtime/issues/109810

More infos about changes in .Net 9 for this topic:
https://github.com/aspnet/Announcements/issues/516

authors: ChristianWeyer bricelam ericsink fingers10 patrickjahr peerem


text:
Walkback, rather than error, when subclass duplicates instance variables

If you define a subclass that has the same instvar name, you get a walkback.
Seems like an error message would be nicer since this is not an unusual problem.
Various class compile errors get walkbacks.
Method compile errors are better if you know to look in the footer bar.  I do see the footer bar is never cleared after an error.

@LisaAlmarode  I reformatted your issue into a task list to more clearly identify separate issues within a single bug. Per our discussion today, fyi.

[ ] If you define a subclass that has the same instvar name, you get a walkback.
Seems like an error message would be nicer since this is not an unusual problem.
Various class compile errors get walkbacks.

[ ]  Method compile errors are better if you know to look in the footer bar. I do see the footer bar is never cleared after an error.

authors: LisaAlmarode ericwinger

repo: ericwinger/Jade


text:
feat: build homebrew package

Homebrew包制作与发布中的坑
Formula Cookbook
使用 Homebrew 维护自己的软件仓库

Creating a HomeBrew Formula

finish client homebrew.

repo: ericwq/aprilsh


text:
Screenshot?

I screenshot for visual learners like me would be nice!

Nice!

repo: erietz/slstatus

license: ISC


text:
onChange validation

Hi! I am tying to do a validation at change event. I need to prevent input of not-valid chars, that are not in characters map (i.e. RegExp) or exceeding max length.
So, in first approximation it looks like
/* ... */
render () {
    const { fields: {
        name,
    }, handleSubmit } = this.props;

    return (
        <input
            type="text"
            required={true}
            {...name}
            onChange={(evt) => {
                if (evt.target.value.length >= 255 || somePatternMatching) {
                    console.log('I TRY TO STOP')
                    return;
                }

                name.onChange(evt);
            }}
        />
    );
}
/* ... */

I've tried onChange and handleChange both. But I've caught strange bug: when I enter symbols, that are not accepted here with RegExp, logging string is passed to console (it says that somePatternMatching works correctly), but the value inside my input changes. Next, I clean up my input with Backspace button and start to enter these symbols again, nothing but accepted symbols are entering. Maybe something inside dispatches an action to change the field regardless to my attempt to prevent it? Or how to make this correctly?
UPD: In addition, I tried to set onKeyDown prop to my input with the same function (it calls onChange at the end too) — and it worked correctly. But it looks like an overhead. Of course, I can write a function to get callbacks and avoid duplicates in code, but is it proper way to pass the same functions inside both props when onChange in standard way can handle this alone?

You might want to check out the normalizer docs. Is that enough for your needs?

Normalizer docs are now here.

authors: Lonelind erikras

repo: erikras/redux-form


text:
asyncValidate prop to fields

Now that we don't have to provide an array of strings for the fields in a form would it make sense to pass and asyncValidate boolean prop in the the field component rather than have to provide a list of strings?
I like to use async blur on all of my widgets all of the time, so I'm finding that I have to create this array of string for every form I do.

Actually for my use case I noticed this: shouldAsyncValidate.
I can always return true and this solves my use case.
Still I think the asyncValidate prop is a nice addition.


text:
[6.0.0-rc.4] hidden field

Hi,
I wasn't able to use an hidden field.
<Field component="input" name="id" type="hidden" />
the field doesnt appear in redux store.
Am I doing something wrong or there is another way to do that?

It works for us and shows up in the redux state. Try initializing the input field with an empty value?
const initialValues = {
  myHiddenInput: '',
};

...

myForm = reduxForm({
  form: 'form',
  initialValues,
})(myForm);

FWIW, here's how I created a hidden field recently:
function HiddenField() {
  return null;
}

function ExampleForm() {
  return <Field name="hiddenthing" component={HiddenField} />
}

export default reduxForm({
  form: 'example',
  initialValues: {hiddenthing: 'hiddenvalue'}
})(ExampleForm);

It worked well and didn't add any unnecessary markup to the HTML.

@brotzky  it is a field that I intend to dynamically update the value.

@stunaz, so you're saying you don't see a redux/REGISTER_FIELD action for id on page init?

@jonjaques  just double checked, I see it redux/REGISTER_FIELD  but I dont see it in the values object.
I will just use @brotzky's way.
Thanks

@stunaz, hope it works! I think the issue arises because of redux's initial state behaviour. In redux (not redux-form) you have to initialize values or else they won't exist in your state (until you add something through an action). This trickles down to redux-form where you need to initalize a Field with something (like an empty string) if you want it to appear in state.

authors: brotzky hathawsh jonjaques stunaz


text:
[6.0.0-rc.4] Unsuccessful attempt at using with immutable

Hi,
Sorry for the un-helpful title, this is more to summarize my attempt at using v6 with immutable.
First things first here is (part of) the code (the rest mostly comes from react-boilerplate):
reducers.js:
import {reducer as formReducer} from 'redux-form/immutable';

[...]

export default function createReducer(asyncReducers) {
  return combineReducers({
    [...]
    form: formReducer,
    [...]
  });
}

Login.js

/*
 *
 * Login
 *
 */

import React from 'react';
import { compose } from 'redux';
import { connect } from 'react-redux';
import selectLogin from './selectors';
import styles from './styles.css';

import { reduxForm, Field } from 'redux-form/immutable';

import { Grid, FormGroup, FormControl, ControlLabel, HelpBlock, Button } from 'react-bootstrap';

const validate = values => {
  const errors = {};
  if (!values.email) {
    errors.email = 'Veuillez entrer votre email';
  } else if (!/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i.test(values.email)) {
    errors.email = 'Adresse email non valide';
  }

  if (!values.password) {
    errors.password = 'Veuillez entrer votre mot de passe';
  }
  console.log(errors);
  return errors;
};

class InputField extends React.Component {
  render() {
    const { input, label, placeholder, type, meta: { touched, error } } = this.props;

    return (<FormGroup validationState={touched && error ? 'error' : 'success'}>
      <ControlLabel>{placeholder}</ControlLabel>
      <FormControl {...input} placeholder={label} type={type} />
      {touched && error && <HelpBlock>{error}</HelpBlock>}
    </FormGroup>);
  }
};

class Login extends React.Component { // eslint-disable-line react/prefer-stateless-function

  _handleSubmit() {
    const { fields: {email, password} } = this.props;
    this.props.login(email.value, password.value);
  }

  render() {
    const { handleSubmit } = this.props;
    return (
      <Grid className={styles.login}>
        <form onSubmit={handleSubmit}>
          <Field name='email' type='email' component={InputField} placeholder='email' />
          <Field name='password' type='password' component={InputField} placeholder='mot de passe' />
          <Button type='submit'>
            Valider
          </Button>
        </form>
      </Grid>
    );
  }
}

const mapStateToProps = selectLogin();

function mapDispatchToProps(dispatch) {
  return {
    dispatch,
    login(email, password) {
      dispatch({type: 'LOGIN', payload: {email, password}});
    },
  };
}

Login = reduxForm({
  form: 'login',
  validate,
  //getFormState: (state) => state.get('form').toJS(),
})(Login);

export default compose(
  connect(mapStateToProps, mapDispatchToProps),
)(Login);

I first tried to install it through npm:
npm install --save redux-form@v6.0.0-rc.4
No errors on the terminal, but the browser (chrome) console gives:

createPropTypes.js:5 Uncaught TypeError: Cannot read property 'PropTypes' of undefined

Which is strange because createPropTypes.js is not even present in the v6.0.0-rc.4 codebase...
And a quick grep createPropTypes -R node_modules/redux-form/* neither shows any occurence to the file nor the function.
Then I tried cloning it to use it as a linked npm module:
git clone git@github.com:erikras/redux-form.git
cd redux-form
git checkout v6
npm i
npm link

then in my project directory:
npm link redux-form

Which first gives in the terminal:

Module build failed: Error: Couldn't find preset "react-hmre" relative to directory "/Users/stant/Documents/zilia/internals/redux-form"

npm install react-hmre in redux-form fixes it.
Now the browser console shows:
Super expression must either be null or a function in SubmissionError.js
It appears the the import is doing something strange not returning the default module export...
(Dirty-)fixed it with a
 class SubmissionError extends ExtendableError.default {
instead of
 class SubmissionError extends ExtendableError {
Now my page renders, but, in the browser console, I get a:

invariant.js:38 Uncaught Invariant Violation: addComponentAsRefTo(...): Only a ReactOwner can have refs. You might be adding a ref to a component that was not created inside a component's render method, or you have multiple copies of React loaded (details: https://fb.me/react-refs-must-have-owner).

Still digging through it. Send help;)

I'm not sure about that first error you got, but I can say that redux-form doesn't work well with npm link. Actually, I've never had a good experience with npm link with any package. @erikras has said in the past that instead of using npm link, he relies heavily on unit tests and he sometimes copies the lib folder of a built redux-form project into the node_modules of another project.

+1

Yes, npm link has never worked well for me with this library or any other.

Fix published in v6.0.3.

I still got this issue with redux-form 6.2 and react-boilerplate 3.3.1

authors: erikras hathawsh javatask nhducit vitaminwater


text:
Brew service is broken

See https://github.com/erikw/restic-automatic-backup-scheduler/issues/133

Can confirm, broken for me as well

authors: johnsturgeon olalonde

repo: erikw/homebrew-tap


text:
[Client] list needs for eris-pm

expose rpc calls through eris-client library

[x] call, callcode (which will be renamed to QueryContract and QueryContractCode)
[x] LatestBlockHeight

please append here more notes as needed; closing #256 and #257 as result

[ ] GetChainId (for a given ChainName)

[ ] List validators
[ ] Rebond, Bond, Unbond
[ ] Permissions

https://github.com/eris-ltd/eris-db/pull/187#discussion-diff-78937360R191

@benjaminbollen is this still serving a purpose please reopen with information for the uninitiated

authors: VoR0220 benjaminbollen silasdavis

repo: eris-ltd/eris-db


text:
SimdYuv420pSaveAsJpegToMemory

I'm very impressed by SimdYuv420pSaveAsJpegToMemory but there is a problem with the colour space conversion. If I go from YUV420P to JPEG and back, the images look washed. Is there a colour space mismatch or is this caused by JPEG compression?
Also please note when choosing SimdPixelFormatNone I get BGR, not YUV420P.

JPEG is image format with loss (except quality =100) so it can cause wash. As to color space see documetaion of function SimdYuv420pSaveAsJpegToMemory: http://ermig1979.github.io/Simd/help/group__image__io.html#gac0ee5c58a3d4de7540d52e7356d2dbab


text:
First person rule seems to be triggered by "API"

In addition, the integration can accept POST requests made to the LGTM endpoint and use them to hide alerts in some views of the <MadCap:variable name="Variables.ShortProductName" /> application. For full details of the webhook API calls, see <MadCap:xref href="issuetracker-webhook-api.html">Issue tracker webhook API</MadCap:xref>. For an example webhook receiver, see LGTM Issue Tracker Example. This repository contains a basic application that is set up to pass information between LGTM and an issue tracker.

(Apologies for the long line. Madcap Flare doesn't have any controls over line length.)
This triggered the following warning:
16:242  warning     Use first person sparingly      Microsoft.FirstPerson
                     ('I').

Possibly I'm doing something wrong with my .ini file but I couldn't see anything that would affect this result.

Here are my results with that text, with vale set to MinAlertLevel = suggestion:
alex.ball:~/devel$ pbpaste | vale
 stdin.txt
 1:70   suggestion  'LGTM' has no definition.       Microsoft.Acronyms
 1:475  suggestion  'LGTM' has no definition.       Microsoft.Acronyms
 1:523  suggestion  Consider using 'has' instead    Microsoft.ComplexWords
                    of 'contains'
 1:552  error       Use "that's" instead of "that   Microsoft.Contractions
                    is".
 1:557  suggestion  'is set' looks like passive     Microsoft.Passive
                    voice.
 1:595  suggestion  'LGTM' has no definition.       Microsoft.Acronyms
✖ 1 error, 0 warnings and 5 suggestions in stdin.

Thanks for responding so quickly. I wonder why you don't get the same error that I'm seeing. I've also run it on the output file generated by Flare and get the same error there (even when the variable is replaced with plain HTML).
I'm not sure how to debug this - any suggestions?

@polarweasel suggested that I try this in a standalone text file - which is what he did. This gave me the following results:
 test.html
 1:1    suggestion  Grade level (10.54) too high!   Semmle.Readability
 1:234  warning     Use first person sparingly      Microsoft.FirstPerson
                    ('I').
 1:523  suggestion  Consider using 'has' instead    Microsoft.ComplexWords
                    of 'contains'
 1:552  suggestion  Use "that's" instead of "that   Microsoft.Contractions
                    is".
 1:557  warning     'is set' looks like passive     Microsoft.Passive
                    voice.

✖ 0 errors, 2 warnings and 3 suggestions in 1 file.

I don't get the acronymns warning because I've added "LGTM" to our acronyms file.
I'm using Windows 10, running Vale in a Git bash window and am using Vale 1.4.0 and a recent version of the Microsoft rules.

This is indeed a bug (introduced in aae69299069191ef9e9a68b52211ee17966da166). I'll push a fix soon.
(@polarweasel is probably using an older release of the style, which had other issues with Microsoft.FirstPerson that aae69299069191ef9e9a68b52211ee17966da166 tried to fix.)

Glad to know laziness has paid off for me in this case :)

Thanks for responding so quickly - I only wish commercial software was as well supported!

This should be fixed in the latest release.

Wow! Many thanks.
I'll install the new version first thing tomorrow morning (I'm in the UK and have to dash for an evening meeting).

Works perfectly with your change. Many thanks 😄

authors: felicity-semmle jdkato polarweasel

repo: errata-ai/Microsoft


text:
Invalid link parsing with right parenthesis

source:
https://en.wikipedia.org/wiki/Calculator_(Windows)

parsed:

https://en.wikipedia.org/wiki/Calculator_(Windows)

expected:

https://en.wikipedia.org/wiki/Calculator_(Windows)

This still appears to be a problem, at least when the paragraph in question is italicized.

Rendered HTML:

Here is the Markdown:

This case is correctly handled by MacDown:

authors: pbakondy segdeha

repo: erusev/parsedown


text:
www.parsedown.org ?

Hy,
the domain with www. (www.parsedown.org) is not available.
Is that intentional or did you forget it?

I forgot it, but I wonder about how you found out about it.

authors: erusev turbopixel


text:
Table not displaying correctly using Parsedown 1.7.4 or 1.8.0-beta-7

I have the following table in a .MD file:
| Letter | Status | Details | | :----: | ------ | ------- | | N | Not Validated | The item is in the **Not Validated** tab in the Claims module, awaiting validation by the user. | | V | Validated | The item is in the **Validated** tab in the Claims module, awaiting verification checks by the system. | | E | Exceptions | The item is in the **Claim Exceptions** tab in the Claims module, awaiting editing/fixing by the user. | | C | Ready To Claim | The item is in the **Send Claim** tab in the Claims module, awaiting transmission to the PCRS. | | P | Paid | The item has been sent to the PCRS and has not yet received an Exception response. As such, we assume it will be paid for unless the system is told otherwise. | | D | Deleted | The item has been deleted from the **Claims Exceptions** tab as it was rejected by the PCRS and then deleted manually by the user, presumably because they opted not to pursue a further reclaim for the item. |
When testing this table on the website, it parses correctly:

However, when using Parsedown 1.7.4 or Parsedown 1.8.0-beta-7, neither of them display the table correctly:

I am running PHP v5.6 on an IIS Server. Is this a bug or a configuration issue or a PHP version issue perhaps?
This is the code being used to display the Markdown:
$handle = fopen($path, 'r'); if ($handle) { while (($line = fgets($handle)) !== false) { // process the line read. echo $Parsedown->text($line); } fclose($handle); } else { // error opening the file. echo "Error"; }

Have you forgotten to create a new object?
$Parsedown = new Parsedown();

Have you forgotten to create a new object?
$Parsedown = new Parsedown();

Hi jockel09, thanks for the reply. No, that is done higher up, I just didn't include that line of code.

Hi, it looks like the issue is that the table you're wanting to display is an object that spans multiple lines, however you're asking Parsedown to parse the lines individually. To get the result you'd expect, you'd need to read the file into a single string, and then pass that string to Parsedown all in one go.

Hi, it looks like the issue is that the table you're wanting to display is an object that spans multiple lines, however you're asking Parsedown to parse the lines individually. To get the result you'd expect, you'd need to read the file into a single string, and then pass that string to Parsedown all in one go.

Hi Aidan, ok that makes so much sense. Stupid question, apologies, am I reading the contents of the file into a string in PHP and then passing that string to the same $Parsedown->text() function or is there a separate function?


text:
Feature: image margins

Our users want the ability to add a margin to the embedded image in QR codes.
Added Build::image_gap and changed the argument of Builder::image_size to remove the gap argument so it can be supplied separately.

Hey @covercash2 thanks for the PR!
There already was the margins, it's the second param in image_size, I don't understand the difference between our outputs, I mean agree that your code is better, but could you explain please :)
I also see you have update the generated JS bindings
I'd like to know your wasm-bindgen version (wasm-bindgen --version) so I can update the .wasm too

i didn't see a way to define the gap without defining an image_size without some complicated downstream algebra 😅
we could definitely go that route, but this seemed simpler, unless i missed something.
this was a fresh install of wasm-bindgen for me:
❯ : wasm-bindgen --version
wasm-bindgen 0.2.91

thanks for the review! 🙏

Ahh, I understand the problem!
I'll reveiw a bit more the code, I think we can remove the double computaions

I simplified code in the library too here #51

i'll defer to #51 then! 😄


text:
Populated the visit tab on registration app

The visit tab now has the visit history of the patient

Coverage decreased (-0.02%) to 26.006% when pulling df89a102ae7f9ec8f2347d848de6c255e14e18ce on ningosi:master into 79961e2a061b391d2e6e8c2e8ada504f2378f009 on esaude:master.

authors: coveralls ningosi

repo: esaude/esaude-emr-poc


text:
TypeError: Cannot read property 'name' of undefined

Hello.
http://prntscr.com/c3fa5d
class A {

  method({ value1, ...rest }) {
     console.log(value1, rest);
  }

}

When esdoc try proccess this code, he throw errors. He don`t like spread operator in function arguments.
If we try next code, all be ok. But use arrow func in class methods not good idea if this don`t need for context, or some else.
class A {

  method = ({ value1, ...rest }) => {
     console.log(value1, rest);
  };

}

Thank for response.

Find same problem in prev issue

Your codes works fine in my env. Please check latest ESDoc and https://esdoc.org/manual/usage/feature.html#ecmascript-proposal
I re-open this issue if is problem.

repo: esdoc/esdoc


text:
Add ability to keep state for gelf formatters.

Sometimes, it's make sense to have internal state for formatter.
For example in my formatter I want to collect some properties of
my system once on the start and send them with each messages.
Also, in my formatter I decide to cache host once it will be resolved,
because looks like cash was removed from
https://github.com/erlang/otp/blob/master/lib/kernel/src/inet.erl#L466
So, in my case I prefer to use potentialy outdated hostname instead of
getting potential performance issues.
There is possible to implement such state cache with another approaches
(like external memoisation libs) but I believe that with simply introducing
internal state we will cover most of the cases.
Unfortunately, this changes will be breaking for formatters interface,
but I guess, that there is not so many custom formatters in the wild for today.
P.S. (Some additional PR in the queue F.E chuncking support in udp backend :))

Hi @IgorKarymov, thanks so much for the PR!
I have one request, could you add a note about what functions should be exposed by the formatter to the README? Apart from that, the PR looks great 😄
And obviously, I'm looking forward to the other one 😉

updated

Thanks @IgorKarymov !

authors: IgorKarymov arkgil


text:
Evaluator generate_quantized_model Failed (AIV-470)

Hi, 我在使用量化工具时，calib.generate_quantization_table(model_proto, test_images, pickle_file_path)可以正常使用，模型在esp32上也能正常推理，但使用Evaluator评估时eva.generate_quantized_model(model_proto, pickle_file_path)提示current model is not supported by esp-dl错误，模型使用了 Conv2D DepthwiseConv2D Pad Add2D Concat Transpose 算子，请问是 Evaluator 还未支持上述中的算子吗？

好的

repo: espressif/esp-dl


text:
mqtt_client: Client was not initialized (IDFGH-10249)

Answers checklist.

[X] I have read the documentation ESP-IDF Programming Guide and the issue is not addressed there.
[X] I have updated my IDF branch (master or release) to the latest version and checked that the issue is present there.
[X] I have searched the issue tracker for a similar issue and not found a similar issue.

General issue report
Hello I am using the updated version of IDF and trying to connect my esp32s3 with ssl_mutual_auth example code. I am providing each and every detail in code from credentials , certificates, host name , uri and so on. But eventually esp_mqtt_client_init(&mqtt_cfg); always return NULL and it says client was not initialized. I did the same project on older version and it works. Please fix this issue I am not sure whats going on but esp_mqtt_client_init(&mqtt_cfg); has some issues or esp_mqtt_client_config_t mqtt_cfg is not responding accordingly with data. Thanks!

eventually

Care to elaborate on that by showing the code?

Yes certainly, In function mqtt_app_start which contains esp_mqtt_client_config_t mqtt_cfg i am adding all credentials which are later assigned to esp_mqtt_client_inti , but despite taking all credentials code returns "client was not initialized". The same code works in older version of esp-idf where it is much more simple. Here is code and all struct credentials being assigned.
static void mqtt_app_start(void)
{
usage();
const esp_mqtt_client_config_t mqtt_cfg = {
.broker.address.uri = AWS_IOT_ENDPOINT ,//AWS_IOT_ENDPOINT,
.broker.address.hostname= "iot.thingsty.com",
.broker.address.transport = MQTT_TRANSPORT_OVER_SSL,//MQTT_TRANSPORT_OVER_SSL,
.broker.address.port=AWS_IOT_PORT,
.broker.verification.use_global_ca_store=true,
.broker.verification.certificate = (const char *)server_cert_pem_start,
.broker.verification.certificate_len=server_cert_size,
.broker.verification.psk_hint_key=NULL,
.broker.verification.skip_cert_common_name_check=false,
.broker.verification.alpn_protos=NULL,
.credentials = {
  //.username="srk",
  .client_id = "630f3f41376e947cf63a",
  .set_null_client_id=false,
  .authentication = {
    //.password = "123456",
    .certificate = (const char *)client_cert_pem_start,
    .certificate_len = client_cert_size,
    .key = (const char *)client_key_pem_start,
    .key_len=client_key_size,
    .key_password = NULL,
    .key_password_len = 0,
    .use_secure_element = false,
    .ds_data = NULL

  },
},
.session = {
        .last_will = {
           // .topic = MQTT_TOPIC,
           // .msg = NULL,
          //  .msg_len = 0,
           // .qos = 0,
           // .retain = 0
        },
        .disable_clean_session = false,
        .keepalive = 120,
        .disable_keepalive = false,
        .protocol_ver = MQTT_PROTOCOL_V_3_1,
        .message_retransmit_timeout = 0
  },
    .network = {
        .reconnect_timeout_ms = 5000,
        .timeout_ms = 5000,
        .refresh_connection_after_ms = 1000,
        .disable_auto_reconnect = false
    },
    .task = {
        .priority = 5,
        .stack_size = 8192
    },
    .buffer = {
        .size = 1024,
        .out_size = 1024
    },
    //.event_handle_cb = mqtt_event_handler_cb,
    //.transport_type = MQTT_TRANSPORT_OVER_SSL

};
//////////////Code ENDS///////////////////////
"//.event_handle_cb = mqtt_event_handler_cb,
//.transport_type = MQTT_TRANSPORT_OVER_SSL"
this line when uncommented says that these are not part of struct of client config. Please tell me what is going on. Older versions were working but has issues.

@srk517 event_handle_cb is removed, you should use esp_mqtt_client_register_event to regist event callback. And transport_type  is renamed as .broker.address.transport. Besides, the problem that client was not initiated, could you please offer the whole log. The log maybe show the reason.

Issue resolved.

Thanks for sharing the updates, feel free to reopen.

Issue resolved.

Hey,
How did you resolve it? I am also trying to initialize the client using the same function of ESPIDF in Arduino ide but I could not able to do it. I am getting the same result. I am also sending all parameters like username, password, client id all. But still receiving the same error. Kindly could you please guide me how you solve it .

repo: espressif/esp-idf


text:
esp_netif_sntp errors (IDFGH-10653)

Answers checklist.

[X] I have read the documentation ESP-IDF Programming Guide and the issue is not addressed there.
[X] I have updated my IDF branch (master or release) to the latest version and checked that the issue is present there.
[X] I have searched the issue tracker for a similar issue and not found a similar issue.

IDF version.
5.1
Operating System used.
Linux
How did you build your project?
Command line with idf.py
If you are using Windows, please specify command line type.
None
What is the expected behavior?
I expect 5.1 documentation examples to compile without error.
I see that ip_event_to_renew is initialized to 0 while it should be an enum.
No clue which of the values to take, the first one is IP_EVENT_STA_GOT_IP and that doesn't seem appropriate.
Note that the rest of the error message below appears to indicate a second bug.
What is the actual behavior?
/home/danny/src/esp-idf/esp32s3-4827s043/minimal/main/App.cpp: In static member function 'static void App::connect(void*, esp_event_base_t, int32_t, void*)':
/home/danny/src/github/esp32/esp-idf-v5.1/components/esp_netif/include/esp_netif_sntp.h:53:34: error: invalid conversion from 'int' to 'ip_event_t' [-fpermissive]
53 |             .ip_event_to_renew = 0,
|                                  ^
|                                  |
|                                  int
/home/danny/src/github/esp32/esp-idf-v5.1/components/esp_netif/include/esp_netif_sntp.h:63:13: note: in expansion of macro 'ESP_NETIF_SNTP_DEFAULT_CONFIG_MULTIPLE'
63 |             ESP_NETIF_SNTP_DEFAULT_CONFIG_MULTIPLE(1, {server})
|             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/danny/src/esp-idf/esp32s3-4827s043/minimal/main/App.cpp:87:28: note: in expansion of macro 'ESP_NETIF_SNTP_DEFAULT_CONFIG'
87 |   esp_sntp_config_t sntp = ESP_NETIF_SNTP_DEFAULT_CONFIG(CONFIG_NTP_SERVER_0);
|                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Steps to reproduce.
from https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/system/system_time.html?highlight=sntp_init#_CPPv49sntp_initv
it says use this :
esp_sntp_config_t config = ESP_NETIF_SNTP_DEFAULT_CONFIG("pool.ntp.org");
esp_netif_sntp_init(&config);
Build or installation Logs.
No response
More Information.
No response

Duplicate of https://github.com/espressif/esp-idf/issues/11825#issuecomment-1655069735
Sorry for the trouble, will fix.

Note : still present in esp-idf-v5.1.1 :-(

fixed by ef451cab0fec03b24d71552054c8489c2bd6217b

Fixed in https://github.com/espressif/esp-idf/commit/597810bf96f90d93a98cc8641f90e5bd09a75ff0

authors: AxelLin dannybackx david-cermak