Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--verbose flag added to CLI #234

Merged
merged 5 commits into from
Oct 28, 2024
Merged

--verbose flag added to CLI #234

merged 5 commits into from
Oct 28, 2024

Conversation

sadrasabouri
Copy link
Collaborator

What does this implement/fix? Explain your changes.

--verbose flag added to Samila CLI

@sadrasabouri sadrasabouri added the enhancement New feature or request label Oct 15, 2024
@sadrasabouri sadrasabouri added this to the samila v1.4 milestone Oct 15, 2024
@sadrasabouri sadrasabouri self-assigned this Oct 15, 2024
Copy link

codecov bot commented Oct 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.45%. Comparing base (fab5b96) to head (3024b3e).
Report is 1 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev     #234      +/-   ##
==========================================
+ Coverage   99.44%   99.45%   +0.01%     
==========================================
  Files           4        4              
  Lines         709      718       +9     
  Branches      108      108              
==========================================
+ Hits          705      714       +9     
  Misses          2        2              
  Partials        2        2              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -76,13 +88,17 @@ def main():
data=args.load_data,
config=args.load_config,
)
if args.verbose:
print("[LOG] GenerativeImage object created.")
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move all messages to params.py

gi.save_image(args.save_image, args.depth)
result = gi.save_image(args.save_image, args.depth)
if args.verbose:
print("[LOG] Image save. Result: ", result)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saved

gi.save_data(args.save_data)
result = gi.save_data(args.save_data)
if args.verbose:
print("[LOG] Data save. Result: ", result)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saved

gi.save_config(args.save_config)
result= gi.save_config(args.save_config)
if args.verbose:
print("[LOG] Config save. Result: ", result)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saved

if not args.no_display:
plt.show()

if args.save_image:
gi.save_image(args.save_image, args.depth)
result = gi.save_image(args.save_image, args.depth)
if args.verbose:
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For all three saving sections (image, data, and config), we should check result["status"] and print different messages.

For example:

  1. Success
    "[LOG] Image saved. File address: ", result["message"])

  2. Failed
    "[ERROR] Image not saved. Message: ", result["message"])

Copy link
Owner

@sepandhaghighi sepandhaghighi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀

@sepandhaghighi sepandhaghighi merged commit b5b811d into dev Oct 28, 2024
17 of 18 checks passed
@sepandhaghighi sepandhaghighi deleted the cli-verbose branch October 28, 2024 07:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants