Skip to content
This repository has been archived by the owner on Jul 3, 2023. It is now read-only.

Changes comments/references for visualization install #289

Merged
merged 2 commits into from
Jan 28, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ To get started, first you need to install hamilton. It is published to pypi unde
> pip install sf-hamilton

Note: to use the DAG visualization functionality, you should instead do:
> pip install sf-hamilton[visualization]
> pip install "sf-hamilton[visualization]"

While it is installing we encourage you to start on the next section.

Expand Down Expand Up @@ -117,7 +117,7 @@ output_columns = [
# let's create the dataframe!
# if you only did `pip install sf-hamilton` earlier:
df = dr.execute(output_columns)
# else if you did `pip install sf-hamilton[visualization]` earlier:
# else if you did `pip install "sf-hamilton[visualization]"` earlier:
# dr.visualize_execution(output_columns, './my-dag.dot', {})
print(df)
```
Expand Down
2 changes: 1 addition & 1 deletion examples/dask/hello_world/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"spend_zero_mean_unit_variance",
]
df = dr.execute(output_columns)
# To visualize do `pip install sf-hamilton[visualization]` if you want these to work
# To visualize do `pip install "sf-hamilton[visualization]"` if you want these to work
# dr.visualize_execution(output_columns, './my_dag.dot', {})
# dr.display_all_functions('./my_full_dag.dot')
logger.info(df.to_string())
Expand Down
2 changes: 1 addition & 1 deletion examples/data_quality/pandera/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"seasons_4",
"absenteeism_time_in_hours",
]
# To visualize do `pip install sf-hamilton[visualization]` if you want these to work
# To visualize do `pip install "sf-hamilton[visualization]"` if you want these to work
# dr.visualize_execution(output_columns, './my_dag.dot', {})
# dr.display_all_functions('./my_full_dag.dot')

Expand Down
2 changes: 1 addition & 1 deletion examples/data_quality/pandera/run_dask.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
"seasons_4",
"absenteeism_time_in_hours",
]
# To visualize do `pip install sf-hamilton[visualization]` if you want these to work
# To visualize do `pip install "sf-hamilton[visualization]"` if you want these to work
# dr.visualize_execution(output_columns, './my_dag.dot', {})
# dr.display_all_functions('./my_full_dag.dot')

Expand Down
2 changes: 1 addition & 1 deletion examples/data_quality/pandera/run_ray.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
"seasons_4",
"absenteeism_time_in_hours",
]
# To visualize do `pip install sf-hamilton[visualization]` if you want these to work
# To visualize do `pip install "sf-hamilton[visualization]"` if you want these to work
# dr.visualize_execution(output_columns, './my_dag.dot', {}, graphviz_kwargs=dict(graph_attr={'ratio': "1"}))
# dr.display_all_functions('./my_full_dag.dot')

Expand Down
2 changes: 1 addition & 1 deletion examples/data_quality/pandera/run_spark.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
"absenteeism_time_in_hours",
"index_col",
]
# To visualize do `pip install sf-hamilton[visualization]` if you want these to work
# To visualize do `pip install "sf-hamilton[visualization]"` if you want these to work
# dr.visualize_execution(output_columns, './my_dag.dot', {})
# dr.display_all_functions('./my_full_dag.dot')

Expand Down
2 changes: 1 addition & 1 deletion examples/data_quality/simple/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"seasons_4",
"absenteeism_time_in_hours",
]
# To visualize do `pip install sf-hamilton[visualization]` if you want these to work
# To visualize do `pip install "sf-hamilton[visualization]"` if you want these to work
# dr.visualize_execution(output_columns, './my_dag.dot', {})
# dr.display_all_functions('./my_full_dag.dot')

Expand Down
2 changes: 1 addition & 1 deletion examples/data_quality/simple/run_dask.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
"seasons_4",
"absenteeism_time_in_hours",
]
# To visualize do `pip install sf-hamilton[visualization]` if you want these to work
# To visualize do `pip install "sf-hamilton[visualization]"` if you want these to work
# dr.visualize_execution(output_columns, './my_dag.dot', {})
# dr.display_all_functions('./my_full_dag.dot')

Expand Down
2 changes: 1 addition & 1 deletion examples/data_quality/simple/run_ray.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
"seasons_4",
"absenteeism_time_in_hours",
]
# To visualize do `pip install sf-hamilton[visualization]` if you want these to work
# To visualize do `pip install "sf-hamilton[visualization]"` if you want these to work
# dr.visualize_execution(output_columns, './my_dag.dot', {}, graphviz_kwargs=dict(graph_attr={'ratio': "1"}))
# dr.display_all_functions('./my_full_dag.dot')

Expand Down
2 changes: 1 addition & 1 deletion examples/data_quality/simple/run_spark.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
"absenteeism_time_in_hours",
"index_col",
]
# To visualize do `pip install sf-hamilton[visualization]` if you want these to work
# To visualize do `pip install "sf-hamilton[visualization]"` if you want these to work
# dr.visualize_execution(output_columns, './my_dag.dot', {})
# dr.display_all_functions('./my_full_dag.dot')

Expand Down
2 changes: 1 addition & 1 deletion examples/hello_world/my_notebook.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@
],
"source": [
"# Cell 5 - visualize execution\n",
"# To visualize do `pip install sf-hamilton[visualization]` if you want these to work\n",
"# To visualize do `pip install "sf-hamilton[visualization]"` if you want these to work\n",
"\n",
"# visualize all possible functions\n",
"dr.display_all_functions(None) # we pass None to not save the image to file."
Expand Down
2 changes: 1 addition & 1 deletion examples/hello_world/my_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@
df = dr.execute(output_columns)
print(df.to_string())

# To visualize do `pip install sf-hamilton[visualization]` if you want these to work
# To visualize do `pip install "sf-hamilton[visualization]"` if you want these to work
dr.visualize_execution(output_columns, "./my_dag.dot", {"format": "png"})
dr.display_all_functions("./my_full_dag.dot", {"format": "png"})
2 changes: 1 addition & 1 deletion examples/model_examples/scikit-learn/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def get_model_config(model_type: str) -> dict:
to my_train_evaluate_logic.
"""
dr = driver.Driver(dag_config, data_module, my_train_evaluate_logic, adapter=adapter)
# ensure you have done "pip install sf-hamilton[visualization]" for the following to work:
# ensure you have done "pip install "sf-hamilton[visualization]"" for the following to work:
# dr.visualize_execution(['classification_report', 'confusion_matrix', 'fit_clf'], './model_dag.dot', {})
results = dr.execute(["classification_report", "confusion_matrix", "fit_clf"])
for k, v in results.items():
Expand Down
2 changes: 1 addition & 1 deletion examples/polars/my_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@
df = dr.execute(output_columns)
print(df)

# To visualize do `pip install sf-hamilton[visualization]` if you want these to work
# To visualize do `pip install "sf-hamilton[visualization]"` if you want these to work
# dr.visualize_execution(output_columns, './my_dag.dot', {})
# dr.display_all_functions('./my_full_dag.dot')
2 changes: 1 addition & 1 deletion examples/ray/hello_world/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
]
# let's create the dataframe!
df = dr.execute(output_columns)
# To visualize do `pip install sf-hamilton[visualization]` if you want these to work
# To visualize do `pip install "sf-hamilton[visualization]"` if you want these to work
# dr.visualize_execution(output_columns, './my_dag.dot', {})
# dr.display_all_functions('./my_full_dag.dot')
print(df.to_string())
Expand Down
2 changes: 1 addition & 1 deletion examples/ray/hello_world/run_rayworkflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
]
# let's create the dataframe!
df = dr.execute(output_columns)
# To visualize do `pip install sf-hamilton[visualization]` if you want these to work
# To visualize do `pip install "sf-hamilton[visualization]"` if you want these to work
# dr.visualize_execution(output_columns, './my_dag.dot', {})
# dr.display_all_functions('./my_full_dag.dot')
print(df.to_string())
Expand Down
2 changes: 1 addition & 1 deletion examples/spark/hello_world/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
]
# let's create the dataframe!
df = dr.execute(output_columns)
# To visualize do `pip install sf-hamilton[visualization]` if you want these to work
# To visualize do `pip install "sf-hamilton[visualization]"` if you want these to work
# dr.visualize_execution(output_columns, './my_dag.dot', {})
# dr.display_all_functions('./my_full_dag.dot')
print(type(df))
Expand Down
4 changes: 2 additions & 2 deletions hamilton/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ def get_cycles(self, nodes: Set[node.Node], user_nodes: Set[node.Node]) -> List[
except ModuleNotFoundError:
logger.exception(
" networkx is required for detecting cycles in the function graph. Install it with:"
"\n\n pip install sf-hamilton[visualization] or pip install networkx \n\n"
'\n\n pip install "sf-hamilton[visualization]" or pip install networkx \n\n'
)
return False
digraph = create_networkx_graph(nodes, user_nodes, "Dependency Graph")
Expand Down Expand Up @@ -259,7 +259,7 @@ def display(
except ModuleNotFoundError:
logger.exception(
" graphviz is required for visualizing the function graph. Install it with:"
"\n\n pip install sf-hamilton[visualization] or pip install graphviz \n\n"
'\n\n pip install "sf-hamilton[visualization]" or pip install graphviz \n\n'
)
return
if graphviz_kwargs is None:
Expand Down