mlem icon indicating copy to clipboard operation
mlem copied to clipboard

Add -c help WIP

Open mike0sv opened this issue 2 years ago • 10 comments

I was investigating how we can add help to -c options. I was able to do this (but in a bit nasty way) You can check it out with mlem declare2 env docker --help. Should work with other mlem declare2 commands. I didnt add field types, defaults and support for complex/nested objects yet cc @aguschin @jorgeorpinel @omesser

close https://github.com/iterative/mlem/issues/214 close https://github.com/iterative/mlem/issues/233

mike0sv avatar Jul 25 '22 23:07 mike0sv

I guess this is related to https://github.com/iterative/mlem/issues/233 ? If so cc @dberenbaum

I'm not sure I'm getting this mlem declare2 syntax TBH. Maybe a bit more explanation or quick demo in the PR description?

jorgeorpinel avatar Aug 02 '22 22:08 jorgeorpinel

Some examples: mlem declare --help image mlem declare env --help image mlem declare env docker --help image

mike0sv avatar Aug 08 '22 07:08 mike0sv

Now it looks like this image

mike0sv avatar Aug 09 '22 08:08 mike0sv

Made less dirty and added for other commands image image

This breaks backward compatibility for some of them because of rearranged arguments (mlem serve model type -> mlem serve type model) Also we'll need to fill all docstrings for classes and their fields Also iterative/mlem#351 is still an issue as well as this: some models has __root__ field and we need to handle this

mike0sv avatar Aug 09 '22 15:08 mike0sv

Just a comment: I see --conf was left there. Now we can remove it, I suppose?

aguschin avatar Aug 10 '22 13:08 aguschin

Left it for 1) backward compatibility 2) not sure all field names can be safely translated into option names

mike0sv avatar Aug 16 '22 12:08 mike0sv

Codecov Report

:exclamation: No coverage uploaded for pull request base (release/0.3.0@5cef637). Click here to learn what that means. Patch has no changes to coverable lines.

Additional details and impacted files
@@               Coverage Diff                @@
##             release/0.3.0     #363   +/-   ##
================================================
  Coverage                 ?   90.59%           
================================================
  Files                    ?       82           
  Lines                    ?     6856           
  Branches                 ?        0           
================================================
  Hits                     ?     6211           
  Misses                   ?      645           
  Partials                 ?        0           

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

codecov[bot] avatar Aug 16 '22 18:08 codecov[bot]

Don't you think it will confuse users to have two places to specify those?

Left it for 1) backward compatibility

I won't worry much about backward compatibility since we're breaking it anyway.

not sure all field names can be safely translated into option names

Should we write tests for it? To make sure all options are translated properly (didn't check if you did that already).

aguschin avatar Aug 17 '22 12:08 aguschin

I've installed this and checked it out. At the first glance, looks good. Great job, @mike0sv! I'll try it out more thoroughly tomorrow.

@jorgeorpinel, @dberenbaum, I invited you to MLEM Demo this week, @mike0sv will showcase this there. We'll have a record in case you won't be available, but waiting on your feedback here as well.

aguschin avatar Aug 17 '22 12:08 aguschin

also closes iterative/mlem#351

mike0sv avatar Aug 21 '22 20:08 mike0sv

@jorgeorpinel we kinda need to merge this to unblock other PRs, I will address your feedback in a separate PR though

mike0sv avatar Sep 08 '22 22:09 mike0sv

need to merge this to unblock other PRs

Sure! Didn't mean to block. I noticed the PR was approved but sometimes there's still other feedback that can def. wait or be rejected. Up to you!

jorgeorpinel avatar Sep 13 '22 02:09 jorgeorpinel