mtzgroup / chemcloud-client

Python client for TeraChem Cloud
MIT License
11 stars 3 forks source link

Internal server error when computing a list of bad inputs #45

Closed jandestrada closed 1 year ago

jandestrada commented 1 year ago

When computing program inputs, if a single 'bad' input is given, a useful error message is returned. But if a list of 'bad' inputs is given, an internal server error happens.


from qcio import Molecule, ProgramInput, SinglePointOutput

from chemcloud import CCClient

d = {'extras': {},
 'symbols': ['O', 'H', 'H'],
 'geometry': [[1.6549551458827496, -0.26127151435405793, 0.03492994026370258],
  [3.727615759920517, -0.1065896331640286, 0.06743299776432625],
  [1.113082998114264, 1.7026627531267413, 0.44760832206429835]],
 'charge': 0,
 'multiplicity': 1,
 'identifiers': {'extras': {},
  'name_IUPAC': None,
  'name_common': None,
  'smiles': None,
  'inchi': None,
  'inchikey': None,
  'canonical_explicit_hydrogen_smiles': None,
  'canonical_isomeric_explicit_hydrogen_mapped_smiles': None,
  'canonical_isomeric_explicit_hydrogen_smiles': None,
  'canonical_isomeric_smiles': None,
  'canonical_smiles': None,
  'pubchem_cid': None,
  'pubchem_sid': None,
  'pubchem_conformerid': None},
 'connectivity': []}

water = Molecule(**d)

client = CCClient()

prog_inp_good = ProgramInput(
    molecule=water,
    model={"method": "b3lyp", "basis": "6-31g"},
    calctype="gradient",
    keywords={},
)

prog_inp_bad = ProgramInput(
    molecule=water,
    model={"method": "b3lyp", "basis": "I am bad"},
    calctype="gradient",
    keywords={},
)

list_of_bad_inputs = [prog_inp_bad for i in range(4)]

#### this works perfectly and returns a result
future_result = client.compute("psi4", prog_inp_good, collect_files=True)
output: SinglePointOutput = future_result.get()
# SinglePointOutput object containing all returned data
# print(output.stdout)
# print(output)
# # The energy value requested
# print(output.return_result)
# print(output.files.keys())

#### this works perfectly and returns a useful error message
future_result = client.compute("psi4", prog_inp_bad, collect_files=True)
output: SinglePointOutput = future_result.get()
# SinglePointOutput object containing all returned data
# print(output.stdout)
# print(output)
# # The energy value requested
# print(output.return_result)
# print(output.files.keys())

#### this does not work and returns an internal server error
future_result = client.compute("psi4", list_of_bad_inputs, collect_files=True)
output: SinglePointOutput = future_result.get()
# SinglePointOutput object containing all returned data
print(output.stdout)
print(output)
# The energy value requested
print(output.return_result)
print(output.files.keys())
coltonbh commented 1 year ago

@jandestrada, this is a perfect write up! Makes it so easy for me to reproduce and fix. Thanks! I'll take a look at this later today or this weekend :)

coltonbh commented 1 year ago

Closed by PR 87 on ChemCloud Server.

coltonbh commented 1 year ago

@jandestrada this has now been pushed to production. Issue now fixed. Thanks for the excellent write up. Keep 'em coming!