-
Notifications
You must be signed in to change notification settings - Fork 10
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
Update database.py #257
Update database.py #257
Conversation
Include additional search method for pulling data from materials project
@matthewcarbone |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests are failing because of permissions not because I think the code necessarily has a problem.
Can you make sure this passes some of the checks by running the tests locally? There are a ton of them so feel free to just run the tests for a few minutes. There are clearly bugs here that will probably break the tests so that's just a nice sanity check.
Thanks!
Code modified with context manager
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
context manager included
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would also be great to put an example of how this new method can be used in the docstring (which definitely needs some tlc and that's my bad).
lightshow/database.py
Outdated
method = _get_method(kwargs.get("method"), mpr=mpr) | ||
try: | ||
kwargs.pop("method") | ||
else: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be except KeyError
not else
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
solved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@aakhiltayal it needs except KeyError
not except
. A bare except statement is dangerous because it catches everything!
Updated doc string
|
I agree please feel free to modify the code as you fit good. |
@aakhiltayal this definitely needs an example somewhere. From your updated docstring I'm still not exactly sure how you plan on using this! Can you post a code snippet on how you do it here? I can then merge this and make some quick corrections myself after. |
Include additional search method for pulling data from materials project