Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Coscine: Creating Resources fails #701

Open
pmrv opened this issue Jun 2, 2023 · 0 comments · May be fixed by #710
Open

Coscine: Creating Resources fails #701

pmrv opened this issue Jun 2, 2023 · 0 comments · May be fixed by #710
Assignees
Labels
bug Something isn't working

Comments

@pmrv
Copy link
Contributor

pmrv commented Jun 2, 2023

Not sure what is the underlying cause exactly, but the following snippet fails

pr = Project('.')

cos = pr.storage_interface.create.coscine(TOKEN)
cos = cos['SFB1394']['A06'] # <- exsist in coscine
cos.create_node('Test')

with error

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
Cell In[34], line 7
      3 cos = pr.storage_interface.create.coscine(TOKEN)
      5 mtp_cos = cos['SFB1394']['A06']
----> 7 mtp_cos.create_node('Test')

File ~/software/pyiron_contrib/pyiron_contrib/generic/coscineIo.py:704, in CoscineProject.create_node(self, name_or_form, size, display_name, description, disciplines, keywords, metadata_visibility, licence, internal_rules_for_reuse, application_profile, resource_type)
    702 if form["Resource Name"] in self.list_groups() + self.list_nodes():
    703     raise ValueError("This name is already in this project!")
--> 704 return CoscineResource(
    705     self._project.create_resource(form), parent_path=self.path
    706 )

File ~/software/pyiron_contrib/pyiron_contrib/generic/coscineIo.py:225, in CoscineResource.__init__(self, resource, parent_path)
    223     return
    224 else:
--> 225     raise TypeError(f"Unknown resource type {type(resource)}!")
    227 self._path = self._construct_path(parent_path)

TypeError: Unknown resource type <class 'concurrent.futures._base.Future'>!

I suspect it comes from this function which can in some cases return a Future, which is not handled by the current code.

@pmrv pmrv added the bug Something isn't working label Jun 2, 2023
@niklassiemer niklassiemer linked a pull request Jun 7, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants