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

Error while getting models #3

Open
deriteidavid opened this issue Oct 14, 2020 · 1 comment
Open

Error while getting models #3

deriteidavid opened this issue Oct 14, 2020 · 1 comment

Comments

@deriteidavid
Copy link

Hey! I ran into this error while trying to get the models from the cellcollective:

In [12]: import ccapi                                                           

In [13]: client=ccapi.Client()                                                  

In [14]: models=client.get('model')                                             
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-14-ea451a0c5350> in <module>
----> 1 models=client.get('model')

~/anaconda2/envs/python_3_env/lib/python3.7/site-packages/ccapi-0.1.0-py3.7.egg/ccapi/api/client.py in get(self, resource, *args, **kwargs)
    498                 ids         = [data["model"]["id"] for data in content]
    499 
--> 500                 resources   = self.get("model", id = ids)
    501         elif _resource == "user":
    502             if not id_:

~/anaconda2/envs/python_3_env/lib/python3.7/site-packages/ccapi-0.1.0-py3.7.egg/ccapi/api/client.py in get(self, resource, *args, **kwargs)
    469                     _model_content_to_model(model,
    470                         users = users, client = self) \
--> 471                             for _, model in iteritems(models)
    472                 ])
    473             else:

~/anaconda2/envs/python_3_env/lib/python3.7/site-packages/ccapi-0.1.0-py3.7.egg/ccapi/api/client.py in <listcomp>(.0)
    469                     _model_content_to_model(model,
    470                         users = users, client = self) \
--> 471                             for _, model in iteritems(models)
    472                 ])
    473             else:

~/anaconda2/envs/python_3_env/lib/python3.7/site-packages/ccapi-0.1.0-py3.7.egg/ccapi/api/helper.py in _model_content_to_model(content, users, client)
    228             users       = users,
    229             parent      = model,
--> 230             client      = client,
    231         )
    232         model           = _merge_metadata_to_model(model, meta)

~/anaconda2/envs/python_3_env/lib/python3.7/site-packages/ccapi-0.1.0-py3.7.egg/ccapi/api/helper.py in _model_version_response_to_boolean_model(response, meta, users, parent, client)
    163                 type        = lower(regulator_data["regulationType"]),
    164                 conditions  = [data["condition"]
--> 165                     for _, data in iteritems(condition_map)
    166                         if data["regulator_id"] == int(regulator_id)
    167                 ]

TypeError: __init__() missing 1 required positional argument: 'species'

I got the same error also with an authenticated client and also when running the example from the documentation:

model = ccapi.load_model("fibroblasts", client = client)

I hope it's an easy fix. Thanks! :)

P.S. I installed the package by running the setup.py install after cloning it from GitHub, because I can't seem to find it in pip. I'm running Ubuntu 18.04.

@achillesrasquinha
Copy link
Collaborator

Hi! Apologies to respond a bit late on this. Let me take a look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants