ndexbio / ndex2-client

NDEx2 Client
BSD 3-Clause "New" or "Revised" License
6 stars 6 forks source link

Network that causes error making nice CX #9

Closed dexterpratt closed 6 years ago

dexterpratt commented 6 years ago

In testing a jupyter notebook that makes a niceCX from an NDEx network, I found a network that fails, resulting in an error that seems to indicate that the network has no metadata. However, the network does have metadata. The network is a private network owned by rudipillich, shared with the NDEx Team group, and accessed by dexterpratt. Password to dexterpratt emailed separately.

(notebook pushed with uuids plus some temporary code to ensure that basic access is ok)

jupyter notebook:

fails

my_network_uuid = '601902a1-d632-11e7-adc1-0ac135e8bacf'

works

my_network_uuid = '9ed0cd55-9ac0-11e4-9499-000c29202374'

Error, followed by metadata copied from downloaded failing network:


TypeError Traceback (most recent call last)

in () 2 3 ----> 4 my_network = ndex2.create_nice_cx_from_server(server='public.ndexbio.org', uuid=my_network_uuid) 5 #my_network = ndex2.create_nice_cx_from_server(server='public.ndexbio.org', uuid=my_network_uuid, account=my_account, password = my_password) 6 print("done") ~/anaconda/envs/py36/lib/python3.6/site-packages/ndex2/__init__.py in create_nice_cx_from_server(server, username, password, uuid) 367 #=================== 368 available_aspects = [] --> 369 for ae in (o for o in my_nicecx.get_aspect(uuid, 'metaData', server, username, password)): 370 available_aspects.append(ae.get(CX_CONSTANTS.METADATA_NAME)) 371 mde = MetaDataElement(cx_fragment=ae) TypeError: 'NoneType' object is not iterable ============================ Metadata ============================ [{"numberVerification":[{"longNumber":281474976710655}]},{"metaData":[{"consistencyGroup":1,"elementCount":1,"lastUpdate":1512089963453,"name":"ndexStatus","properties":[],"version":"1.0"},{"consistencyGroup":1,"elementCount":1,"lastUpdate":1512089963454,"name":"provenanceHistory","properties":[],"version":"1.0"},{"consistencyGroup":1,"elementCount":1,"name":"@context","properties":[],"version":"1.0"},{"consistencyGroup":1,"elementCount":4172,"idCounter":4172,"name":"nodes","properties":[],"version":"1.0"},{"consistencyGroup":1,"elementCount":17099,"idCounter":17099,"name":"edges","properties":[],"version":"1.0"},{"consistencyGroup":1,"elementCount":6,"name":"networkAttributes","properties":[],"version":"1.0"},{"consistencyGroup":1,"elementCount":4172,"name":"nodeAttributes","properties":[],"version":"1.0"},{"consistencyGroup":1,"elementCount":109624,"name":"edgeAttributes","properties":[],"version":"1.0"},{"consistencyGroup":1,"elementCount":3,"name":"cyVisualProperties","properties":[]}]},
agary-ucsd commented 6 years ago

My guess is that the network is private. The exception handling for error described above has been improved. If the network can't be accessed and no username and password is supplied then the user is notified of such.