Skip to content

Commit

Permalink
Fixing merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
Dozgulbas committed Sep 25, 2024
2 parents b8c7404 + 4345349 commit 5c5e183
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 41 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "ad_sdl.wei"
version = "0.6.1"
version = "0.6.2"
description = "The Rapid Prototyping Laboratory's Workflow Execution Interface."
authors = [
{name = "Rafael Vescovi", email = "[email protected]"},
Expand Down
2 changes: 1 addition & 1 deletion src/ui/src/components/Workflow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ const data_headers = [
]
props.steps.forEach((step : any)=> { test.value[step.id] = {}; if(step.result.data)
props.steps.forEach((step : any)=> { test.value[step.id] = {}; if(step.result && step.result.data)
{Object.keys(step.result.data).forEach(async (key: string) => {
let val = await ((await fetch( "http://".concat(window.location.host).concat("/runs/data/").concat(step.result.data[key]).concat("/info"))).json())
Expand Down
1 change: 1 addition & 0 deletions src/wei/core/state_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ def _redis_client(self) -> Any:
port=int(Config.redis_port),
db=0,
decode_responses=True,
password=Config.redis_password if Config.redis_password else None,
)
return self._redis_connection

Expand Down
3 changes: 3 additions & 0 deletions src/wei/types/workcell_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ class WorkcellConfig(BaseModel, extra="allow"):
default="localhost", description="Hostname for the Redis server"
)
redis_port: int = Field(default=6379, description="Port for the Redis server")
redis_password: str = Field(
default="", description="Password for the Redis server, if any"
)
data_directory: PathLike = Field(
default=Path.home() / ".wei",
description="Directory to store data produced by WEI",
Expand Down
47 changes: 8 additions & 39 deletions tests/test_module/test_rest_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
REST-based node that interfaces with WEI and provides various fake actions for testing purposes
"""

import time
from typing import Annotated

from fastapi import UploadFile
Expand Down Expand Up @@ -190,41 +191,9 @@ def synthesize(
) -> StepResponse:
"""Synthesizes a sample using specified amounts `foo` and `bar` according to file `protocol`"""

# Read the uploaded protocol file content (not used further in this example)
protocol_content = protocol.file.read().decode("utf-8")
print(protocol_content)

# Retrieve the plate resource
plate = state.resource_interface.get_resource(
resource_name="Plate0", module_name=state.module_name
)

if not plate:
return StepResponse.step_failed("Plate0 resource not found")

try:
# Update specific wells
state.resource_interface.update_plate_well(plate, "A1", 80.0) # Set A1 to 80
# Safely retrieve well 'B1' quantity before modification
well_B1_quantity = state.resource_interface.get_well_quantity(plate, "B1")
state.resource_interface.update_plate_well(
plate, "B1", well_B1_quantity - 1
) # Decrease B1 by 'bar'

# Update the entire contents of wells, setting C1 to well capacity
state.resource_interface.update_plate_contents(
plate, {"C1": plate.well_capacity}
)

# Set D1 well to zero
state.resource_interface.update_plate_well(plate, "D1", 0.0)

all_plates = state.resource_interface.get_all_resources(PlateTable)
print("All Plates in the database:", all_plates)
return StepResponse.step_succeeded()

except Exception as e:
return StepResponse.step_failed(f"Failed to synthesize: {e}")
state.foobar = foo + bar
time.sleep(5)
return StepResponse.step_succeeded()


@test_rest_node.action(
Expand Down Expand Up @@ -267,10 +236,10 @@ def measure_action(state: State, action: ActionRequest) -> StepResponse:
all_collections = state.resource_interface.get_all_resources(CollectionTable)
print("All Collections in the database:", all_collections)
# Return the success response with the generated files
# return StepResponse.step_succeeded(
# files={"test_file": "test.txt", "test2_file": "test2.txt"},
# data={"test": {"test": "test"}},
# )
return StepResponse.step_succeeded(
files={"test_file": "test.txt", "test2_file": "test2.txt"},
data={"test": {"test": "test"}},
)
return StepResponse.step_succeeded()

else:
Expand Down

0 comments on commit 5c5e183

Please sign in to comment.