Skip to content

Commit

Permalink
v 0.6.1
Browse files Browse the repository at this point in the history
  • Loading branch information
krish-adi committed Jul 25, 2022
1 parent df755b4 commit 46b0d0a
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

Release dates are in YYYY-MM-DD

## [0.6.1] - 2022-07-25

- Fix base_blocks_list passed to the compute engine.

## [0.6.0] - 2022-07-19

- Add option to categories the Blocks with a category in a sub-menu in the context menu on right-click>add-node.
Expand Down
7 changes: 5 additions & 2 deletions barfi/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,14 @@ def st_barfi(base_blocks: Union[List[Block], Dict], load_schema: str = None, com

if isinstance(base_blocks, List):
base_blocks_data = [block._export() for block in base_blocks]
base_blocks_list = base_blocks
elif isinstance(base_blocks, Dict):
base_blocks_data = []
base_blocks_list = []
for category, block_list in base_blocks.items():
if isinstance(block_list, List):
for block in block_list:
base_blocks_list.append(block)
block_data = block._export()
block_data['category'] = category
base_blocks_data.append(block_data)
Expand All @@ -82,13 +85,13 @@ def st_barfi(base_blocks: Union[List[Block], Dict], load_schema: str = None, com

if _from_client['command'] == 'execute':
if compute_engine:
_ce = ComputeEngine(blocks=base_blocks)
_ce = ComputeEngine(blocks=base_blocks_list)
_ce.add_editor_state(_from_client['editor_state'])
_ce._map_block_link()
_ce._execute_compute()
return _ce.get_result()
else:
_ce = ComputeEngine(blocks=base_blocks)
_ce = ComputeEngine(blocks=base_blocks_list)
_ce.add_editor_state(_from_client['editor_state'])
_ce._map_block_link()
# return _ce.get_result()
Expand Down
2 changes: 1 addition & 1 deletion barfi/compute_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def _map_block_link(self):

for _block in self._editor_state['nodes']:

# Create a child block object for the active the block and associate with its id
# Create a child block object for the active block and associate with its id
_parent_block = next(
_b for _b in self._blocks if _b._type == _block['type'])
# Create an independent deep copy of the parent block type
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

setuptools.setup(
name="barfi",
version="0.6.0",
version="0.6.1",
author="Adithya Krishnan",
author_email="krishsandeep@gmail.com",
description="Framework for a graphical programming environment.",
Expand Down
2 changes: 1 addition & 1 deletion tests/test_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

compute_engine = st.checkbox('Activate barfi compute engine', value=False)

barfi_result = st_barfi(base_blocks=base_blocks, compute_engine=compute_engine,
barfi_result = st_barfi(base_blocks=base_blocks_category, compute_engine=compute_engine,
load_schema=barfi_schema_name)

if barfi_result:
Expand Down

0 comments on commit 46b0d0a

Please sign in to comment.