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

Multiple Updates #14

Merged
merged 13 commits into from
Nov 27, 2017
Merged

Multiple Updates #14

merged 13 commits into from
Nov 27, 2017

Conversation

appukuttan-shailesh
Copy link
Collaborator

Multiple updates such as:

  • updates authentication process
  • adds helper methods to BaseClient
  • adds a utils.generate_report() method using above
  • updates requirements.txt in view of above
  • expands documentation
  • small fixes

@@ -60,7 +50,15 @@ class BaseClient(object):

def __init__(self, username,
password=None,
url=VALIDATION_FRAMEWORK_URL):
Copy link
Owner

Choose a reason for hiding this comment

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

I don't like this change. We need to be able to support different URLs and different client ids, for example when running a local development server, beyond the two cases here.

I suggest adding client_id as a keyword argument to the constructor, with a default value of the production server, and then have an optional config.json file in the project directory where you can read alternative values for the url and client id (could also be used for other project-level configuration, like a regex or glob expression for which output files get uploaded to storage).

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Resolved by introducing environment in d5ba824 and planned feature in #15

@@ -180,6 +194,59 @@ def _hbp_auth(self, username, password):
else:
raise Exception("Something went wrong. Status code {} from NMPI, expected 302".format(rNMPI1.status_code))

def _translate_URL_to_UUID(self, path):
Copy link
Owner

Choose a reason for hiding this comment

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

This method should be in the CollabDataStore class.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Will be done in #17

else:
raise Exception("The provided 'path' is invalid! Error: " + str(data))

def _download_resource(self, uuid):
Copy link
Owner

Choose a reason for hiding this comment

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

This method should be in the CollabDataStore class.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Will be done in #17

@@ -212,9 +279,10 @@ class TestLibrary(BaseClient):
password : string, optional
Your HBP Collaboratory password; advisable to not enter as plaintext.
If left empty, you would be prompted for password at run time (safer).
url : string, optional
Copy link
Owner

Choose a reason for hiding this comment

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

Same comment as above. We need to keep url field.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Resolved by introducing environment in d5ba824 and planned feature in #15

@@ -20,7 +21,8 @@
from datetime import datetime
from . import TestLibrary, ModelCatalog
from .datastores import CollabDataStore

from fpdf import FPDF
Copy link
Owner

Choose a reason for hiding this comment

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

I suggest making these dependencies optional, i.e. generate_report() produces an error message saying "Please install these packages ...." if they are not installed.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Will be done in #18

@apdavison apdavison merged commit a9f0acb into apdavison:master Nov 27, 2017
apdavison added a commit that referenced this pull request Apr 17, 2018
Two Fixes: Boolean as String changed; Valid values dict removed from API calls
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