Closed idoby closed 2 years ago
Hi @lebrice, I'm building an experiment automation library for ML and I'm using your library to pull args from the command line in a typesafe way. Great library, just missing a couple of things, which I want to add.
Thanks
Hi, my project is not open source yet, it's too fresh for that yet. The first thing I want to add is the ability to parse polymorphic data classes from the command line, but this will be tricky...
Merging this now, thanks for your contribution!
Just out of curiosity, what do you mean by "parse polymorphic data classes"?
Thanks for the merge, mate!
I mean getting something like this from the command line in a typesafe way:
@dataclass
class Base:
num1: int = 5
@dataclass
class Derived1(Base):
num_specific_to_this_class: float = 7.5
class Derived2(Base):
...
This isn't hard at all though! It's already supported with Simple-Parsing. Depending on what you want to do, subparsers might be the best way to go about this. Let me know if you have any issues with this.
Hi @lebrice It seems like both features I added (this and #124) got marked as deprecated. Do you intend to remove them? Why? In that case, I will need to find an alternative to SP or fork it.
Hey @idoby , If I'm being honest, I don't remember why exactly I marked those as deprecated. I'm not thinking of removing them anytime soon.
Feel free to fork the repo if you want, but I don't intend to remove those without good reason.
Add ability to pass a dictionary as the default value for a dataclass argument, with support for only some fields being provided a default value.