I’m trying to use cryosparc-tools
to create and queue a new job, but it’s not working.
This is what I run:
cs = CryoSPARC(
license=csparc_license,
email=csparc_email,
password=csparc_password,
host=host,
base_port=base_port)
project = cs.find_project(config['project_options']['project_uid'])
workspace = project.create_workspace(config['project_options']['workspace_name'])
import_job = workspace.create_job(
type="import_movies",
params=config['preprocessing']['import_movies'] )
config
is a simple dictionary containing the job parameters. Regardless of whether I set the job parameters or not, I get the following error:
Traceback (most recent call last):
File "/home/ubuntu/repos/cryo_flows/basic_workflow.py", line 67, in <module>
main(parser.parse_args())
File "/home/ubuntu/repos/cryo_flows/basic_workflow.py", line 56, in main
preprocessing(cs, config)
File "/home/ubuntu/repos/cryo_flows/basic_workflow.py", line 41, in preprocessing
import_job = workspace.create_job(
File "/opt/conda/envs/pyem/lib/python3.9/site-packages/cryosparc/workspace.py", line 89, in create_job
return self.cs.create_job(
File "/opt/conda/envs/pyem/lib/python3.9/site-packages/cryosparc/tools.py", line 344, in create_job
job_uid: str = self.cli.create_new_job( # type: ignore
File "/opt/conda/envs/pyem/lib/python3.9/site-packages/cryosparc/command.py", line 112, in func
assert "error" not in res, f'Error for "{key}" with params {params}:\n' + format_server_error(res["error"])
AssertionError: Error for "create_new_job" with params {'job_type': 'import_movies', 'project_uid': 'P3', 'workspace_uid': 'W16', 'title': None, 'desc': None}:
ServerError: create_new_job() missing 1 required positional argument: 'created_by_user_id'
Traceback (most recent call last):
File "/home/ubuntu/cryosparc/cryosparc_master/cryosparc_command/commandcommon.py", line 200, in wrapper
res = func(*args, **kwargs)
File "/home/ubuntu/cryosparc/cryosparc_master/cryosparc_command/commandcommon.py", line 266, in wrapper
return func(*args, **kwargs)
TypeError: create_new_job() missing 1 required positional argument: 'created_by_user_id'
It does correctly find the project and generate a workspace that I can interact with in the web interface, but the job is obviously not created. I also get a very similar error if I try to create other jobs: I tried the homo_abinit
job as listed in the cryosparc-tools
documentation. I am running cryosparc v4.1.1.
Is this a bug?