Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
'''how much?'''
amount = 30
'''what is the unit?'''
unit = [
# 'g',
# 'mg',
# 'ug',
# 'mol',
# 'mmol',
'umol',
]
from pythoms.classes import Molecule
mol = Molecule(formula,
dropmethod='threshold',
)
if len(unit) > 1:
raise ValueError('only one unit may be specified')
if unit[0].startswith('m'): # milli
if unit[0][1] != 'o':
order = 3
else: # if 'mol'
order = 0
elif unit[0].startswith('u'): # micro
order = 6
else: # standard
order = 0
amount = float(amount) # make sure it's a float
kwargs = {
'dropmethod': 'threshold'
}
Ar = 'Ar+'
X = 'I'
arunit = 'C6H4'
cap = 'Ph'
n = 6
print(Ar)
print('aromatic units')
print('n\tmass')
for i in range(1, n):
print('%d\t%.2f' % (i, Molecule(Ar + (arunit * i) + X, **kwargs).em))
print('\nPd units')
print('n\tmass')
for i in range(1, n):
print('%d\t%.2f' % (i, Molecule('L2Pd' + Ar + (arunit * i) + X, **kwargs).em))
print('\ncapped')
print('n\tmass')
for i in range(0, n + 3):
print('%d\t%.2f' % (i, Molecule(cap + Ar + (arunit * i), **kwargs).em))