Dear cryoSPARC team,
I am happily working my way through the workflow example using the cryosparc_tools API. Most of the functions work and I was able to submit a workflow-tree of jobs.
I came across an error when trying to interact with a Job-object as described in the custom-workflow.ipynb.
Here my simple test case for a “Manual Curate Exposure”-type job “J133” in project “P80”.
The job was created and submitted to the lane in the front-end.
So the job is existing, but the method “.interact()” is not available.
data = j133.interact("get_fields_and_thresholds")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'Job' object has no attribute 'interact'
I had the same error of “interact” not being an attribute when creating the job via the API.
I am using cryosparc 4.2.0 and cryosparc_tools 4.2.0.
I found that when installing cryosparc_tools via pip the interact method is not present in the job.py module. Could it be that the pip command is not using the latest GitHub version?
Thanks for your help in advance.
Very likely you have encountered a feature that is present in the latest github comments, but not yet present in the current pip-installable release of cryosparc-tools. A new release of cryosparc-tools will become available soon.
Thanks. I did it and installed the latest cryosparc-tools version (develop, commit 1b99aab224).
The interact() job is working now, but I get an error for the job creation now.
The “desc” argument on make_job is unexpected.
When switching between cryosparc-tools version I can create a job (PIP version) and interact with it (develop version). But I should be possible to do it in the same version, right?
I would assume that cryosparc-tools (develop) is using some newer/additional arguments that require cryosparc 4.2.1. Since we are running on 4.2.0 I will update to 4.2.1 soon and test again.
Can I assume that cryosparc-tools will always be build for the latest stable cryosparc version, so 4.2.1 right now?
Thanks
Ferdinand
Error log
>>> python cs_dev_test.py
Connection to CryoSPARC was established successfully.
Starting CTF curation
Traceback (most recent call last):
File "/xxx/xxx/cs_dev_test.py", line 26, in <module>
curate_exposures_job = workspace.create_job(
File "/xxx/xxx/software/cryosparc-tools/cryosparc/workspace.py", line 99, in create_job
return self.cs.create_job(
File "/xxx/xxx/software/cryosparc-tools/cryosparc/tools.py", line 358, in create_job
job_uid: str = self.cli.make_job( # type: ignore
File "/xxx/xxx/software/cryosparc-tools/cryosparc/command.py", line 113, in func
assert "error" not in res, f'Error for "{key}" with params {params}:\n' + format_server_error(res["error"])
AssertionError: Error for "make_job" with params {'job_type': 'curate_exposures_v2', 'project_uid': 'P80', 'workspace_uid': 'W2', 'user_id': '647deb8a28a8c92e11734fc0', 'title': None, 'desc': None, 'params': {}, 'input_group_connects': {'exposures': ['J135.exposures']}}:
ServerError: make_job() got an unexpected keyword argument 'desc'
Traceback (most recent call last):
File "/opt/cryosparc/cryosparc_master/cryosparc_command/commandcommon.py", line 200, in wrapper
res = func(*args, **kwargs)
File "/opt/cryosparc/cryosparc_master/cryosparc_command/commandcommon.py", line 266, in wrapper
return func(*args, **kwargs)
TypeError: make_job() got an unexpected keyword argument 'desc'
Any malfunction of cryosparc-tools under the above conditions could be a bug in either cryosparc-tools and/or CryoSPARC and/or the documentation.
A concrete example what should or should not work: As of July 18, 2023,
the release of cryosparc-tools is v4.2.0
the release of CryoSPARC is v4.2.1
cryosparc-tools v4.2.0 supports CryoSPARC release v4.2.0 and v4.2.1