Closed Henning742 closed 10 months ago
While the syntax youre're using is more concise, we believe that this breaks from standard convention. Tap
currently supports similar functionality with process_args
:
class MyTap(Tap):
exp_name: str = 'your_exp_name'
exp_dir: str | None = None
def process_args(self):
if self.exp_dir is None:
self.exp_dir = f'work_dirs/{self.exp_name}'
This allows the user to optionally pass exp_dir
from the command line and if no exp_dir
is specified, return f'work_dirs/{self.exp_name}'
--JK
Not a professional coder so I don't know if this suggestion is good.
What I want to accomplish: Say there're two arguments:
then the second line means its default value is using the value of 'exp_name'.
This is my implementation:
Any comment is appreciated, thank you.