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

Plugins revamp #134

Merged
merged 8 commits into from
Oct 29, 2019
Merged

Plugins revamp #134

merged 8 commits into from
Oct 29, 2019

Conversation

hhsecond
Copy link
Member

Motivation and Context

Revamping plugin system to make at actually pluggable for different data types etc.

Description

  • Introducing new io module. This will help users to use the import/export functionality of plugins through the program if they don't wan't to interact with the low-level hangar APIs
  • We potentially can move other modules like dataset inside io module
  • Test cases are work in progress
  • Docs are work in progress

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.

@hhsecond hhsecond added the WIP Don't merge; Work in Progress label Oct 11, 2019
@hhsecond hhsecond requested a review from rlizzo October 11, 2019 11:45
@hhsecond
Copy link
Member Author

@rlizzo There will be few more minute changes but it's in a good shape now to review especially because of the introduction of io module

@rlizzo
Copy link
Member

rlizzo commented Oct 11, 2019

Ok. I'd like to merge the changes in #130 before this, since they did a big overhaul of the test suit to simplify it's fixture setup (improving speeds in most cases)

@hhsecond
Copy link
Member Author

Make sense. I'll finish my review soon

@rlizzo
Copy link
Member

rlizzo commented Oct 11, 2019

Thanks!

@rlizzo
Copy link
Member

rlizzo commented Oct 15, 2019

Hey @hhsecond lets connect about these changes on a call. I don't think I agree with moving to io directory to top level of src/hangar. Will get into the details over a vid chat.

@hhsecond
Copy link
Member Author

Sure thing. I was reluctant too about it initially but then realized few reasons why should we do it. Let's talk

@codecov
Copy link

codecov bot commented Oct 18, 2019

Codecov Report

Merging #134 into master will increase coverage by 0.15%.
The diff coverage is 78.74%.

@@            Coverage Diff             @@
##           master     #134      +/-   ##
==========================================
+ Coverage      95%   95.15%   +0.15%     
==========================================
  Files          63       61       -2     
  Lines       11203    11189      -14     
  Branches      998      968      -30     
==========================================
+ Hits        10643    10646       +3     
+ Misses        372      363       -9     
+ Partials      188      180       -8
Impacted Files Coverage Δ
src/hangar/constants.py 100% <ø> (ø) ⬆️
tests/conftest.py 100% <ø> (ø) ⬆️
tests/test_cli.py 99.57% <100%> (-0.43%) ⬇️
tests/test_arrayset.py 100% <100%> (ø) ⬆️
src/hangar/external/__init__.py 100% <100%> (ø)
src/hangar/cli/utils.py 41.67% <41.67%> (ø)
src/hangar/external/base_plugin.py 62.5% <62.5%> (ø)
src/hangar/external/_external.py 68.42% <68.42%> (ø)
src/hangar/external/plugin_manager.py 75.61% <75.61%> (ø)
src/hangar/cli/cli.py 89.52% <94.05%> (+4.5%) ⬆️
... and 10 more

Copy link
Member

@rlizzo rlizzo left a comment

Choose a reason for hiding this comment

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

So i'm a bit baffled by the control flow here. There's some nice ideas (the cli changes seem to be really solid), but the manage_plugins.py file is a mess. Can you walk me through how exactaly plugins are discovered, loaded, and executed?

src/hangar/cli/utils.py Outdated Show resolved Hide resolved
src/hangar/external/manage_plugins.py Outdated Show resolved Hide resolved
src/hangar/external/manage_plugins.py Outdated Show resolved Hide resolved
src/hangar/external/manage_plugins.py Outdated Show resolved Hide resolved
src/hangar/external/manage_plugins.py Outdated Show resolved Hide resolved
src/hangar/external/manage_plugins.py Outdated Show resolved Hide resolved
src/hangar/external/preferred_plugins.ini Outdated Show resolved Hide resolved
tests/test_external.py Outdated Show resolved Hide resolved
@elistevens
Copy link

What's the actual use case for plugins? I'm worried it's a lot of complexity and API surface area for benefit that isn't super clear from the outside.

@hhsecond
Copy link
Member Author

@elistevens comment here #134 (comment) should give you more info. Lemme know what do you think

@elistevens
Copy link

elistevens commented Oct 19, 2019 via email

Copy link
Member

@rlizzo rlizzo left a comment

Choose a reason for hiding this comment

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

Overall this is a really good design. There's a few things to clean up, but I really like this! Nice Job!

src/hangar/external/_external.py Outdated Show resolved Hide resolved
src/hangar/external/base_plugin.py Show resolved Hide resolved
src/hangar/external/plugin_manager.py Outdated Show resolved Hide resolved
src/hangar/external/plugin_manager.py Show resolved Hide resolved
tests/test_cli.py Outdated Show resolved Hide resolved
tests/test_cli.py Outdated Show resolved Hide resolved
tests/test_cli.py Outdated Show resolved Hide resolved
src/hangar/cli/cli.py Outdated Show resolved Hide resolved
src/hangar/cli/cli.py Outdated Show resolved Hide resolved
src/hangar/cli/cli.py Outdated Show resolved Hide resolved
@hhsecond hhsecond added Awaiting Review Author has determined PR changes area nearly complete and ready for formal review. and removed WIP Don't merge; Work in Progress labels Oct 25, 2019
setup.py Outdated Show resolved Hide resolved
src/hangar/cli/cli.py Outdated Show resolved Hide resolved
src/hangar/cli/cli.py Outdated Show resolved Hide resolved
src/hangar/cli/cli.py Outdated Show resolved Hide resolved
src/hangar/cli/cli.py Outdated Show resolved Hide resolved
src/hangar/cli/cli.py Outdated Show resolved Hide resolved
Copy link
Member

@rlizzo rlizzo left a comment

Choose a reason for hiding this comment

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

These and my previous single comments need to be changed. There are some serious errors and code smells in the cli methods, the tests need to be much more thorough, since they seem to have missed some really big issues.

src/hangar/cli/cli.py Outdated Show resolved Hide resolved
src/hangar/cli/cli.py Outdated Show resolved Hide resolved
src/hangar/cli/cli.py Outdated Show resolved Hide resolved
Copy link
Member

@rlizzo rlizzo left a comment

Choose a reason for hiding this comment

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

This looks good to me. when the ci suite run's i'll merge!

@rlizzo rlizzo merged commit f4881b8 into tensorwerk:master Oct 29, 2019
@hhsecond hhsecond deleted the plugins branch October 30, 2019 04:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Review Author has determined PR changes area nearly complete and ready for formal review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants