cnr-ibba / pyusirest Goto Github PK
View Code? Open in Web Editor NEWPython USI submission REST API contain all methods to interact with EMBL-EBI Unified Submissions Interface
License: Other
Python USI submission REST API contain all methods to interact with EMBL-EBI Unified Submissions Interface
License: Other
Describe the bug
Getting teams from a Root object raises KeyError: 'teams'
if no team is found
To Reproduce
from pyUSIrest.auth import Auth
from pyUSIrest.client import Root
auth = Auth(user='image-lPvdsc50', password='***')
root = Root(auth)
root.get_user_teams()
Expected behavior
A message like "no teams found for user ...." or even a more informative exception like "you need to create at least a team"
Additional context
/usr/local/lib/python3.6/site-packages/pyUSIrest/client.py in get_user_teams(self)
470
471 # now iterate over teams and create new objects
--> 472 for i, team_data in enumerate(document._embedded['teams']):
473 teams.append(Team(self.auth, team_data))
474 logger.debug("Found %s team" % (teams[i].name))
KeyError: 'teams'
Describe the bug
Patching a sample in a Draft biosample submission returns:
USIConnectionError: 400:{"type":"/api/docs/submission_api.html#_errors","title":"Bad Request","status":400,"instance":"uri=/api/samples/xxxxxxxxxxxxxxxxxxxx","errors":["Malformed JSON request"]}
The issue seems to be related on how relationship are read from Sample
object: team should be expressed as str
and not as Team.data
dictionary
To Reproduce
Steps to reproduce the behavior:
Submission
Sample
to a Submission
Sample
even with the same dataExpected behavior
Sample need to be patched without errors
Additional context
USIDataError
not USIConnectionError
(50x)Sample.team
attribute like Submission.team
Describe the bug
BioSamples API has changed and this library can't deal with data submission. Root and others methods need to point to the proper API urls
To Reproduce
Try to instantiate a new Root
class or create and submit data into BioSamples service
Expected behavior
Methods need to be updated in order to user the proper API url. Documents need to described how a submission can be made with the current URLs
Additional context
Try to understand the API submission system and define new python object to automate some stuff
Is your feature request related to a problem? Please describe.
Data are collected and stored locally in dictionaries, however this raise issues when accessing submission with a lot of samples since all those data are stored in memory. Since the majority of tasks are iterating over objects, will be nice to iterate over objects without reading all data in memory.
Describe the solution you'd like
Methods like Root.get_user_submissions()
and Submission.get_samples()
need to reply with an iterator object. If a user need the list representation of its objecs, will call list()
on iterator object
Describe alternatives you've considered
We could store information data in local objects and accessing them using direct links. The code as it is published in pypi works, the only drawback is the memory used while accesing a lot of data.
Additional context
There are other points that could enhance this library, they are also described in 0.3.0.dev0. Scrutinizer rating could be improved to facilitate code maintenance
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.