Skip to content

Commit

Permalink
Move cal_ls to auspex
Browse files Browse the repository at this point in the history
cal_ls doesn't belong to ChannelLibraries. Moved to auspex
  • Loading branch information
Diego Ristè committed Nov 8, 2019
1 parent 3ba9ca0 commit c0b8956
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions QGL/ChannelLibraries.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,17 +147,6 @@ def ls(self):
table_code += f"<tr><td>{id}</td><td>{y}</td><td>{d}</td><td>{t}</td><td>{label}</td><td>{notes}</td></tr>"
display(HTML(f"<table><tr><th>id</th><th>Year</th><th>Date</th><th>Time</th><th>Name</th><th>Notes</th></tr><tr>{table_code}</tr></table>"))

def cal_ls(self):
''' List of auspex.pulse_calibration results '''
caldb = bbndb.calibration.Calibration
c = self.session.query(caldb.id, caldb.sample_id, caldb.name, caldb.value, caldb.date).order_by(-caldb.id).all()
table_code = ""
for i, (sample_id, name, value, time) in enumerate(c):
d,t = str(time).split()
sample = self.session.query(bbndb.calibration.Sample).filter_by(id=sample_id).first()
table_code += f"<tr><td>{id}</td><td>{d}</td><td>{t.split('.')[0]}</td><td>{sample.name}</td><td>{name}</td><td>{round(value,9)}</td></tr>"
display(HTML(f"<table><tr><th>id</th><th>Date</th><th>Time</th><th>Sample</th><th>Name</th><th>Value</th></tr><tr>{table_code}</tr></table>"))

def ent_by_type(self, obj_type, show=False):
q = self.session.query(obj_type).filter(obj_type.channel_db.has(label="working")).order_by(obj_type.label).all()
if show:
Expand Down

0 comments on commit c0b8956

Please sign in to comment.