ProtoLife / daptics-api

API documentation and clients for the daptics.ai design of experiments engine
https://daptics.ai
GNU General Public License v3.0
1 stars 1 forks source link

bug: Cannot query field "gen" on type "Task" #28

Closed nhpackard closed 3 years ago

nhpackard commented 3 years ago

Trying to run 06_AutomationWorkflow.ipynb

Seems to login fine, create session ok, but then has a problem finding gen.

NB: the input files input/experimental_space.csv and input/experiments.csv are correctly generated.

Creating the session Automated Workflow 20210429-114322.
Creating the experimental space. This may take a minute or more.
---------------------------------------------------------------------------
GraphQLError                              Traceback (most recent call last)
<ipython-input-2-e69e0a7afe29> in <module>
     42 # each experimental input parameter, and set other meta-parameters,
     43 # to completely initialize the Daptics engine for this campaign.
---> 44 daptics.put_experimental_parameters_csv(csv_space_file, space_params)
     45 
     46 # Because the `auto_task_timeout` option was set, the Python script

~/Projects/daptics-api/python_client/daptics_client/daptics_client.py in put_experimental_parameters_csv(self, fname, params)
   1590             param_rows = [r for r in reader]
   1591         params['space']['table'] = {'data': param_rows}
-> 1592         return self.put_experimental_parameters(params)
   1593 
   1594     def get_experiments(self, design_only=False, gen=None):

~/Projects/daptics-api/python_client/daptics_client/daptics_client.py in put_experimental_parameters(self, params)
   1480             task_id = data['putExperimentalParameters']['taskId']
   1481             self.task_info[task_id] = data['putExperimentalParameters']
-> 1482             auto_task = self._auto_task()
   1483             if auto_task is not None:
   1484                 return {'putExperimentalParameters': auto_task}

~/Projects/daptics-api/python_client/daptics_client/daptics_client.py in _auto_task(self, timeout_override)
   2662 
   2663         data, errors = self.wait_for_current_task(
-> 2664             task_type=None, timeout=timeout)
   2665         self._raise_exception_on_error(data, errors)
   2666 

~/Projects/daptics-api/python_client/daptics_client/daptics_client.py in wait_for_current_task(self, task_type, timeout)
   2611         retry = 0
   2612         while True:
-> 2613             data, errors = self.poll_for_current_task(task_type)
   2614             if data and 'currentTask' in data and data['currentTask'] is not None:
   2615                 status = data['currentTask']['status']

~/Projects/daptics-api/python_client/daptics_client/daptics_client.py in poll_for_current_task(self, task_type)
   2506         """)
   2507 
-> 2508         data, errors = self.call_api(doc, vars)
   2509         if data and 'currentTask' in data and data['currentTask'] is not None:
   2510             if 'status' in data['currentTask'] and 'type' in data['currentTask']:

~/Projects/daptics-api/python_client/daptics_client/daptics_client.py in call_api(self, document, vars, timeout)
    701 
    702         if self.gql.schema:
--> 703             self.gql.validate(document)
    704 
    705         try:

~/.pyenv/versions/3.7.2/lib/python3.7/site-packages/gql/client.py in validate(self, document)
     42         validation_errors = validate(self.schema, document)
     43         if validation_errors:
---> 44             raise validation_errors[0]
     45 
     46     def execute(self, document, *args, **kwargs):

GraphQLError: Cannot query field "gen" on type "Task".
pzingg commented 3 years ago

The no "gen" on type "Task" error is because of this:

fragment TaskFragment on Task {
    sessionId taskId type description status gen startedAt progress {
        phase message
    }