changeset 24:d2bd074d9284

fixing sextile range and allowing save of raw files to save repull every time new class structure
author DaveM
date Mon, 09 Apr 2018 16:07:05 +0100
parents 11d4e438045e
children a5482a6afe9b
files V5/runme.py V5/synastry.py timesheet.xlsx
diffstat 3 files changed, 8 insertions(+), 33 deletions(-) [+]
line wrap: on
line diff
--- a/V5/runme.py	Mon Apr 09 15:07:21 2018 +0100
+++ b/V5/runme.py	Mon Apr 09 16:07:05 2018 +0100
@@ -102,12 +102,12 @@
 		if issue is not None:
 			print 'SKIPPING person '+ person.id + ' error with ' + issue 
 		else:
-			print 'parsing person '+ person.id
+			# print 'parsing person '+ person.id
 			if person.resp is None:
 				print 'Posting Request for person '+ person.id
 				person.makePayload()
 				rawData[person.id] = person.requestURL()
-			print 'parsing person '+ person.id
+			# print 'parsing person '+ person.id
 			person.horiscope = person.parsePage()
 			# person.horiscope.printPositions()
 		if saveFile is not None:
@@ -121,39 +121,17 @@
 		if issue is not None:
 			print 'SKIPPING person '+ person.id + ' error with ' + issue 
 		else:
-			print 'parsing person '+ person.id
+			# print 'parsing person '+ person.id
 			if person.resp is None:
-				print 'Posting Request for person '+ person.id
+				print 'Reading Request for person '+ person.id
 				person.makePayload()
 				person.resp = rawData[person.id]
-			print 'parsing person '+ person.id
+			# print 'parsing person '+ person.id
 			person.horiscope = person.parsePage()
 			# person.horiscope.printPositions()
 		if saveFile is not None:
 			savePick(saveFile,people)
 
-# def testMain():
-# 	pickFile = 'outData.pick'
-# 	restartDataFile = 0
-# 	if(restartDataFile):
-# 		# people = makePeople('individuals.csv')
-# 		# savePick(pickFile,people)
-# 		people = loadPick(pickFile)
-# 		parseSaveFile = pickFile.split('.')[0]+'_collect.pick'
-# 		parseHoriscope(people,parseSaveFile)
-# 	else:
-# 		people = loadPick('outData_collect.pick')
-# 	comp = syn.compatibility()
-# 	comp.parseCompatRules('compatibilityRules.csv')
-# 	for person in people:
-# 		if person.issue is None:
-# 			person.score = comp.calcCompatibility(person.horiscope)
-# 			if person.score is None:
-# 				person.issue = 'None Planet Locations'
-# 			else:
-# 				print person.id,person.score
-# 	pdb.set_trace()
-
 def _main():
 	pickFile = 'outData.pick'
 	if not os.path.exists(pickFile):
--- a/V5/synastry.py	Mon Apr 09 15:07:21 2018 +0100
+++ b/V5/synastry.py	Mon Apr 09 16:07:05 2018 +0100
@@ -278,6 +278,7 @@
 
 class planetPositions:
 	aspectDict = {'conjunction':0,'semi-square':45,'sextile':60,'square':90,'trine':120,'opposition':180}
+	aspectRange = {'conjunction':10,'semi-square':2,'sextile':4,'square':10,'trine':10,'opposition':10}
 	# zodiacAngle = {'aries':0,'taurus':30,'gemini':60,'cancer':90,'leo':120,'virgo':150,'libra':180,'scorpio':210,'sagittarius':240,'capricorn':270,'aquarius':300,'pisces':330}
 	# Taken from https://en.wikipedia.org/wiki/Astrological_sign, with reference from https://en.wikipedia.org/wiki/Astrological_symbols#Signs_of_the_zodiac
 	planetNames = ['sun','moon','mercury','venus','mars','jupiter','saturn','uranus','neptune','pluto','node','lilith','chiron','asc','ic','dsc','mc','asc/mc','sun/moon']
@@ -292,19 +293,15 @@
 			self.planets[planet].test_random()
 
 	def calcAngle(self,componentA,componentB):
-		print componentA,componentB
 		self.angle = abs(self.planets[componentA].angleA - self.planets[componentB].angleB)
-		self.angleRange = self.angle-10,self.angle+10
 
 	def calcAspect(self,componentA,componentB):
 		self.calcAngle(componentA,componentB)
-		# print componentA,componentB,self.angle,self.planets[componentA].angleA,self.planets[componentB].angleB
 		for aspect in planetPositions.aspectDict:
-			if self.angleRange[0] < planetPositions.aspectDict[aspect] and self.angleRange[1] > planetPositions.aspectDict[aspect]:
-				# print aspect#,componentA,componentB,self.angle
+			if self.angle-self.aspectRange[aspect] < self.aspectDict[aspect] and self.angle+self.aspectRange[aspect] > self.aspectDict[aspect]:
 				aspectDiff = round(abs(self.angle - planetPositions.aspectDict[aspect]),2)
 				self.aspect[componentA,componentB] = (aspect,aspectDiff)
-				print componentA,componentB,self.angle,aspect,aspectDiff
+				print componentA,self.planets[componentA].angleA,componentB,self.planets[componentB].angleB,self.angle,aspect,aspectDiff
 				return aspect,aspectDiff
 		return None,None
 
Binary file timesheet.xlsx has changed