def set_table(self, **kwds): self._name = kwds.get('name', '') self._table = [] for r in range(self._nrows): self._table.append([]) for k in range(self._ncols): self._table[r].append({}) rec_len = self._ncols * self._nrows skip = rec_len * self._skip_rec mwfp_logger.debug("In mwfp.set_table") mwfp_logger.debug("skip: {0} rec_len:{1}".format(skip, rec_len)) info = {} finds = db.mwfp.search({}, limit=rec_len, offset=skip, info=info) mwfp_logger.debug("finds: {0} no. {1}:".format(finds, info['number'])) i = 0 for f in finds: mwfp_logger.debug("R: {0}".format(f['ev'])) col = i % self._ncols row = i // self._ncols if row > self._nrows: mwfp_logger.debug( "Got too large row {0} from i={1} and self._nrows={2}". format(row, i, self._nrows)) break R = f['ev'] maass_id = f['maass_id'] url = url_for('mwfp.render_picard_maass_forms_get_one', docid=str(maass_id)) self._table[row][col] = {'url': url, 'name': R} # mwfp_logger.debug("table[{0}][{1}]={2}".format(row,col,self._table[r][col])) i = i + 1 self._is_set = True
def set_table(self, **kwds): self._name = kwds.get('name', '') self._table = dict() self._table = [] for r in range(self._nrows): self._table.append([]) for k in range(self._ncols): self._table[r].append({}) rec_len = self._ncols * self._nrows skip = rec_len * self._skip_rec mwfp_logger.debug("In mwfp.set_table: collections : {0}".format( self.collection())) mwfp_logger.debug("skip: {0} rec_len:{1}".format(skip, rec_len)) # only have one collection here... c = self.collection()[0] finds = c.find().sort('ev', 1).skip(skip).limit(rec_len) mwfp_logger.debug("finds: {0} no. {1}:".format(finds, finds.count())) i = 0 for f in finds: mwfp_logger.debug("R: {0}".format(f['ev'])) col = i % self._ncols row = i // self._ncols if row > self._nrows: mwfp_logger.debug( "Got too large row {0} from i={1} and self._nrows={2}". format(row, i, self._nrows)) break R = f['ev'] _id = f['_id'] url = url_for('mwfp.render_picard_maass_forms_get_one', docid=str(_id)) self._table[row][col] = {'url': url, 'name': R} # mwfp_logger.debug("table[{0}][{1}]={2}".format(row,col,self._table[r][col])) i = i + 1 self._is_set = True
def set_table(self, **kwds): self._name = kwds.get('name', '') self._table = [] for r in range(self._nrows): self._table.append([]) for k in range(self._ncols): self._table[r].append({}) rec_len = self._ncols * self._nrows skip = rec_len * self._skip_rec mwfp_logger.debug("In mwfp.set_table") mwfp_logger.debug("skip: {0} rec_len:{1}".format(skip, rec_len)) info = {} finds = db.mwfp.search({}, limit=rec_len, offset=skip, info=info) mwfp_logger.debug("finds: {0} no. {1}:".format(finds, info['number'])) i = 0 for f in finds: mwfp_logger.debug("R: {0}".format(f['ev'])) col = i % self._ncols row = i // self._ncols if row > self._nrows: mwfp_logger.debug( "Got too large row {0} from i={1} and self._nrows={2}".format(row, i, self._nrows)) break R = f['ev'] maass_id = f['maass_id'] url = url_for('mwfp.render_picard_maass_forms_get_one', docid=str(maass_id)) self._table[row][col] = {'url': url, 'name': R} # mwfp_logger.debug("table[{0}][{1}]={2}".format(row,col,self._table[r][col])) i = i + 1 self._is_set = True
def set_table(self, **kwds): self._name = kwds.get('name', '') self._table = dict() self._table = [] for r in range(self._nrows): self._table.append([]) for k in range(self._ncols): self._table[r].append({}) rec_len = self._ncols * self._nrows skip = rec_len * self._skip_rec mwfp_logger.debug("In mwfp.set_table: collections : {0}".format(self.collection())) mwfp_logger.debug("skip: {0} rec_len:{1}".format(skip, rec_len)) # only have one collection here... c = self.collection()[0] finds = c.find().sort('ev', 1).skip(skip).limit(rec_len) mwfp_logger.debug("finds: {0} no. {1}:".format(finds, finds.count())) i = 0 for f in finds: mwfp_logger.debug("R: {0}".format(f['ev'])) col = i % self._ncols row = i // self._ncols if row > self._nrows: mwfp_logger.debug( "Got too large row {0} from i={1} and self._nrows={2}".format(row, i, self._nrows)) break R = f['ev'] _id = f['_id'] url = url_for('mwfp.render_picard_maass_forms_get_one', docid=str(_id)) self._table[row][col] = {'url': url, 'name': R} # mwfp_logger.debug("table[{0}][{1}]={2}".format(row,col,self._table[r][col])) i = i + 1 self._is_set = True
def render_picard_maass_forms_get_one(docid): mwfp_logger.debug("Render one picard form!") PT = PicardFormTable(mwfp_dbname, collection='picard', skip=[0, 0], limit=[20, 20], keys=['coef'], docid=docid) PT.set_table(name='browsing') info = dict() title = "Maass Form on \(\mathrm{PSL}(2,\mathbb{Z}[i])\)" bread = [('Modular Forms', url_for('mf.modular_form_main_page'))] info['title'] = title info['bread'] = bread info['table'] = PT.table() info['nrows'] = PT.nrows() info['ncols'] = PT.ncols() info['col_heads'] = PT.col_heads() info['row_heads'] = PT.row_heads() info['ev'] = PT.prop('ev') info['sym'] = PT.prop('sym') info['prec'] = PT.prop('prec') # jl = app.jinja_loader # mwfp_logger.debug("Templates: {0}".format(jl.list_templates())) return render_template("mwfp_one_form.html", **info)
def render_picard_test(): x = request.args.get('x', 0) # y = request.args.get('y', 0) mwfp_logger.debug("skip= {0}".format(x)) PT = PicardDataTable(db.mwfp_forms, skip=[x], limit=[10, 10], keys=['ev']) PT.set_table(name='browsing') info = dict() info['table'] = PT.table() info['nrows'] = PT.nrows() info['ncols'] = PT.ncols() info['title'] = "Maass Forms on \(\mathrm{PSL}(2,\mathbb{Z}[i])\)" return render_template("mwfp_navigation.html", **info)
def set_table(self, **kwds): self._name = kwds.get('name', '') self._table = dict() self._table = [] self._is_set = True for r in range(self._nrows): self._table.append([]) for k in range(self._ncols): self._table[r].append({}) rec_len = self._ncols * self._nrows skip = rec_len * self._skip_rec mwfp_logger.debug("rows: {0}".format(self._nrows)) mwfp_logger.debug("cols: {0}".format(self._ncols)) mwfp_logger.debug("In mwfp.set_table: collections : {0}".format( self.collection())) mwfp_logger.debug("skip: {0} rec_len:{1}".format(skip, rec_len)) # only have one collection here... c = self.collection()[0] f = c.find_one({'_id': self._docid}) if not f: mwfp_logger.critical("You did not supply a valid id!") return self._props['ev'] = f['ev'] self._props['sym'] = f['sym'] self._props['prec'] = f['prec'] self._row_heads = [] self._col_heads = [] row_min = self._nrows * skip col_min = self._ncols * skip for a, b, val in f['coef']: if a >= self._nrows or a < row_min: continue if b >= self._ncols or b < col_min: continue if a not in self._row_heads: self._row_heads.append(a) if b not in self._col_heads: self._col_heads.append(b) mwfp_logger.debug("a,b={0},{1}".format(a, b)) val = str(val).replace(' ', '') self._table[a][b] = {'value': val} self._row_heads.sort() self._col_heads.sort()
def set_table(self, **kwds): self._name = kwds.get('name', '') self._table = dict() self._table = [] self._is_set = True for r in range(self._nrows): self._table.append([]) for k in range(self._ncols): self._table[r].append({}) rec_len = self._ncols * self._nrows skip = rec_len * self._skip_rec mwfp_logger.debug("rows: {0}".format(self._nrows)) mwfp_logger.debug("cols: {0}".format(self._ncols)) mwfp_logger.debug("In mwfp.set_table: collections : {0}".format(self.collection())) mwfp_logger.debug("skip: {0} rec_len:{1}".format(skip, rec_len)) # only have one collection here... c = self.collection()[0] f = c.find_one({'_id': self._docid}) if not f: mwfp_logger.critical("You did not supply a valid id!") return self._props['ev'] = f['ev'] self._props['sym'] = f['sym'] self._props['prec'] = f['prec'] self._row_heads = [] self._col_heads = [] row_min = self._nrows * skip col_min = self._ncols * skip for a, b, val in f['coef']: if a >= self._nrows or a < row_min: continue if b >= self._ncols or b < col_min: continue if a not in self._row_heads: self._row_heads.append(a) if b not in self._col_heads: self._col_heads.append(b) mwfp_logger.debug("a,b={0},{1}".format(a, b)) val = str(val).replace(' ', '') self._table[a][b] = {'value': val} self._row_heads.sort() self._col_heads.sort()
def render_picard_maass_forms_get_one(docid): mwfp_logger.debug("Render one picard form!") PT = PicardFormTable(skip=[0, 0], limit=[20, 20], keys=['coef'], docid=docid) PT.set_table(name='browsing') info = dict() title = "Maass Form on \(\mathrm{PSL}(2,\mathbb{Z}[i])\)" bread = [('Modular Forms', url_for('mf.modular_form_main_page'))] info['title'] = title info['bread'] = bread info['table'] = PT.table() info['nrows'] = PT.nrows() info['ncols'] = PT.ncols() info['col_heads'] = PT.col_heads() info['row_heads'] = PT.row_heads() info['ev'] = PT.prop('ev') info['sym'] = PT.prop('sym') info['prec'] = PT.prop('prec') # jl = app.jinja_loader # mwfp_logger.debug("Templates: {0}".format(jl.list_templates())) return render_template("mwfp_one_form.html", **info)