-
Notifications
You must be signed in to change notification settings - Fork 114
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
Add parser for glass transition temperature #13
Conversation
…ditions to extract melting point using Tm.
I got this when I run pytest: |
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.
Looks great, thanks!
@@ -460,6 +469,9 @@ def merge_contextual(self, other): | |||
for item in self[k]: | |||
# print('item: %s' % item) | |||
for other_item in other.get(k, []): | |||
#RBT Problem with doi: ma301230y. Had to add following check | |||
if (isinstance(other_item,unicode) == True): | |||
continue |
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.
Seems this problem occurs when it is attempted to merge the 'contextual' information from a compound record into another one, but the 'contextual' record also happens to contain a name/label/role. This can happen when merging in information from table footnotes or caption - the idea is to merge e.g. a solvent into the property in the table cell that references it. But sometimes there is an actual compound named in the footnote. This fix seems to work well - just ignoring the string-based properties - which are name/label/role. However, unicode
is python 2 only - this needs to be six.text_type
for python 2 and 3 compatibility. In future, this whole merge_contextual
method needs refactoring to be more agnostic of the model schema.
c.quantum_yields = [QuantumYield(**context)] | ||
c.fluorescence_lifetimes = [FluorescenceLifetime(**context)] | ||
c.electrochemical_potentials = [ElectrochemicalPotential(**context)] | ||
c.uvvis_spectra = [UvvisSpectrum(**context)] |
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.
Good catch on the missing **
- I forgot to update this when I changed the model objects to accept keyword arguments rather than a single dictionary. The **
unpacks the context
dict to be the equivalent of kwargs like solvent='acetonitrile
etc.
Thanks Matt!!!! I'm really glad to have participated!
…On Thu, Feb 2, 2017 at 4:30 PM, Matt Swain ***@***.***> wrote:
Merged #13 <#13>.
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#13 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ADfma554VxsbuqfkGAYS-zwPcMIMp3dKks5rYlkHgaJpZM4LtGsL>
.
|
…ditions to extract melting point using Tm.