Roy Kid
05/17/2024, 9:26 AM@save_to.pickle(path="pickle_entry_point.pkl")
def entry_point(freq: float, phase: float) -> np.ndarray:
return np.sin(freq * np.linspace(0, 2 * np.pi, 100) + phase)
According to the manual, I also need extra arguments output_name
, but when I add it, it raises an error: hamilton.function_modifiers.base.InvalidDecoratorException: Extra parameters for loader: <class 'hamilton.io.default_data_loaders.PickleSaver'> {'output_name'}. Choices for parameters are: dict_keys(['path'])
.
Also, I use a materializer, and I don't know how to "call" this save in dr. materialize... Can you help me fix it?Stefan Krawczyk
05/17/2024, 1:05 PMRoy Kid
05/17/2024, 1:08 PMoutput_name_
with underscore not output_name
!Stefan Krawczyk
05/17/2024, 1:08 PM@save_to.pickle(path="pickle_entry_point.pkl", output_name_="entry_point_pickle")
def entry_point(freq: float, phase: float) -> np.ndarray:
return np.sin(freq * np.linspace(0, 2 * np.pi, 100) + phase)
you’d request this as part of the additional_vars=["entry_point_pickle"]
if you are using .materialize()
Stefan Krawczyk
05/17/2024, 1:08 PMRoy Kid
05/17/2024, 1:10 PMpath
. Sorry for bothering you