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

Import export in CLI #103

Merged
merged 6 commits into from
Sep 6, 2019
Merged

Import export in CLI #103

merged 6 commits into from
Sep 6, 2019

Conversation

hhsecond
Copy link
Member

@hhsecond hhsecond commented Aug 6, 2019

Motivation and Context

Why is this change required? What problem does it solve?:

Introducing import-export utility over the command line

If it fixes an open issue, please link to the issue here:

This PR won't solve issue #72 completely but starting with image import and export. Also, the release is going to be experimental and the APIs are subjective to change

Description

Describe your changes in detail:

  • Moving CLI as a module
  • Introducing import option using click
  • Introducing export option using click
  • Base class for the introduction of plugin system

Types of changes

What types of changes does your code introduce? Put an x in all the boxes that apply:

  • Documentation update
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Is this PR ready for review, or a work in progress?

  • Ready for review
  • Work in progress

How Has This Been Tested?

Put an x in the boxes that apply:

  • Current tests cover modifications made
  • New tests have been added to the test suite
  • Modifications were made to existing tests to support these changes
  • Tests may be needed, but they are not included when the PR was proposed
  • I don't know. Help!

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have signed (or will sign when prompted) the tensorwork CLA.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@rlizzo
Copy link
Member

rlizzo commented Aug 6, 2019

Hey @hhsecond I took the code you started on and did a massive overhaul of it. Basically took heavy inspiration from scikit-image's plugin infrastructure and utility. The interface needs to be cleaned up a bit still, and we need tests, but both importing and exporting works!

Let me know what you think!

@hhsecond
Copy link
Member Author

hhsecond commented Aug 7, 2019

@rlizzo Wow! that's indeed massive. Are we pushing this in 0.2? I was thinking of a basic stable interface which we could push into 0.2

@rlizzo
Copy link
Member

rlizzo commented Aug 7, 2019

Why don't we push it to 0.3? We can make that a quick release.

If we're going to put it in 0.2 I'd rather not include a plugin the system (which we haven't had time to thoroughly review and test.) I suppose we could just hard code pillow is a dependency and only allow the file types that it could support. That would serve as a decent proof-of-concept?

What are your thoughts? Should we put a limited version in 0.2? Or just push it all to 0.3? (It'll be a short turn around time for that release)

@hhsecond
Copy link
Member Author

hhsecond commented Aug 7, 2019

@rlizzo do you wanna go back to my last commit and push that for 0.2
It has exactly this. Only pillow loader nothing else. Then we can keep your updates for 0.3?

@codecov
Copy link

codecov bot commented Aug 19, 2019

Codecov Report

Merging #103 into master will decrease coverage by 0.38%.
The diff coverage is 86.84%.

@@            Coverage Diff             @@
##           master     #103      +/-   ##
==========================================
- Coverage   92.54%   92.16%   -0.38%     
==========================================
  Files          51       59       +8     
  Lines        9448     9858     +410     
  Branches      930      990      +60     
==========================================
+ Hits         8743     9085     +342     
- Misses        511      561      +50     
- Partials      194      212      +18
Impacted Files Coverage Δ
src/hangar/remote/config.py 70.37% <ø> (+0.81%) ⬆️
tests/test_cli.py 100% <100%> (ø) ⬆️
tests/test_cli_plugin.py 100% <100%> (ø)
src/hangar/cli/__init__.py 100% <100%> (ø)
src/hangar/repository.py 96.52% <100%> (+6.92%) ⬆️
tests/test_cli_io.py 100% <100%> (ø)
src/hangar/cli/io/__init__.py 100% <100%> (ø)
src/hangar/cli/io/_io.py 50% <50%> (ø)
src/hangar/cli/io/_plugins/pil_plugin.py 50% <50%> (ø)
src/hangar/cli/io/_plugins/matplotlib_plugin.py 81.82% <81.82%> (ø)
... and 16 more

@rlizzo
Copy link
Member

rlizzo commented Sep 5, 2019

Hey @hhsecond can you give this a review? The tests are passing now (even though a few more are needed) and the quality is close to where I'm OK with it for the time being.

Copy link
Member Author

@hhsecond hhsecond left a comment

Choose a reason for hiding this comment

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

Overall looks good. I would say we need a PluginManager class eventually instead of several functions and few global containers floating around. What do you think?

src/hangar/cli/cli.py Show resolved Hide resolved
src/hangar/cli/io/manage_plugins.py Show resolved Hide resolved
src/hangar/cli/io/manage_plugins.py Show resolved Hide resolved
@rlizzo
Copy link
Member

rlizzo commented Sep 6, 2019

Ok. Going to merge this now.

@rlizzo rlizzo merged commit 15884b4 into tensorwerk:master Sep 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants