Skip to content

Commit

Permalink
Update driver.py to use inputs (#174)
Browse files Browse the repository at this point in the history
Inputs can be passed in as configuration, but really they should be passed in as inputs -- that way visualization doesn't interpret them as configuration.
  • Loading branch information
skrawcz authored May 29, 2024
1 parent a268dd6 commit dc17bb1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions naturf/driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def __init__(self, inputs: dict, outputs: List[str], **kwargs):
# instantiate driver with function definitions & adapters
self.dr = (
driver.Builder()
.with_config(self.inputs)
.with_config({})
.with_modules(nodes, output)
.with_adapters(*hamilton_adapters)
.build()
Expand All @@ -74,15 +74,15 @@ def execute(self) -> pd.DataFrame:
"""Run the driver."""

# generate initial data frame
df = self.dr.execute(self.outputs)
df = self.dr.execute(self.outputs, inputs=self.inputs)

return df

def graph(self, view: bool = True, output_file_path: Union[str, None] = None) -> object:
"""Show the DAG. Return the graph object for the given inputs to execute."""

return self.dr.visualize_execution(
final_vars=self.outputs, output_file_path=output_file_path, render_kwargs={"view": view}
final_vars=self.outputs, inputs=self.inputs, output_file_path=output_file_path, render_kwargs={"view": view}
)

def list_parameters(self):
Expand Down

0 comments on commit dc17bb1

Please sign in to comment.