News for hackers. Stuff that matters.
Re:Python Fire – Generates CLIs from any Python object by vultour on Friday August 17, 2018 @05:40PM (#17785699)
The builtin argparse module is also really easy to use for simple stuff.
Re:Python Fire – Generates CLIs from any Python object by m_ke on Friday August 17, 2018 @05:52PM (#17785740)
It's ok but for some scripts it ends up being half of the code and you end up with a script that's dealing with an opaque args object.

Here's a decent example of this https://github.com/pytorch/examples/blob/master/imagenet/mai...

Re:Python Fire – Generates CLIs from any Python object by heavenlyblue on Friday August 17, 2018 @06:06PM (#17785795)
Could you solve ghat with click much easier? This seems mostly related to various flags set up, which would need to exist in the code anyway.
Re:Python Fire – Generates CLIs from any Python object by m_ke on Friday August 17, 2018 @06:26PM (#17785869)
I'm saying that this should really be a function like

    def train(
      data: File,
      arch='resnet18',
      workers=4,
      epochs=90,
      start_epoch=0,
      batch_size=256,
      learning_rate=0.9,
      momentum=1e-4,
  ):
    ...

that could be exposed as a cli if __name__ is main but otherwise can be imported in a notebook or another script.