Mercurial > hg > horiscopes
changeset 31:926b008ccb0c tip
resolving vertex and fixing description results - I believe everything works
author | DaveM |
---|---|
date | Sat, 19 May 2018 14:50:41 +0100 |
parents | 15c43f44a806 |
children | |
files | V5/runme.py V5/synastry.py |
diffstat | 2 files changed, 10 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/V5/runme.py Sun May 13 17:40:12 2018 +0100 +++ b/V5/runme.py Sat May 19 14:50:41 2018 +0100 @@ -56,12 +56,11 @@ def outputDescriptions(filename,people): with open(filename, "wb") as csv_file: - csv_file.write('Person ID, Description \n') for person in people: if person.issue is None: - csv_file.write(str(person.id)+','+str(person.description)+'\n') + csv_file.write(str(person.id)+', '+str(person.score)+'\n'+''.join(person.description)+'\n\n') else: - csv_file.write(str(person.id)+','+str(person.issue)+'\n') + csv_file.write(str(person.id)+', '+str(person.issue)+'\n\n') def outputIssues(filename,people): with open(filename, "wb") as csv_file: @@ -133,7 +132,7 @@ for item in os.listdir('.'): if item.endswith(".pick"): os.remove(item) - os.remove('outData_collect.pick') + # os.remove('outData_collect.pick') pickFile = 'outData.pick' if not os.path.exists(pickFile): people = makePeople('individuals.csv') @@ -168,7 +167,7 @@ people = loadPick('fullResults.pick') outputPeople('fullResult.csv',people) outputScores('scores.csv',people) - outputDescriptions('description.csv',people) + outputDescriptions('description.txt',people) outputIssues('issues.csv',people) if __name__ == "__main__":
--- a/V5/synastry.py Sun May 13 17:40:12 2018 +0100 +++ b/V5/synastry.py Sat May 19 14:50:41 2018 +0100 @@ -9,12 +9,13 @@ import pdb DEFAULT_SOURCE = 'local' +# DEFAULT_SOURCE = None class compatibility: def __init__(self): self.rules = [] self.uniqueID = 0 - print 'Warning, need to fix [Vertex and None Location] issues\n the semi-square has a 2 degrees orbs. For planets/axis in aspects with Mid-Point a maximum of 2 degrees orb applies. Same for the Vertex' + print 'Warning, need to fix [None Location] issues' def addRule(self,planetTuple,aspectList,score): rule = compatibilityRule(self.uniqueID,planetTuple,aspectList,score) @@ -90,7 +91,7 @@ return score - def printCompatibility(self, horiscope): + def describeCompatibility(self, horiscope): score = 0 outString = [] for rule in sorted(self.rules): @@ -348,6 +349,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} + reduceAspectPlanets = {'sun':10,'moon':10,'mercury':10,'venus':10,'mars':10,'jupiter':10,'saturn':10,'uranus':10,'neptune':10,'pluto':10,'node':10,'southnode':10,'lilith':10,'chiron':10,'asc':10,'ic':10,'dsc':10,'mc':10,'asc/mc':2,'sun/moon':2,'vertex':2} # 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','southnode','lilith','chiron','asc','ic','dsc','mc','asc/mc','sun/moon','vertex'] @@ -367,7 +369,8 @@ def calcAspect(self,componentA,componentB): self.calcAngle(componentA,componentB) for aspect in planetPositions.aspectDict: - if self.angle-self.aspectRange[aspect] < self.aspectDict[aspect] and self.angle+self.aspectRange[aspect] > self.aspectDict[aspect]: + compareRange = min(self.aspectDict[aspect], self.reduceAspectPlanets[componentA]) + if self.angle-self.aspectRange[aspect] < compareRange and self.angle+self.aspectRange[aspect] > compareRange: aspectDiff = round(abs(self.angle - planetPositions.aspectDict[aspect]),2) self.aspect[componentA,componentB] = (aspect,aspectDiff) # print componentA,self.planets[componentA].angleA,componentB,self.planets[componentB].angleB,self.angle,aspect,aspectDiff