Skip to content

Commit

Permalink
more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
MatteoGiomi committed Sep 18, 2018
1 parent c10f91e commit a6afe84
Showing 1 changed file with 50 additions and 0 deletions.
50 changes: 50 additions & 0 deletions tests/test6.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import marshaltools

# test source and some keys to play with
name, src_id = 'ZTF18abjyjdz', 3329
keys = [
'classification',
'redshift',
'uploaded_spectra.observer',
'autoannotations.username',
'redshift'
]

prog = marshaltools.ProgramList("AMPEL Test", load_sources=True, load_candidates=True)


# get the source (just to see that it's in the candidates)
#src = prog.find_source(name)
#print (src)



out = prog.retrieve_from_src(name, keys)#, default=None, src_dict=None, append_summary=True, include_candidates=True):
print (out)



## pass the source name
#print ("----------------")
#out = prog.retrieve_from_src(name, keys)
#print (out)

## if you've looked in the summary (as we are doing in this example), the summary
## is downloaded at the first call, then it is simlpy used. Now it should be faster:
#print ("----------------")
#out = prog.retrieve_from_src(name, keys)
#print (out)

## try with some missing key and default argument. You should see a warning there.
#print ("----------------")
#keys2 = keys+['fuffa']
#out = prog.retrieve_from_src(name, keys2, default="merci")
#print (out)


## now try passing the source instead of the name
#print ("----------------")
#src = prog.find_source(name, include_candidates=False)
#out = prog.retrieve_from_src(name, keys, src_dict=src)
#print (out)

0 comments on commit a6afe84

Please sign in to comment.