Added new incompressibles, cleaned the docs, and improved the log fitting procedures

This commit is contained in:
Jorrit Wronski
2014-09-22 19:47:47 +02:00
parent 10a817f9b5
commit 2591bdd056
103 changed files with 1840 additions and 654 deletions

View File

@@ -92,7 +92,7 @@ class BibTeXerClass(object):
return stripped
def getBibliography(self, keys=[], fmt="plaintext", style="unsrtalpha", enc=None, objects=False):
def getBibliography(self, keys=None, fmt="plaintext", style="unsrtalpha", enc=None, objects=False):
"""This function creates a formatted bibliography according to the
defined parameters using Pybtex.
Specify your desired output format using the \"fmt\" parameter. Supported
@@ -158,7 +158,16 @@ class BibTeXerClass(object):
} # How do we find the end of the label?
end_of_label = contents.index(label_table[fmt])
contents = contents[end_of_label+1:].strip()
contents = contents[end_of_label+len(label_table[fmt]):].strip()
if fmt=="latex":
contents = contents.replace(u"\\newblock ","")
elif fmt=="html":
contents = contents.replace(u"<dd>","")
contents = contents.replace(u"</dd>","")
contents = contents.replace(u"\n","")
return contents
@@ -166,43 +175,15 @@ class BibTeXerClass(object):
#getEntry(self, key, label=False, fmt="markdown", style="unsrtalpha", enc=None):
if __name__=='__main__':
B = BibTeXerClass()
B.loadLibrary('../../../Web/fluid_properties/Incompressibles.bib')
print(B.getEntry('Cesar2013'))
print(B.getEntry('Skovrup2013'))
print(B.getEntry('Therminol2014'))
# B = BibTeXerClass('../../../Web/fluid_properties/Incompressibles.bib')
# print("\nHTML:")
# print(B.entries2All(keys=['Skovrup2013'], output_backend='html'))
# print("\nMarkdown:")
# print(B.entries2All(keys=['Skovrup2013'], output_backend='markdown'))
# print("\nText:")
# print(B.entries2All(keys=['Skovrup2013'], output_backend='text'))
#
# B = BibTeXerClass('../../../CoolPropBibTeXLibrary.bib')
# print("\nHTML:")
# print(B.entries2All(keys=['Mulero-JPCRD-2012'], output_backend='html'))
# print("\nMarkdown:")
# print(B.entries2All(keys=['Mulero-JPCRD-2012'], output_backend='markdown'))
# print("\nText:")
# print(B.entries2All(keys=['Mulero-JPCRD-2012'], output_backend='text'))
#
#
# from pybtex.richtext import Text, Tag, Symbol, HRef
# from pybtex.backends.markdown import Backend
#
# link_href = HRef(
# 'http://www.test.test/directory/file.ext?para=in&sec=out', # URL
# 'testing links with href class'
# )
# tag_emph = Tag('emph', Text(u'Emph', Symbol('nbsp'), u'text'))
# unicode_text = Text(u'Л.:', Symbol('nbsp'), u'<<Химия>>')
# latex_text = Text(u'{\\aa}', Symbol(u'nbsp'), u'\\\'e')
# markd_text = Text(u'{ and & and *', Symbol(u'nbsp'), u'\\')
#
# for i in [link_href,tag_emph,unicode_text,latex_text,markd_text]:
# print(i.render(Backend()))
B = BibTeXerClass('../../../CoolPropBibTeXLibrary.bib')
print("\nLatex:")
print(B.getEntry(key='Mulero-JPCRD-2012', fmt='latex'))
print("\nHTML:")
print(B.getEntry(key='Mulero-JPCRD-2012', fmt='html'))
print("\nMarkdown:")
print(B.getEntry(key='Mulero-JPCRD-2012', fmt='markdown'))
print("\nText:")
print(B.getEntry(key='Mulero-JPCRD-2012', fmt='plaintext'))