From 502767bf421263cbd08795aafb0fafbbb86d3600 Mon Sep 17 00:00:00 2001 From: elijahbenizzy Date: Mon, 23 Sep 2024 09:15:39 -0700 Subject: [PATCH] Post-hoc feedback from #1145 --- examples/scikit-learn/species_distribution_modeling/README.md | 4 ++-- hamilton/function_modifiers/macros.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/scikit-learn/species_distribution_modeling/README.md b/examples/scikit-learn/species_distribution_modeling/README.md index 2bd0194f4..3734cb7a8 100644 --- a/examples/scikit-learn/species_distribution_modeling/README.md +++ b/examples/scikit-learn/species_distribution_modeling/README.md @@ -53,7 +53,7 @@ qux(baz(foo(bar))) ``` This can be particularly useful when: -1. Ensuring consi +1. Ensuring consistency between transforms/data processing steps across different nodes. 2. Re-using the same function on multiple nodes. For example, needing to do different pre-processing, but than passing data to the same `model`, aka feature engineering hyper-tuning. 3. We can also use `step(...).when(...)` and can choose at execution time which transformation will be applied to the output of a particular node. For example, each `step` represents a different `model` and we switch between them with a config dictionary in the Hamilton driver. @@ -70,7 +70,7 @@ so that it does not run when imported into other scripts. This script can be run as is for comparison. Actually the external functions `construct_grids()` and `create_species_bunch()` we will directly import and use as external functions to showcase how you can use our `pipe` and `pipe_output` functionality to "Hamiltonise" external modules. ## hamilton_notebook.ipynb -Is a nodebook that contains all the modules and has the execution cells to run the complete code. It also gives you the ability to visualize the DAG. +Is a notebook that contains all the modules and has the execution cells to run the complete code. It also gives you the ability to visualize the DAG. ## run.py If you prefer to run code through a shell the same code is also available as a python script. diff --git a/hamilton/function_modifiers/macros.py b/hamilton/function_modifiers/macros.py index 62abad7ed..00bf05689 100644 --- a/hamilton/function_modifiers/macros.py +++ b/hamilton/function_modifiers/macros.py @@ -905,7 +905,7 @@ def B(...): B1, takes the output of B1 applies to it B2 and then gets renamed to B to re-connect to the rest of the DAG. While it is generally reasonable to contain these constructs within a node's function, - you should consider `pipe_output` for similar reasons as `pipe`, namely, for any of the following reasons: + you should consider `pipe_output` for similar reasons as `pipe_input`, namely, for any of the following reasons: 1. You want the transformations to display as nodes in the DAG, with the possibility of storing or visualizing the result