-
I have a class that takes an argument which is a tuple of datetime objects:
And was wondering if something like this is possible:
To then run
So far I cannot get it to work, but would appreciate any pointers how one could go about this. Thanks! |
Beta Was this translation helpful? Give feedback.
Answered by
Jasha10
Sep 20, 2023
Replies: 1 comment 1 reply
-
@nilsleh yes, this is possible using my_class:
_target_: myApp.MyClass
time_range:
- _target_: datetime.datetime.strptime
_args_:
- "2020-01-01"
- "%Y-%m-%d"
- _target_: datetime.datetime.strptime
_args_:
- "2020-05-01"
- "%Y-%m-%d" Docs on |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
nilsleh
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@nilsleh yes, this is possible using
_args_
to pass positional arguments todatetime.datetime.strptime
:Docs on
_args_
: https://hydra.cc/docs/advanced/instantiate_objects/overview/