<commit_before>import random
from sympy import *

import fm.mathengine.problemTypes.problem as problem

class derivPolynomial(problem.Problem):
	terms = [1,2,3,4,5]
	exponents = [0,1,2,3,4,5,6]
	coefficients = [1,2,3,4,5,6,7,8,9]

	def generate_problem(self):
		nterms = random.choice(self.terms)
		nexponents = random.sample(self.exponents, nterms)
		polynomial = 0
		x = self.x
		for i in range(0, nterms):
			polynomial += random.choice(self.coefficients) * x ** nexponents.pop(0)
		self.problem_statement = Derivative(polynomial, x)<commit_msg>Prevent derivPolynomial from spitting out constant terms<commit_after>import random
from sympy import *

import fm.mathengine.problemTypes.problem as problem

class derivPolynomial(problem.Problem):
	terms = [1,2,3,4,5]
	exponents = [1,2,3,4,5,6]
	coefficients = [1,2,3,4,5,6,7,8,9]

	def generate_problem(self):
		nterms = random.choice(self.terms)
		nexponents = random.sample(self.exponents, nterms)
		polynomial = 0
		x = self.x
		for i in range(0, nterms):
			polynomial += random.choice(self.coefficients) * x ** nexponents.pop(0)
		self.problem_statement = Derivative(polynomial, x)
{'fraction_non_alphanumeric': 0.13280562884784522, 'fraction_numerical': 0.04133685136323659, 'mean_word_length': 5.35754189944134, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4730598', 'n_tokens_mistral': 480, 'n_tokens_neox': 432, 'n_words': 85}