Exemplo n.º 1
0
	def algebra_models(self, models):
		if self.workers > 0:
			return self.algebra_models_multiprocess(models)
		else:
			# print ("  algebra:", len(models))
			alges = []
			for modl in models:
				for meth in self.algebra_methods:
					manipd, err = algebra.manip_model(modl,meth)
					if err is not None:
						if err == "same":
							continue
						else:
							print ("Error:", err)
					else:
						# print (modl.expr, "==", meth, "==>", manipd.expr, manipd.xs, manipd.cs)
						manipd.parent_id = modl.id
						manipd.gen_relation = meth
						alges.append(manipd)
				modl.algebrad = True
			return alges
Exemplo n.º 2
0
def unwrap_self_alge_model_queue(PGE):
	while True:
		try:
			val = PGE.alge_in_queue.get()
			if val is None:
				print("Val None Breaking Algebra Processor")
				break;
			pos = val[0]
			modl = val[1]
			meth = val[2]


			alged, err = algebra.manip_model(modl, meth)
			if err is not None:
				PGE.alge_out_queue.put( (pos, err, None, None) )
			else:


				PGE.alge_out_queue.put( (pos, None, meth, alged) )
		except Exception as e:
			print("alge breaking!", e, "\n  ", pos, modl.expr)
			break