Regarding release of latest version (including support for parallel and async)
Hi Krish
Hope you're well
When are you releasing the version latest version (with support for async and parallel computation) ?
Best, Abrar
Hey @abrarzahoor004 , I was planning on making the release end of this week. Is this something you'd require asap?
Hey @abrarzahoor004 version 1.1.0 is released check it out.
Hi Aditya,
Thanks for the update. Already using the latest version, the async functionality has increased the compute efficiency.
One question, regarding the schemas, the "Save" button within the flow seems interesting. I would love to engage it to save my schema, however I am not able to do it, while i can do the same for the Execute button (to start the ComputeEngine) the save button in my code is rudimentary. Can you help with a demo code, how will this button help me engage it (to save the schema in the flow)?
Best, Abrar
Hey @abrarzahoor004 ,
I'll try to explain the working on the save button with an example:
Lets say you have a set of blocks, and you have a streamlit widget like this:
base_blocks [...]
barfi_result = st_flow(
blocks=base_blocks,
editor_schema=load_schema,
)
when the Save button is clicked on the widget (UI), the barfi_result contains an attribute command for which the value is equal to save. Therefore, this is how you can check for the save command in the backend and save your schema:
schema_manager = SchemaManager(filepath="./schemas/")
if barfi_result.command == "save":
schema_manager.save_schema("name of schema", barfi_result.editor_schema)
you can see an example app here: https://github.com/krish-adi/barfi/blob/main/tests/app.py
Hi Krish, Hope you're well. Is it possible to get the depreciated UI back, to ask the least the black colored bg and blocks?
If not, is there a way to get it done on my local Barfi version
Best Regards Abrar
Hi Krish,
Lets say you have a set of blocks, and you have a streamlit widget like this:
base_blocks [...] barfi_result = st_flow( blocks=base_blocks, editor_schema=load_schema, )when the
Savebutton is clicked on the widget (UI), thebarfi_resultcontains an attributecommandfor which the value is equal tosave. Therefore, this is how you can check for thesavecommand in the backend and save your schema:schema_manager = SchemaManager(filepath="./schemas/") if barfi_result.command == "save": schema_manager.save_schema("name of schema", barfi_result.editor_schema)
I tried above code, but there is a problem with the behavior of the attribute 'command' from st_flow(). Once the Save or Execute button is pressed, subsequent reruns of the st_flow() will always return 'save' or 'execute' even though the button is no more pressed. Therefore, every time I touch a another widget, save or execute code is also executed. The expected behavior is to restore the attribute 'command' to 'default' if these buttons are not pressed.
In addition, it seems that result of st_flow() does not reflect actual workflow shown on the Flow-Editor until Save or Execute button is pressed. Thus, it is also difficult to create a streamlit button and do save or execute instead of using Editor's button.
Hi Krish
Adding to the above comment, I tried assigning "None" to the .command to stop the reruns but it retains the state despite doing so. barfi_result.command retains "execute" even after changing it to None or "save" Is there a way to bypass this or is this an issue with the library ?
Best Abrar